Skip to content

Commit

Permalink
themes MDL-21862 Implements base theme and standard theme.
Browse files Browse the repository at this point in the history
Very big theme changes, standardold theme has been split into two themes base and standard. Base theme contains only CSS that is absolutly required (e.g. layout, white space rules, specific widths) and standard (which now looks like standardwhite) contains all the frills.
The following noteable changes have also been made:
  * Plugin CSS has been pushed back into the plugin directories as styles.css files.
  * Install_print_header has been corrected.
  * Redundant or deprecated rules have been removed.
  * Several minor class changes throughout Moodle.
  * CSS is now single line rules not multiline indented.
  * Installs with theme=standardold automatically switch to standard.
  * body classes / id now have prefixes to make it clearer what they are and avoid conflicts.
Also worth noting:
  * There is still alot of tweaking that is required to get everything looking as it is supposed to, please be patient or better yet help out.
  * I am currently working on the documentation for the themes system... it will be here soon.
  • Loading branch information
Sam Hemelryk committed Mar 25, 2010
1 parent 49da4a5 commit 9072383
Show file tree
Hide file tree
Showing 113 changed files with 3,435 additions and 1,673 deletions.
8 changes: 3 additions & 5 deletions admin/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'delete', 'settings'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('id', 'blocks');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->set_attribute('class', 'compatibleblockstable blockstable generaltable');
$table->setup();

