Skip to content

Commit

Permalink
MDL-20204 first batch of major theme changes, some regressions are st…
Browse files Browse the repository at this point in the history
…ill there, expect more changes and improvements soon; see tracker for details and list of subtasks
  • Loading branch information
skodak committed Dec 16, 2009
1 parent e09ef36 commit 78946b9
Show file tree
Hide file tree
Showing 268 changed files with 5,966 additions and 8,029 deletions.
2 changes: 1 addition & 1 deletion admin/bloglevelupgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require_once($CFG->libdir.'/adminlib.php');

admin_externalpage_setup('bloglevelupgrade');
$PAGE->set_generaltype('maintenance');
$PAGE->set_pagelayout('maintenance');

$go = optional_param('go', 0, PARAM_BOOL);

Expand Down
2 changes: 0 additions & 2 deletions admin/cli/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
$CFG->libdir = "$CFG->dirroot/lib";
$CFG->wwwroot = "http://localhost";
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->httpsthemewww = $CFG->wwwroot;
$CFG->dataroot = str_replace('\\', '/', dirname(dirname(dirname(__FILE__))).'/moodledata');
$CFG->docroot = 'http://docs.moodle.org';
$CFG->directorypermissions = 00777;
Expand Down Expand Up @@ -262,7 +261,6 @@
}
$CFG->wwwroot = $wwwroot;
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->httpsthemewww = $CFG->wwwroot;


//We need dataroot before lang download
Expand Down
2 changes: 1 addition & 1 deletion admin/generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ function definition_after_data() {
require_capability('moodle/site:config', $systemcontext);

$PAGE->set_url($CFG->wwwroot.'/admin/generator.php');
$PAGE->set_generaltype('form');
$PAGE->set_pagelayout('form');
$generator = new generator_web();
$generator->setup();
$generator->display();
Expand Down
4 changes: 2 additions & 2 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
$CFG->xmlstrictheaders = false;

if (!core_tables_exist()) {
$PAGE->set_generaltype('maintenance');
$PAGE->set_pagelayout('maintenance');

// fake some settings
$CFG->docroot = 'http://docs.moodle.org';
Expand Down Expand Up @@ -188,7 +188,7 @@
}

if ($version > $CFG->version) { // upgrade
$PAGE->set_generaltype('maintenance');
$PAGE->set_pagelayout('maintenance');

$a->oldversion = "$CFG->release ($CFG->version)";
$a->newversion = "$release ($version)";
Expand Down
1 change: 0 additions & 1 deletion admin/roles/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@
}

/// Print the form.
check_theme_arrows();
?>
<form id="assignform" method="post" action="<?php echo $baseurl . '&amp;roleid=' . $roleid ?>"><div>
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
Expand Down
12 changes: 12 additions & 0 deletions admin/settings/appearance.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// "themesettings" settingpage
$temp = new admin_settingpage('themesettings', get_string('themesettings', 'admin'));
$temp->add(new admin_setting_configtext('themelist', get_string('themelist', 'admin'), get_string('configthemelist','admin'), '', PARAM_NOTAGS));
$setting = new admin_setting_configcheckbox('themedesignermode', get_string('themedesignermode', 'admin'), get_string('configthemedesignermode', 'admin'), 0);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$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));
Expand All @@ -23,6 +26,14 @@
$ADMIN->add('themes', $temp);
$ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));

// settings for each theme
foreach (get_plugin_list('theme') as $theme => $themedir) {
$settings_path = "$themedir/settings.php";
if (file_exists($settings_path)) {
include($settings_path);
}
}

// calendar
$temp = new admin_settingpage('calendar', get_string('calendarsettings','admin'));
$temp->add(new admin_setting_special_adminseesall());
Expand Down Expand Up @@ -132,3 +143,4 @@
$ADMIN->add('appearance', new admin_externalpage('managetags', get_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));

} // end of speedup

1 change: 0 additions & 1 deletion admin/settings/development.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

