Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
cbcc9852
Commit
cbcc9852
authored
Dec 23, 2009
by
Petr Skoda
Browse files
MDL-21125 removing obsolete global $THEME
parent
f6794ace
Changes
4
Show whitespace changes
Inline
Side-by-side
blocks/upgrade.txt
View file @
cbcc9852
...
...
@@ -13,6 +13,7 @@ required changes in code:
* 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
old global $THEME is fully replaced by $OUTPUT
optional - no changes needed in older code:
...
...
lib/pagelib.php
View file @
cbcc9852
...
...
@@ -944,18 +944,13 @@ class moodle_page {
/**
* 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, and theme/styles.php.
* Please use this cautiously. It is only intended to be used by the themes selector admin page.
*
* @param $themename the name of the theme to use.
*/
public
function
force_theme
(
$themename
)
{
global
$PAGE
,
$THEME
;
$this
->
ensure_theme_not_set
();
$this
->
_theme
=
theme_config
::
load
(
$themename
);
if
(
$this
===
$PAGE
)
{
$THEME
=
$this
->
_theme
;
}
}
/**
...
...
@@ -1025,10 +1020,10 @@ class moodle_page {
*
* 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
s $THEME and
$OUTPUT.
* we are $PAGE, set up the global $OUTPUT.
*/
public
function
initialise_theme_and_output
()
{
global
$OUTPUT
,
$PAGE
,
$SITE
,
$THEME
;
global
$OUTPUT
,
$PAGE
,
$SITE
;
if
(
!
empty
(
$this
->
_wherethemewasinitialised
))
{
return
;
...
...
@@ -1047,7 +1042,6 @@ class moodle_page {
$this
->
_theme
->
setup_blocks
(
$this
->
pagelayout
,
$this
->
blocks
);
if
(
$this
===
$PAGE
)
{
$THEME
=
$this
->
_theme
;
$OUTPUT
=
$this
->
get_renderer
(
'core'
);
}
...
...
lib/setup.php
View file @
cbcc9852
...
...
@@ -110,19 +110,13 @@ global $COURSE;
* to change something that affects the current theme ($PAGE->course, logged in use,
* httpsrequried ... will result in an exception.)
*
* Please note the $OUTPUT is replacing the old global $THEME object.
*
* @global object $OUTPUT
* @name $OUTPUT
*/
global
$OUTPUT
;
/**
* $THEME is a global that defines the current theme.
*
* @global theme_config $THEME
* @name THEME
*/
global
$THEME
;
/**
* Shared memory cache.
* @global object $MCACHE
...
...
mod/upgrade.txt
View file @
cbcc9852
...
...
@@ -22,6 +22,7 @@ required changes in code:
* theme changes: move plugin styles into mod/xxx/styles.css and use new css markers for images,
move all images into new mod/xxx/pix/ directory and use new outputlib api
move module icon to mod/xxx/pix/icon.gif
old global $THEME is fully replaced by $OUTPUT
optional - no changes needed in older code:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment