]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8343 reorganize frontpage settings in admintree - I hope fixed last installation bug
authorskodak <skodak>
Tue, 30 Jan 2007 10:33:09 +0000 (10:33 +0000)
committerskodak <skodak>
Tue, 30 Jan 2007 10:33:09 +0000 (10:33 +0000)
admin/settings/frontpage.php
lib/adminlib.php

index 576d9c6efae19200fc9810779c2216b8c0e96534..1393208acfeab3175401b7f0861bdbee6edbcf42 100644 (file)
@@ -3,8 +3,12 @@
 // This file defines everything related to frontpage
 
 if (get_site()) { //do not use during installation
-
-$frontpagecontext = get_context_instance(CONTEXT_COURSE, SITEID);
+    $frontpagecontext = get_context_instance(CONTEXT_COURSE, SITEID);
+    $frontpagecontextid = $frontpagecontext->id; 
+} else {
+    $frontpagecontext = NULL;
+    $frontpagecontextid = 0; 
+}
 
 // "frontpage" settingpage
 $temp = new admin_settingpage('frontpagesettings', get_string('frontpagesettings','admin'), 'moodle/course:update', false, $frontpagecontext);
@@ -30,7 +34,7 @@ $temp->add(new admin_setting_configtext('coursesperpage', get_string('coursesper
 $temp->add(new admin_setting_configcheckbox('allowvisiblecoursesinhiddencategories', get_string('allowvisiblecoursesinhiddencategories', 'admin'), get_string('configvisiblecourses', 'admin'), 0));
 $ADMIN->add('frontpage', $temp);
 
-$ADMIN->add('frontpage', new admin_externalpage('frontpageroles', get_string('frontpageroles', 'admin'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $frontpagecontext->id, 'moodle/role:assign', false, $frontpagecontext));
+$ADMIN->add('frontpage', new admin_externalpage('frontpageroles', get_string('frontpageroles', 'admin'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $frontpagecontextid, 'moodle/role:assign', false, $frontpagecontext));
 
 $ADMIN->add('frontpage', new admin_externalpage('frontpagebackup', get_string('frontpagebackup', 'admin'), $CFG->wwwroot.'/backup/backup.php?id='.SITEID, 'moodle/site:backup', false, $frontpagecontext));
 
@@ -38,5 +42,4 @@ $ADMIN->add('frontpage', new admin_externalpage('frontpagerestore', get_string('
 
 $ADMIN->add('frontpage', new admin_externalpage('sitefiles', get_string('sitefiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID, 'moodle/course:managefiles', false, $frontpagecontext));
 
-}
 ?>
\ No newline at end of file
index 30255f5de0caefe513c09d15506683399af830bf..083fe16e0c116dfccd9e3252a87445411d776196 100644 (file)
@@ -1131,7 +1131,7 @@ class admin_externalpage extends part_of_admin_tree {
      * @param string $url The external URL that we should link to when someone requests this external page.
      * @param mixed $req_capability The role capability/permission a user must have to access this external page. Defaults to 'moodle/site:config'.
      */
-    function admin_externalpage($name, $visiblename, $url, $req_capability = 'moodle/site:config', $hidden=false, $context=false) {
+    function admin_externalpage($name, $visiblename, $url, $req_capability = 'moodle/site:config', $hidden=false, $context=NULL) {
         $this->name = $name;
         $this->visiblename = $visiblename;
         $this->url = $url;
@@ -1264,7 +1264,7 @@ class admin_settingpage extends part_of_admin_tree {
     }
 
     // see admin_externalpage
-    function admin_settingpage($name, $visiblename, $req_capability = 'moodle/site:config', $hidden=false, $context=false) {
+    function admin_settingpage($name, $visiblename, $req_capability = 'moodle/site:config', $hidden=false, $context=NULL) {
         global $CFG;
         $this->settings = new stdClass();
         $this->name = $name;