$temp = new admin_settingpage('experimentalsettings', get_string('experimentalsettings', 'admin'));
$temp->add(new admin_setting_configcheckbox('enableglobalsearch', get_string('enableglobalsearch', 'admin'), get_string('configenableglobalsearch', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('smartpix', get_string('smartpix', 'admin'), get_string('configsmartpix', 'admin'), 0));
$item = new admin_setting_configcheckbox('enablehtmlpurifier', get_string('enablehtmlpurifier', 'admin'), get_string('configenablehtmlpurifier', 'admin'), 0);
$item->set_updatedcallback('reset_text_filters_cache');
$temp->add($item);
Expand Down
14 changes: 7 additions & 7 deletions admin/settings/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
* Please note that is file is always loaded last - it means that you can inject entries into other categories too.
*/

if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {

require_once($CFG->libdir. '/portfoliolib.php');

if ($hassiteconfig) {
$ADMIN->add('modules', new admin_category('modsettings', get_string('activitymodules')));
$ADMIN->add('modsettings', new admin_page_managemods());
if ($modules = $DB->get_records('modules')) {
Expand Down Expand Up @@ -136,6 +133,9 @@
}
}


//== Portfolio settings ==
require_once($CFG->libdir. '/portfoliolib.php');
$catname = get_string('portfolios', 'portfolio');
$manage = get_string('manageportfolios', 'portfolio');
$url = "$CFG->wwwroot/$CFG->admin/portfolio.php";
Expand Down Expand Up @@ -222,9 +222,7 @@
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstanceedit',
get_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true),
'', $url);
foreach (repository::get_types()
as $repositorytype)
{
foreach (repository::get_types() as $repositorytype) {
//display setup page for plugins with: general options or multiple instances (e.g. has instance config)
$typeoptionnames = repository::static_function($repositorytype->get_typename(), 'get_type_option_names');
$instanceoptionnames = repository::static_function($repositorytype->get_typename(), 'get_instance_option_names');
Expand All @@ -236,6 +234,7 @@
'moodle/site:config');
}
}
}

// Web services
$ADMIN->add('modules', new admin_category('webservicesettings', get_string('webservices', 'webservice')));
Expand Down Expand Up @@ -264,6 +263,7 @@
}
}

if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
// Question type settings.
$ADMIN->add('modules', new admin_category('qtypesettings', get_string('questiontypes', 'admin')));
$ADMIN->add('qtypesettings', new admin_page_manageqtypes());
Expand Down
2 changes: 1 addition & 1 deletion admin/upgradesettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

$adminroot = admin_get_root(); // need all settings
admin_externalpage_setup('upgradesettings'); // now hidden page
$PAGE->set_generaltype('maintenance');
$PAGE->set_pagelayout('maintenance');

// now we'll deal with the case that the admin has submitted the form with new settings
if ($data = data_submitted() and confirm_sesskey()) {
Expand Down
2 changes: 0 additions & 2 deletions admin/webservice/service_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@
}
}
/// Print the form.
check_theme_arrows();

/// display the UI
?>
<form id="assignform" method="post" action="service_users.php?id=<?php echo $id ?>"><div>
Expand Down
4 changes: 2 additions & 2 deletions auth/shibboleth/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
$select = html_select::make_popup_form("$CFG->httpswwwroot/login/index.php", 'lang', $langs, 'chooselang', $currlang);
$select->nothinglabel = false;
$select->set_label(get_accesshide(get_string('language')));
$langmenu = $OUTPUT->select($select);
$langmenu = '<div class="langmenu">'.$OUTPUT->select($select).'</div>';
}

$loginsite = get_string("loginsite");
Expand Down Expand Up @@ -82,7 +82,7 @@
$PAGE->set_title("$site->fullname: $loginsite");
$PAGE->set_heading($site->fullname);
$PAGE->set_focuscontrol('idp');
$PAGE->set_headingmenu('<div class="langmenu">'.$langmenu.'</div>');
$PAGE->set_headingmenu($langmenu);

