Moodle  2.2.1
http://www.collinsharper.com
moodle_page Class Reference
Inheritance diagram for moodle_page:

Public Member Functions

 __get ($name)
 __set ($name, $value)
 get_renderer ($component, $subtype=null, $target=null)
 Other information getting methods ==========================================.
 has_navbar ()
 user_is_editing ()
 user_can_edit_blocks ()
 user_allowed_editing ()
 debug_summary ()
 set_state ($state)
 Setter methods =============================================================.
 set_course ($course)
 set_context ($context)
 set_cm ($cm, $course=null, $module=null)
 set_activity_record ($module)
 set_pagetype ($pagetype)
 set_pagelayout ($pagelayout)
 set_subpage ($subpage)
 add_body_class ($class)
 add_body_classes ($classes)
 set_title ($title)
 set_heading ($heading)
 set_headingmenu ($menu)
 set_category_by_id ($categoryid)
 set_docs_path ($path)
 set_url ($url, array $params=null)
 ensure_param_not_in_url ($param)
 add_alternate_version ($title, $url, $mimetype)
 set_focuscontrol ($controlid)
 set_button ($html)
 set_blocks_editing_capability ($capability)
 set_other_editing_capability ($capability)
 set_cacheable ($cacheable)
 set_periodic_refresh_delay ($delay=null)
 force_theme ($themename)
 https_required ()
 verify_https_required ()
 initialise_theme_and_output ()
 get_type ()
 Deprecated fields and methods for backwards compatibility ==================.
 get_format_name ()
 get_courserecord ()
 get_legacyclass ()
 blocks_get_positions ()
 blocks_default_position ()
 blocks_get_default ()
 blocks_move_position (&$instance, $move)
 url_get_parameters ()
 url_get_path ()
 url_get_full ($extraparams=array())
 set_legacy_page_object ($pageobject)
 print_header ($_)
 get_id ()
 get_pageid ()
 get_modulerecord ()
 has_set_url ()
 set_block_actions_done ($setting=true)
 get_popup_notification_allowed ()
 set_popup_notification_allowed ($allowed)

Data Fields

const STATE_BEFORE_HEADER = 0
const STATE_PRINTING_HEADER = 1
const STATE_IN_BODY = 2
const STATE_DONE = 3

Protected Member Functions

 magic_get_state ()
 magic_get_headerprinted ()
 magic_get_course ()
 magic_get_cm ()
 magic_get_activityrecord ()
 magic_get_activityname ()
 magic_get_category ()
 magic_get_categories ()
 magic_get_context ()
 magic_get_pagetype ()
 magic_get_bodyid ()
 magic_get_pagelayout ()
 magic_get_layout_options ()
 magic_get_subpage ()
 magic_get_bodyclasses ()
 magic_get_title ()
 magic_get_heading ()
 magic_get_headingmenu ()
 magic_get_docspath ()
 magic_get_url ()
 magic_get_alternateversions ()
 magic_get_blocks ()
 magic_get_requires ()
 magic_get_cacheable ()
 magic_get_focuscontrol ()
 magic_get_button ()
 magic_get_theme ()
 magic_get_devicetypeinuse ()
 magic_get_legacythemeinuse ()
 magic_get_periodicrefreshdelay ()
 magic_get_opencontainers ()
 magic_get_navigation ()
 magic_get_navbar ()
 magic_get_settingsnav ()
 starting_output ()
 resolve_theme ()
 initialise_default_pagetype ($script=null)
 initialise_standard_body_classes ()
 load_activity_record ()
 ensure_category_loaded ()
 load_category ($categoryid)
 ensure_categories_loaded ()
 ensure_theme_not_set ()
 url_to_class_name ($url)
 all_editing_caps ()

Protected Attributes

 $_state = self::STATE_BEFORE_HEADER
 Field declarations =========================================================.
 $_course = null
 $_cm = null
 $_module = null
 $_context = null
 $_categories = null
 $_bodyclasses = array()
 $_title = ''
 $_heading = ''
 $_pagetype = null
 $_pagelayout = 'base'
 $_layout_options = array()
 $_subpage = ''
 $_docspath = null
 $_legacyclass = null
 $_url = null
 $_alternateversions = array()
 $_blocks = null
 $_requires = null
 $_blockseditingcap = 'moodle/site:manageblocks'
 $_block_actions_done = false
 $_othereditingcaps = array()
 $_cacheable = true
 $_focuscontrol = ''
 $_button = ''
 $_theme = null
 $_navigation = null
 $_settingsnav = null
 $_navbar = null
 $_headingmenu = null
 $_wherethemewasinitialised = null
 $_opencontainers
 $_periodicrefreshdelay = null
 $_legacypageobject = null
 $_legacybrowsers = array('MSIE' => 6.0)
 $_devicetypeinuse = null
 $_https_login_required = false
 $_popup_notification_allowed = true

Detailed Description

Definition at line 90 of file pagelib.php.


Member Function Documentation

__get ( name)

PHP overloading magic to make the $PAGE->course syntax work by redirecting it to the corresponding $PAGE->magic_get_course() method if there is one, and throwing an exception if not.

Parameters:
$namestring property name
Returns:
mixed

Definition at line 614 of file pagelib.php.

__set ( name,
value 
)

PHP overloading magic which prevents the $PAGE->context = $context; syntax

Parameters:
$namestring property name
$namemixed value
Returns:
void, throws exception if field not defined in page class

Definition at line 630 of file pagelib.php.

add_alternate_version ( title,
url,
mimetype 
)

There can be alternate versions of some pages (for example an RSS feed version). If such other version exist, call this method, and a link to the alternate version will be included in the <head> of the page.

Parameters:
$titleThe title to give the alternate version.
$urlThe URL of the alternate version.
$mimetypeThe mime-type of the alternate version.

Definition at line 1038 of file pagelib.php.

add_body_class ( class)
Parameters:
string$classadd this class name ot the class attribute on the body tag.

Definition at line 900 of file pagelib.php.

Here is the caller graph for this function:

add_body_classes ( classes)
Parameters:
array$classesthis utility method calls add_body_class for each array element.

Definition at line 910 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

all_editing_caps ( ) [protected]

Reimplemented in testable_moodle_page.

Definition at line 1539 of file pagelib.php.

Here is the caller graph for this function:

Deprecated:
since Moodle 2.0 - use $PAGE->blocks->get_default_region() instead
Returns:
string the default place for blocks on this page.

Definition at line 1598 of file pagelib.php.

Here is the call graph for this function:

Deprecated:
since Moodle 2.0 - no longer used.

Definition at line 1606 of file pagelib.php.

Here is the call graph for this function:

Deprecated:
since Moodle 2.0 - use $PAGE->blocks->get_regions() instead
Returns:
string the places on this page where blocks can go.

Definition at line 1589 of file pagelib.php.

Here is the call graph for this function:

blocks_move_position ( &$  instance,
move 
)
Deprecated:
since Moodle 2.0 - no longer used.

Definition at line 1613 of file pagelib.php.

Here is the call graph for this function:

Returns:
string a description of this page. Normally displayed in the footer in developer debug mode.

Definition at line 693 of file pagelib.php.

Here is the call graph for this function:

ensure_categories_loaded ( ) [protected]

Definition at line 1501 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

ensure_category_loaded ( ) [protected]

Definition at line 1473 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Make sure page URL does not contain the given URL parameter.

This should not be necessary if the script has called set_url properly. However, in some situations like the block editing actions; when the URL has been guessed, it will contain dangerous block-related actions. Therefore, the blocks code calls this function to clean up such parameters before doing any redirect.

Parameters:
string$paramthe name of the parameter to make sure is not in the page URL.

Definition at line 1024 of file pagelib.php.

ensure_theme_not_set ( ) [protected]

Definition at line 1515 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

force_theme ( themename)

Force this page to use a particular theme.

Please use this cautiously. It is only intended to be used by the themes selector admin page.