foreach ($blockbyname as $blockname => $blockid) {
Expand Down Expand Up @@ -188,16 +187,15 @@
$table->print_html();

if(!empty($incompatible)) {
echo $OUTPUT->heading(get_string('incompatibleblocks', 'admin'));
echo $OUTPUT->heading(get_string('incompatibleblocks', 'blockstable', 'admin'));

$table = new flexible_table('admin-blocks-incompatible');

$table->define_columns(array('block', 'delete'));
$table->define_headers(array($strname, $strdelete));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');

$table->set_attribute('id', 'incompatible');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->set_attribute('class', 'incompatibleblockstable generaltable');

$table->setup();

Expand Down
2 changes: 1 addition & 1 deletion admin/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
$table->head = array(get_string('name'), get_string('enable'), get_string('default'), $str->settings);
$table->align = array('left', 'center', 'center', 'center');
$table->size = array('60%', '', '', '15%');
$table->width = '700';
$table->attributes['class'] = 'generaltable enrolplugintable';
$table->data = array();

$enabledplugins = explode(',', $CFG->enrol_plugins_enabled);
Expand Down
2 changes: 1 addition & 1 deletion admin/report/capability/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
}

// Print the settings form.
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter centerpara');
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
echo '<form method="get" action="." id="settingsform"><div>';
echo $OUTPUT->heading(get_string('reportsettings', 'report_capability'));
echo '<p id="intro">', get_string('intro', 'report_capability') , '</p>';
Expand Down
5 changes: 5 additions & 0 deletions blocks/admin_tree/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.block_admin_tree .admintree {text-align:left;}
.block_admin_tree .admintree .depth1 {padding-left: 16px;}
.block_admin_tree .admintree .depth2 {padding-left: 32px;}
.block_admin_tree .admintree .depth3 {padding-left: 48px;}
.block_admin_tree .admintree .depth4 {padding-left: 64px;}
20 changes: 20 additions & 0 deletions blocks/blog_tags/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.block_blog_tags .s20 {font-size: 1.5em;font-weight: bold;}
.block_blog_tags .s19 {font-size: 1.5em;}
.block_blog_tags .s18 {font-size: 1.4em;font-weight: bold;}
.block_blog_tags .s17 {font-size: 1.4em;}
.block_blog_tags .s16 {font-size: 1.3em;font-weight: bold;}
.block_blog_tags .s15 {font-size: 1.3em;}
.block_blog_tags .s14 {font-size: 1.2em;font-weight: bold;}
.block_blog_tags .s13 {font-size: 1.2em;}
.block_blog_tags .s12,
.block_blog_tags .s11 {font-size: 1.1em;font-weight: bold;}
.block_blog_tags .s10,
.block_blog_tags .s9 {font-size: 1.1em;}
.block_blog_tags .s8,
.block_blog_tags .s7 {font-size: 1em;font-weight: bold;}
.block_blog_tags .s6,
.block_blog_tags .s5 {font-size: 1em;}
.block_blog_tags .s4,
.block_blog_tags .s3 {font-size: 0.9em;font-weight: bold;}
.block_blog_tags .s2,
.block_blog_tags .s1 {font-size: 0.9em;}
11 changes: 11 additions & 0 deletions blocks/calendar_month/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.block_calendar_month .minicalendar {width:100%;margin:10px auto;}
.block_calendar_month .minicalendar th,
.block_calendar_month .minicalendar td {padding:2px;font-size:0.8em;}
.block_calendar_month .minicalendar td.weekend {color:#A00;}

.block_calendar_month .calendar-controls .previous {text-align: left;display: block;float: left;width: 12%;}
.block_calendar_month .calendar-controls .current {float:left;text-align: center;display: block;width:76%;}
.block_calendar_month .calendar-controls .next {text-align: right;display: block;float: left;width: 12%;}

.block_calendar_month .filters table {border-collapse:separate;border-spacing: 2px;padding: 2px;width: 100%;}
.block_calendar_month .content h3.eventskey {margin-top:0.5em;margin-bottom:0;margin-left:0.5em;}
23 changes: 0 additions & 23 deletions blocks/calendar_month/styles.php

This file was deleted.

1 change: 1 addition & 0 deletions blocks/calendar_upcoming/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.block_calendar_upcoming .event .date {text-align:right;}
1 change: 1 addition & 0 deletions blocks/course_list/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.block_course_list .footer {margin-top: 5px;}
2 changes: 2 additions & 0 deletions blocks/course_summary/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.block_course_summary .content {padding:10px;}
.block_course_summary .editbutton {text-align:right;}
7 changes: 0 additions & 7 deletions blocks/course_summary/styles.php

This file was deleted.

15 changes: 13 additions & 2 deletions blocks/dock.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ M.core_dock = {
return;
}

var blockclass = (function(classes){
var r = /(^|\s)(block_[a-zA-Z0-9_]+)(\s|$)/;
var m = r.exec(classes);
return (m)?m[2]:m;
})(node.getAttribute('className').toString());

this.cachedcontentnode = node;

var placeholder = this.Y.Node.create('<div id="content_placeholder_'+this.id+'"></div>');
Expand All @@ -391,7 +397,7 @@ M.core_dock = {
blockcommands.append(moveto);

// Create a new dock item for the block
var dockitem = new M.core_dock.item(this.Y, this.id, blocktitle, blockcontent, blockcommands);
var dockitem = new M.core_dock.item(this.Y, this.id, blocktitle, blockcontent, blockcommands, blockclass);
if (spacewidth !== null && M.core_dock.cfg.display.mindisplaywidth == null) {
dockitem.cfg.display.mindisplaywidth = spacewidth;
}
Expand Down Expand Up @@ -566,6 +572,7 @@ M.core_dock = {
this.panel.renderEvent.subscribe(this.resize_panel, this, true);
this.panel.setBody(this.Y.Node.getDOMNode(this.contents));
this.panel.render(M.core_dock.node);
this.Y.one(this.panel.body).addClass(this.blockclass);
if (this.cfg.display.mindisplaywidth !== null && this.Y.one(this.panel.body).getStyle('minWidth') == '0px') {
this.Y.one(this.panel.body).setStyle('minWidth', this.cfg.display.mindisplaywidth);
this.Y.one(this.panel.body).setStyle('minHeight', dockitemtitle.get('offsetHeight')+'px');
Expand Down Expand Up @@ -744,7 +751,7 @@ M.core_dock.genericblock.prototype.fix_title_orientation = M.core_dock.abstrac
* @param {this.Y.Node} contents
* @param {this.Y.Node} commands
*/
M.core_dock.item = function(Y, uid, title, contents, commands){
M.core_dock.item = function(Y, uid, title, contents, commands, blockclass){
this.Y = Y;
if (uid && this.id==null) {
this.id = uid;
Expand All @@ -758,6 +765,9 @@ M.core_dock.item = function(Y, uid, title, contents, commands){
if (commands && this.commands==null) {
this.commands = commands;
}
if (blockclass && this.blockclass==null) {
this.blockclass = blockclass
}
this.init_events();
}
/** Properties */
Expand All @@ -770,6 +780,7 @@ M.core_dock.item.prototype.active = M.core_dock.abstract_item_class.
M.core_dock.item.prototype.panel = M.core_dock.abstract_item_class.panel;
M.core_dock.item.prototype.preventhide = M.core_dock.abstract_item_class.preventhide;
M.core_dock.item.prototype.cfg = M.core_dock.cfg;
M.core_dock.item.prototype.blockclass = null;
M.core_dock.item.prototype.delayhiderunning = false;
M.core_dock.item.prototype.delayhidetimeout = 1000; // 1 Second
/** Methods **/
Expand Down
22 changes: 22 additions & 0 deletions blocks/global_navigation_tree/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** JavaScript state rules **/
.jsenabled .block_global_navigation_tree.dock_on_load,
.block_global_navigation_tree .block_tree_box .requiresjs {display:none;}
.jsenabled .block_global_navigation_tree .block_tree_box .requiresjs {display:inline;}

/** General display rules **/
.block_global_navigation_tree .block_tree {margin:5px;padding-left:0px;overflow-x:auto;overflow-y:visible;}
.block_global_navigation_tree .block_tree li {margin:0;list-style: none;}
.block_global_navigation_tree .block_tree li ul {padding-left:16px;margin:0;}
.block_global_navigation_tree .block_tree .tree_item {white-space:nowrap;margin:2px 0px;padding-left: 16px;margin:3px 0px;white-space:nowrap;text-align:left;}
.block_global_navigation_tree .block_tree .tree_item.branch {background-image: url([[pix:t/expanded]]);background-position: center left;background-repeat: no-repeat;}
.block_global_navigation_tree .block_tree .root_node.leaf {padding-left:0px;}
.block_global_navigation_tree .block_tree .current_branch {font-weight:bold;}
.jsenabled .block_global_navigation_tree .block_tree .tree_item.branch {cursor:pointer;}
.jsenabled .block_global_navigation_tree .block_tree .tree_item.emptybranch {background-image: url([[pix:t/collapsed_empty]]);background-position: center left;background-repeat: no-repeat;}
.jsenabled .block_global_navigation_tree .block_tree .collapsed ul {display: none;}
.jsenabled .block_global_navigation_tree .block_tree .collapsed .tree_item.branch {background-image: url([[pix:t/collapsed]]);}

/** Internet explorer specific rules **/
.ie6 .block_global_navigation_tree .block_tree,
.ie7 .block_global_navigation_tree .block_tree {overflow-x:scroll;}
.ie6 .block_global_navigation_tree .block_tree .tree_item {width:100%;}
4 changes: 4 additions & 0 deletions blocks/messages/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.block_messages .content {text-align:left;font-size:0.75em;padding-top:5px;}
.block_messages .content .list li.listentry {clear:both;}
.block_messages .content .list li.listentry div.user {float:left;}
.block_messages .content .list li.listentry div.message {float:right;}
3 changes: 3 additions & 0 deletions blocks/online_users/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.block_online_users .content .list li.listentry {clear:both;}
.block_online_users .content .list li.listentry div.user {float:left;}
.block_online_users .content .list li.listentry div.message {float:right;}
6 changes: 6 additions & 0 deletions blocks/quiz_results/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.block_quiz_results {text-align: center;}
.block_quiz_results h1 {margin: 4px;font-size: 1.1em;}
.block_quiz_results table.grades {text-align: left;width: 100%;}
.block_quiz_results table.grades .number,
.block_quiz_results table.grades .grade {text-align: right;width: 10%;}
.block_quiz_results table.grades caption {margin: 1em 0px 0px 0px;border-bottom-width: 1px;border-bottom-style: solid;font-weight: bold;}
2 changes: 2 additions & 0 deletions blocks/recent_activity/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.block_recent_activity .activitydate,
.block_recent_activity .activityhead {text-align:center;}
54 changes: 0 additions & 54 deletions blocks/rss_client/styles.php

This file was deleted.

4 changes: 4 additions & 0 deletions blocks/search_forums/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.block_search_forums .searchform {text-align: center;}
.block_search_forums .searchform img {vertical-align: middle;}
.block_search_forums .searchform img.resize {width: 1em;height: 1.1em;}
.block_search_forums .invisiblefieldset {display: block;}
22 changes: 22 additions & 0 deletions blocks/settings_navigation_tree/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** JavaScript state rules **/
.jsenabled .block_settings_navigation_tree.dock_on_load,
.block_settings_navigation_tree .block_tree_box .requiresjs {display:none;}
.jsenabled .block_settings_navigation_tree .block_tree_box .requiresjs {display:inline;}

/** General display rules **/
.block_settings_navigation_tree .block_tree {margin:5px;padding-left:0px;overflow-x:auto;overflow-y:visible;}
.block_settings_navigation_tree .block_tree li {margin:0;list-style: none;}
.block_settings_navigation_tree .block_tree li ul {padding-left:16px;margin:0;}
.block_settings_navigation_tree .block_tree .tree_item {white-space:nowrap;margin:2px 0px;padding-left: 16px;margin:3px 0px;white-space:nowrap;text-align:left;}
.block_settings_navigation_tree .block_tree .tree_item.branch {background-image: url([[pix:t/expanded]]);background-position: center left;background-repeat: no-repeat;}
.block_settings_navigation_tree .block_tree .root_node.leaf {padding-left:0px;}
.block_settings_navigation_tree .block_tree .current_branch {font-weight:bold;}
.jsenabled .block_settings_navigation_tree .block_tree .tree_item.branch {cursor:pointer;}
.jsenabled .block_settings_navigation_tree .block_tree .tree_item.emptybranch {background-image: url([[pix:t/collapsed_empty]]);background-position: center left;background-repeat: no-repeat;}
.jsenabled .block_settings_navigation_tree .block_tree .collapsed ul {display: none;}
.jsenabled .block_settings_navigation_tree .block_tree .collapsed .tree_item.branch {background-image: url([[pix:t/collapsed]]);}

/** Internet explorer specific rules **/
.ie6 .block_settings_navigation_tree .block_tree,
.ie7 .block_settings_navigation_tree .block_tree {overflow-x:scroll;}
.ie6 .block_settings_navigation_tree .block_tree .tree_item {width:100%;}
1 change: 1 addition & 0 deletions blocks/tag_flickr/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.block_tag_flickr .flickr-photos {padding:3px;}
2 changes: 2 additions & 0 deletions blocks/tag_youtube/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.block_tag_youtube .youtube-thumb {padding: 3px;padding-bottom: 0.5em;display: block;float: left;}
.block_tag_youtube .yt-video-entry li {clear: left;}
11 changes: 11 additions & 0 deletions blocks/tags/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.block_tags {}
.block_tags #coursetag {}
.block_tags #coursetag .coursetag_form_wrapper {}
.block_tags #coursetag .coursetag_form_wrapper .coursetag_form_positioner {position: relative;}
.block_tags #coursetag .coursetag_form_wrapper .coursetag_form_positioner .coursetag_form_input1 {position: relative;top: 0;left: 0;z-index: 1;width:100%;}
.block_tags #coursetag .coursetag_form_wrapper .coursetag_form_positioner .coursetag_form_input2 {position: absolute;top: 0;left: 0;z-index: 2;width:100%;}
.block_tags #coursetag .coursetag_form_wrapper .coursetag_form_positioner .coursetag_form_input3 {position: absolute;top: 3px;left: 12.8em;display: none;}
.block_tags #coursetag .coursetag_form_wrapper .coursetag_form_positioner .coursetag_form_input1a {background-color: white; border: 1px solid #999;width: 12em;padding: 2px;}
.block_tags #coursetag .coursetag_form_wrapper .coursetag_form_positioner .coursetag_form_input2a {background-color: transparent; border: 1px solid #999;width: 12em;color: #669954;padding: 2px;}
.block_tags .coursetag_morelink {}
.block_tags .coursetag_list {}
Loading

0 comments on commit 9072383

Please sign in to comment.