Commit b0324df6 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Moved all earth admin files around. Most of them are broken at this point,

subsequent commits will fix them.
parent 69b3f982
<?php
/**
* This program is part of Mahara
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage admin
* @author Nigel McNie <nigel@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL',1);
define('ADMIN',1);
define('MENUITEM','siteoptions');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('pieforms/pieform.php');
$langoptions = get_languages();
$themeoptions = get_themes();
$yesno = array(true => get_string('yes'),
false => get_string('no'));
$siteoptionform = pieform(array(
'name' => 'siteoptions',
'ajaxpost' => true,
'elements' => array(
'sitename' => array(
'type' => 'text',
'title' => get_string('sitename','admin'),
'description' => get_string('sitenamedescription','admin'),
'defaultvalue' => get_config('sitename'),
),
'language' => array(
'type' => 'select',
'title' => get_string('language','admin'),
'description' => get_string('sitelanguagedescription','admin'),
'defaultvalue' => get_config('language'),
'collapseifoneoption' => true,
'options' => $langoptions,
),
'theme' => array(
'type' => 'select',
'title' => get_string('theme','admin'),
'description' => get_string('sitethemedescription','admin'),
'defaultvalue' => get_config('theme'),
'collapseifoneoption' => true,
'options' => $themeoptions,
),
'viruschecking' => array(
'type' => 'checkbox',
'title' => get_string('viruschecking','admin'),
'description' => get_string('viruscheckingdescription','admin'),
'defaultvalue' => get_config('viruschecking'),
),
'pathtoclam' => array(
'type' => 'text',
'title' => get_string('pathtoclam','admin'),
'description' => get_string('pathtoclamdescription','admin'),
'defaultvalue' => get_config('pathtoclam'),
),
'sessionlifetime' => array(
'type' => 'text',
'size' => 4,
'title' => get_string('sessionlifetime','admin'),
'description' => get_string('sessionlifetimedescription','admin'),
'defaultvalue' => get_config('session_timeout') / 60,
),
'allowpublicviews' => array(
'type' => 'select',
'title' => get_string('allowpublicviews','admin'),
'description' => get_string('allowpublicviewsdescription','admin'),
'defaultvalue' => get_config('allowpublicviews'),
'options' => $yesno,
),
'artefactviewinactivitytime' => array(
'type' => 'expiry',
'title' => get_string('artefactviewinactivitytime','admin'),
'description' => get_string('artefactviewinactivitytimedescription','admin'),
'defaultvalue' => get_config('artefactviewinactivitytime'),
),
'submit' => array(
'type' => 'submit',
'value' => get_string('updatesiteoptions','admin')
),
)
));
function siteoptions_fail($field) {
json_reply('local', get_string('setsiteoptionsfailed','admin', get_string($field)));
}
function siteoptions_submit($values) {
$fields = array('sitename','language','theme','pathtoclam',
'allowpublicviews','artefactviewinactivitytime');
foreach ($fields as $field) {
if (!set_config($field, $values[$field])) {
siteoptions_fail($field);
}
}
// submitted sessionlifetime is in minutes; db entry session_timeout is in seconds
if (!set_config('session_timeout', $values['sessionlifetime'] * 60)) {
siteoptions_fail('sessionlifetime');
}
// Submitted value is on/off; database entry should be 1/0
if (!set_config('viruschecking', (int) ($values['viruschecking'] == 'on'))) {
siteoptions_fail('viruschecking');
}
json_reply(false, get_string('siteoptionsset','admin'));
}
$smarty = smarty();
$smarty->assign('SITEOPTIONFORM',$siteoptionform);
$smarty->display('admin/options/index.tpl');
?>
......@@ -26,14 +26,14 @@
define('INTERNAL', 1);
define('ADMIN', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$itemid = param_integer('itemid');
if (!delete_records('site_menu','id',$itemid)) {
if (!delete_records('site_menu','id', $itemid)) {
json_reply('local', get_string('deletefailed','admin'));
}
json_reply(false,get_string('menuitemdeleted','admin'));
json_reply(false, get_string('menuitemdeleted','admin'));
?>
......@@ -26,18 +26,18 @@
define('INTERNAL', 1);
define('ADMIN', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$pagename = param_alpha('pagename');
$data['pagename'] = $pagename;
if (!$page = @get_record('site_content','name',$pagename)) {
json_reply('local',get_string('loadsitepagefailed','admin'));
if (!$page = @get_record('site_content', 'name', $pagename)) {
json_reply('local', get_string('loadsitepagefailed', 'admin'));
}
$data['content'] = $page->content;
$data['error'] = false;
$data['error'] = false;
$data['message'] = get_string('sitepageloaded','admin');
json_headers();
echo json_encode($data);
......
......@@ -26,7 +26,7 @@
define('INTERNAL', 1);
define('ADMIN', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$public = (int) param_boolean('public');
......
......@@ -24,10 +24,11 @@
*
*/
define('INTERNAL',1);
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM','menueditor');
require(dirname(dirname(__FILE__)).'/init.php');
define('MENUITEM', 'configsite');
define('SUBMENUITEM', 'editmenu');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$strings = array('edit','delete','update','cancel','add','name','unknownerror');
$adminstrings = array('deletefailed','deletingmenuitem','savingmenuitem',
......
......@@ -24,9 +24,10 @@
*
*/
define('INTERNAL',1);
define('ADMIN',1);
define('MENUITEM','siteoptions');
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'configsite');
define('SUBMENUITEM', 'siteoptions');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('pieforms/pieform.php');
......@@ -94,15 +95,6 @@ $siteoptionform = pieform(array(
'description' => get_string('artefactviewinactivitytimedescription','admin'),
'defaultvalue' => get_config('artefactviewinactivitytime'),
),
'contactaddress' => array(
'type' => 'text',
'title' => get_string('contactaddress','admin'),
'description' => get_string('contactaddressdescription','admin'),
'defaultvalue' => get_config('contactaddress'),
'rules' => array(
'email' => true
)
),
'submit' => array(
'type' => 'submit',
'value' => get_string('updatesiteoptions','admin')
......@@ -116,8 +108,7 @@ function siteoptions_fail($field) {
function siteoptions_submit($values) {
$fields = array('sitename','language','theme','pathtoclam',
'allowpublicviews','artefactviewinactivitytime',
'contactaddress');
'allowpublicviews','artefactviewinactivitytime');
foreach ($fields as $field) {
if (!set_config($field, $values[$field])) {
siteoptions_fail($field);
......
......@@ -24,10 +24,11 @@
*
*/
define('INTERNAL',1);
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM','pageeditor');
require(dirname(dirname(__FILE__)).'/init.php');
define('MENUITEM', 'configsite');
define('SUBMENUITEM', 'pageeditor');
require(dirname(dirname(dirname(__FILE__))).'/init.php');
require_once('pieforms/pieform.php');
$sitepages = get_records_array('site_content');
......
......@@ -26,7 +26,7 @@
define('INTERNAL', 1);
define('ADMIN', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$type = param_alpha('type'); // external list or admin file
$name = param_variable('name');
......
......@@ -28,7 +28,7 @@
// here might need to be fixed there too.
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'usermanagement');
define('MENUITEM', 'configusers');
define('SUBMENUITEM', 'adminusers');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('pieforms/pieform.php');
......
......@@ -26,8 +26,9 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'institutions');
require(dirname(dirname(__FILE__)) . '/init.php');
define('MENUITEM', 'configusers');
define('SUBMENUITEM', 'institutions');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('pieforms/pieform.php');
$smarty = smarty();
......@@ -176,6 +177,7 @@ if ($institution || $add) {
$smarty->assign('institution_form', pieform(array(
'name' => 'institution',
'renderer' => 'table',
'elements' => $elements
)));
......
......@@ -26,7 +26,7 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'usermanagement');
define('MENUITEM', 'configusers');
define('SUBMENUITEM', 'adminnotifications');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
......
......@@ -28,7 +28,7 @@
// here might need to be fixed there too.
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'usermanagement');
define('MENUITEM', 'configusers');
define('SUBMENUITEM', 'staffusers');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('pieforms/pieform.php');
......@@ -68,7 +68,7 @@ function staffusers_submit($values) {
WHERE id IN (' . join(',', $values['users']) . ')');
db_commit();
$SESSION->add_ok_msg(get_string('staffusersupdated', 'admin'));
redirect(get_config('wwwroot') . 'admin/usermanagement/staffusers.php');
redirect(get_config('wwwroot') . 'admin/users/staff.php');
}
$smarty->assign('staffusersform', pieform($form));
......
......@@ -26,7 +26,7 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'usermanagement');
define('MENUITEM', 'configusers');
define('SUBMENUITEM', 'suspendedusers');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
......
......@@ -26,7 +26,7 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'usermanagement');
define('MENUITEM', 'configusers');
define('SUBMENUITEM', 'uploadcsv');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('pieforms/pieform.php');
......
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