From: skodak Date: Thu, 21 Sep 2006 08:05:50 +0000 (+0000) Subject: old admin configuration cleanup - MDL-6595 MDL-6449 MDL-6447 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=db51ddc52e5cc22a170c12e078a9c2eca690cb96;p=moodle.git old admin configuration cleanup - MDL-6595 MDL-6449 MDL-6447 --- diff --git a/admin/calendar.html b/admin/calendar.html index 48d022c963..bba64f8870 100644 --- a/admin/calendar.html +++ b/admin/calendar.html @@ -51,14 +51,6 @@

- - timezones: - -
-

forcetimezone, get_string('timezonenotforced', 'admin'), '', '99'); ?>

-

...

- - diff --git a/admin/calendar.php b/admin/calendar.php index ce929f6f35..0a018c67bb 100644 --- a/admin/calendar.php +++ b/admin/calendar.php @@ -3,25 +3,16 @@ // Allows the admin to configure calendar and date/time stuff require_once('../config.php'); + require_once($CFG->libdir.'/adminlib.php'); + $adminroot = admin_get_root(); + admin_externalpage_setup('calendar', $adminroot); - require_login(); - - require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID)); - - if (!$site = get_site()) { - error('Site isn\'t defined!'); - } /// Print headings - $stradministration = get_string('administration'); - $strconfiguration = get_string('configuration'); - $strcalendarsettings = get_string('calendarsettings', 'admin'); - - print_header("$site->shortname: $strcalendarsettings", "$site->fullname", - "$stradministration -> ". - "$strconfiguration -> $strcalendarsettings"); + admin_externalpage_print_header($adminroot); + $strcalendarsettings = get_string('calendarsettings', 'admin'); print_heading($strcalendarsettings); /// If data submitted, process and store @@ -31,11 +22,6 @@ set_config('calendar_adminseesall', intval($form->adminseesallcourses) != 0); unset($SESSION->cal_courses_shown); } - if(isset($form->forcetimezone)) { - // To protect from SQL injections ... - $form->timezone = clean_param($form->timezone, PARAM_PATH); //not a path, but it looks like it anyway - set_config('forcetimezone', $form->forcetimezone); - } if(isset($form->startwday)) { $startwday = intval($form->startwday); if($startwday >= 0 && $startwday <= 6) { @@ -66,14 +52,12 @@ set_config('calendar_maxevents', $maxevents); } } - redirect('index.php'); + redirect('calendar.php', get_string('changessaved')); } // Include the calendar library AFTER modifying the data, so we read the latest values require_once($CFG->dirroot.'/calendar/lib.php'); - // Populate some variables we 're going to need in calendar.html - $timezones = get_list_of_timezones(); $weekdays = array( 0 => get_string('sunday', 'calendar'), @@ -91,6 +75,6 @@ include('./calendar.html'); print_simple_box_end(); - print_footer(); + admin_externalpage_print_footer($adminroot); ?> diff --git a/admin/editor.html b/admin/editor.html deleted file mode 100644 index 7da0a03328..0000000000 --- a/admin/editor.html +++ /dev/null @@ -1,331 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $fontvalue) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
htmleditor: - htmleditor, "", "", ""); - ?> - - -
editorbackgroundcolor:
editorfontfamily:
editorfontsize:
editorkillword:
aspellpath:
editorspelling: - -

  -
  -
editorhidebuttons: - editorhidebuttons)) { - $buttons = explode(chr(32), $CFG->editorhidebuttons); - } - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/> - /> - />
<?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" />
/> /> /> /> /> /> /> /> /> /> /> />
<?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" />
/> /> /> /> /> /> /> /> /> /> /> />
<?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" /><?php print_string(" title="" />
/> /> /> /> /> /> /> /> /> /> /> />
<?php print_string(" title="" />           
/>           
-
tinymcetheme: 'Advanced','simple' => 'Simple'); - choose_from_menu ($options, "tinymcetheme", $CFG->tinymcetheme, "", "", ""); - ?> 
tinymceplugins:libdir .'/editor/tinymce/jscripts/tiny_mce/plugins'; - $plugins = editor_get_tiny_plugins(); - $pluginsinuse = explode(",", $CFG->tinymceplugins); - - sort($plugins); - $cnt = 0; - echo ''; - foreach ( $plugins as $plugin ) { - $num = ($cnt % 2); - if ( $num < 1 ) { - echo ''; - } - echo ''."\n"; - - if ( $num > 0 ) { - echo ''; - } - $cnt++; - } - echo '
'. $plugin .'
'; - ?>
 
