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

Merge branch 'master' into view-themes

Conflicts:

	htdocs/lang/en.utf8/admin.php
	htdocs/lang/en.utf8/mahara.php
	htdocs/lib/db/upgrade.php
	htdocs/lib/version.php
	htdocs/theme/raw/static/style/style.css
	htdocs/theme/raw/templates/microheader.tpl
	htdocs/theme/raw/templates/user/view.tpl
	htdocs/theme/raw/templates/view/blocks.tpl
	htdocs/theme/raw/templates/view/view.tpl
	htdocs/theme/raw/templates/viewmicroheader.tpl
	htdocs/theme/views.css
	htdocs/view/blocks.php
	htdocs/view/view.php
parents b0899a76 f5d59450
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @subpackage core
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @subpackage core
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @subpackage core
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......@@ -31,6 +32,7 @@ define('SECTION_PLUGINNAME', 'account');
define('SECTION_PAGE', 'activity');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('pieforms/pieform.php');
define('TITLE', get_string('notifications'));
$types = get_records_assoc('activity_type', 'admin', 0, 'plugintype,pluginname,name', 'id,name,plugintype,pluginname');
......@@ -170,6 +172,28 @@ function showHideMessage(id) {
JAVASCRIPT;
$deleteall = pieform(array(
'name' => 'delete_all_notifications',
'method' => 'post',
'plugintype' => 'core',
'pluginname' => 'account',
'elements' => array(
'submit' => array(
'type' => 'submit',
'value' => get_string('deleteallnotifications', 'activity'),
'confirm' => get_string('reallydeleteallnotifications', 'activity'),
),
),
));
function delete_all_notifications_submit() {
global $USER, $SESSION;
$count = count_records('notification_internal_activity', 'usr', $USER->get('id'));
delete_records('notification_internal_activity', 'usr', $USER->get('id'));
$SESSION->add_ok_msg(get_string('deletednotifications', 'activity', $count));
redirect(get_config('wwwroot') . 'account/activity/index.php');
}
$smarty = smarty(array('tablerenderer'));
$smarty->assign('selectallread', 'toggleChecked(\'tocheckread\'); return false;');
$smarty->assign('selectalldel', 'toggleChecked(\'tocheckdel\'); return false;');
......@@ -179,5 +203,6 @@ $smarty->assign('typechange', 'activitylist.type = this.options[this.selectedInd
$smarty->assign('types', $types);
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->assign('PAGEHEADING', hsc(get_string('notifications')));
$smarty->assign('deleteall', $deleteall);
$smarty->display('account/activity/index.tpl');
?>
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @subpackage core
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......@@ -33,6 +34,7 @@ define('SECTION_PAGE', 'activitypreferences');
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
define('TITLE', get_string('activityprefs'));
require_once('pieforms/pieform.php');
require_once(get_config('libroot') . 'activity.php');
$activitytypes = get_records_array('activity_type', 'admin', 0);
if ($USER->get('admin') || $USER->is_institutional_admin()) {
......@@ -51,11 +53,7 @@ foreach ($notifications as $n) {
foreach ($activitytypes as $type) {
$dv = $USER->get_activity_preference($type->id);
if (empty($dv)) {
if (!empty($type->admin) && $USER->get('admin')) {
$dv = 'none';
} else {
$dv = 'email';
}
$dv = call_static_method(generate_activity_class_name($type->name, $type->plugintype, $type->pluginname), 'default_notification_method');
}
if (!empty($type->plugintype)) {
$section = $type->plugintype . '.' . $type->pluginname;
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -17,45 +18,47 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package mahara
* @subpackage artefact-blog
* @subpackage core
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
defined('INTERNAL') || die();
define('INTERNAL', 1);
define('MENUITEM', 'settings/preferences');
$enc_wwwroot = json_encode(get_config('wwwroot'));
$enc_id = json_encode($this->id);
$enc_options = json_encode(json_encode($options));
require(dirname(dirname(__FILE__)) . '/init.php');
define('TITLE', get_string('deleteaccount', 'account'));
require_once('pieforms/pieform.php');
return <<<EOJAVASCRIPT
if (!$USER->can_delete_self()) {
throw new AccessDeniedException(get_string('accessdenied', 'error'));
}
var blog_listchildren{$blockid} = new TableRenderer(
'blog_listchildren{$blockid}',
{$enc_wwwroot} + 'artefact/blog/render/blog_listchildren.json.php',
[
function(r) {
var td = TD();
if (typeof(r.content.html) != 'undefined') {
td.innerHTML = r.content.html;
}
else {
td.innerHTML = r.content;
}
return td;
}
]
);
$deleteform = pieform(array(
'name' => 'account_delete',
'plugintype' => 'core',
'pluginname' => 'account',
'elements' => array(
'submit' => array(
'type' => 'submit',
'value' => get_string('delete'),
),
),
));
blog_listchildren{$blockid}.statevars.push('id');
blog_listchildren{$blockid}.id = {$enc_id};
blog_listchildren{$blockid}.statevars.push('options');
blog_listchildren{$blockid}.options = {$enc_options};
function account_delete_submit(Pieform $form, $values) {
global $SESSION, $USER;
$userid = $USER->get('id');
$USER->logout();
delete_user($userid);
$SESSION->add_ok_msg(get_string('accountdeleted', 'account'));
redirect('/');
}
blog_listchildren{$blockid}.updateOnLoad();
EOJAVASCRIPT;
$smarty = smarty();
$smarty->assign('form', $deleteform);
$smarty->display('account/delete.tpl');
?>
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @subpackage core
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......@@ -142,6 +143,16 @@ $elements['addremovecolumns'] = array(
'separator' => '<br>',
'help' => 'true'
);
if (get_config('showtagssideblock')) {
$elements['tagssideblockmaxtags'] = array(
'type' => 'text',
'size' => 4,
'title' => get_string('tagssideblockmaxtags', 'account'),
'description' => get_string('tagssideblockmaxtagsdescription', 'account'),
'defaultvalue' => isset($prefs->tagssideblockmaxtags) ? $prefs->tagssideblockmaxtags : get_config('tagssideblockmaxtags'),
'rules' => array('integer' => true, 'minvalue' => 0, 'maxvalue' => 1000),
);
}
$elements['submit'] = array(
'type' => 'submit',
'value' => get_string('save')
......@@ -228,6 +239,7 @@ $prefsform = pieform($prefsform);
$smarty = smarty();
$smarty->assign('form', $prefsform);
$smarty->assign('candeleteself', $USER->can_delete_self());
$smarty->assign('INLINEJAVASCRIPT', "
function clearPasswords(form, data) {
formSuccess(form, data);
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @subpackage core
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......@@ -34,31 +35,35 @@ require_once('pieforms/pieform.php');
$institutions = get_records_assoc('institution', '', '', '', 'name,displayname,registerallowed');
// For all institutions the user is already a member of, create a
// button to leave the institution
// button to leave the institution, unless the institution does not
// allow registration.
$member = $USER->get('institutions');
if (!empty($member)) {
$elements = array();
foreach ($member as $i) {
$elements[] = array(
'type' => 'submit',
'class' => 'btn-del',
'name' => '_leave_' . $i->institution,
'confirm' => get_string('reallyleaveinstitution'),
'title' => get_string('youareamemberof', 'mahara',
$institutions[$i->institution]->displayname),
'value' => get_string('leaveinstitution')
);
$elements[] = array(
'type' => 'html',
'name' => '_leavehtml_' . $i->institution,
'value' => '<br>',
);
if ($institutions[$i->institution]->registerallowed) {
$elements[] = array(
'type' => 'submit',
'class' => 'btn-del',
'name' => '_leave_' . $i->institution,
'confirm' => get_string('reallyleaveinstitution'),
'title' => get_string('youareamemberof', 'mahara', $institutions[$i->institution]->displayname),
'value' => get_string('leaveinstitution')
);
}
else {
$elements[] = array(
'type' => 'html',
'name' => '_noleave_' . $i->institution,
'title' => get_string('youareamemberof', 'mahara', $institutions[$i->institution]->displayname),
'value' => '',
);
}
unset($institutions[$i->institution]);
}
$memberform = pieform(array(
'name' => 'leaveinstitution',
'method' => 'post',
'renderer' => 'oneline',
'plugintype' => 'core',
'pluginname' => 'account',
'elements' => $elements
......@@ -102,7 +107,6 @@ if (!empty($requested)) {
$requestedform = pieform(array(
'name' => 'cancelrequest',
'method' => 'post',
'renderer' => 'oneline',
'plugintype' => 'core',
'pluginname' => 'account',
'elements' => $elements
......@@ -151,7 +155,6 @@ if (!empty($invited)) {
$invitedform = pieform(array(
'name' => 'confirminvite',
'method' => 'post',
'renderer' => 'oneline',
'plugintype' => 'core',
'pluginname' => 'account',
'elements' => $elements
......@@ -201,12 +204,12 @@ if (!empty($institutions) &&
$joinform = pieform(array(
'name' => 'requestmembership',
'method' => 'post',
'renderer' => 'oneline',
'plugintype' => 'core',
'pluginname' => 'account',
'elements' => array(
'institution' => array(
'type' => 'select',
'title' => get_string('institution'),
'collapseifoneoption' => false,
'options' => $options,
'defaultvalue' => key($options),
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......@@ -38,6 +39,7 @@ if (get_config('installed')) {
else {
define('TITLE', get_string('installation', 'admin'));
}
require_once('pieforms/pieform.php');
require(get_config('libroot') . 'upgrade.php');
require(get_config('libroot') . 'registration.php');
......@@ -55,6 +57,22 @@ if (!get_config('registration_lastsent')) {
$register = register_site();
}
$closed = get_config('siteclosedbyadmin');
$closeform = pieform(array(
'name' => 'close_site',
'renderer' => 'oneline',
'elements' => array(
'close' => array(
'type' => 'hidden',
'value' => !$closed,
),
'submit' => array(
'type' => 'submit',
'value' => get_string($closed ? 'Open' : 'Close', 'admin'),
),
),
));
$smarty = smarty();
$smarty->assign('PAGEHEADING', hsc(get_string('administration', 'admin')));
......@@ -65,6 +83,20 @@ if (isset($register)) {
$smarty->assign('register', $register);
}
$smarty->assign('closed', $closed);
$smarty->assign('closeform', $closeform);
$smarty->display('admin/index.tpl');
function close_site_submit(Pieform $form, $values) {
global $closed;
if (!$closed && $values['close']) {
set_config('siteclosedbyadmin', 1);
}
else if ($closed && !$values['close']) {
set_config('siteclosedbyadmin', 0);
}
redirect(get_config('wwwroot') . 'admin/index.php');
}
?>
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* 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
......@@ -20,7 +21,7 @@
* @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
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
......@@ -72,7 +73,17 @@ $networkingform = pieform(
'type' => 'html',
'title' => get_string('publickey','admin'),
'description' => get_string('publickeydescription2', 'admin', 365),
'value' => '<pre style="font-size: 0.7em">'.$openssl->certificate.'</pre>'
'value' => '<pre style="font-size: 0.7em; white-space: pre;">'.$openssl->certificate.'</pre>'
),
'sha1fingerprint' => array(
'type' => 'html',
'title' => 'SHA1 Fingerprint',
'value' => $openssl->sha1_fingerprint
),
'md5fingerprint' => array(
'type' => 'html',
'title' => 'MD5 Fingerprint',
'value' => $openssl->md5_fingerprint
),
'expires' => array(