]> git.mjollnir.org Git - moodle.git/commitdiff
admin MDL-17429 Move registration button to admin menu, and make registration page...
authormoodler <moodler>
Wed, 10 Dec 2008 06:23:35 +0000 (06:23 +0000)
committermoodler <moodler>
Wed, 10 Dec 2008 06:23:35 +0000 (06:23 +0000)
admin MDL-16867 Change "Optional subsystems" menu item to "Advanced features"

(Sorry for the mixed checkin)

admin/index.php
admin/register.php
admin/settings/server.php
admin/settings/top.php
lang/en_utf8/admin.php

index 9bd8214514336f02dfb2ae217f64b7b77e84492a..77f5674dc9048d6b217eb772876bc1998d5080c2 100644 (file)
     }
 
 
-/// Print slightly annoying registration button
-    $options = array();
-    $options['sesskey'] = $USER->sesskey;
-    print_box_start('generalbox adminwarning');
-    if(!isset($CFG->registered)) {
-       print_string('pleaseregister', 'admin');
-    }
-    else { /* if (isset($CFG->registered) && $CFG->registered < (time() - 3600*24*30*6)) { */
-       print_string('pleaserefreshregistration', 'admin', userdate($CFG->registered));
-    }
-    print_single_button('register.php', $options, get_string('registration'));
-    print_box_end();
-
-
     //////////////////////////////////////////////////////////////////////////////////////////////////
     ////  IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
     $copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
index d6bc2a3ed1adee20c3103b863a2ada1fdbd515ac..e4217f023a8a54de6f3565ef619700578e22fe73 100644 (file)
@@ -2,19 +2,19 @@
        // register.php - allows admin to register their site on moodle.org
 
     require_once('../config.php');
+    require_once($CFG->libdir.'/adminlib.php');
 
     require_login();
 
     require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
 
+
+    admin_externalpage_setup('adminregistration');
+
     if (!$site = get_site()) {
         redirect("index.php");
     }
 
-    if (!confirm_sesskey()) {
-        print_error('confirmsesskeybad', 'error');
-    }
-
     if (!$admin = get_admin()) {
         print_error('noadmins', 'error');
     }
@@ -27,6 +27,8 @@
         set_config('siteidentifier', random_string(32).$_SERVER['HTTP_HOST']);
     }
 
+/// Print the header stuff
+    admin_externalpage_print_header();
 
 /// Print headings
 
@@ -37,7 +39,6 @@
     $navlinks[] = array('name' => $stradministration, 'link' => "../$CFG->admin/index.php", 'type' => 'misc');
     $navlinks[] = array('name' => $strregistration, 'link' => null, 'type' => 'misc');
     $navigation = build_navigation($navlinks);
-    print_header("$site->shortname: $strregistration", $site->fullname, $navigation);
 
     print_heading($strregistration);
 
               FROM {role_capabilities} rc,
                    {role_assignments} ra,
                    {user} u
-             WHERE (rc.capability = 'moodle/course:update' or rc.capability='moodle/site:doanything')
+             WHERE (rc.capability = ? or rc.capability = ?)
                    AND rc.roleid = ra.roleid
                    AND u.id = ra.userid";
 
-    $count = $DB->count_records_sql($sql);
+    $count = $DB->count_records_sql($sql, array('moodle/course:update', 'moodle/site:doanything'));
     echo get_string("teachers").": ".$count;
     echo "<input type=\"hidden\" name=\"courseupdaters\" value=\"$count\" />\n";
     echo '<br />';
 
     echo "</form>\n";
 
-    print_footer();
-
-?>
+/// Print footer
+    admin_externalpage_print_footer();
index 1468a3b4165bb37f6d740695977360fbc3d24fb1..1041ae53741e066db60a4c76e1ec848d99141430 100644 (file)
@@ -255,6 +255,8 @@ $temp->add(new admin_setting_configselect('memcachedpconn', get_string('memcache
                                           get_string('configmemcachedpconn', 'admin'), 0,
                                           array( '0' => get_string('no'),
                                                  '1' => get_string('yes'))));
+$ADMIN->add('server', new admin_externalpage('adminregistration', get_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/register.php"));
+
 $ADMIN->add('server', $temp);
 
 $dbfamily = $DB->get_dbfamily();
index f179cda7a5ef96840e407d97f0555a98738c11f1..b316f0bb0a3e050f05411120c6fe39716e417b4c 100644 (file)
@@ -15,11 +15,16 @@ if (get_site()) {
 
 $ADMIN->add('root', new admin_externalpage('adminnotifications', get_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
 
+// Show the annoying registration button if registration hasn't been done or is 6 months old (15552000 seconds) MDL-17429
+if (empty($CFG->registered) || ($CFG->registered < (time() - 15552000))) { 
+    $ADMIN->add('root', new admin_externalpage('adminregistration', get_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/register.php"));
+}
+
  // hidden upgrade script
 $ADMIN->add('root', new admin_externalpage('upgradesettings', get_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
 
 if ($hassiteconfig) {
-    $optionalsubsystems = new admin_settingpage('optionalsubsystems', get_string('optionalsubsystems', 'admin'));
+    $optionalsubsystems = new admin_settingpage('optionalsubsystems', get_string('advancedfeatures', 'admin'));
     $ADMIN->add('root', $optionalsubsystems);
 }
 
index 60e488bfd052238709e462a456d7b482eb7ac65f..295d973fcd87ad144a699d5f7f4d772284e4931c 100644 (file)
@@ -4,6 +4,7 @@ $string['accounts'] = 'Accounts';
 $string['adminseesall'] = 'Admins See All';
 $string['adminseesallevents'] = 'Administrators see all events';
 $string['adminseesownevents'] = 'Administrators are just like other users';
+$string['advancedfeatures'] = 'Advanced features';
 $string['allowcategorythemes'] = 'Allow category themes';
 $string['allowcoursethemes'] = 'Allow course themes';
 $string['allowdeletes'] = 'Allow deletes';
@@ -562,7 +563,6 @@ $string['numquestionsandhidden'] = '$a->numquestions (+$a->numhidden hidden)';
 $string['opensslrecommended'] = 'Installing the optional OpenSSL library is highly recommended -- it enables Moodle Networking functionality.';
 $string['opentogoogle'] = 'Open to Google';
 $string['optionalmaintenancemessage'] = 'Optional maintenance message';
-$string['optionalsubsystems'] = 'Optional subsystems';
 $string['order1'] = 'First';
 $string['order2'] = 'Second';
 $string['order3'] = 'Third';
@@ -657,6 +657,7 @@ $string['rcache'] = 'Record cache';
 $string['rcachettl'] = 'Record cache TTL';
 $string['recaptchapublickey'] = 'ReCAPTCHA public key';
 $string['recaptchaprivatekey'] = 'ReCAPTCHA private key';
+$string['registration'] = 'Registration';
 $string['releasenoteslink'] = 'For information about this version of Moodle, please see the online <a target=\"_blank\" href=\"$a\">Release Notes</a>';
 $string['remotelangnotavailable'] = 'Because Moodle can not connect to download.moodle.org, we are unable to do language pack installation automatically. Please download the appropriate zip file(s) from the list below, copy them to your $a directory and unzip them manually.';
 $string['renameerrors'] = 'Rename errors';