tinymcecontentcss: 
tinymcepopupcss: 
tinymceeditorcss: 
" />
-
- -
- - -
- -
-
- diff --git a/admin/editor.php b/admin/editor.php deleted file mode 100644 index 9ea7917fb5..0000000000 --- a/admin/editor.php +++ /dev/null @@ -1,306 +0,0 @@ -resettodefaults)) { - if (!(reset_to_defaults($currentpage))) { - error("Editor settings could not be restored!"); - } - } else { - - if (!(editor_update_config($data, $currentpage))) { - error("Editor settings could not be updated!"); - } - } - redirect("$CFG->wwwroot/$CFG->admin/editor.php?tab=$currentpage", get_string("changessaved"), 1); - - } else { - // Generate edit form - - $inactive = array(); - switch ( $currentpage ) { - case 1: - $currenttab = 'htmlarea'; - break; - case 2: - $currenttab = 'tinymce'; - break; - default: - error("Unknown currentpage: $currentpage"); - } - - //$url = 'editor.php?tab='; - //$tabrow = array(); - //$tabrow[] = new tabobject('htmlarea',$url . '1', 'HTMLArea'); - //$tabrow[] = new tabobject('tinymce',$url . '2', 'TinyMCE'); - //$tabs = array($tabrow); - - $fontlist = editor_convert_to_array($CFG->editorfontlist); - $dicts = editor_get_dictionaries(); - - $stradmin = get_string("administration"); - $strconfiguration = get_string("configuration"); - $streditorsettings = get_string("editorsettings"); - $streditorsettingshelp = get_string("adminhelpeditorsettings"); - print_header("Editor settings","Editor settings", - "$stradmin -> ". - "$strconfiguration -> $streditorsettings"); - print_heading($streditorsettings); - - print_simple_box("
$streditorsettingshelp
","center","50%"); - print("
\n"); - //print_tabs($tabs, $currenttab, $inactive); - - print_simple_box_start("center"); - include("editor.html"); - print_simple_box_end(); - print_footer(); - } - - -/// FUNCTIONS - -function editor_convert_to_array ($string) { -/// Converts $CFG->editorfontlist to array - - if (empty($string) || !is_string($string)) { - return false; - } - $fonts = array(); - - $lines = explode(";", $string); - foreach ($lines as $line) { - if (!empty($line)) { - list($fontkey, $fontvalue) = explode(":", $line); - $fonts[$fontkey] = $fontvalue; - } - } - - return $fonts; -} - -function editor_update_config ($data, $editor) { - -/// Updates the editor config values. - - if (!is_object($data)) { - return false; - } - - switch($editor) { - case 1: // HTMLArea. - // Make array for unwanted characters. - $nochars = array(chr(33),chr(34),chr(35),chr(36),chr(37), - chr(38),chr(39),chr(40),chr(41),chr(42), - chr(43),chr(46),chr(47),chr(58),chr(59), - chr(60),chr(61),chr(62),chr(63),chr(64), - chr(91),chr(92),chr(93),chr(94),chr(95), - chr(96),chr(123),chr(124),chr(125),chr(126)); - - $fontlist = ''; - - // make font string - $cnt = count($data->fontname); - for ($i = 0; $i < $cnt; $i++) { - if (!empty($data->fontname[$i])) { - $fontlist .= str_replace($nochars, "", $data->fontname[$i]) .":"; - $fontlist .= str_replace($nochars, "", $data->fontnamevalue[$i]) .";"; - } - } - // strip last semicolon - $fontlist = substr($fontlist, 0, strlen($fontlist) - 1); - - // make array of values to update - $updatedata = array(); - $updatedata['htmleditor'] = !empty($data->htmleditor) ? $data->htmleditor : 0; - $updatedata['editorbackgroundcolor'] = !empty($data->backgroundcolor) ? $data->backgroundcolor : "#ffffff"; - $updatedata['editorfontfamily'] = !empty($data->fontfamily) ? str_replace($nochars,"",$data->fontfamily) : "Times New Roman, Times"; - $updatedata['editorfontsize'] = !empty($data->fontsize) ? $data->fontsize : ""; - $updatedata['editorkillword'] = !empty($data->killword) ? $data->killword : 0; - $updatedata['editorspelling'] = !empty($data->spelling) ? $data->spelling : 0; - $updatedata['editorfontlist'] = $fontlist; - $updatedata['editordictionary'] = !empty($data->dictionary) ? $data->dictionary : ''; - $updatedata['aspellpath'] = !empty($data->aspellpath) ? $data->aspellpath : ''; - - $hidebuttons = ''; - if (!empty($data->buttons) && is_array($data->buttons)) { - foreach ($data->buttons as $key => $value) { - $hidebuttons .= $key . " "; - } - } - $updatedata['editorhidebuttons'] = trim($hidebuttons); - break; - - case 2: // TinyMCE. - $updatedata = array(); - $updatedata['htmleditor'] = !empty($data->htmleditor) ? $data->htmleditor : 0; - - // Process plugins - if ( !empty($data->tinymceplugins) ) { - foreach ( $data->tinymceplugins as $key => $value ) { - $value = stripslashes(clean_param($value, PARAM_ALPHA)); - $data->tinymceplugins[$key] = addslashes($value); - } - } - $updatedata['tinymceplugins'] = !empty($data->tinymceplugins) ? implode(",", $data->tinymceplugins) : ''; - $updatedata['tinymcetheme'] = !empty($data->tinymcetheme) ? - clean_param($data->tinymcetheme, PARAM_ALPHA) : ''; - $updatedata['tinymcecontentcss'] = !empty($data->tinymcecontentcss) ? - clean_param($data->tinymcecontentcss, PARAM_URL) : ''; - $updatedata['tinymcepopupcss'] = !empty($data->tinymcepopupcss) ? - clean_param($data->tinymcepopupcss, PARAM_URL) : ''; - $updatedata['tinymceeditorcss'] = !empty($data->tinymceeditorcss) ? - clean_param($data->tinymceeditorcss, PARAM_URL) : ''; - break; - } - - foreach ($updatedata as $name => $value) { - if (!(set_config($name, $value))) { - return false; - } - } - - return true; -} - -function reset_to_defaults ($editor) { -/// Reset the values to default - - global $CFG; - //TO DO: fix defaults now that lib/defaults.php is about to be removed - include_once($CFG->dirroot .'/lib/defaults.php'); - - $updatedata = array(); - - switch ( $editor ) { - case 1: // HTMLArea. - $updatedata['editorbackgroundcolor'] = $defaults['editorbackgroundcolor']; - $updatedata['editorfontfamily'] = $defaults['editorfontfamily']; - $updatedata['editorfontsize'] = $defaults['editorfontsize']; - $updatedata['editorkillword'] = $defaults['editorkillword']; - $updatedata['editorspelling'] = $defaults['editorspelling']; - $updatedata['editorfontlist'] = $defaults['editorfontlist']; - $updatedata['editorhidebuttons'] = $defaults['editorhidebuttons']; - $updatedata['editordictionary'] = ''; - break; - - case 2: // TinyMCE. - $updatedata['tinymceplugins'] = $defaults['tinymceplugins']; - $updatedata['tinymcetheme'] = $defaults['tinymcetheme']; - $updatedata['tinymcecontentcss'] = $defaults['tinymcecontentcss']; - $updatedata['tinymcepopupcss'] = $defaults['tinymcepopupcss']; - $updatedata['tinymceeditorcss'] = $defaults['tinymceeditorcss']; - break; - } - - foreach ($updatedata as $name => $value) { - if (!(set_config($name, $value))) { - return false; - } - } - return true; -} - -function editor_get_dictionaries () { -/// Get all installed dictionaries in the system - - global $CFG; - - error_reporting(E_ALL); // for debug, final version shouldn't have this... - clearstatcache(); - - $strerror = ''; - - // If aspellpath isn't set don't even bother ;-) - if (empty($CFG->aspellpath)) { - return $strerror = 'Empty aspell path!'; - } - - // Do we have access to popen function? - if (!function_exists('popen')) { - return $strerror = "Popen function disabled!"; - exit; - } - - global $CFG; - - $cmd = $CFG->aspellpath; - $output = ''; - $dictionaries = array(); - $dicts = array(); - - if(!($handle = @popen(escapeshellarg($cmd) .' dump dicts', 'r'))) { - return $strerror = "Couldn't create handle!"; - exit; - } - - while(!feof($handle)) { - $output .= fread($handle, 1024); - } - @pclose($handle); - - $dictionaries = explode(chr(10), $output); - - // Get rid of possible empty values - if (is_array($dictionaries)) { - - $cnt = count($dictionaries); - - for ($i = 0; $i < $cnt; $i++) { - if (!empty($dictionaries[$i])) { - $dicts[] = $dictionaries[$i]; - } - } - } - - if (count($dicts) >= 1) { - return $dicts; - } - - $strerror = "Error! Check your aspell installation!"; - return $strerror; - -} - -function editor_get_tiny_plugins() { - global $CFG; - - $plugins = array(); - $plugindir = $CFG->libdir .'/editor/tinymce/jscripts/tiny_mce/plugins'; - - if ( !$fp = opendir($plugindir) ) { - return $plugins; - exit; - } - - while ( ($file = readdir($fp)) !== false ) { - - if ( preg_match("/^\.+/", $file) ) { - continue; - } - - if ( is_dir($plugindir .'/'. $file) ) { - array_push($plugins, $file); - } - - } - - if ( $fp ) { - closedir($fp); - } - - return $plugins; - -} -?> diff --git a/admin/index.php b/admin/index.php index d8a52dd20f..aeac32ef57 100644 --- a/admin/index.php +++ b/admin/index.php @@ -498,112 +498,6 @@ $registrationbuttonshown = true; } -/// The old admin menu - if (optional_param('oldmenu', 0)) { - $table->tablealign = "center"; - $table->align = array ("right", "left"); - $table->wrap = array ("nowrap", "nowrap"); - $table->cellpadding = 5; - $table->cellspacing = 0; - $table->width = '40%'; - - $configdata = ''; - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - if (empty($CFG->disablescheduledbackups)) { - $configdata .= ''; - } - $configdata .= ''; - $configdata .= ''; - $configdata .= ''; - - $table->data[] = array(''.get_string('configuration').'', $configdata); - - $userdata = ''; - $userdata .= ''; - $userdata .= ''; - $userdata .= ''; - $userdata .= ''; - $userdata .= ''; - - $table->data[] = array(''.get_string('users').'', $userdata); - - $coursedata = ''; - $coursedata .= ''; - - - $table->data[] = array(''.get_string('courses').'', $coursedata); - - $miscdata = ''; - $miscdata .= ''; - $miscdata .= ''; - //to be enabled later - /* $miscdata .= '';*/ - $miscdata .= ''; - /// Optional stuff - if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) { - $miscdata .= ''; - } - /// Hack to show the XMLDB editor - if (file_exists("$CFG->dirroot/$CFG->admin/xmldb")) { - $miscdata .= ''; - } - - $table->data[] = array(''.get_string('miscellaneous').'', $miscdata); - -/* - /// Hooks for Matt Oquists contrib code for repositories and portfolio. - /// The eventual official versions may not look like this - if (isset($CFG->portfolio) && file_exists("$CFG->dirroot/$CFG->portfolio")) { - $table->data[] = array("".get_string('portfolio','portfolio').'', - '
'.get_string('adminhelpportfolio','portfolio').'
'); - } - - if (isset($CFG->repo) && file_exists("$CFG->dirroot/$CFG->repo")) { - $table->data[] = array("".get_string('repository',' - repository').'', - '
'.get_string('adminhelprepository','repository').'
'); - } -*/ - - - print_table($table); - - } - ////////////////////////////////////////////////////////////////////////////////////////////////// //// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE /// $copyrighttext = 'Moodle '. diff --git a/admin/questiontypes.php b/admin/questiontypes.php deleted file mode 100644 index 62bf3589f4..0000000000 --- a/admin/questiontypes.php +++ /dev/null @@ -1,171 +0,0 @@ -shortname: $strquestions", "$site->fullname", - "$stradministration -> ". - "$strconfiguration -> $strquestions"); - - print_heading($strquestions); - - -/// If data submitted, then process and store. - - if (!empty($hide) and confirm_sesskey()) { - if (!$qtype = get_record("question_types", "name", $hide)) { - error("Question type doesn't exist!"); - } - set_field("question_types", "visible", "0", "id", $qtype->id); // Hide question type - } - - if (!empty($show) and confirm_sesskey()) { - if (!$qtype = get_record("question_types", "name", $show)) { - error("Question type doesn't exist!"); - } - set_field("question_types", "visible", "1", "id", $qtype->id); // Show question type - } - - if (!empty($delete) and confirm_sesskey()) { - - $strqtypename = get_string("qtypename", "qtype_$delete"); - - if (!$confirm) { - notice_yesno(get_string("qtypedeleteconfirm", "admin", $strqtypename), - "questiontypes.php?delete=$delete&confirm=1&sesskey=$USER->sesskey", - "questiontypes.php"); - print_footer(); - exit; - - } else { // Delete everything!! - - if ($delete == "random") { - error("You can not delete the random question type!!"); - } - - if (!$qtype = get_record("question_types", "name", $delete)) { - error("Question type doesn't exist!"); - } - - // OK, first delete all the questions - if ($questions = get_records("quiz_questions", "qtype", $qtype->id)) { - foreach ($questions as $question) { - if (! quiz_delete_question($coursemod->id, $coursemod->section)) { - notify("Could not delete the $strqtypename with id = $question->id"); - } - } - } - - // And the qtype entry itself - if (!delete_records("question_types", "name", $qtype->name)) { - notify("Error occurred while deleting the $strqtypename record from question_types table"); - } - - // Then the tables themselves - - if ($tables = $db->Metatables()) { - $prefix = $CFG->prefix.$qtype->name; - foreach ($tables as $table) { - if (strpos($table, $prefix) === 0) { - if (!execute_sql("DROP TABLE $table", false)) { - notify("ERROR: while trying to drop table $table"); - } - } - } - } - - $a->qtype = $strqtypename; - $a->directory = "$CFG->dirroot/qtype/$delete"; - notice(get_string("qtypedeletefiles", "", $a), "questiontypes.php"); - } - } - -/// Get and sort the existing questiontypes - - if (!$qtypes = get_records("question_types")) { - error("No question types found!!"); // Should never happen - } - - foreach ($qtypes as $qtype) { - $strqtypename = get_string("qtypename", "qtype_$qtype->name"); - $qtypebyname[$strqtypename] = $qtype; - } - ksort($qtypebyname); - -/// Print the table of all questiontypes - - $table->head = array ($strquestiontype, $strquestions, $strversion, "$strhide/$strshow", $strdelete, $strsettings); - $table->align = array ("left", "right", "left", "center", "center", "center"); - $table->wrap = array ("nowrap", "", "", "", "",""); - $table->size = array ("100%", "10", "10", "10", "10","12"); - $table->width = "100"; - - foreach ($qtypebyname as $qtypename => $qtype) { - - $icon = "dirroot/mod/quiz/questiontypes/$qtype->name/icon.gif\" hspace=\"10\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />"; - - if (file_exists("$CFG->dirroot/mod/quiz/questiontypes/$qtype->name/config.html")) { - $settings = "name\">$strsettings"; - } else { - $settings = ""; - } - - $count = count_records('quiz_questions', 'qtype', $qtype->id); - - $delete = $count ? '' : "name&sesskey=$USER->sesskey\">$strdelete"; - - if ($qtype->visible) { - $visible = "name&sesskey=$USER->sesskey\" title=\"$strhide\">". - "pixpath/i/hide.gif\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />"; - $class = ""; - } else { - $visible = "name&sesskey=$USER->sesskey\" title=\"$strshow\">". - "pixpath/i/show.gif\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />"; - $class = "class=\"dimmed_text\""; - } - if ($qtype->name == "random") { - $delete = ""; - $visible = ""; - $class = ""; - } - $table->data[] = array ("$icon $qtypename", $count, $qtype->version, $visible, $delete, $settings); - } - print_table($table); - - echo "

