New language strings.
$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,
$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();
$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';
$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.';
$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';
text-align:center;
}
+#course-category #themeform {
+ text-align: center;
+}
+
#course-category .singlebutton {
text-align:center;
}