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
......@@ -8,7 +8,7 @@ require_once($CFG->dirroot.'/mod/forum/lib.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('bloglevelupgrade');
$PAGE->set_generaltype('maintenance');
$PAGE->set_pagelayout('maintenance');
$go = optional_param('go', 0, PARAM_BOOL);
......
......@@ -110,7 +110,6 @@ $CFG->dirroot = str_replace('\\', '/', dirname(dirname(dirname(__FI
$CFG->libdir = "$CFG->dirroot/lib";
$CFG->wwwroot = "http://localhost";
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->httpsthemewww = $CFG->wwwroot;
$CFG->dataroot = str_replace('\\', '/', dirname(dirname(dirname(__FILE__))).'/moodledata');
$CFG->docroot = 'http://docs.moodle.org';
$CFG->directorypermissions = 00777;
......@@ -262,7 +261,6 @@ if ($interactive) {
}
$CFG->wwwroot = $wwwroot;
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->httpsthemewww = $CFG->wwwroot;
//We need dataroot before lang download
......
......@@ -1334,7 +1334,7 @@ if (isset($argv) && isset($argc)) {
require_capability('moodle/site:config', $systemcontext);
$PAGE->set_url($CFG->wwwroot.'/admin/generator.php');
$PAGE->set_generaltype('form');
$PAGE->set_pagelayout('form');
$generator = new generator_web();
$generator->setup();
$generator->display();
......
......@@ -107,7 +107,7 @@ $origxmlstrictheaders = !empty($CFG->xmlstrictheaders);
$CFG->xmlstrictheaders = false;
if (!core_tables_exist()) {
$PAGE->set_generaltype('maintenance');
$PAGE->set_pagelayout('maintenance');
// fake some settings
$CFG->docroot = 'http://docs.moodle.org';
......@@ -188,7 +188,7 @@ if (empty($CFG->version)) {
}
if ($version > $CFG->version) { // upgrade
$PAGE->set_generaltype('maintenance');
$PAGE->set_pagelayout('maintenance');
$a->oldversion = "$CFG->release ($CFG->version)";
$a->newversion = "$release ($version)";
......
......@@ -310,7 +310,6 @@
}
/// Print the form.
check_theme_arrows();
?>
<form id="assignform" method="post" action="<?php echo $baseurl . '&amp;roleid=' . $roleid ?>"><div>
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
......
......@@ -8,6 +8,9 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
// "themesettings" settingpage
$temp = new admin_settingpage('themesettings', get_string('themesettings', 'admin'));
$temp->add(new admin_setting_configtext('themelist', get_string('themelist', 'admin'), get_string('configthemelist','admin'), '', PARAM_NOTAGS));
$setting = new admin_setting_configcheckbox('themedesignermode', get_string('themedesignermode', 'admin'), get_string('configthemedesignermode', 'admin'), 0);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$temp->add(new admin_setting_configcheckbox('allowuserthemes', get_string('allowuserthemes', 'admin'), get_string('configallowuserthemes', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowcoursethemes', get_string('allowcoursethemes', 'admin'), get_string('configallowcoursethemes', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowcategorythemes', get_string('allowcategorythemes', 'admin'), get_string('configallowcategorythemes', 'admin'), 0));
......@@ -23,6 +26,14 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$ADMIN->add('themes', $temp);
$ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
// settings for each theme
foreach (get_plugin_list('theme') as $theme => $themedir) {
$settings_path = "$themedir/settings.php";
if (file_exists($settings_path)) {
include($settings_path);
}
}
// calendar
$temp = new admin_settingpage('calendar', get_string('calendarsettings','admin'));
$temp->add(new admin_setting_special_adminseesall());
......@@ -132,3 +143,4 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$ADMIN->add('appearance', new admin_externalpage('managetags', get_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
} // end of speedup
......@@ -9,7 +9,6 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp = new admin_settingpage('experimentalsettings', get_string('experimentalsettings', 'admin'));
$temp->add(new admin_setting_configcheckbox('enableglobalsearch', get_string('enableglobalsearch', 'admin'), get_string('configenableglobalsearch', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('smartpix', get_string('smartpix', 'admin'), get_string('configsmartpix', 'admin'), 0));
$item = new admin_setting_configcheckbox('enablehtmlpurifier', get_string('enablehtmlpurifier', 'admin'), get_string('configenablehtmlpurifier', 'admin'), 0);
$item->set_updatedcallback('reset_text_filters_cache');
$temp->add($item);
......
......@@ -4,10 +4,7 @@
* Please note that is file is always loaded last - it means that you can inject entries into other categories too.
*/
if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
require_once($CFG->libdir. '/portfoliolib.php');
if ($hassiteconfig) {
$ADMIN->add('modules', new admin_category('modsettings', get_string('activitymodules')));
$ADMIN->add('modsettings', new admin_page_managemods());
if ($modules = $DB->get_records('modules')) {
......@@ -136,6 +133,9 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
}
}
//== Portfolio settings ==
require_once($CFG->libdir. '/portfoliolib.php');
$catname = get_string('portfolios', 'portfolio');
$manage = get_string('manageportfolios', 'portfolio');
$url = "$CFG->wwwroot/$CFG->admin/portfolio.php";
......@@ -222,9 +222,7 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstanceedit',
get_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true),
'', $url);
foreach (repository::get_types()
as $repositorytype)
{
foreach (repository::get_types() as $repositorytype) {
//display setup page for plugins with: general options or multiple instances (e.g. has instance config)
$typeoptionnames = repository::static_function($repositorytype->get_typename(), 'get_type_option_names');
$instanceoptionnames = repository::static_function($repositorytype->get_typename(), 'get_instance_option_names');
......@@ -236,6 +234,7 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
'moodle/site:config');
}
}
}
// Web services
$ADMIN->add('modules', new admin_category('webservicesettings', get_string('webservices', 'webservice')));
......@@ -264,6 +263,7 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
}
}
if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
// Question type settings.
$ADMIN->add('modules', new admin_category('qtypesettings', get_string('questiontypes', 'admin')));
$ADMIN->add('qtypesettings', new admin_page_manageqtypes());
......
......@@ -13,7 +13,7 @@ require_login(0, false);
$adminroot = admin_get_root(); // need all settings
admin_externalpage_setup('upgradesettings'); // now hidden page
$PAGE->set_generaltype('maintenance');
$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()) {
......
......@@ -73,8 +73,6 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
}
}
/// Print the form.
check_theme_arrows();
/// display the UI
?>
<form id="assignform" method="post" action="service_users.php?id=<?php echo $id ?>"><div>
......
......@@ -29,7 +29,7 @@ httpsrequired();
$select = html_select::make_popup_form("$CFG->httpswwwroot/login/index.php", 'lang', $langs, 'chooselang', $currlang);
$select->nothinglabel = false;
$select->set_label(get_accesshide(get_string('language')));
$langmenu = $OUTPUT->select($select);
$langmenu = '<div class="langmenu">'.$OUTPUT->select($select).'</div>';
}
$loginsite = get_string("loginsite");
......@@ -82,7 +82,7 @@ httpsrequired();
$PAGE->set_title("$site->fullname: $loginsite");
$PAGE->set_heading($site->fullname);
$PAGE->set_focuscontrol('idp');
$PAGE->set_headingmenu('<div class="langmenu">'.$langmenu.'</div>');
$PAGE->set_headingmenu($langmenu);
echo $OUTPUT->header();
include("index_form.html");
......
......@@ -9288,9 +9288,10 @@ WHERE
$restorelog_file = fopen("$dest_dir/restorelog.html","a");
//Add the stylesheet
$stylesheetshtml = '';
foreach ($CFG->stylesheets as $stylesheet) {
/* foreach ($CFG->stylesheets as $stylesheet) {
//TODO: MDL-21120
$stylesheetshtml .= '<link rel="stylesheet" type="text/css" href="'.$stylesheet.'" />'."\n";
}
}*/
///Accessibility: added the 'lang' attribute to $direction, used in theme <html> tag.
$languagehtml = get_html_lang($dir=true);
......@@ -9299,7 +9300,7 @@ WHERE
fwrite ($restorelog_file," \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> ");
fwrite ($restorelog_file,"<html dir=\"ltr\".$languagehtml.");
fwrite ($restorelog_file,"<head>");
fwrite ($restorelog_file,$stylesheetshtml);
// fwrite ($restorelog_file,$stylesheetshtml);
fwrite ($restorelog_file,"<title>".$course_header->course_shortname." Restored </title>");
fwrite ($restorelog_file,"</head><body><br/><h1>The following changes were made during the Restoration of this Course.</h1><br/><br/>");
fwrite ($restorelog_file,"The Course ShortName is now - ".$course_header->course_shortname." The FullName is now - ".$course_header->course_fullname."<br/><br/>");
......
......@@ -88,6 +88,7 @@ class block_global_navigation_tree extends block_tree {
if ($this->contentgenerated === true) {
return true;
}
$this->page->requires->yui_lib('dom');
$this->page->requires->js('lib/javascript-navigation.js');
// Navcount is used to allow us to have multiple trees although I dont' know why
// you would want to trees the same
......
......@@ -815,7 +815,7 @@ class block_tree extends block_list {
*
* Also adds the required javascript call to the page output.
*
* @param moodle_core_renderer $output
* @param core_renderer $output
* @return string HTML
*/
protected function formatted_contents($output) {
......
......@@ -175,7 +175,7 @@ if ($returnurl) {
$managefeeds = new moodle_url($CFG->wwwroot . '/blocks/rss_client/managefeeds.php', $urlparams);
$PAGE->set_url('blocks/rss_client/editfeed.php', $urlparams);
$PAGE->set_generaltype('form');
$PAGE->set_pagelayout('form');
if ($rssid) {
$isadding = false;
......
......@@ -78,7 +78,7 @@ $feeds = $DB->get_records_select('block_rss_client', $select, null, $DB->sql_ord
$strmanage = get_string('managefeeds', 'block_rss_client');
$PAGE->set_generaltype('form');
$PAGE->set_pagelayout('form');
$PAGE->set_title($strmanage);
$PAGE->set_heading($strmanage);
......
......@@ -55,7 +55,7 @@ if ($returnurl) {
$urlparams['returnurl'] = $returnurl;
}
$PAGE->set_url('blocks/rss_client/viewfeed.php', $urlparams);
$PAGE->set_generaltype('popup');
$PAGE->set_pagelayout('popup');
$rssrecord = $DB->get_record('block_rss_client', array('id' => $rssid), '*', MUST_EXIST);
......
......@@ -87,6 +87,7 @@ class block_settings_navigation_tree extends block_tree {
if ($this->contentgenerated === true) {
return true;
}
$this->page->requires->yui_lib('dom');
$this->page->requires->js('lib/javascript-navigation.js');
block_settings_navigation_tree::$navcount++;
......
......@@ -11,6 +11,9 @@ required changes in code:
* move post instalation code from install() method into db/install.php
* completely rewrite file handling
* 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
optional - no changes needed in older code:
*
......
......@@ -719,7 +719,7 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
}
function calendar_top_controls($type, $data) {
global $CFG, $CALENDARDAYS, $THEME;
global $CFG, $CALENDARDAYS;
$content = '';
if(!isset($data['d'])) {
$data['d'] = 1;
......
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