Parameters:
$themenamethe name of the theme to use.

Definition at line 1124 of file pagelib.php.

Here is the call graph for this function:

Deprecated:
since Moodle 2.0 - use $PAGE->course instead.
Returns:
object course.

Definition at line 1568 of file pagelib.php.

Here is the call graph for this function:

Deprecated:
since Moodle 2.0 - use $PAGE->pagetype instead.
Returns:
string this is what page_id_and_class used to return via the $getclass parameter.

Definition at line 1560 of file pagelib.php.

get_id ( )
Deprecated:
since Moodle 2.0
Returns:
the 'page id'. This concept no longer exists.

Reimplemented in page_base.

Definition at line 1668 of file pagelib.php.

Here is the call graph for this function:

Deprecated:
since Moodle 2.0
Returns:
string this is what page_id_and_class used to return via the $getclass parameter.

Definition at line 1577 of file pagelib.php.

Here is the call graph for this function:

Deprecated:
since Moodle 2.0 - user $PAGE->cm instead.
Returns:
$this->cm;

Definition at line 1692 of file pagelib.php.

Deprecated:
since Moodle 2.0
Returns:
the 'page id'. This concept no longer exists.

Definition at line 1680 of file pagelib.php.

Here is the call graph for this function:

Are popup notifications allowed on this page? Popup notifications may be disallowed in situations such as while upgrading or completing a quiz

Returns:
boolean true if popup notifications may be displayed

Definition at line 1709 of file pagelib.php.

get_renderer ( component,
subtype = null,
target = null 
)

Other information getting methods ==========================================.

Returns instance of page renderer

Parameters:
string$componentname such as 'core', 'mod_forum' or 'qtype_multichoice'.
string$subtypeoptional subtype such as 'news' resulting to 'mod_forum_news'
string$targetone of rendering target constants
Returns:
renderer_base

Definition at line 647 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_type ( )

Deprecated fields and methods for backwards compatibility ==================.

Deprecated:
since Moodle 2.0 - use $PAGE->pagetype instead.
Returns:
string page type.

Definition at line 1551 of file pagelib.php.

Here is the call graph for this function:

Checks to see if there are any items on the navbar object

Returns:
bool true if there are, false if not

Definition at line 655 of file pagelib.php.

Definition at line 1696 of file pagelib.php.

This function indicates that current page requires the https when $CFG->loginhttps enabled.

By using this function properly, we can ensure 100% https-ized pages at our entire discretion (login, forgot_password, change_password)

Returns:
void

Definition at line 1137 of file pagelib.php.

Here is the call graph for this function:

initialise_default_pagetype ( script = null) [protected]

Sets ->pagetype from the script name. For example, if the script that was run is mod/quiz/view.php, ->pagetype will be set to 'mod-quiz-view'.

Parameters:
string$scriptthe path to the script that should be used to initialise ->pagetype. If not passed the $SCRIPT global will be used. If legacy code has set $CFG->pagepath that will be used instead, and a developer warning issued.

Reimplemented in testable_moodle_page.

Definition at line 1363 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1393 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Method for use by Moodle core to set up the theme. Do not use this in your own code.

Make sure the right theme for this page is loaded. Tell our blocks_manager about the theme block regions, and then, if we are $PAGE, set up the global $OUTPUT.

Definition at line 1244 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

load_activity_record ( ) [protected]

Definition at line 1465 of file pagelib.php.

Here is the caller graph for this function:

load_category ( categoryid) [protected]

Definition at line 1487 of file pagelib.php.

Here is the caller graph for this function:

magic_get_activityname ( ) [protected]

Please do not call this method directly, use the ->activityname syntax. __get().

Returns:
string|null the The type of activity we are in, for example 'forum' or 'quiz'. Will be null if this page is not within a module.

Definition at line 300 of file pagelib.php.

magic_get_activityrecord ( ) [protected]

Please do not call this method directly, use the ->activityrecord syntax. __get().

Returns:
object the row from the activities own database table (for example the forum or quiz table) that this page belongs to. Will be null if this page is not within a module.

Definition at line 288 of file pagelib.php.

Here is the call graph for this function:

magic_get_alternateversions ( ) [protected]

The list of alternate versions of this page.

Returns:
array mime type => object with ->url and ->title.

Definition at line 461 of file pagelib.php.

magic_get_blocks ( ) [protected]

Please do not call this method directly, use the ->blocks syntax. __get().

Returns:
blocks_manager the blocks manager object for this page.

Definition at line 469 of file pagelib.php.

magic_get_bodyclasses ( ) [protected]

Please do not call this method directly, use the ->bodyclasses syntax. __get().

Returns:
string the class names to put on the body element in the HTML.

Definition at line 401 of file pagelib.php.

magic_get_bodyid ( ) [protected]

Please do not call this method directly, use the ->pagetype syntax. __get().

Returns:
string The id to use on the body tag, uses magic_get_pagetype().

Definition at line 368 of file pagelib.php.

magic_get_button ( ) [protected]

Please do not call this method directly, use the ->button syntax. __get().

Returns:
string the HTML to go where the Turn editing on button normally goes.

Definition at line 514 of file pagelib.php.

magic_get_cacheable ( ) [protected]

Please do not call this method directly, use the ->cacheable syntax. __get().

Returns:
boolean can this page be cached by the user's browser.

Definition at line 498 of file pagelib.php.

magic_get_categories ( ) [protected]

Please do not call this method directly, use the ->categories syntax. __get().

Returns:
array an array of all the categories the page course belongs to, starting with the immediately containing category, and working out to the top-level category. This may be the empty array if we are in the front page course.

Definition at line 328 of file pagelib.php.

Here is the call graph for this function:

magic_get_category ( ) [protected]

Please do not call this method directly, use the ->category syntax. __get().

Returns:
mixed the category that the page course belongs to. If there isn't one (that is, if this is the front page course) returns null.

Definition at line 312 of file pagelib.php.

Here is the call graph for this function:

magic_get_cm ( ) [protected]

Please do not call this method directly, use the ->cm syntax. __get().

Returns:
object the course_module that this page belongs to. Will be null if this page is not within a module. This is a full cm object, as loaded by get_coursemodule_from_id or get_coursemodule_from_instance, so the extra modname and name fields are present.
cm_info

Definition at line 278 of file pagelib.php.

magic_get_context ( ) [protected]

Please do not call this method directly, use the ->context syntax. __get().

Returns:
object the main context to which this page belongs.

Definition at line 337 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

magic_get_course ( ) [protected]

Please do not call this method directly, use the ->course syntax. __get().

object

Returns:
object the current course that we are inside - a row from the course table. (Also available as $COURSE global.) If we are not inside an actual course, this will be the site course.

Definition at line 262 of file pagelib.php.

magic_get_devicetypeinuse ( ) [protected]

Please do not call this method directly, use the ->devicetypeinuse syntax. __get().

Returns:
string The device type being used.

Definition at line 534 of file pagelib.php.

Here is the call graph for this function:

magic_get_docspath ( ) [protected]

Please do not call this method directly, use the ->docspath syntax. __get().

Returns:
string the path to the Moodle docs for this page.

Definition at line 433 of file pagelib.php.

magic_get_focuscontrol ( ) [protected]

Please do not call this method directly, use the ->focuscontrol syntax. __get().

Returns:
string the id of the HTML element to be focused when the page has loaded.

Definition at line 506 of file pagelib.php.

magic_get_headerprinted ( ) [protected]

Please do not call this method directly, use the ->headerprinted syntax. __get().

Returns:
boolean has the header already been printed?

Definition at line 250 of file pagelib.php.

magic_get_heading ( ) [protected]

Please do not call this method directly, use the ->heading syntax. __get().

Returns:
string the main heading that should be displayed at the top of the <body>.

Definition at line 417 of file pagelib.php.

magic_get_headingmenu ( ) [protected]

Please do not call this method directly, use the ->heading syntax. __get().

Returns:
string The menu (or actions) to display in the heading

Definition at line 425 of file pagelib.php.

magic_get_layout_options ( ) [protected]

Please do not call this method directly, use the ->layout_tions syntax. __get().

Returns:
array returns arrys with options for layout file

Definition at line 385 of file pagelib.php.

magic_get_legacythemeinuse ( ) [protected]

Please do not call this method directly, use the ->legacythemeinuse syntax. __get().

Deprecated:
since 2.1
Returns:
bool

Definition at line 546 of file pagelib.php.

Here is the call graph for this function:

magic_get_navbar ( ) [protected]

Return a navbar object

Returns:
navbar

Definition at line 587 of file pagelib.php.

magic_get_navigation ( ) [protected]

Return the navigation object

Returns:
global_navigation

Definition at line 576 of file pagelib.php.

magic_get_opencontainers ( ) [protected]

Please do not call this method directly use the ->opencontainers syntax. __get()

Returns:
xhtml_container_stack tracks XHTML tags on this page that have been opened but not closed. mainly for internal use by the rendering code.

Definition at line 565 of file pagelib.php.

magic_get_pagelayout ( ) [protected]

Please do not call this method directly, use the ->pagelayout syntax. __get().

Returns:
string the general type of page this is. For example 'standard', 'popup', 'home'. Allows the theme to display things differently, if it wishes to.

Definition at line 377 of file pagelib.php.

magic_get_pagetype ( ) [protected]

Please do not call this method directly, use the ->pagetype syntax. __get().

Returns:
string e.g. 'my-index' or 'mod-quiz-attempt'.

Definition at line 356 of file pagelib.php.

Here is the call graph for this function:

Please do not call this method directly use the ->periodicrefreshdelay syntax __get()

Returns:
int The periodic refresh delay to use with meta refresh

Definition at line 556 of file pagelib.php.

magic_get_requires ( ) [protected]

Please do not call this method directly, use the ->requires syntax. __get().

Returns:
page_requirements_manager tracks the JavaScript, CSS files, etc. required by this page.

Definition at line 486 of file pagelib.php.

magic_get_settingsnav ( ) [protected]

Returns the settings navigation object

Returns:
settings_navigation

Definition at line 598 of file pagelib.php.

magic_get_state ( ) [protected]

Magic getter methods ============================================================= Due to the __get magic below, you normally do not call these as $PAGE->magic_get_x methods, but instead use the $PAGE->x syntax. Please do not call this method directly, use the ->state syntax. __get().

Returns:
integer one of the STATE_... constants. You should not normally need to use this in your code. It is intended for internal use by this class and its friends like print_header, to check that everything is working as expected. Also accessible as $PAGE->state.

Definition at line 242 of file pagelib.php.

magic_get_subpage ( ) [protected]

Please do not call this method directly, use the ->subpage syntax. __get().

Returns:
string|null The subpage identifier, if any.

Definition at line 393 of file pagelib.php.

magic_get_theme ( ) [protected]

Please do not call this method directly, use the ->theme syntax. __get().

Returns:
theme_config the initialised theme for this page.

Definition at line 522 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

magic_get_title ( ) [protected]

Please do not call this method directly, use the ->title syntax. __get().

Returns:
string the title that should go in the <head> section of the HTML of this page.

Definition at line 409 of file pagelib.php.

magic_get_url ( ) [protected]

Please do not call this method directly, use the ->url syntax. __get().

Returns:
moodle_url the clean URL required to load the current page. (You should normally use this in preference to $ME or $FULLME.)

Definition at line 446 of file pagelib.php.

Here is the call graph for this function:

print_header ( _)
Deprecated:
since Moodle 2.0 - page objects should no longer be doing print_header.
Parameters:
$_,...

Definition at line 1655 of file pagelib.php.

Here is the call graph for this function:

resolve_theme ( ) [protected]

Work out the theme this page should use.

This depends on numerous $CFG settings, and the properties of this page.

Returns:
string the name of the theme that should be used on this page.

Definition at line 1282 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_activity_record ( module)
Parameters:
$modulea row from the main database table for the module that this page belongs to. For example, if ->cm is a forum, then you can pass the corresponding row from the forum table here if you have it (saves a database query sometimes).

Definition at line 844 of file pagelib.php.

Here is the caller graph for this function:

set_block_actions_done ( setting = true)

Definition at line 1700 of file pagelib.php.

set_blocks_editing_capability ( capability)

Set the capability that allows users to edit blocks on this page. Normally the default of 'moodle/site:manageblocks' is used, but a few pages like the My Moodle page need to use a different capability like 'moodle/my:manageblocks'.

Parameters:
string$capabilitya capability.

Definition at line 1072 of file pagelib.php.

set_button ( html)

Specify a fragment of HTML that goes where the 'Turn editing on' button normally goes.

Parameters:
string$htmlthe HTML to display there.

Definition at line 1062 of file pagelib.php.

Here is the caller graph for this function:

set_cacheable ( cacheable)
Returns:
boolean $cacheable can this page be cached by the user's browser.

Definition at line 1093 of file pagelib.php.

set_category_by_id ( categoryid)

Set the course category this page belongs to manually. This automatically sets $PAGE->course to be the site course. You cannot use this method if you have already set $PAGE->course - in that case, the category must be the one that the course belongs to. This also automatically sets the page context to the category context.

Parameters:
integer$categoryidThe id of the category to set.

Definition at line 947 of file pagelib.php.

Here is the call graph for this function:

set_cm ( cm,
course = null,
module = null 
)

The course module that this page belongs to (if it does belong to one).

Parameters:
stdClass | cm_info$cma record from course_modules table or cm_info from get_fast_modinfo().
stdClass$course
stdClass$module
Returns:
void

Definition at line 803 of file pagelib.php.

Here is the call graph for this function:

set_context ( context)

Set the main context to which this page belongs.

Parameters:
object$contexta context object, normally obtained with get_context_instance.

Definition at line 767 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_course ( course)

Set the current course. This sets both $PAGE->course and $COURSE. It also sets the right theme and locale.

Normally you don't need to call this function yourself, require_login will call it for you if you pass a $course to it. You can use this function on pages that do need to call require_login().

Sets $PAGE->context to the course context, if it is not already set.

Parameters:
objectthe course to set as the global course.

Definition at line 738 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_docs_path ( path)

Set a different path to use for the 'Moodle docs for this page' link. By default, it uses the pagetype, which is normally the same as the script name. So, for example, for mod/quiz/attempt.php, pagetype is mod-quiz-attempt, and so docspath is mod/quiz/attempt.

Parameters:
string$paththe path to use at the end of the moodle docs URL.

Definition at line 968 of file pagelib.php.

set_focuscontrol ( controlid)

Specify a form control should be focused when the page has loaded.

Parameters:
string$controlidthe id of the HTML element to be focused.

Definition at line 1053 of file pagelib.php.

set_heading ( heading)
Parameters:
string$headingthe main heading that should be displayed at the top of the <body>.

Definition at line 928 of file pagelib.php.

Here is the call graph for this function:

set_headingmenu ( menu)
Parameters:
string$menuThe menu/content to show in the heading

Definition at line 935 of file pagelib.php.

set_legacy_page_object ( pageobject)
Deprecated:
since Moodle 2.0 - just a backwards compatibility hook.

Definition at line 1647 of file pagelib.php.

set_other_editing_capability ( capability)

Some pages let you turn editing on for reasons other than editing blocks. If that is the case, you can pass other capabilities that let the user edit this page here.

Parameters:
string | array$capabilityeither a capability, or an array of capabilities.

Definition at line 1082 of file pagelib.php.

set_pagelayout ( pagelayout)
Parameters:
string$pagelayoutthe page layout this is. For example 'popup', 'home'. 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.

Uncomment this to debug theme pagelayout issues like missing blocks.

if (!empty($this->_wherethemewasinitialised) && $pagelayout != $this->_pagelayout) { debugging('Page layout has already been set and cannot be changed.', DEBUG_DEVELOPER); }

Definition at line 872 of file pagelib.php.

set_pagetype ( pagetype)
Parameters:
string$pagetypee.g. 'my-index' or 'mod-quiz-attempt'. Normally you do not need to set this manually, it is automatically created from the script name. However, on some pages this is overridden. For example, the page type for course/view.php includes the course format, for example 'course-view-weeks'. This gets used as the id attribute on <body> and also for determining which blocks are displayed.

Definition at line 862 of file pagelib.php.

set_periodic_refresh_delay ( delay = null)

Sets the page to periodically refresh

This function must be called before $OUTPUT->header has been called or a coding exception will be thrown.

Parameters:
int$delaySets the delay before refreshing the page, if set to null refresh is cancelled

Definition at line 1106 of file pagelib.php.

Allow or disallow popup notifications on this page. Popups are allowed by default.

Parameters:
booleantrue if notifications are allowed. False if not allowed. They are allowed by default.
Returns:
null

Definition at line 1718 of file pagelib.php.

set_state ( state)

Setter methods =============================================================.

Set the state. The state must be one of that STATE_... constants, and the state is only allowed to advance one step at a time.

Parameters:
integer$statethe new state.

Definition at line 713 of file pagelib.php.

Here is the call graph for this function:

set_subpage ( subpage)

If context->id and pagetype are not enough to uniquely identify this page, then you can set a subpage id as well. For example, the tags page sets

Parameters:
string$subpagean arbitrary identifier that, along with context->id and pagetype, uniquely identifies this page.

Definition at line 889 of file pagelib.php.

set_title ( title)
Parameters:
string$titlethe title that should go in the <head> section of the HTML of this page.

Definition at line 919 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_url ( url,
array params = null 
)

You should call this method from every page to set the cleaned-up URL that should be used to return to this page. Used, for example, by the blocks editing UI to know where to return the user after an action. For example, course/view.php does: $id = optional_param('id', 0, PARAM_INT); $PAGE->set_url('/course/view.php', array('id' => $id));

Parameters:
moodle_url | string$urlURL relative to $CFG->wwwroot or moodle_url instance
array$paramsparameters to add to the URL

Definition at line 982 of file pagelib.php.

Here is the call graph for this function:

starting_output ( ) [protected]

Initialisation methods ===================================================== These set various things up in a default way. This method is called when the page first moves out of the STATE_BEFORE_HEADER state. This is our last change to initialise things.

Definition at line 1203 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

url_get_full ( extraparams = array())
Deprecated:
since Moodle 2.0 - use $this->url->out() instead.
Returns:
string full URL for this page.

Definition at line 1639 of file pagelib.php.

Here is the call graph for this function:

Deprecated:
since Moodle 2.0 - use $this->url->params() instead.
Returns:
array URL parameters for this page.

Definition at line 1621 of file pagelib.php.

Here is the call graph for this function:

Deprecated:
since Moodle 2.0 - use $this->url->params() instead.
Returns:
string URL for this page without parameters.

Definition at line 1630 of file pagelib.php.

Here is the call graph for this function:

url_to_class_name ( url) [protected]

Reimplemented in testable_moodle_page.

Definition at line 1524 of file pagelib.php.

Here is the caller graph for this function:

Returns:
boolean does the user have permission to see this page in editing mode.

Definition at line 682 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
boolean does the user have permission to edit blocks on this page.

Definition at line 675 of file pagelib.php.

Here is the call graph for this function:

Returns:
boolean should the current user see this page in editing mode. That is, are they allowed to edit this page, and are they currently in editing mode.

Definition at line 667 of file pagelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Makes sure that page previously marked with https_required() is really using https://, if not it redirects to https://

Returns:
void (may redirect to https://self)

Definition at line 1161 of file pagelib.php.

Here is the call graph for this function:


Field Documentation

$_alternateversions = array() [protected]

Definition at line 159 of file pagelib.php.

$_block_actions_done = false [protected]

Definition at line 167 of file pagelib.php.

$_blocks = null [protected]

Definition at line 161 of file pagelib.php.

$_blockseditingcap = 'moodle/site:manageblocks' [protected]

Definition at line 165 of file pagelib.php.

$_bodyclasses = array() [protected]

Definition at line 133 of file pagelib.php.

$_button = '' [protected]

Definition at line 175 of file pagelib.php.

$_cacheable = true [protected]

Definition at line 171 of file pagelib.php.

$_categories = null [protected]

This holds any categories that $_course belongs to, starting with the particular category it belongs to, and working out through any parent categories to the top level. These are loaded progressively, if needed. There are three states. $_categories = null initially when nothing is loaded; $_categories = array($id => $cat, $parentid => null) when we have loaded $_course->category, but not any parents; and a complete array once everything is loaded.

Definition at line 131 of file pagelib.php.

$_cm = null [protected]

Definition at line 108 of file pagelib.php.

$_context = null [protected]

The context that this page belongs to.

Definition at line 120 of file pagelib.php.

$_course = null [protected]

Definition at line 102 of file pagelib.php.

$_devicetypeinuse = null [protected]

Definition at line 225 of file pagelib.php.

$_docspath = null [protected]

Definition at line 152 of file pagelib.php.

$_focuscontrol = '' [protected]

Definition at line 173 of file pagelib.php.

$_heading = '' [protected]

Definition at line 137 of file pagelib.php.

$_headingmenu = null [protected]

Definition at line 185 of file pagelib.php.

$_https_login_required = false [protected]

Definition at line 227 of file pagelib.php.

$_layout_options = array() [protected]

Definition at line 148 of file pagelib.php.

$_legacybrowsers = array('MSIE' => 6.0) [protected]

Definition at line 217 of file pagelib.php.

$_legacyclass = null [protected]

Definition at line 155 of file pagelib.php.

$_legacypageobject = null [protected]

This is simply to improve backwards compatibility. If old code relies on a page class that implements print_header, or complex logic in user_allowed_editing then we stash an instance of that other class here, and delegate to it in certain situations.

Definition at line 210 of file pagelib.php.

$_module = null [protected]

If $_cm is not null, then this will hold the corresponding row from the modname table. For example, if $_cm->modname is 'quiz', this will be a row from the quiz table.

Definition at line 115 of file pagelib.php.

$_navbar = null [protected]

Definition at line 183 of file pagelib.php.

$_navigation = null [protected]

Definition at line 179 of file pagelib.php.

$_opencontainers [protected]

Definition at line 194 of file pagelib.php.

$_othereditingcaps = array() [protected]

Definition at line 169 of file pagelib.php.

$_pagelayout = 'base' [protected]

Definition at line 141 of file pagelib.php.

$_pagetype = null [protected]

Definition at line 139 of file pagelib.php.

$_periodicrefreshdelay = null [protected]

Definition at line 202 of file pagelib.php.

$_popup_notification_allowed = true [protected]

Definition at line 229 of file pagelib.php.

$_requires = null [protected]

Definition at line 163 of file pagelib.php.

$_settingsnav = null [protected]

Definition at line 181 of file pagelib.php.

$_state = self::STATE_BEFORE_HEADER [protected]

Field declarations =========================================================.

#@-

Definition at line 100 of file pagelib.php.

$_subpage = '' [protected]

Definition at line 150 of file pagelib.php.

$_theme = null [protected]

Definition at line 177 of file pagelib.php.

$_title = '' [protected]

Definition at line 135 of file pagelib.php.

$_url = null [protected]

Definition at line 157 of file pagelib.php.

$_wherethemewasinitialised = null [protected]

Definition at line 191 of file pagelib.php.

#@+ Tracks the where we are in the generation of the page.

Definition at line 92 of file pagelib.php.

const STATE_DONE = 3

Definition at line 95 of file pagelib.php.

const STATE_IN_BODY = 2

Definition at line 94 of file pagelib.php.

Definition at line 93 of file pagelib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations