Commit 78946b9b authored by Petr Skoda's avatar Petr Skoda
Browse files

MDL-20204 first batch of major theme changes, some regressions are still...

MDL-20204 first batch of major theme changes, some regressions are still there, expect more changes and improvements soon; see tracker for details and list of subtasks
parent e09ef36a
......@@ -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
......
......@@ -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 />
......
......@@ -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!
......@@ -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) {
......
......@@ -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)) {
......
......@@ -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);
......
......@@ -127,7 +127,7 @@ foreach ($cms as $cm) {
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
......
......@@ -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');
......@@ -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()) {
......
......@@ -48,7 +48,7 @@ var $errormsg;
* @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');
......@@ -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 = '';
......
......@@ -129,7 +129,6 @@ if ($data = data_submitted() and confirm_sesskey()) {
/// Print header
print_grade_page_head($COURSE->id, 'outcome', 'course');
check_theme_arrows();
require('course_form.html');
echo $OUTPUT->footer();
......
......@@ -36,7 +36,6 @@ $PAGE->requires->yui_lib('element');
$PAGE->requires->yui_lib('container');
$PAGE->requires->yui_lib('animation');
$PAGE->requires->js('grade/edit/tree/functions.js');
$PAGE->requires->css('/grade/edit/tree/tree.css');
$courseid = required_param('id', PARAM_INT);
$action = optional_param('action', 0, PARAM_ALPHA);
......
......@@ -803,13 +803,12 @@ class grade_plugin_info {
* @param boolean $return Whether to return (true) or echo (false) the HTML generated by this function
* @param string $bodytags Additional attributes that will be added to the <body> tag
* @param string $buttons Additional buttons to display on the page
* @param array $extracss An array of additional stylesheets to load (relative paths)
*
* @return string HTML code or nothing if $return == false
*/
function print_grade_page_head($courseid, $active_type, $active_plugin=null,
$heading = false, $return=false,
$buttons=false, $extracss=array()) {
$buttons=false) {
global $CFG, $COURSE, $OUTPUT, $PAGE;
$strgrades = get_string('grades');
$plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
......@@ -826,13 +825,6 @@ function print_grade_page_head($courseid, $active_type, $active_plugin=null,
$first_link = $CFG->wwwroot.'/grade/index.php?id='.$COURSE->id;
}
if ($active_type == 'preferences') {
$CFG->stylesheets[] = $CFG->wwwroot . '/grade/report/styles.css';
}
foreach ($extracss as $css_url) {
$CFG->stylesheets[] = $css_url;
}
$PAGE->navbar->add($strgrades, $first_link);
......
......@@ -35,7 +35,6 @@ $toggle = optional_param('toggle', NULL, PARAM_INT);
$toggle_type = optional_param('toggle_type', 0, PARAM_ALPHANUM);
$PAGE->set_url('grade/report/grader/index.php', compact('courseid', 'page', 'perpageurl', 'edit', 'sortitemid'));
$PAGE->requires->css('lib/yui/container/assets/skins/sam/container.css');
/// basic access checks
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
......
......@@ -217,8 +217,8 @@ class grade_report_grader extends grade_report {
if ($bounded > $finalgrade) {
$errorstr = 'lessthanmin';
} else if ($bounded < $finalgrade) {
$errorstr = 'morethanmax';
}
$errorstr = 'morethanmax';
}
}
if ($errorstr) {
$user = $DB->get_record('user', array('id' => $userid), 'id, firstname, lastname');
......
#content #siteconfiglink {
text-align: right;
}
......@@ -147,7 +147,6 @@ echo $OUTPUT->header();
</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 />
......
......@@ -87,7 +87,6 @@ $PAGE->set_title("$course->shortname: $strgroups");
$PAGE->set_heading($course->fullname);
$PAGE->set_headingmenu(user_login_string($course, $USER));
echo $OUTPUT->header();
check_theme_arrows();
?>
<div id="addmembersform">
......
......@@ -113,7 +113,7 @@ if(preg_match('~(##emoticons_html##)~', $output, $matches)) {
}
// Do the main output.
$PAGE->set_generaltype('popup');
$PAGE->set_pagelayout('popup');
$PAGE->set_title($title);
echo $OUTPUT->header();
echo $OUTPUT->box_start();
......
......@@ -78,17 +78,18 @@
$select = html_select::make_popup_form($CFG->wwwroot .'/index.php', 'lang', $langs, 'chooselang', $currlang);
$select->nothinglabel = false;
$select->set_label(get_accesshide(get_string('language')));
$langmenu = $OUTPUT->select($select);
//TODO: MDL-21123
$langmenu = '<div class="langmenu">'.$OUTPUT->select($select).'</div>';
}
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
$PAGE->set_url('');
$PAGE->set_docs_path('');
$PAGE->set_generaltype('home');
$PAGE->set_pagelayout('home');
$editing = $PAGE->user_is_editing();
$PAGE->set_title($SITE->fullname);
$PAGE->set_heading($SITE->fullname);
$PAGE->set_headingmenu(user_login_string($SITE) . $langmenu);
echo $OUTPUT->header();
$PAGE->set_headingmenu($langmenu);
echo $OUTPUT->header($langmenu);
/// Print Section
if ($SITE->numsections > 0) {
......
......@@ -139,10 +139,7 @@ $CFG->lang = $config->lang;
$CFG->dirroot = str_replace('\\', '/', dirname(__FILE__)); // Fix for win32
$CFG->libdir = "$CFG->dirroot/lib";
$CFG->wwwroot = install_guess_wwwroot(); // can not be changed - ppl must use the real address when installing
$CFG->themedir = $CFG->dirroot.'/theme';
$CFG->themewww = $CFG->wwwroot.'/theme';
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->httpsthemewww = $CFG->wwwroot;
$CFG->dataroot = $config->dataroot;
$CFG->admin = $config->admin;
$CFG->docroot = 'http://docs.moodle.org';
......
......@@ -39,7 +39,7 @@ if (isset($CFG->iplookup)) {
}
$PAGE->set_url('iplookup/index.php', array('id'=>$ip, 'user'=>$user));
$PAGE->set_generaltype('popup');
$PAGE->set_pagelayout('popup');
$info = array($ip);
$note = array();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment