]> git.mjollnir.org Git - moodle.git/commitdiff
GUI for category themes.
authorikawhero <ikawhero>
Thu, 3 May 2007 07:00:55 +0000 (07:00 +0000)
committerikawhero <ikawhero>
Thu, 3 May 2007 07:00:55 +0000 (07:00 +0000)
New language strings.

admin/settings/appearance.php
course/category.php
lang/en_utf8/admin.php
lang/en_utf8/moodle.php
theme/standard/styles_layout.css

index 355221bf51b1861ab97468cfa90e8e1718a14bcf..2764c972d35da373a57336611181941c6369984a 100644 (file)
@@ -8,6 +8,7 @@ $temp = new admin_settingpage('themesettings', get_string('themesettings', 'admi
 $temp->add(new admin_setting_configtext('themelist', get_string('themelist', 'admin'), get_string('configthemelist','admin'), '', PARAM_NOTAGS));
 $temp->add(new admin_setting_configcheckbox('allowuserthemes', get_string('allowuserthemes', 'admin'), get_string('configallowuserthemes', 'admin'), 0));
 $temp->add(new admin_setting_configcheckbox('allowcoursethemes', get_string('allowcoursethemes', 'admin'), get_string('configallowcoursethemes', 'admin'), 0));
+$temp->add(new admin_setting_configcheckbox('allowcategorythemes',  get_string('allowcategorythemes', 'admin'), get_string('configallowcategorythemes', 'admin'), 0));
 $temp->add(new admin_setting_configcheckbox('allowuserblockhiding', get_string('allowuserblockhiding', 'admin'), get_string('configallowuserblockhiding', 'admin'), 1));
 $temp->add(new admin_setting_configcheckbox('showblocksonmodpages', get_string('showblocksonmodpages', 'admin'), get_string('configshowblocksonmodpages', 'admin'), 0));
 $temp->add(new admin_setting_configselect('hideactivitytypecrumb', get_string('hideactivitytypecrumb', 'admin'), get_string('confighideactivitytypecrumb', 'admin'), 0,
index aaad8155736ca689744391114db6d2b4aaeb9155..2690cb26fc2d72dcdd1a05adc5065a1cf19a71bd 100644 (file)
@@ -17,6 +17,7 @@
     $moveto       = optional_param('moveto', 0, PARAM_INT);
     $rename       = optional_param('rename', '', PARAM_NOTAGS);
     $resort       = optional_param('resort', 0, PARAM_BOOL);
+    $categorytheme= optional_param('categorytheme', false, PARAM_CLEAN);
 
     if (!$site = get_site()) {
         error("Site isn't defined!");
             }
         }
 
+        /// Set the category theme if requested
+        if (($categorytheme !== false) and confirm_sesskey()) {
+            $category->theme = $categorytheme;
+            if (! set_field('course_categories', 'theme', $category->theme, 'id', $category->id)) {
+                notify('An error occurred while setting the theme');
+            }
+        }
+
         /// Resort the category if requested
 
         if ($resort and confirm_sesskey()) {
         echo '<input type="submit" value="'.$strrename.'" />';
         echo '</div></form>';
         echo '<br />';
+
+        if (!empty($CFG->allowcategorythemes)) {
+            $choices = array();
+            $choices[''] = get_string('default');
+            $choices += get_list_of_themes();
+
+            echo '<form id="themeform" action="category.php" method="post"><div>';
+            echo '<input type="hidden" name="id" value="'.$category->id.'" />';
+            echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
+            choose_from_menu($choices, 'categorytheme', $category->theme);
+            echo '<input type="submit" value="'.get_string('setcategorytheme').'" />';
+            echo '</div></form>';
+            echo '<br />';
+        }
     }
+
     
     print_course_search();
     
index da4165d657b1b27b1c49adcb8fd7b439ffcb2328..c53a2ca2d9b2fa55d7b2047cb71cc788abe6de66 100644 (file)
@@ -7,6 +7,7 @@ $string['accounts'] = 'Accounts';
 $string['adminseesall'] = 'Admins See All';
 $string['adminseesallevents'] = 'Administrators see all events';
 $string['adminseesownevents'] = 'Administrators are just like other users';
+$string['allowcategorythemes'] = 'Allow category themes';
 $string['allowcoursethemes'] = 'Allow course themes';
 $string['allowemailaddresses'] = 'Allowed email domains';
 $string['allowobjectembed'] = 'Allow EMBED and OBJECT tags';
@@ -45,6 +46,7 @@ $string['cleanup'] = 'Cleanup';
 $string['componentinstalled'] = 'Component Installed';
 $string['confeditorhidebuttons'] = 'Select the buttons that should be hidden in the HTML editor.';
 $string['configallowassign'] = 'Allow the roles on the left side to assign the roles in each column';
+$string['configallowcategorythemes'] = 'If you enable this, then themes can be set at the category level. This will affect all child categories and courses unless they have specifically set their own theme. WARNING: Enabling category themes may affect performance.';
 $string['configallowcoursethemes'] = 'If you enable this, then courses will be allowed to set their own themes.  Course themes override all other theme choices (site, user, or session themes)';
 $string['configallowemailaddresses'] = 'If you want to restrict all new email addresses to particular domains, then list them here separated by spaces.  All other domains will be rejected.  eg <strong>ourcollege.edu.au .gov.au</strong>';
 $string['configallowobjectembed'] = 'As a default security measure, normal users are not allowed to embed multimedia (like Flash) within texts using explicit EMBED and OBJECT tags in their HTML (although it can still be done safely using the mediaplugins filter).  If you wish to allow these tags then enable this option.';
index e2d2b0ace4220628906d73c3b9262fb2c740c082..f2743ec19e8f80951a40fa0b67ea3a36ef3ba151 100644 (file)
@@ -1252,6 +1252,7 @@ $string['senddetails'] = 'Send my details via email';
 $string['separate'] = 'Separate';
 $string['separateandconnected'] = 'Separate and Connected ways of knowing';
 $string['serverlocaltime'] = 'Server\'s local time';
+$string['setcategorytheme'] = 'Set Category Theme';
 $string['settings'] = 'Settings';
 $string['shortname'] = 'Short name';
 $string['shortnamecollisionwarning'] = '[*] = This shortname is already in use by a course and will need to be changed upon approval';
index fc6780f7a84f56bfdcddcca6932d0217e4737615..ace4333727813a52dbcaf0979a7c3f275169bbfa 100644 (file)
@@ -1879,6 +1879,10 @@ body#course-info .generalbox.info {
   text-align:center;
 }
 
+#course-category #themeform {
+  text-align: center;
+}
+
 #course-category .singlebutton {
   text-align:center;
 }