Commit e18ba33b authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Raw theme: remove remaining refs to columnleftstart, columnfullstart; other misc cleanups

parent ee43828e
......@@ -121,7 +121,7 @@ $heading = get_string('pluginadmin', 'admin') . ': ' . $plugintype . ': ' . $plu
if ($type) {
$heading .= ': ' . $type;
}
$smarty->assign('heading', $heading);
$smarty->assign('PAGEHEADING', hsc($heading));
$smarty->display('admin/extensions/pluginconfig.tpl');
......
......@@ -486,6 +486,7 @@ if ($id != $USER->get('id') && is_null($USER->get('parentuser'))) {
$loginas = null;
}
$smarty->assign('loginas', $loginas);
$smarty->assign('PAGEHEADING', hsc(TITLE . ': ' . display_name($user)));
$smarty->display('admin/users/edit.tpl');
?>
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package mahara
* @subpackage admin
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
define('ADMIN', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('suspenduser', 'admin'));
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
require_once('pieforms/pieform.php');
$id = param_integer('id');
if (!$user = get_record('usr', 'id', $id)) {
throw new UserNotFoundException("User not found");
}
$f = pieform(array(
'name' => 'suspend',
'elements' => array(
'id' => array(
'type' => 'hidden',
'value' => $id,
),
'reason' => array(
'type' => 'text',
'title' => get_string('reason'),
),
'submit' => array(
'type' => 'submitcancel',
'value' => array(get_string('suspenduser','admin'), get_string('cancel')),
),
)
));
function suspend_submit(Pieform $form, $values) {
global $SESSION;
suspend_user($values['id'], $values['reason']);
$SESSION->add_ok_msg(get_string('usersuspended', 'admin'));
redirect('/user/view.php?id=' . $values['id']);
}
function suspend_cancel_submit() {
redirect('/admin/users/search.php');
}
$smarty = smarty();
$smarty->assign('user', $user);
$smarty->assign('form', $f);
$smarty->display('admin/users/suspend.tpl');
?>
......@@ -97,7 +97,9 @@ $string['validationemailwillbesent'] = 'a validation email will be sent when you
$string['validationemailsent'] = 'a validation email has been sent';
$string['emailactivation'] = 'Email Activation';
$string['emailactivationsucceeded'] = 'Email Activation Successful';
$string['emailalreadyactivated'] = 'Email already activiated';
$string['emailactivationfailed'] = 'Email Activation Failed';
$string['verificationlinkexpired'] = 'Verification link expired';
$string['invalidemailaddress'] = 'Invalid email address';
$string['unvalidatedemailalreadytaken'] = 'The e-mail address you are trying to validate is already taken';
......
{include file="header.tpl"}
{include file="sidebar.tpl"}
{include file="columnleftstart.tpl"}
<p>
{$message|escape}
</p>
{include file="columnleftend.tpl"}
{include file="footer.tpl"}
......@@ -39,37 +39,49 @@ $key = param_variable('key');
$row = get_record('artefact_internal_profile_email', 'email', $email, 'key', $key, null,null,'owner,artefact,email,verified,' . db_format_tsfield('expiry'));
if ($row && $row->expiry > time()) {
if ($row->artefact) {
$artefact = new ArtefactTypeEmail($row->artefact);
if ($row) {
if ($row->expiry > time()) {
if ($row->artefact) {
$artefact = new ArtefactTypeEmail($row->artefact);
}
else {
$artefact = new ArtefactTypeEmail();
}
$artefact->set('owner', $row->owner);
$artefact->set('title', $row->email);
$artefact->commit();
update_record(
'artefact_internal_profile_email',
(object)array(
'verified' => 1,
'key' => null,
'expiry' => null,
'artefact' => $artefact->get('id'),
),
(object)array(
'owner' => $row->owner,
'email' => $row->email,
)
);
$SESSION->add_ok_msg(get_string('emailactivationsucceeded', 'artefact.internal'));
redirect(get_config('wwwroot') . 'artefact/internal/index.php?fs=contact');
}
else {
$artefact = new ArtefactTypeEmail();
$message = get_string('verificationlinkexpired', 'artefact.internal');
}
$artefact->set('owner', $row->owner);
$artefact->set('title', $row->email);
$artefact->commit();
update_record(
'artefact_internal_profile_email',
(object)array(
'verified' => 1,
'key' => null,
'expiry' => null,
'artefact' => $artefact->get('id'),
),
(object)array(
'owner' => $row->owner,
'email' => $row->email,
)
);
$SESSION->add_ok_msg(get_string('emailactivationsucceeded', 'artefact.internal'));
redirect(get_config('wwwroot') . 'artefact/internal/index.php?fs=contact');
}
else if (get_record('artefact_internal_profile_email', 'email', $email, 'verified', 1)) {
$message = get_string('emailalreadyactivated', 'artefact.internal');
}
else {
$message = get_string('emailactivationfailed', 'artefact.internal');
}
$smarty = smarty();
$smarty->assign('message', get_string('emailactivationfailed', 'artefact.internal'));
$smarty->assign('PAGEHEADING', hsc(TITLE));
$smarty->assign('message', $message);
$smarty->display('artefact:internal:validate.tpl');
?>
......@@ -949,7 +949,7 @@ function auth_draw_login_page($message=null, Pieform $form=null) {
}
$smarty = smarty(array(), array(), array(), array('pagehelp' => false));
$smarty->assign('login_form', $loginform);
$smarty->assign('loginmessage', get_string('loginto', 'mahara', get_config('sitename')));
$smarty->assign('PAGEHEADING', hsc(get_string('loginto', 'mahara', get_config('sitename'))));
$smarty->display('login.tpl');
exit;
}
......
......@@ -40,7 +40,8 @@ if (!PluginBlocktypeWall::can_delete_wallpost($wallpost->from, $view->get('owner
throw new AccessDeniedException();
}
$goto = ($return == 'wall')
$goto = get_config('wwwroot');
$goto .= ($return == 'wall')
? '/blocktype/wall/wall.php?id=' . $instance->get('id')
: '/user/view.php?id=' . $view->get('owner');
......@@ -71,6 +72,7 @@ function deletepost_submit(Pieform $form, $values) {
$smarty = smarty();
$smarty->assign('deleteform', $form);
$smarty->assign('PAGEHEADING', hsc(get_string('deletepost', 'blocktype.wall')));
$smarty->display('blocktype:wall:deletepost.tpl');
?>
......@@ -37,6 +37,7 @@ $string['wall'] = 'Wall';
$string['wholewall'] = 'View whole wall';
$string['reply'] = 'reply';
$string['delete'] = 'delete post';
$string['deletepost'] = 'Delete post';
$string['Post'] = 'Post';
$string['deletepostsure'] = 'Are you sure you want to do this? It cannot be undone.';
$string['deletepostsuccess'] = 'Post deleted successfully';
......
{include file="header.tpl"}
{include file="sidebar.tpl"}
{include file="columnleftstart.tpl"}
<h2>{$subheading|escape}</h2>
<div class="message">{$deleteform}</div>
{include file="columnleftend.tpl"}
{include file="footer.tpl"}
{include file="header.tpl"}
{include file="columnfullstart.tpl"}
<div id="wall">
<h3>{$owner->displayname}: {str tag='wall' section='blocktype.wall'}</h3>
( <a href="{$WWWROOT}/user/view.php?id={$owner->id}">{str tag='backtoprofile' section='blocktype.wall'}</a> )
{include file="blocktype:wall:inlineposts.tpl}
</div>
{include file="columnfullend.tpl"}
{include file="footer.tpl"}
......@@ -44,7 +44,7 @@ $view = $block->get_view();
$owner = $view->get_owner_object();
$owner->displayname = display_name($owner);
$smarty = smarty();
$smarty = smarty(array(), array(), array(), array('sidebars' => false));
$smarty->assign('instanceid', $instanceid);
$smarty->assign('owner', $owner);
$smarty->assign('wholewall', true);
......
......@@ -102,7 +102,7 @@ define('TITLE', $group->name . ' - ' . get_string('changerole', 'group'));
$smarty = smarty();
$smarty->assign('heading', $group->name);
$smarty->assign('subtitle', get_string('changeroleofuseringroup', 'group', display_name($user), $group->name));
$smarty->assign('subheading', get_string('changeroleofuseringroup', 'group', display_name($user), $group->name));
$smarty->assign('changeform', $changeform);
$smarty->display('group/changerole.tpl');
......
......@@ -84,6 +84,7 @@ $creategroup = pieform(array(
$smarty = smarty();
$smarty->assign('creategroup', $creategroup);
$smarty->assign('PAGEHEADING', hsc(TITLE));
$smarty->display('group/create.tpl');
......
......@@ -66,7 +66,7 @@ $form = pieform(array(
));
$smarty = smarty();
$smarty->assign('heading', TITLE);
$smarty->assign('subheading', hsc(TITLE));
$smarty->assign('message', $views ? get_string('groupconfirmdeletehasviews', 'group') : get_string('groupconfirmdelete', 'group'));
$smarty->assign('form', $form);
$smarty->display('group/delete.tpl');
......
......@@ -149,9 +149,7 @@ function editgroup_submit(Pieform $form, $values) {
}
$smarty = smarty();
$smarty->assign('editgroup', $editgroup);
$smarty->display('group/edit.tpl');
?>
......@@ -29,14 +29,12 @@ define('MENUITEM', 'groups');
require(dirname(dirname(__FILE__)) . '/init.php');
require_once(get_config('docroot') . 'interaction/lib.php');
require_once(get_config('libroot') . 'group.php');
$id = param_integer('id');
define('GROUP', param_integer('id'));
$group = group_current_group();
if (!$group = get_record('group', 'id', $id, 'deleted', 0)) {
throw new GroupNotFoundException(get_string('groupnotfound', 'group', $id));
}
if (!$group->owner == $USER->get('id')) {
if (group_user_access($group->id, $USER->get('id')) != 'admin') {
throw new AccessDeniedException(get_string('notallowedtoeditinteraction', 'group'));
}
......@@ -50,7 +48,7 @@ $interactiontypes = array_flip(
);
if (!$interactions = get_records_select_array('interaction_instance',
'"group" = ? AND deleted = ?', array($id, 0),
'"group" = ? AND deleted = ?', array($group->id, 0),
'plugin, ctime', 'id, plugin, title')) {
$interactions = array();
}
......@@ -72,7 +70,7 @@ $smarty = smarty();
$smarty->assign('group', $group);
$smarty->assign('data', $interactiontypes);
$smarty->assign('pluginnames', $names);
$smarty->assign('heading', TITLE);
$smarty->assign('subheading', hsc(TITLE));
$smarty->display('group/interactions.tpl');
?>
......@@ -84,7 +84,7 @@ $form = pieform(array(
));
$smarty = smarty();
$smarty->assign('heading', TITLE);
$smarty->assign('subheading', hsc(TITLE));
$smarty->assign('form', $form);
$smarty->display('group/invite.tpl');
......
......@@ -341,7 +341,7 @@ function log_build_backtrace($backtrace) {
* @todo this function should go away
*/
function die_info($message) {
$smarty = smarty();
$smarty = smarty(array(), array(), array(), array('sidebars' => false));
$smarty->assign('message', $message);
$smarty->assign('type', 'info');
$smarty->display('message.tpl');
......@@ -529,7 +529,7 @@ class MaharaException extends Exception {
$outputmessage = trim($this->render_exception());
if (function_exists('smarty') && !$this instanceof ConfigSanityException) {
$smarty = smarty();
$smarty = smarty(array(), array(), array(), array('sidebars' => false));
$smarty->assign('title', $outputtitle);
$smarty->assign('message', $outputmessage);
$smarty->display('error.tpl');
......
......@@ -413,7 +413,8 @@ EOF;
}
// ---------- sideblock stuff ----------
if (!defined('INSTALLER') && (!defined('MENUITEM') || substr(MENUITEM, 0, 5) != 'admin')) {
$sidebars = !isset($extraconfig['sidebars']) || $extraconfig['sidebars'] !== false;
if ($sidebars && !defined('INSTALLER') && (!defined('MENUITEM') || substr(MENUITEM, 0, 5) != 'admin')) {
if (get_config('installed') && !defined('ADMIN') && !defined('INSTITUTIONALADMIN')) {
$data = site_menu();
if (!empty($data)) {
......@@ -502,7 +503,7 @@ EOF;
$smarty->assign('userauthinstance', $SESSION->get('authinstance'));
$smarty->assign('MNETUSER', $SESSION->get('mnetuser'));
$smarty->assign('SIDEBLOCKS', $SIDEBLOCKS);
$smarty->assign('SIDEBARS', true);
$smarty->assign('SIDEBARS', $sidebars);
if ($USER->get('parentuser')) {
$smarty->assign('USERMASQUERADING', true);
......@@ -972,6 +973,9 @@ function param_integer($name) {
if (preg_match('/^\d+$/',$value)) {
return (int)$value;
}
else if ($value == '' && isset($args[1])) {
return $args[1];
}
throw new ParameterException("The '$name' parameter is not an integer");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment