$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
$PAGE->set_url($CFG->admin . '/settings.php', array('section' => $section));
$PAGE->set_pagetype('admin-setting-' . $section);
+$PAGE->set_pagelayout('admin');
$PAGE->navigation->clear_cache();
$adminroot = admin_get_root(); // need all settings
$adminroot = admin_get_root(); // need all settings
admin_externalpage_setup('upgradesettings'); // now hidden page
-$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()) {
$managefeeds = new moodle_url($CFG->wwwroot . '/blocks/rss_client/managefeeds.php', $urlparams);
$PAGE->set_url('blocks/rss_client/editfeed.php', $urlparams);
-$PAGE->set_pagelayout('form');
+$PAGE->set_pagelayout('base');
if ($rssid) {
$isadding = false;
$strmanage = get_string('managefeeds', 'block_rss_client');
-$PAGE->set_pagelayout('form');
+$PAGE->set_pagelayout('base');
$PAGE->set_title($strmanage);
$PAGE->set_heading($strmanage);
$PAGE->set_title("$site->shortname: $category->name");
$PAGE->set_heading("$site->fullname: $strcourses");
$PAGE->set_button(print_course_search('', true, 'navbar'));
+ $PAGE->set_pagelayout('coursecategory');
echo $OUTPUT->header();
}
$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_pagelayout('form');
+ $PAGE->set_pagelayout('base');
/// basic access control checks
if ($id) { // editing course
$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_pagelayout('form');
+ $PAGE->set_pagelayout('base');
$url = new moodle_url($CFG->wwwroot.'/course/modedit.php');
if (!empty($add)) {
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
$PAGE->set_url('');
$PAGE->set_docs_path('');
- $PAGE->set_pagelayout('home');
+ $PAGE->set_pagelayout('frontpage');
$editing = $PAGE->user_is_editing();
$PAGE->set_title($SITE->fullname);
$PAGE->set_heading($SITE->fullname);
}
$editpage = new moodle_page();
- $editpage->set_pagelayout('form');
+ $editpage->set_pagelayout('base');
$editpage->set_course($this->page->course);
$editpage->set_context($block->context);
$editurlbase = str_replace($CFG->wwwroot . '/', '', $this->page->url->out(true));
* If $cm is given and the coursemodule is hidden and the user is not a teacher
* in the course then the user is redirected to the course home page.
*
+ * When $cm parameter specified, this function sets page layout to 'module'.
+ * You need to change it manually later if some other layout needed.
+ *
* @global object
* @global object
* @global object
}
if ($cm) {
$PAGE->set_cm($cm, $course);
+ $PAGE->set_pagelayout('incourse');
} else {
$PAGE->set_course($course);
}
}
if ($cm) {
$PAGE->set_cm($cm, $course);
+ $PAGE->set_pagelayout('incourse');
} else {
$PAGE->set_course($course);
}
* <pre>
* $THEME->layouts = array(
* // Most pages - if we encounter an unknown or amissing page type, this one is used.
- * 'normal' => array(
+ * 'standard' => array(
* 'theme' = 'mytheme',
* 'file' => 'normal.php',
* 'regions' => array('side-pre', 'side-post'),
if (array_key_exists($pagelayout, $this->layouts)) {
return $this->layouts[$pagelayout];
} else {
- return $this->layouts['normal'];
+ debugging('Invalid page layout specified: ' . $pagelayout);
+ return $this->layouts['standard'];
}
}
}
}
+ debugging('Can not find layout file for: ' . $pagelayout);
// fallback to standard normal layout
return "$CFG->dirroot/theme/base/layout/general.php";
}
@header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
}
$this->page->set_url(''); // no url
- //$this->page->set_pagelayout('form'); //TODO: MDL-20676 blocks on error pages are weird, unfortunately it somehow detect the pagelayout from URL :-(
+ //$this->page->set_pagelayout('base'); //TODO: MDL-20676 blocks on error pages are weird, unfortunately it somehow detect the pagelayout from URL :-(
$this->page->set_title(get_string('error'));
$output .= $this->header();
}
protected $_pagetype = null;
- protected $_pagelayout = 'normal';
+ protected $_pagelayout = 'base';
/**
* List of theme layeout options, these are ignored by core.
/**
* Please do not call this method directly, use the ->pagelayout syntax. {@link __get()}.
- * @return string the general type of page this is. For example 'normal', 'popup', 'home'.
+ * @return string the general type of page this is. For example 'standard', 'popup', 'home'.
* Allows the theme to display things differently, if it wishes to.
*/
protected function magic_get_pagelayout() {
/**
* @param string $pagelayout the page layout this is. For example 'popup', 'home'.
- * This properly defaults to 'normal', so you only need to call this function if
+ * This properly defaults to 'base', so you only need to call this function if
* you want something different. The exact range of supported layouts is specified
* in the standard theme.
*/
$this->add_body_class('yui-skin-sam'); // Make YUI happy, if it is used.
$this->add_body_class($this->url_to_class_name($CFG->wwwroot));
+ $this->add_body_class('pagelayout-' . $this->_pagelayout); // extra class describing current page layout
+
if (!during_initial_install()) {
$this->add_body_class('course-' . $this->_course->id);
$this->add_body_class('context-' . $this->context->id);
require '../config.php';
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/lib/session-test.php'));
-$PAGE->set_pagelayout('form');
error('session test not reimplemented yet'); //DO NOT localize or use print_error()!
//
$context = get_context_instance(CONTEXT_SYSTEM);
$PAGE->set_course($SITE);
-$PAGE->set_pagelayout('form');
+$PAGE->set_pagelayout('login');
/// Initialize variables
$errormsg = '';
}
require_course_login($course);
+$PAGE->set_pagelayout('incourse');
+
add_to_log($course->id, "assignment", "view all", "index.php?id=$course->id", "");
$strassignments = get_string("modulenameplural", "assignment");
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_login($course->id, false, $cm);
require_capability('mod/chat:chat',$context);
-$PAGE->set_pagelayout('form');
+$PAGE->set_pagelayout('base');
/// Check to see if groups are being used here
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used
}
require_course_login($course);
+$PAGE->set_pagelayout('incourse');
add_to_log($course->id, 'chat', 'view all', "index.php?id=$course->id", '');
}
require_course_login($course);
+ $PAGE->set_pagelayout('incourse');
add_to_log($course->id, "choice", "view all", "index?id=$course->id", "");
}
require_course_login($course);
+$PAGE->set_pagelayout('incourse');
$context = get_context_instance(CONTEXT_COURSE, $course->id);
$capabilities = feedback_load_course_capabilities($course->id);
require_login($course->id);
+$PAGE->set_pagelayout('incourse');
add_to_log($course->id, 'feedback', 'view all', htmlspecialchars('index.php?id='.$course->id), $course->id);
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
require_course_login($course, true);
+$PAGE->set_pagelayout('incourse');
add_to_log($course->id, 'folder', 'view all', "index.php?id=$course->id", '');
}
require_course_login($course);
+$PAGE->set_pagelayout('incourse');
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
}
require_course_login($course);
+$PAGE->set_pagelayout('incourse');
$context = get_context_instance(CONTEXT_COURSE, $course->id);
add_to_log($course->id, "glossary", "view all", "index.php?id=$course->id", "");
}
require_login($course->id);
+ $PAGE->set_pagelayout('incourse');
$coursecontext = get_context_instance(CONTEXT_COURSE, $id);
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
require_course_login($course, true);
+$PAGE->set_pagelayout('incourse');
add_to_log($course->id, 'imscp', 'view all', "index.php?id=$course->id", '');
}
require_login($course);
+$PAGE->set_pagelayout('incourse');
add_to_log($course->id, "lesson", "view all", "index.php?id=$course->id", "");
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
require_course_login($course, true);
+$PAGE->set_pagelayout('incourse');
add_to_log($course->id, 'page', 'view all', "index.php?id=$course->id", '');
list($thispageurl, $contexts, $cmid, $cm, $quiz, $pagevars) =
question_edit_setup('editq', true);
$PAGE->set_url('mod/quiz/edit.php', $thispageurl->params());
-$PAGE->set_pagelayout('form');
+$PAGE->set_pagelayout('base');
$defaultcategoryobj = question_make_default_categories($contexts->all());
$defaultcategoryid = $defaultcategoryobj->id;
}
$coursecontext = get_context_instance(CONTEXT_COURSE, $id);
require_login($course->id);
+ $PAGE->set_pagelayout('incourse');
+
add_to_log($course->id, "quiz", "view all", "index.php?id=$course->id", "");
// Print the header
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
require_course_login($course, true);
+$PAGE->set_pagelayout('incourse');
add_to_log($course->id, 'resource', 'view all', "index.php?id=$course->id", '');
}
require_course_login($course);
+ $PAGE->set_pagelayout('incourse');
add_to_log($course->id, "scorm", "view all", "index.php?id=$course->id", "");
}
require_course_login($course);
+ $PAGE->set_pagelayout('incourse');
add_to_log($course->id, "survey", "view all", "index.php?id=$course->id", "");
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
require_course_login($course, true);
+$PAGE->set_pagelayout('incourse');
add_to_log($course->id, 'url', 'view all', "index.php?id=$course->id", '');
}
require_course_login($course);
+ $PAGE->set_pagelayout('incourse');
add_to_log($course->id, "wiki", "view all", "index.php?id=$course->id", "");
$PAGE->set_context(get_context_instance(CONTEXT_USER, $USER->id));
$PAGE->set_url('my/index.php');
- $PAGE->set_pagelayout('my');
+ $PAGE->set_pagelayout('mydashboard');
$PAGE->set_blocks_editing_capability('moodle/my:manageblocks');
if (($edit != -1) and $PAGE->user_allowed_editing()) {
$PAGE->set_subpage($tag->id);
$PAGE->set_context($systemcontext);
$PAGE->set_blocks_editing_capability('moodle/tag:editblocks');
-$PAGE->set_pagelayout('form');
+$PAGE->set_pagelayout('base');
$PAGE->requires->yui2_lib('animation');
$PAGE->requires->yui2_lib('autocomplete');
$THEME->editor_sheets = array();
$THEME->layouts = array(
- // Most pages - if we encounter an unknown or a missing page type, this one is used.
- 'normal' => array(
+ // Most backwards compatible layout without the blocks - this is the layout used by default
+ 'base' => array(
+ 'theme' => 'base',
+ 'file' => 'general.php',
+ 'regions' => array(),
+ ),
+ // Standard layout with blocks, this is recommended for most pages with general information
+ 'standard' => array(
'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
- 'defaultregion' => 'side-post'
+ 'defaultregion' => 'side-post',
),
- // Course page
+ // Main course page
'course' => array(
'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
- 'defaultregion' => 'side-post'
+ 'defaultregion' => 'side-post',
+ ),
+ 'coursecategory' => array(
+ 'theme' => 'base',
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-post',
+ ),
+ // part of course, typical for modules - default page layout if $cm specified in require_login()
+ 'incourse' => array(
+ 'theme' => 'base',
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-post',
),
// The site home page.
- 'home' => array(
+ 'frontpage' => array(
'theme' => 'base',
- 'file' => 'home.php',
+ 'file' => 'frontpage.php',
'regions' => array('side-pre', 'side-post'),
- 'defaultregion' => 'side-post'
+ 'defaultregion' => 'side-post',
),
// Server administration scripts.
'admin' => array(
'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre'),
- 'defaultregion' => 'side-pre'
+ 'defaultregion' => 'side-pre',
),
- // My moodle page
- 'my' => array(
+ // My dashboard page
+ 'mydashboard' => array(
'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
- 'defaultregion' => 'side-post'
+ 'defaultregion' => 'side-post',
),
-
- // Settings form pages, like course of module settings.
- 'form' => array(
+ // My public page
+ 'mypublic' => array(
+ 'theme' => 'base',
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-post',
+ ),
+ 'login' => array(
'theme' => 'base',
'file' => 'general.php',
'regions' => array(),
),
+
// Pages that appear in pop-up windows - no navigation, no blocks, no header.
'popup' => array(
'theme' => 'base',
'regions' => array(),
'options' => array('nofooter'),
),
- // Embeded pages, like iframe embeded in moodleform
+ // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible
'embedded' => array(
'theme' => 'base',
'file' => 'embedded.php',
$THEME->editor_sheets = array('styles_tinymce');
$THEME->layouts = array(
- // Most pages - if we encounter an unknown or a missing page type, this one is used.
- 'normal' => array(
+ // Most backwards compatible layout without the blocks - this is the layout used by default
+ 'base' => array(
+ 'theme' => 'standard',
+ 'file' => 'normal.php',
+ 'regions' => array(),
+ ),
+ // Standard layout with blocks, this is recommended for most pages with general information
+ 'standard' => array(
'theme' => 'standard',
'file' => 'normal.php',
'regions' => array('side-pre', 'side-post'),
- 'defaultregion' => 'side-post'
+ 'defaultregion' => 'side-post',
),
- // Course page
+ // Main course page
'course' => array(
'theme' => 'standard',
'file' => 'normal.php',
'regions' => array('side-pre', 'side-post'),
- 'defaultregion' => 'side-post'
+ 'defaultregion' => 'side-post',
+ ),
+ 'coursecategory' => array(
+ 'theme' => 'base',
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-post',
+ ),
+ // Standard module pages - default page layout if $cm specified in require_login()
+ 'module' => array(
+ 'theme' => 'standard',
+ 'file' => 'normal.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-post',
),
// The site home page.
- 'home' => array(
+ 'frontpage' => array(
'theme' => 'standard',
'file' => 'home.php',
'regions' => array('side-pre', 'side-post'),
- 'defaultregion' => 'side-post'
+ 'defaultregion' => 'side-post',
),
// Server administration scripts.
'admin' => array(
'theme' => 'standard',
'file' => 'normal.php',
'regions' => array('side-pre'),
- 'defaultregion' => 'side-pre'
+ 'defaultregion' => 'side-pre',
),
- // My moodle page
- 'my' => array(
+ // My dashboard page
+ 'mydashboard' => array(
+ 'theme' => 'standard',
+ 'file' => 'normal.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-post',
+ ),
+ // My public page
+ 'mypublic' => array(
'theme' => 'standard',
'file' => 'normal.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post'
),
-
- // Settings form pages, like course of module settings.
- 'form' => array(
+ 'login' => array(
'theme' => 'standard',
'file' => 'normal.php',
'regions' => array(),
),
+
// Pages that appear in pop-up windows - no navigation, no blocks, no header.
'popup' => array(
'theme' => 'standard',
'file' => 'frametop.php',
'regions' => array(),
),
- // Embeded pages, like iframe embeded in moodleform
+ // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible
'embedded' => array(
'theme' => 'standard',
'file' => 'embedded.php',