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
......@@ -304,6 +304,8 @@ $string['configsupportemail'] = 'This email address will be published to users o
$string['configsupportname'] = 'This is the name of a person or other entity offering general help via the support email or web address.';
$string['configsupportpage'] = 'This web address will be published to users of this site as the one to go to when they need general help (for example, when new users create their own accounts). If this address is left blank then no link will be supplied.';
$string['configteacherassignteachers'] = 'Should ordinary teachers be allowed to assign other teachers within courses they teach? If \'No\', then only course creators and admins can assign teachers.';
$string['configthemedesignermode'] = 'All theme images and CSS are cached in browsers and in server for a very long time. Turn on this setting if you are developing or tweaking themes. This setting is also suitable for developers.
You can invalidate all theme caches manually from the theme selection page too. WARNING: enabling of theme designer mode affects the server performance severly!';
$string['configthemelist'] = 'Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you can specify a comma-separated list of names here (Don\'t use spaces!).
For example: standard,orangewhite.';
$string['configtimezone'] = 'You can set the default timezone here. This is the only the DEFAULT timezone for displaying dates - each user can override this by setting their own in their profile. \"Server time\" here will make Moodle default to the server\'s operating system setting, but \"Server time\" in the user profile will make the user default to this timezone setting. Cronjobs that depend on a time of day to run will use this timezone.';
......@@ -851,7 +853,9 @@ $string['tablenosave'] = 'Changes in table above are saved automatically.';
$string['tablesnosave'] = 'Changes in tables above are saved automatically.';
$string['tabselectedtofront'] = 'On tables with tabs, should the row with the currently selected tab be placed at the front';
$string['tabselectedtofronttext'] = 'Bring selected tab row to front';
$string['themedesignermode'] = 'Theme designer mode';
$string['themelist'] = 'Theme list';
$string['themeresetcaches'] = 'Invalidate theme caches';
$string['themeselector'] = 'Theme Selector';
$string['themesettings'] = 'Theme settings';
$string['therewereerrors'] = 'There were errors in your data';
......
<?php // $Id$
// theme_standard.php - created with Moodle 2.0 dev
<?php
$string['pluginname'] = "Standard";
$string['region-side-pre'] = 'Left';
$string['region-side-post'] = 'Right';
......@@ -5185,6 +5185,12 @@ function admin_externalpage_setup($section, $extrabutton = '',
$adminroot = admin_get_root(false, false); // settings not required for external pages
$extpage = $adminroot->locate($section);
if ($section === 'upgradesettings') {
$PAGE->set_pagelayout('maintenance');
} else {
$PAGE->set_pagelayout('admin');
}
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
// $PAGE->set_extra_button($extrabutton); TODO
......@@ -5222,7 +5228,7 @@ function admin_externalpage_setup($section, $extrabutton = '',
* @param string $focus focus element
*/
function admin_externalpage_print_header($focus='') {
global $CFG, $PAGE, $SITE, $THEME, $OUTPUT;
global $CFG, $PAGE, $SITE, $OUTPUT;
if (!is_string($focus)) {
$focus = ''; // BC compatibility, there used to be adminroot parameter
......
......@@ -32,7 +32,7 @@
* @param page_requirements_manager $requires The page_requirements_manager to initialise.
*/
function setup_core_javascript(page_requirements_manager $requires) {
global $CFG, $OUTPUT;
global $CFG, $OUTPUT, $PAGE;
// JavaScript should always work with $CFG->httpswwwroot rather than $CFG->wwwroot.
// Otherwise, in some situations, users will get warnings about insecure content
......@@ -41,7 +41,9 @@ function setup_core_javascript(page_requirements_manager $requires) {
$config = array(
'wwwroot' => $CFG->httpswwwroot, // Yes, really. See above.
'sesskey' => sesskey(),
'loadingicon' => $OUTPUT->old_icon_url('i/loading_small')
'loadingicon' => $OUTPUT->old_icon_url('i/loading_small', 'moodle', false),
'themerev' => theme_get_revision(),
'theme' => $PAGE->theme->name,
);
if (debugging('', DEBUG_DEVELOPER)) {
$config['developerdebug'] = true;
......@@ -74,7 +76,7 @@ function setup_core_javascript(page_requirements_manager $requires) {
*
* Typical useage would be
* <pre>
* $PAGE->requires->css('mod/mymod/styles.css');
* $PAGE->requires->css('mod/mymod/userstyles.php?id='.$id); // not overriddable via themes!
* $PAGE->requires->js('mod/mymod/script.js');
* $PAGE->requires->js('mod/mymod/small_but_urgent.js')->in_head();
* $PAGE->requires->js_function_call('init_mymod', array($data))->on_dom_ready();
......@@ -148,11 +150,6 @@ class page_requirements_manager {
* performance. Optional dependencies are not loaded automatically - if you want
* them you will need to load them first with other calls to this method.
*
* If the YUI library you ask for requires one or more CSS files, and if
* <head> has already been printed, then an exception will be thrown.
* Therefore, you are strongly advised to request all the YUI libraries you
* will need before output is started.
*
* Even if a particular library is requested more than once (perhaps as a dependancy
* of other libraries) it will only be linked to once.
*
......@@ -696,10 +693,7 @@ class required_js extends linked_requirement {
*
* This class (with the help of {@link ajax_resolve_yui_lib()}) knows about the
* dependancies between the different YUI libraries, and will include all the
* other libraries required by the one you ask for. It also knows which YUI
* libraries require css files. If the library you ask for requires CSS files,
* then you should ask for it before <head> is output, or an exception will
* be thrown.
* other libraries required by the one you ask for.
*
* By default JavaScript files are included at the end of the HTML.
* This is recommended practice because it means that the web browser will only
......@@ -726,15 +720,10 @@ class required_yui_lib extends linked_requirement {
parent::__construct($manager, '');
$this->when = page_requirements_manager::WHEN_AT_END;
list($jsurls, $cssurls) = ajax_resolve_yui_lib($libname);
$jsurls = ajax_resolve_yui_lib($libname);
foreach ($jsurls as $jsurl) {
$this->jss[] = $manager->js($jsurl, true);
}
foreach ($cssurls as $cssurl) {
// this might be a bit problematic because it requires yui to be
// requested before print_header() - this was not required in 1.9.x
$manager->css($cssurl, true);
}
}
public function get_html() {
......@@ -1150,8 +1139,7 @@ function ajax_generate_script_tag($js) {
/**
* Given the name of a YUI library, return a list of the .js and .css files that
* it requries.
* Given the name of a YUI library, return a list of the .js that it requries.
*
* This method takes note of the $CFG->useexternalyui setting.
*
......@@ -1159,10 +1147,8 @@ function ajax_generate_script_tag($js) {
* the -debug version of the YUI files, otherwise it will return links to the -min versions.
*
* @param string $libname the name of a YUI library, for example 'autocomplete'.
* @return array with two elementes. The first is an array of the JavaScript URLs
* that must be loaded to make this library work, in the order they should be
* loaded. The second element is a (possibly empty) list of CSS files that
* need to be loaded.
* @return an array of the JavaScript URLs that must be loaded to make this library work,
* in the order they should be loaded.
*/
function ajax_resolve_yui_lib($libname) {
global $CFG;
......@@ -1171,99 +1157,53 @@ function ajax_resolve_yui_lib($libname) {
// because another part of the code may later ask for other bits. It is easier, and
// not very inefficient, just to always use (and get browsers to cache) the combined file.
static $translatelist = array(
'yahoo' => 'yahoo-dom-event',
'animation' => array('yahoo-dom-event', 'animation'),
'autocomplete' => array(
'js' => array('yahoo-dom-event', 'datasource', 'autocomplete'),
'css' => array('autocomplete/assets/skins/sam/autocomplete.css')),
'button' => array(
'js' => array('yahoo-dom-event', 'element', 'button'),
'css' => array('button/assets/skins/sam/button.css')),
'calendar' => array(
'js' => array('yahoo-dom-event', 'calendar'),
'css' => array('calendar/assets/skins/sam/calendar.css')),
'carousel' => array(
'js' => array('yahoo-dom-event', 'element', 'carousel'),
'css' => array('carousel/assets/skins/sam/carousel.css')),
'charts' => array('yahoo-dom-event', 'element', 'datasource', 'json', 'charts'),
'colorpicker' => array(
'js' => array('utilities', 'slider', 'colorpicker'),
'css' => array('colorpicker/assets/skins/sam/colorpicker.css')),
'connection' => array('yahoo-dom-event', 'connection'),
'container' => array(
'js' => array('yahoo-dom-event', 'container'),
'css' => array('container/assets/skins/sam/container.css')),
'cookie' => array('yahoo-dom-event', 'cookie'),
'datasource' => array('yahoo-dom-event', 'datasource'),
'datatable' => array(
'js' => array('yahoo-dom-event', 'element', 'datasource', 'datatable'),
'css' => array('datatable/assets/skins/sam/datatable.css')),
'dom' => 'yahoo-dom-event',
'dom-event' => 'yahoo-dom-event',
'dragdrop' => array('yahoo-dom-event', 'dragdrop'),
'editor' => array(
'js' => array('yahoo-dom-event', 'element', 'container', 'menu', 'button', 'editor'),
'css' => array('assets/skins/sam/skin.css')),
'element' => array('yahoo-dom-event', 'element'),
'event' => 'yahoo-dom-event',
'get' => array('yahoo-dom-event', 'get'),
'history' => array('yahoo-dom-event', 'history'),
'imagecropper' => array(
'js' => array('yahoo-dom-event', 'dragdrop', 'element', 'resize', 'imagecropper'),
'css' => array('assets/skins/sam/resize.css', 'assets/skins/sam/imagecropper.css')),
'imageloader' => array('yahoo-dom-event', 'imageloader'),
'json' => array('yahoo-dom-event', 'json'),
'layout' => array(
'js' => array('yahoo-dom-event', 'dragdrop', 'element', 'layout'),
'css' => array('reset-fonts-grids/reset-fonts-grids.css', 'assets/skins/sam/layout.css')),
'logger' => array(
'js' => array('yahoo-dom-event', 'logger'),
'css' => array('logger/assets/skins/sam/logger.css')),
'menu' => array(
'js' => array('yahoo-dom-event', 'container', 'menu'),
'css' => array('menu/assets/skins/sam/menu.css')),
'paginator' => array(
'js' => array('yahoo-dom-event', 'element', 'paginator'),
'css' => array('paginator/assets/skins/sam/paginator.css')),
'profiler' => array('yahoo-dom-event', 'profiler'),
'yahoo' => array('yahoo-dom-event'),
'animation' => array('yahoo-dom-event', 'animation'),
'autocomplete' => array('yahoo-dom-event', 'datasource', 'autocomplete'),
'button' => array('yahoo-dom-event', 'element', 'button'),
'calendar' => array('yahoo-dom-event', 'calendar'),
'carousel' => array('yahoo-dom-event', 'element', 'carousel'),
'charts' => array('yahoo-dom-event', 'element', 'datasource', 'json', 'charts'),
'colorpicker' => array('utilities', 'slider', 'colorpicker'),
'connection' => array('yahoo-dom-event', 'connection'),
'container' => array('yahoo-dom-event', 'container'),
'cookie' => array('yahoo-dom-event', 'cookie'),
'datasource' => array('yahoo-dom-event', 'datasource'),
'datatable' => array('yahoo-dom-event', 'element', 'datasource', 'datatable'),
'dom' => array('yahoo-dom-event'),
'dom-event' => array('yahoo-dom-event'),
'dragdrop' => array('yahoo-dom-event', 'dragdrop'),
'editor' => array('yahoo-dom-event', 'element', 'container', 'menu', 'button', 'editor'),
'element' => array('yahoo-dom-event', 'element'),
'event' => array('yahoo-dom-event'),
'get' => array('yahoo-dom-event', 'get'),
'history' => array('yahoo-dom-event', 'history'),
'imagecropper' => array('yahoo-dom-event', 'dragdrop', 'element', 'resize', 'imagecropper'),
'imageloader' => array('yahoo-dom-event', 'imageloader'),
'json' => array('yahoo-dom-event', 'json'),
'layout' => array('yahoo-dom-event', 'dragdrop', 'element', 'layout'),
'logger' => array('yahoo-dom-event', 'logger'),
'menu' => array('yahoo-dom-event', 'container', 'menu'),
'paginator' => array('yahoo-dom-event', 'element', 'paginator'),
'profiler' => array('yahoo-dom-event', 'profiler'),
'profilerviewer' => array('yuiloader-dom-event', 'element', 'profiler', 'profilerviewer'),
'resize' => array(
'js' => array('yahoo-dom-event', 'dragdrop', 'element', 'resize'),
'css' => array('assets/skins/sam/resize.css')),
'selector' => array('yahoo-dom-event', 'selector'),
'simpleeditor' => array(
'js' => array('yahoo-dom-event', 'element', 'container', 'simpleeditor'),
'css' => array('assets/skins/sam/skin.css')),
'slider' => array('yahoo-dom-event', 'gragdrop', 'slider'),
'stylesheet' => array('yahoo-dom-event', 'stylesheet'),
'tabview' => array(
'js' => array('yahoo-dom-event', 'element', 'tabview'),
'css' => array('assets/skins/sam/skin.css')),
'treeview' => array(
'js' => array('yahoo-dom-event', 'treeview'),
'css' => array('treeview/assets/skins/sam/treeview.css')),
'uploader' => array('yahoo-dom-event', 'element', 'uploader'),
'utilities' => array('yahoo-dom-event', 'connection', 'animation', 'dragdrop', 'element', 'get'),
'yuiloader' => 'yuiloader',
'yuitest' => array(
'js' => array('yahoo-dom-event', 'logger', 'yuitest'),
'css' => array('logger/assets/logger.css', 'yuitest/assets/testlogger.css')),
'resize' => array('yahoo-dom-event', 'dragdrop', 'element', 'resize'),
'selector' => array('yahoo-dom-event', 'selector'),
'simpleeditor' => array('yahoo-dom-event', 'element', 'container', 'simpleeditor'),
'slider' => array('yahoo-dom-event', 'gragdrop', 'slider'),
'stylesheet' => array('yahoo-dom-event', 'stylesheet'),
'tabview' => array('yahoo-dom-event', 'element', 'tabview'),
'treeview' => array('yahoo-dom-event', 'treeview'),
'uploader' => array('yahoo-dom-event', 'element', 'uploader'),
'utilities' => array('yahoo-dom-event', 'connection', 'animation', 'dragdrop', 'element', 'get'),
'yuiloader' => array('yuiloader'),
'yuitest' => array('yahoo-dom-event', 'logger', 'yuitest'),
);
if (!isset($translatelist[$libname])) {
throw new coding_exception('Unknown YUI library ' . $libname);
}
$data = $translatelist[$libname];
if (!is_array($data)) {
$jsnames = array($data);
$cssfiles = array();
} else if (isset($data['js']) && isset($data['css'])) {
$jsnames = $data['js'];
$cssfiles = $data['css'];
} else {
$jsnames = $data;
$cssfiles = array();
}
$jsnames = $translatelist[$libname];
$debugging = debugging('', DEBUG_DEVELOPER);
if ($debugging) {
......@@ -1294,12 +1234,7 @@ function ajax_resolve_yui_lib($libname) {
}
}
$cssurls = array();
foreach ($cssfiles as $css) {
$cssurls[] = $libpath . $css;
}
return array($jsurls, $cssurls);
return $jsurls;
}
/**
......
......@@ -296,22 +296,6 @@ class page_requirements_manager_test extends ajaxlib_unit_test_base {
$this->assertTrue($this->requires->is_top_of_body_done());
}
public function test_requiring_css() {
global $CFG;
$cssfile = 'theme/standard/styles_layout.css'; // Just needs to be a CSS file that exists.
$this->requires->css($cssfile);
$html = $this->requires->get_head_code();
$this->assertContains($html, $CFG->httpswwwroot . '/' . $cssfile);
}
public function test_nonexistant_css_throws_exception() {
$cssfile = 'css/file/that/does/not/exist.css';
$this->expectException();
$this->requires->css($cssfile);
}
public function test_requiring_js() {
global $CFG;
$jsfile = 'lib/javascript-static.js'; // Just needs to be a JS file that exists.
......@@ -331,10 +315,10 @@ class page_requirements_manager_test extends ajaxlib_unit_test_base {
}
public function test_nonexistant_js_throws_exception() {
$cssfile = 'js/file/that/does/not/exist.js';
$jsfile = 'js/file/that/does/not/exist.js';
$this->expectException();
$this->requires->js($cssfile);
$this->requires->js($jsfile);
}
public function test_requiring_skip_link() {
......
......@@ -167,9 +167,9 @@ class block_manager {
* @return array the internal names of the regions on this page where block may appear.
*/
public function get_regions() {
if (is_null($this->defaultregion)) {
if (is_null($this->defaultregion)) {
$this->page->initialise_theme_and_output();
}
}
return array_keys($this->regions);
}
......@@ -303,7 +303,7 @@ class block_manager {
* output the blocks anyway, so we are not doing wasted effort.)
*
* @param string $region a block region that exists on this page.
* @param object $output a moodle_core_renderer. normally the global $OUTPUT.
* @param object $output a core_renderer. normally the global $OUTPUT.
* @return boolean Whether there is anything in this region.
*/
public function region_has_content($region, $output) {
......@@ -781,7 +781,7 @@ class block_manager {
* Return an array of content objects from a set of block instances
*
* @param array $instances An array of block instances
* @param moodle_renderer_base The renderer to use.
* @param renderer_base The renderer to use.
* @param string $region the region name.
* @return array An array of block_content (and possibly block_move_target) objects.
*/
......@@ -1056,7 +1056,7 @@ class block_manager {
}
$editpage = new moodle_page();
$editpage->set_generaltype('form');
$editpage->set_pagelayout('form');
$editpage->set_course($this->page->course);
$editpage->set_context($block->context);
$editurlbase = str_replace($CFG->wwwroot . '/', '', $this->page->url->out(true));
......@@ -1455,11 +1455,11 @@ function blocks_remove_inappropriate($course) {
return;
$blockmanager = blocks_get_by_page($page);
if(empty($blockmanager)) {
if (empty($blockmanager)) {
return;
}
if(($pageformat = $page->pagetype) == NULL) {
if (($pageformat = $page->pagetype) == NULL) {
return;
}
......
......@@ -16,14 +16,40 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Serve the CSS for this theme. Every theme must contain a copy of this file
* DO NOT MODIFY THIS FILE IT IS IMPORTANT TO THE WORKING OF THE MOODLE THEMES SYSTEM.
* If you are are trying to change something, you should probably be looking at config.php.
* Minimalistic library, usable even when no other moodle libs are loaded.
*
* The only library that gets loaded if you define ABORT_AFTER_CONFIG
* before including main config.php. You can resume normal script operation
* if you define ABORT_AFTER_CONFIG_CANCEL and require the setup.php
*
* @package moodlecore
* @copyright 2009 Tim Hunt
* @copyright 2009 petr Skoda (skodak)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$themename = basename(dirname(__FILE__));
require_once(dirname(__FILE__) . '/../../theme/styles.php');
\ No newline at end of file
/**
* Minimalistic parameter validation function.
* Can not use optional param because moodlelib.php is not loaded yet
* @param string $name
* @param mixed $default
* @param string $type
* @return mixed
*/
function min_optional_param($name, $default, $type) {
$value = $default;
if (isset($_GET[$name])) {
$value = $_GET[$name];
} else if (isset($_GET['amp;'.$name])) {
// very, very, very ugly hack, unforunately $OUTPUT->old_icon_url() is not used properly in javascript code :-(
$value = $_GET['amp;'.$name];
}
switch($type) {
case 'INT': $value = (int)$value; break;
case 'SAFEDIR': $value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); break;
case 'SAFEPATH': $value = preg_replace('/[^a-zA-Z0-9\/_-]/', '', $value); break;
default: die("Coding error: incorrent parameter type specified ($type).");
}
return $value;
}
......@@ -49,7 +49,7 @@ function xmldb_main_install() {
'enrol_plugins_enabled' => 'manual',
'style' => 'default',
'template' => 'default',
'theme' => 'standardwhite',
'theme' => 'standard', //TODO: MDL-20204 replace with some new default theme when implemented
'filter_multilang_converted' => 1,
'siteidentifier' => random_string(32).get_host_from_url($CFG->wwwroot),
'backup_version' => 2008111700,
......@@ -216,4 +216,6 @@ function xmldb_main_install() {
set_role_contextlevels($guestrole, get_default_contextlevels('guest'));
set_role_contextlevels($userrole, get_default_contextlevels('user'));
// init themes
set_config('themerev', 1);
}
......@@ -20,7 +20,7 @@
// before any action that may take longer time to finish.
function xmldb_main_upgrade($oldversion) {
global $CFG, $THEME, $USER, $DB, $OUTPUT;
global $CFG, $USER, $DB, $OUTPUT;
require_once($CFG->libdir.'/db/upgradelib.php'); // Core Upgrade-related functions
......
......@@ -585,7 +585,7 @@ function get_current_group($courseid, $full = false) {
* @return void, always throws moodle_exception
*/
function error($message, $link='') {
throw new moodle_exception('notlocalisederrormessage', 'error', $link, $message, 'error() is a deprecated function, please call print_error() instead of error()');
throw new moodle_exception('notlocalisederrormessage', 'error', $link, $message, 'error() is a deprecated function, please call print_error() instead of error()');
}
......@@ -1720,33 +1720,6 @@ function make_mod_upload_directory($courseid) {
return make_upload_directory($courseid .'/'. $CFG->moddata);
}
/**
* This is a slight variatoin on the standard_renderer_factory that uses
* custom_corners_core_renderer instead of moodle_core_renderer.
*
* This generates the slightly different HTML that the custom_corners theme expects.
*
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @deprecated Required to make the old $THEME->customcorners setting work.
*/
class custom_corners_renderer_factory extends standard_renderer_factory {
public function __construct($theme) {
parent::__construct($theme);
global $CFG;
require_once($CFG->themedir . '/custom_corners/renderers.php');
}
/* Implement the subclass method. */
public function get_renderer($module, $page, $subtype=null) {
if ($module == 'core') {
return new custom_corners_core_renderer($page);
}
return parent::get_renderer($module, $page, $subtype);
}
}
/**
* Used to be used for setting up the theme. No longer used by core code, and
* should not have been used elsewhere.
......@@ -1777,25 +1750,6 @@ function current_theme() {
return $PAGE->theme->name;
}
/**
* This used to be the thing that theme styles.php files used to do all the work.
* This is now handled differently. You should copy theme/standard/styes.php
* into your theme.
*
* @deprecated
* @param int $lastmodified Always gets set to now
* @param int $lifetime The max-age header setting (seconds) defaults to 300
* @param string $themename The name of the theme to use (optional) defaults to current theme
* @param string $forceconfig Force a particular theme config (optional)
* @param string $lang Load styles for the specified language (optional)
*/
function style_sheet_setup($lastmodified=0, $lifetime=300, $themename='', $forceconfig='', $lang='') {
global $CFG, $PAGE, $THEME, $showdeprecatedstylesheetsetupwarning;
$showdeprecatedstylesheetsetupwarning = true;
include($CFG->dirroot . '/theme/styles.php');
exit;
}
/**
* @todo Remove this deprecated function when no longer used
* @deprecated since Moodle 2.0 - use $PAGE->pagetype instead of the .
......@@ -1895,7 +1849,7 @@ function print_heading($text, $deprecated = '', $size = 2, $class = 'main', $ret
function print_heading_block($heading, $class='', $return=false) {
global $OUTPUT;
debugging('print_heading_with_block() has been deprecated. Please change your code to use $OUTPUT->heading().');
$output = $OUTPUT->heading($heading, 2, 'headingblock header ' . moodle_renderer_base::prepare_classes($class));
$output = $OUTPUT->heading($heading, 2, 'headingblock header ' . renderer_base::prepare_classes($class));
if ($return) {
return $output;
} else {
......@@ -2012,6 +1966,13 @@ function print_container_start($clearfix=false, $classes='', $idbase='', $return
}
}
/**
* Deprecated, now handled automatically in themes
*/
function check_theme_arrows() {
debugging('check_theme_arrows() has been deprecated, do not use it anymore, it is now automatic.');
}
/**
* Simple function to end a container (see above)
*
......@@ -2193,7 +2154,7 @@ function print_footer($course = NULL, $usercourse = NULL, $return = false) {
// TODO check arguments.
if (is_string($course)) {
debugging("Magic values like 'home', 'empty' passed to print_footer no longer have any effect. " .
'To achieve a similar effect, call $PAGE->set_generaltype before you call print_header.', DEBUG_DEVELOPER);
'To achieve a similar effect, call $PAGE->set_pagelayout before you call print_header.', DEBUG_DEVELOPER);
} else if (!empty($course->id) && $course->id != $PAGE->course->id) {
throw new coding_exception('The $course object you passed to print_footer does not match $PAGE->course.');
}
......@@ -3702,8 +3663,6 @@ function build_navigation($extranavlinks, $cm = null) {
* @return string
*/
function navmenu($course, $cm=NULL, $targetwindow='self') {
global $CFG, $THEME, $USER, $DB, $OUTPUT;
// This function has been deprecated with the creation of the global nav in
// moodle 2.0
......@@ -3776,7 +3735,7 @@ function delete_event($id) {
/**
* Call this function to hide an event in the calendar table
* the event will be identified by the id field of the $event object.
*
*
* @param object $event An object representing an event from the calendar table. The event will be identified by the id field.
* @return true
*/
......
......@@ -74,8 +74,8 @@ class tinymce_texteditor extends texteditor {
$directionality = get_string('thisdirection');
$strtime = get_string('strftimetime');
$strdate = get_string('strftimedaydate');
$lang = str_replace('_utf8', '', current_language()); // use more standard language codes
$contentcss = $CFG->themewww.'/'.current_theme().'/styles.php'; // should be customizable
$lang = str_replace('_utf8', '', current_language()); // use more standard language codes
$contentcss = $PAGE->theme->editor_css_url()->out(false, array(), false);
$context = empty($options['context']) ? get_context_instance(CONTEXT_SYSTEM) : $options['context'];
if (!empty($options['legacy'])) {
......
......@@ -2068,9 +2068,10 @@ function file_modify_html_header($text) {
global $CFG;
$stylesheetshtml = '';
foreach ($CFG->stylesheets as $stylesheet) {
/* foreach ($CFG->stylesheets as $stylesheet) {
//TODO: MDL-21120
$stylesheetshtml .= '<link rel="stylesheet" type="text/css" href="'.$stylesheet.'" />'."\n";
}
}*/
$ufo = '';
if (filter_is_enabled('filter/mediaplugin')) {
......
......@@ -233,7 +233,7 @@ function install_print_help_page($help) {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo '<html dir="'.(right_to_left() ? 'rtl' : 'ltr').'">
<head>
<link rel="shortcut icon" href="theme/standard/favicon.ico" />
<link rel="shortcut icon" href="theme/standard/pix/favicon.ico" />
<link rel="stylesheet" type="text/css" href="'.$CFG->wwwroot.'/install.php?css=1" />
<title>'.get_string('installation','install').'</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
......@@ -279,7 +279,7 @@ function install_print_header($config, $stagename, $heading, $stagetext) {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo '<html dir="'.(right_to_left() ? 'rtl' : 'ltr').'">
<head>
<link rel="shortcut icon" href="theme/standard/favicon.ico" />';