echo $OUTPUT->header();
include("index_form.html");
Expand Down
7 changes: 4 additions & 3 deletions backup/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -9288,9 +9288,10 @@ function restore_open_html($restore,$course_header) {
$restorelog_file = fopen("$dest_dir/restorelog.html","a");
//Add the stylesheet
$stylesheetshtml = '';
foreach ($CFG->stylesheets as $stylesheet) {
/* foreach ($CFG->stylesheets as $stylesheet) {
//TODO: MDL-21120
$stylesheetshtml .= '<link rel="stylesheet" type="text/css" href="'.$stylesheet.'" />'."\n";
}
}*/
///Accessibility: added the 'lang' attribute to $direction, used in theme <html> tag.
$languagehtml = get_html_lang($dir=true);

Expand All @@ -9299,7 +9300,7 @@ function restore_open_html($restore,$course_header) {
fwrite ($restorelog_file," \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> ");
fwrite ($restorelog_file,"<html dir=\"ltr\".$languagehtml.");
fwrite ($restorelog_file,"<head>");
fwrite ($restorelog_file,$stylesheetshtml);
// fwrite ($restorelog_file,$stylesheetshtml);
fwrite ($restorelog_file,"<title>".$course_header->course_shortname." Restored </title>");
fwrite ($restorelog_file,"</head><body><br/><h1>The following changes were made during the Restoration of this Course.</h1><br/><br/>");
fwrite ($restorelog_file,"The Course ShortName is now - ".$course_header->course_shortname." The FullName is now - ".$course_header->course_fullname."<br/><br/>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function get_content() {
if ($this->contentgenerated === true) {
return true;
}
$this->page->requires->yui_lib('dom');
$this->page->requires->js('lib/javascript-navigation.js');
// Navcount is used to allow us to have multiple trees although I dont' know why
// you would want to trees the same
Expand Down
2 changes: 1 addition & 1 deletion blocks/moodleblock.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ class block_tree extends block_list {
*
* Also adds the required javascript call to the page output.
*
* @param moodle_core_renderer $output
* @param core_renderer $output
* @return string HTML
*/
protected function formatted_contents($output) {
Expand Down
2 changes: 1 addition & 1 deletion blocks/rss_client/editfeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public static function autodiscover_feed_url($url){
$managefeeds = new moodle_url($CFG->wwwroot . '/blocks/rss_client/managefeeds.php', $urlparams);

$PAGE->set_url('blocks/rss_client/editfeed.php', $urlparams);
$PAGE->set_generaltype('form');
$PAGE->set_pagelayout('form');

if ($rssid) {
$isadding = false;
Expand Down
2 changes: 1 addition & 1 deletion blocks/rss_client/managefeeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

$strmanage = get_string('managefeeds', 'block_rss_client');

$PAGE->set_generaltype('form');
$PAGE->set_pagelayout('form');
$PAGE->set_title($strmanage);
$PAGE->set_heading($strmanage);

Expand Down
2 changes: 1 addition & 1 deletion blocks/rss_client/viewfeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
$urlparams['returnurl'] = $returnurl;
}
$PAGE->set_url('blocks/rss_client/viewfeed.php', $urlparams);
$PAGE->set_generaltype('popup');
$PAGE->set_pagelayout('popup');

$rssrecord = $DB->get_record('block_rss_client', array('id' => $rssid), '*', MUST_EXIST);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function get_content() {
if ($this->contentgenerated === true) {
return true;
}
$this->page->requires->yui_lib('dom');
$this->page->requires->js('lib/javascript-navigation.js');
block_settings_navigation_tree::$navcount++;

Expand Down
3 changes: 3 additions & 0 deletions blocks/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ required changes in code:
* move post instalation code from install() method into db/install.php
* completely rewrite file handling
* rewrite backup/restore
* theme changes: move plugin styles into blocks/xxx/styles.css and use new css markers for images,
move all images into new blocks/xxx/pix/ directory and use new outputlib api


optional - no changes needed in older code:
*
Expand Down
2 changes: 1 addition & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
}

function calendar_top_controls($type, $data) {
global $CFG, $CALENDARDAYS, $THEME;
global $CFG, $CALENDARDAYS;
$content = '';
if(!isset($data['d'])) {
$data['d'] = 1;
Expand Down
2 changes: 1 addition & 1 deletion course/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$id = optional_param('id', 0, PARAM_INT); // course id
$categoryid = optional_param('category', 0, PARAM_INT); // course category - can be changed in edit form

$PAGE->set_generaltype('form');
$PAGE->set_pagelayout('form');

/// basic access control checks
if ($id) { // editing course
Expand Down
1 change: 0 additions & 1 deletion course/importstudents.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
?>
</select></td>
<td valign="top">
<?php check_theme_arrows(); ?>
<p class="arrow_button">
<input name="add" id="add" type="submit" value="<?php echo '&nbsp;'.$THEME->larrow.' &nbsp; &nbsp; '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
<br />
Expand Down
16 changes: 8 additions & 8 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1383,12 +1383,12 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
if (!empty($customicon)) {
if (substr($customicon, 0, 4) === 'mod/') {
list($modname, $iconname) = explode('/', substr($customicon, 4), 2);
$icon = $OUTPUT->mod_icon_url(str_replace(array('.gif', '.png'), '', $customicon), $modname);
$icon = $OUTPUT->old_icon_url(str_replace(array('.gif', '.png'), '', $customicon), $modname);
} else {
$icon = $OUTPUT->old_icon_url(str_replace(array('.gif', '.png'), '', $customicon));
}
} else {
$icon = $OUTPUT->mod_icon_url('icon', $mod->modname);
$icon = $OUTPUT->old_icon_url('icon', $mod->modname);
}

//Accessibility: for files get description via icon, this is very ugly hack!
Expand Down Expand Up @@ -2924,12 +2924,12 @@ function make_editing_buttons($mod, $absolute=false, $moveselect=true, $indent=-
$leftright = '';
if (has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $mod->course))) {

if (right_to_left()) { // Exchange arrows on RTL
$rightarrow = 't/left';
$leftarrow = 't/right';
} else {
$rightarrow = 't/right';
$leftarrow = 't/left';
if (right_to_left()) { // Exchange arrows on RTL
$rightarrow = 't/left';
$leftarrow = 't/right';
} else {
$rightarrow = 't/right';
$leftarrow = 't/left';
}

if ($indent > 0) {
Expand Down
2 changes: 1 addition & 1 deletion course/modedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$return = optional_param('return', 0, PARAM_BOOL); //return to course/view.php if false or mod/modname/view.php if true
$type = optional_param('type', '', PARAM_ALPHANUM); //TODO: hopefully will be removed in 2.0

$PAGE->set_generaltype('form');
$PAGE->set_pagelayout('form');

$url = new moodle_url($CFG->wwwroot.'/course/modedit.php');
if (!empty($add)) {
Expand Down
2 changes: 1 addition & 1 deletion course/report/log/live.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$strupdatesevery = get_string("updatesevery", "moodle", COURSE_LIVELOG_REFRESH);

$PAGE->set_url('/course/report/log/live.php', Array('id'=>$course->id));
$PAGE->set_generaltype('popup');
$PAGE->set_pagelayout('popup');
$PAGE->set_title("$strlivelogs ($strupdatesevery)");
$PAGE->set_periodic_refresh_delay(COURSE_LIVELOG_REFRESH);
$PAGE->set_heading($strlivelogs);
Expand Down
2 changes: 1 addition & 1 deletion course/resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
if (!empty($cm->icon)) {
$icon = '<img src="'.$OUTPUT->old_icon_url($cm->icon).'" class="activityicon" alt="" /> ';
} else {
$icon = '<img src="'.$OUTPUT->mod_icon_url('icon', $cm->modname).'" class="activityicon" alt="" /> ';
$icon = '<img src="'.$OUTPUT->old_icon_url('icon', $cm->modname).'" class="activityicon" alt="" /> ';
}

$class = $cm->visible ? '' : 'class="dimmed"'; // hidden modules are dimmed
Expand Down
4 changes: 3 additions & 1 deletion course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
}

$PAGE->set_url('course/view.php', array('id' => $course->id));
$PAGE->set_pagelayout('course');
$PAGE->set_pagetype('course-view-' . $course->format);
$PAGE->set_other_editing_capability('moodle/course:manageactivities');

Expand Down Expand Up @@ -197,7 +198,8 @@
$PAGE->set_title(get_string('course') . ': ' . $course->fullname);
$PAGE->set_heading($course->fullname);
$PAGE->set_button($buttons);
$PAGE->set_headingmenu(user_login_string($course, $USER));
//TODO: MDL-21123 this should be done in course page layout, not here with this ugly hack!
//$PAGE->set_headingmenu(user_login_string($course, $USER));
echo $OUTPUT->header();

if ($completion->is_enabled() && ajaxenabled()) {
Expand Down
4 changes: 2 additions & 2 deletions enrol/manual/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class enrolment_plugin_manual {
* @param course current course object
*/
function print_entry($course) {
global $CFG, $USER, $SESSION, $THEME, $OUTPUT, $PAGE;
global $CFG, $USER, $SESSION, $OUTPUT, $PAGE;

$strloginto = get_string('loginto', '', $course->shortname);
$strcourses = get_string('courses');
Expand Down Expand Up @@ -134,7 +134,7 @@ function print_entry($course) {
* @param course the current course, as an object
*/
function check_entry($form, $course) {
global $CFG, $USER, $SESSION, $THEME;
global $CFG, $USER, $SESSION;

if (empty($form->password)) {
$form->password = '';
Expand Down
1 change: 0 additions & 1 deletion grade/edit/outcome/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
/// Print header
print_grade_page_head($COURSE->id, 'outcome', 'course');

check_theme_arrows();
require('course_form.html');

echo $OUTPUT->footer();
Expand Down
Loading

0 comments on commit 78946b9

Please sign in to comment.