"; - - print_footer(); - -?> diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index d7af1530ff..a815115f27 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -40,6 +40,8 @@ $temp->add(new admin_setting_sitesetselect('newsitems', get_string('newsitemsnum $temp->add(new admin_setting_configtext('coursesperpage', get_string('coursesperpage', 'admin'), get_string('configcoursesperpage', 'admin'), '20', PARAM_INT)); $ADMIN->add('appearance', $temp); +// calendar +$ADMIN->add('appearance', new admin_externalpage('calendar', get_string('calendarsettings', 'admin'), $CFG->wwwroot.'/'.$CFG->admin.'/calendar.php')); // "filtersettings" settingpage $temp = new admin_settingpage('filtersettings', get_string('filtersettings', 'admin')); diff --git a/admin/settings/language.php b/admin/settings/language.php index 5dd9e15417..da1b915100 100644 --- a/admin/settings/language.php +++ b/admin/settings/language.php @@ -9,15 +9,6 @@ $temp->add(new admin_setting_configcheckbox('langmenu', get_string('langmenu', ' $temp->add(new admin_setting_configtext('langlist', get_string('langlist', 'admin'), get_string('configlanglist', 'admin'), '', PARAM_NOTAGS)); $temp->add(new admin_setting_configcheckbox('langcache', get_string('langcache', 'admin'), get_string('configlangcache', 'admin'), 1)); $temp->add(new admin_setting_configtext('locale', get_string('localetext', 'admin'), get_string('configlocale', 'admin'), '', PARAM_FILE)); -$options = get_list_of_timezones(); -$options[99] = get_string('serverlocaltime'); -$temp->add(new admin_setting_configselect('timezone', get_string('timezone','admin'), get_string('configtimezone', 'admin'), 99, $options)); -$options = get_list_of_timezones(); -$options[0] = get_string('choose') .'...'; -$temp->add(new admin_setting_configselect('country', get_string('country', 'admin'), get_string('configcountry', 'admin'), 0, $options)); -$options = get_list_of_timezones(); -$options[99] = get_string('timezonenotforced', 'admin'); -$temp->add(new admin_setting_configselect('forcetimezone', get_string('forcetimezone', 'admin'), get_string('helpforcetimezone', 'admin'), 99, $options)); $ADMIN->add('language', $temp); diff --git a/admin/site.html b/admin/site.html deleted file mode 100644 index 603af4de58..0000000000 --- a/admin/site.html +++ /dev/null @@ -1,150 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:" /> - -
:" /> - -
:

- "; - if ($usehtmleditor) { - helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); - } else { - helpbutton("html", get_string("helphtml"), "moodle", true, true); - } - echo "
"; - ?> -
summary); ?>
: - - - get_string("frontpagenews"), - FRONTPAGECOURSELIST => get_string("frontpagecourselist"), - FRONTPAGECATEGORYNAMES => get_string("frontpagecategorynames"), - FRONTPAGECATEGORYCOMBO => get_string("frontpagecategorycombo"), - ); - $values = array(get_string('hide'), get_string('order1', 'admin'), get_string('order2', 'admin'), get_string('order3', 'admin'), get_string('order4', 'admin')); - $seq = array_flip(explode(',',$form->frontpage)); - foreach ($seq as $k => $s) { - $seq[$k]++; - } - if (!$coursecount and isset($seq[FRONTPAGECOURSELIST])) { - unset($seq[FRONTPAGECOURSELIST]); //disable course list option when too many course present - } - - foreach ($options as $key => $option) { - $disabled = (!$coursecount and ($key == FRONTPAGECOURSELIST)); - echo "'; - } - ?> - -
$option
"; - choose_from_menu ($values, "frontpage[$key]", isset($seq[$key])?$seq[$key]:0, '', '', 0, false, $disabled); - echo '
-
: - - - frontpageloggedin)); - foreach ($seq as $k => $s) { - $seq[$k]++; - } - - foreach ($options as $key => $option) { - echo "'; - } - ?> - -
$option
"; - choose_from_menu ($values, "frontpageloggedin[$key]", isset($seq[$key])?$seq[$key]:0, ''); - echo '
-
:numsections, ""); - ?> -
: "0 $newsitems", - "1" => "1 $newsitem", - "2" => "2 $newsitems", - "3" => "3 $newsitems", - "4" => "4 $newsitems", - "5" => "5 $newsitems", - "6" => "6 $newsitems", - "7" => "7 $newsitems", - "8" => "8 $newsitems", - "9" => "9 $newsitems", - "10" => "10 $newsitems"); - choose_from_menu ($options, "newsitems", "$form->newsitems", ""); - ?> -
:" /> - () - -
:" /> - () - -
:" /> - () - -
:" /> - () - -
" />
- - - - -
diff --git a/admin/site.php b/admin/site.php deleted file mode 100644 index 98bc9daa83..0000000000 --- a/admin/site.php +++ /dev/null @@ -1,171 +0,0 @@ -format = "social"; // override - } - - $focus = "form.fullname"; - -/// If data submitted, then process and store. - - if ($form = data_submitted()) { - - if (!empty($USER->id)) { // Additional identity check - if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); - } - } - - validate_form($form, $err); - - if (count($err) == 0) { - - $form->frontpage = array_flip($form->frontpage); - unset($form->frontpage[0]); - $form->frontpage = array_flip($form->frontpage); - asort($form->frontpage); - $form->frontpage = implode(',',array_flip($form->frontpage)); - set_config("frontpage", $form->frontpage); - if ($form->frontpage == '') { - $form->numsections = 1; // Force the topic display for this format - } - - $form->frontpageloggedin = array_flip($form->frontpageloggedin); - unset($form->frontpageloggedin[0]); - $form->frontpageloggedin = array_flip($form->frontpageloggedin); - asort($form->frontpageloggedin); - $form->frontpageloggedin = implode(',',array_flip($form->frontpageloggedin)); - set_config("frontpageloggedin", $form->frontpageloggedin); - - $form->timemodified = time(); - - if ($form->id) { - if (update_record("course", $form)) { - redirect("$CFG->wwwroot/", get_string("changessaved")); - } else { - error("Serious Error! Could not update the site record! (id = $form->id)"); - } - } else { - // We are about to create the site "course" - require_once($CFG->dirroot.'/lib/blocklib.php'); - - if ($newid = insert_record('course', $form)) { - - // Site created, add blocks for it - $page = page_create_object(PAGE_COURSE_VIEW, $newid); - blocks_repopulate_page($page); // Return value not checked because you can always edit later - - $cat->name = get_string('miscellaneous'); - if (insert_record('course_categories', $cat)) { - redirect("$CFG->wwwroot/$CFG->admin/index.php", get_string("changessaved"), 1); - } else { - error("Serious Error! Could not set up a default course category!"); - } - } else { - error("Serious Error! Could not set up the site!"); - } - } - die; - - } else { - foreach ($err as $key => $value) { - $focus = "form.$key"; - } - } - } - -/// Otherwise fill and print the form. - - if ($site and empty($form)) { - $form = $site; - $course = $site; - $firsttime = false; - } else { - $form->fullname = ""; - $form->shortname = ""; - $form->summary = ""; - $form->newsitems = 3; - $form->numsections = 0; - $form->id = ""; - $form->category = 0; - $form->format = 'site'; // Only for this course - $form->teacher = get_string("defaultcourseteacher"); - $form->teachers = get_string("defaultcourseteachers"); - $form->student = get_string("defaultcoursestudent"); - $form->students = get_string("defaultcoursestudents"); - $firsttime = true; - } - - if (isset($CFG->frontpage)) { - $form->frontpage = $CFG->frontpage; - } else { - $form->frontpage = FRONTPAGECOURSELIST; // Show course list by default - set_config("frontpage", $form->frontpage); - } - - if (isset($CFG->frontpageloggedin)) { - $form->frontpageloggedin = $CFG->frontpageloggedin; - } else { - $form->frontpageloggedin = $form->frontpage; - set_config("frontpageloggedin", $form->frontpageloggedin); - } - - $stradmin = get_string("administration"); - $strconfiguration = get_string("configuration"); - $strsitesettings = get_string("sitesettings"); - - if ($firsttime) { - print_header(); - print_heading($strsitesettings); - print_simple_box(get_string("configintrosite", 'admin'), "center", "50%"); - echo "
"; - } else { - print_header("$site->shortname: $strsitesettings", "$site->fullname", - "$stradmin -> ". - "$strconfiguration -> $strsitesettings", "$focus"); - print_heading($strsitesettings); - } - - if (empty($USER->id)) { // New undefined admin user - $USER->htmleditor = true; - $sesskey = ''; - } else { - $sesskey = $USER->sesskey; - } - $usehtmleditor = can_use_html_editor(); - $defaultformat = FORMAT_HTML; - - print_simple_box_start("center", ""); - include("site.html"); - print_simple_box_end(); - - if ($usehtmleditor) { - use_html_editor(); - } - - if (!$firsttime) { - print_footer(); - } - - exit; - -/// Functions ///////////////////////////////////////////////////////////////// - -function validate_form(&$form, &$err) { - - if (empty($form->fullname)) - $err["fullname"] = get_string("missingsitename"); - - if (empty($form->shortname)) - $err["shortname"] = get_string("missingshortsitename"); - - return; -} - - -?> diff --git a/blocks/course_summary/block_course_summary.php b/blocks/course_summary/block_course_summary.php index ebe8b1d96c..98ee250159 100644 --- a/blocks/course_summary/block_course_summary.php +++ b/blocks/course_summary/block_course_summary.php @@ -29,7 +29,7 @@ class block_course_summary extends block_base { $this->content->text = format_text($COURSE->summary, FORMAT_HTML, $options); if(isediting($COURSE->id)) { if($COURSE->id == SITEID) { - $editpage = $CFG->wwwroot.'/'.$CFG->admin.'/site.php'; + $editpage = $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=frontpage'; } else { $editpage = $CFG->wwwroot.'/course/edit.php?id='.$COURSE->id; } diff --git a/lib/defaults.php b/lib/defaults.php deleted file mode 100644 index 4481f74c9a..0000000000 --- a/lib/defaults.php +++ /dev/null @@ -1,121 +0,0 @@ - false, - 'allowemailaddresses' => '', - 'allowobjectembed' => false, - 'allowunenroll' => true, - 'allowusermailcharset' => 0, - 'allowuserthemes' => false, - 'allowuserblockhiding' => true, - 'allusersaresitestudents' => true, - 'alternateloginurl' => '', - 'aspellpath' => '', - 'auth' => 'email', - 'auth_pop3mailbox' => 'INBOX', - 'autologinguests' => 0, - 'bloglevel' => 4, - 'cachetext' => 60, - 'changepassword' => '', - 'country' => '', - 'clamfailureonupload' => 'donothing', - 'dbsessions' => false, - 'debug' => 5, - 'defaultrequestedcategory' => 1, - 'deleteunconfirmed' => 168, - 'denyemailaddresses' => '', - 'digestmailtime' => 17, - 'displayloginfailures' => '', - 'docroot' => 'http://docs.moodle.org', - 'doctonewwindow' => 0, - 'enablecourserequests' => 0, - 'enablerssfeeds' => 0, - 'enablestats' => 0, - 'enabletrusttext' => 0, - 'enrol' => 'internal',//wrong - 'extendedusernamechars' => false, - 'editorbackgroundcolor' => '#ffffff', - 'editorfontfamily' => 'Trebuchet MS,Verdana,Arial,Helvetica,sans-serif', - 'editorfontsize' => '', - 'editorkillword' => 1, - 'editorspelling' => 0, - 'editorfontlist' => 'Trebuchet:Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial:arial,helvetica,sans-serif;Courier New:courier new,courier,monospace;Georgia:georgia,times new roman,times,serif;Tahoma:tahoma,arial,helvetica,sans-serif;Times New Roman:times new roman,times,serif;Verdana:verdana,arial,helvetica,sans-serif;Impact:impact;Wingdings:wingdings', - 'editorhidebuttons' => '', - 'filterall' => false, - 'filtermatchoneperpage' => 0, - 'filtermatchonepertext' => 0, - 'filteruploadedfiles' => 0, - 'forcelogin' => false, - 'forceloginforprofiles' => false, - 'forcetimezone' => 99, - 'fullnamedisplay' => 'firstname lastname', - 'framename' => '_top', - 'frontpage' => 1, - 'gdversion' => 1, - 'guestloginbutton' => 1, - 'htmleditor' => true, - 'lang' => !empty($CFG->unicodedb) ? 'en_utf8' : 'en', - 'langcache' => 1, - 'langmenu' => 1, - 'langlist' => '', - 'locale' => '', // by default language pack locales should be used - 'loginhttps' => false, - 'loglifetime' => 0, - 'longtimenosee' => 100, - 'maxbytes' => 0, - 'maxeditingtime' => 1800, - 'messaging' => true, - 'mymoodleredirect' => false, - 'noreplyaddress' => 'noreply@'.$_SERVER['HTTP_HOST'], - 'notifyloginfailures' => '', - 'notifyloginthreshold' => 10, - 'opentogoogle' => false, - 'pathtoclam' => '', - 'pathtodu' => '', - 'prefix' => '', - 'perfdebug' => 0, - 'proxyhost' => '', - 'proxyport' => '', - 'quarantinedir' => '', - 'requestedteachername' => '', - 'requestedteachersname' => '', - 'requestedstudentname' => '', - 'requestedstudentsname' => '', - 'restrictmodulesfor' => 'none', - 'restrictbydefault' => 0, - 'runclamonupload' => 0, - 'secureforms' => false, - 'sessioncookie' => '', - 'sessioncookiepath' => '/', - 'sessiontimeout' => 7200, - 'showblocksonmodpages' => 0, - 'sitemailcharset' => '', - 'sitepolicy' => '', - 'slasharguments' => 1, - 'smtphosts' => '', - 'smtppass' => '', - 'smtpuser' => '', - 'statsfirstrun' => 'none', - 'statsmaxruntime' => 0, - 'statsuserthreshold' => 0, - 'style' => 'default', - 'tabselectedtofront' => false, - 'teacherassignteachers' => true, - 'template' => 'default', - 'textfilters' => 'mod/glossary/dynalink.php',//wrong - 'theme' => 'standardwhite', - 'themelist' => '', - 'timezone' => 99, - 'tinymceplugins' => 'advimage,fullscreen', - 'tinymcetheme' => 'advanced', - 'tinymcecontentcss' => $CFG->httpswwwroot .'/lib/editor/tinymce/moodlecontent.css', - 'tinymcepopupcss' => '', - 'tinymceeditorcss' => '', - 'unzip' => '', - 'zip' => '' - ); - -?>