Skip to content

Commit

Permalink
CSS MDL-26013 Fixed several display bugs when using right to left lan…
Browse files Browse the repository at this point in the history
…guages
  • Loading branch information
nadavkav authored and Sam Hemelryk committed Apr 14, 2011
1 parent 91787c3 commit b41fc49
Show file tree
Hide file tree
Showing 22 changed files with 244 additions and 105 deletions.
10 changes: 7 additions & 3 deletions blocks/messages/styles.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.block_messages .content {text-align:left;padding-top:5px;}
.block_messages .content .list li.listentry {clear:both;}
.block_messages .content .list li.listentry div.user {float:left;position:relative;}
.block_messages .content .list li.listentry div.message {float:right;}
.block_messages .content .footer {clear:both;}
.block_messages .content .list li.listentry .user {float:left;position:relative;}
.block_messages .content .list li.listentry .message {float:right;}
.block_messages .content .info {text-align:center;}
.block_messages .content .footer {clear:both;}

.dir-rtl .block_messages .content .list li.listentry .user {float:right;}
.dir-rtl .block_messages .content .list li.listentry .message {float:left;}
16 changes: 9 additions & 7 deletions blocks/navigation/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,18 @@
.ie6 .block_navigation .block_tree .tree_item {width:100%;}

/** Overide for RTL layout **/
.dir-rtl .block_navigation .block_tree {padding-right:0px;}
.dir-rtl .block_navigation .block_tree li.item_with_icon > p img {right:0;}

.dir-rtl .block_navigation .block_tree li ul {padding-right:0;}
.dir-rtl .block_navigation .block_tree li.depth_2 ul {padding-right:16px;}
.dir-rtl .block_navigation .block_tree li.depth_2 ul {padding-left:0;padding-right: 7px;}
.dir-rtl .block_navigation .block_tree .tree_item {padding-right: 18px;text-align:right;}

.dir-rtl .block_navigation .block_tree .tree_item.branch {background-position: center right;}
.dir-rtl .block_navigation .block_tree .navigation_node.tree_item.branch {padding-right:0;}
.dir-rtl .block_navigation .block_tree .root_node.leaf {padding-right:0px;}

.dir-rtl .block_navigation .block_tree,
.dir-rtl .block_navigation .block_tree li ul,
.dir-rtl .block_navigation .block_tree .navigation_node.tree_item.branch,
.dir-rtl .block_navigation .block_tree .root_node.leaf {padding-right:0;}

.dir-rtl .block_navigation .block_tree li.item_with_icon > p img,
.dir-rtl .block_navigation .block_tree .type_activity > .tree_item.branch img {right:0;left:auto;}

.jsenabled.dir-rtl .block_navigation .block_tree .tree_item.emptybranch {background-image: url([[pix:t/collapsed_empty_rtl]]);background-position: center right;}
.jsenabled.dir-rtl .block_navigation .block_tree .collapsed .tree_item.branch {background-image: url([[pix:t/collapsed_rtl]]);}
8 changes: 6 additions & 2 deletions blocks/online_users/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.block_online_users .content .list li.listentry {clear:both;}
.block_online_users .content .list li.listentry div.user {float:left;position:relative;}
.block_online_users .content .list li.listentry div.message {float:right;}
.block_online_users .content .list li.listentry .user {float:left;position:relative;}
.block_online_users .content .list li.listentry .message {float:right;}
.block_online_users .content .info {text-align:center;}

.dir-rtl .block_online_users .content .list li.listentry .user {float:right;}
.dir-rtl .block_online_users .content .list li.listentry .message {float:left;}
4 changes: 3 additions & 1 deletion blocks/recent_activity/styles.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.block_recent_activity .activitydate,
.block_recent_activity .activityhead {text-align:center;}
.block_recent_activity .unlist li {margin-bottom:1em;}
.block_recent_activity li .head .date {float:right;}
.block_recent_activity li .head .date {float:right;}

.dir-rtl .block_recent_activity .content h3 {text-align: right;}
5 changes: 3 additions & 2 deletions blocks/settings/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@

/** Overide for RTL layout **/
.dir-rtl .block_settings .block_tree {padding-right:0px;}
.dir-rtl .block_settings .block_tree li ul {padding-right:16px;}
.dir-rtl .block_settings .block_tree li.item_with_icon > p img {right:0;}
.dir-rtl .block_settings .block_tree li ul {padding-left:0;padding-right: 7px;}
.dir-rtl .block_settings .block_tree li.item_with_icon > p img,
.dir-rtl .block_navigation .block_tree .type_activity > .tree_item.branch img {left:auto;right:0;}
.dir-rtl .block_settings .block_tree .tree_item {padding-right: 18px;text-align:right;}
.dir-rtl .block_settings .block_tree .tree_item.branch {background-position: center right;}
.dir-rtl .block_settings .block_tree .root_node.leaf {padding-right:0px;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ Structure of the user enroller panel
.user-enroller-panel .collapsiblearea {border:1px solid #bbb;background-color:#f6f6f6;}
.user-enroller-panel .collapsiblearea.hidden {display:none;}
.user-enroller-panel .collapsiblearea .uep-enrolment-option {margin:5px 1em;}

.dir-rtl .user-enroller-panel .uep-header .close {right: auto;left:1em;}
.dir-rtl .user-enroller-panel .uep-search-results .user { text-align: right;}
.dir-rtl .user-enroller-panel .uep-content .uep-controls { text-align: right;}
6 changes: 6 additions & 0 deletions mod/assignment/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@

#page-mod-assignment-submissions .optionspref {width: 50%;}
#page-mod-assignment-submissions .fastgbutton {text-align: center;}

#page-mod-assignment-submissions.dir-rtl .fullname,
#page-mod-assignment-submissions.dir-rtl .timemodified,
#page-mod-assignment-submissions.dir-rtl .timemarked {text-align:right;}
#page-mod-assignment-submissions.dir-rtl .mform.optionspref .fitem .fitemtitle {text-align:left;}
#page-mod-assignment-type-uploadsingle-upload.dir-rtl .mdl-left {text-align:right;}
82 changes: 42 additions & 40 deletions mod/chat/gui_ajax/theme/bubble/chat.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.yui-skin-sam .yui-layout .yui-layout-hd { border:0; }
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd { border:0; }
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd { border:0; }
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd { border:0; }
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-unit-right { background: white; }
.yui-skin-sam .yui-layout-unit-bottom { background: #F2F2F2; }
Expand All @@ -8,44 +8,46 @@
.yui-skin-sam .yui-layout-unit-top { background: #FFE39D; }
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd { background: transparent; }

#input-message {
background:#FFFFFF url(input.png) repeat-x scroll 0 0;
padding:0 9px;
border: 1px solid #999;
border-radius: 9px;
-moz-border-radius: 9px;
}
.mdl-chat-entry, .mdl-chat-my-entry {
clear:both;
}
.chat-message td {
padding: 0;
}
#input-message {background:#FFFFFF url(input.png) repeat-x scroll 0 0;padding:0 9px;border: 1px solid #999;border-radius: 9px;-moz-border-radius: 9px;}
.mdl-chat-entry,
.mdl-chat-my-entry {clear:both;}
.chat-message td {padding: 0;}

.mdl-chat-entry .topleft { background:transparent url(bubbles.png) no-repeat scroll left top; height:9px; width:18px; }
.mdl-chat-entry .top { background:transparent url(horizontal.png) repeat-x scroll center top; font-size:1px; height:9px; }
.mdl-chat-entry .topright { background:transparent url(bubbles.png) no-repeat scroll -18px top; height:9px; width:11px; }
.mdl-chat-entry .left { background:transparent url(vertical.png) repeat-y scroll left center; width:18px; }
.mdl-chat-entry .conmts { background:#DCDCDC none repeat scroll 0 0; color:#000000; text-shadow:0 1px 0 #EEEEEE; }
.mdl-chat-entry .right { background:transparent url(vertical.png) repeat-y scroll -18px 0; width:11px; }
.mdl-chat-entry .bottomleft { background:transparent url(bubbles.png) no-repeat scroll left -9px; height:12px; width:18px; }
.mdl-chat-entry .bottomright { background:transparent url(bubbles.png) no-repeat scroll right -9px; height:12px; width:11px; }
.mdl-chat-entry .bottom { background:transparent url(horizontal.png) repeat-x scroll 0 -9px; height:12px; }
.mdl-chat-entry .topleft {background:transparent url(bubbles.png) no-repeat scroll left top; height:9px; width:18px;}
.mdl-chat-entry .top {background:transparent url(horizontal.png) repeat-x scroll center top; font-size:1px; height:9px;}
.mdl-chat-entry .topright {background:transparent url(bubbles.png) no-repeat scroll -18px top; height:9px; width:11px;}
.mdl-chat-entry .left {background:transparent url(vertical.png) repeat-y scroll left center; width:18px;}
.mdl-chat-entry .conmts {background:#DCDCDC none repeat scroll 0 0; color:#000000; text-shadow:0 1px 0 #EEEEEE;}
.mdl-chat-entry .right {background:transparent url(vertical.png) repeat-y scroll -18px 0; width:11px;}
.mdl-chat-entry .bottomleft {background:transparent url(bubbles.png) no-repeat scroll left -9px; height:12px; width:18px;}
.mdl-chat-entry .bottomright {background:transparent url(bubbles.png) no-repeat scroll right -9px; height:12px; width:11px;}
.mdl-chat-entry .bottom {background:transparent url(horizontal.png) repeat-x scroll 0 -9px; height:12px;}

.mdl-chat-my-entry .topleft{background:url(bubbles.png) no-repeat 0 -21px;height:9px;width:11px;}
.mdl-chat-my-entry .topright{background:url(bubbles.png) no-repeat -11px -21px;height:9px;width:18px;}
.mdl-chat-my-entry .bottomleft{background:url(bubbles.png) no-repeat 0 bottom;width:11px;height:12px;}
.mdl-chat-my-entry .bottomright{background:url(bubbles.png) no-repeat right bottom;width:18px;height:12px;}
.mdl-chat-my-entry .top{background:url(horizontal.png) repeat-x 0 -21px;font-size:1px;height:9px;}
.mdl-chat-my-entry .bottom{background:url(horizontal.png) repeat-x bottom;height:12px;}
.mdl-chat-my-entry .left{background:url(vertical.png) repeat-y -29px 0;width:11px;}
.mdl-chat-my-entry .right{background:url(vertical.png) repeat-y right;width:18px;}
.mdl-chat-my-entry .conmts{background:#C0E668;color:#000;}
#chat-input-area ,#chat-input-area table.generaltable, #chat-input-area table.generaltable td.cell {
background: #92B3E8;
border: 0;
}
#chat-userlist {
background: #E3E8F0;
height: 100%;
}
.mdl-chat-my-entry .topleft {background:url(bubbles.png) no-repeat 0 -21px;height:9px;width:11px;}
.mdl-chat-my-entry .topright {background:url(bubbles.png) no-repeat -11px -21px;height:9px;width:18px;}
.mdl-chat-my-entry .bottomleft {background:url(bubbles.png) no-repeat 0 bottom;width:11px;height:12px;}
.mdl-chat-my-entry .bottomright {background:url(bubbles.png) no-repeat right bottom;width:18px;height:12px;}
.mdl-chat-my-entry .top {background:url(horizontal.png) repeat-x 0 -21px;font-size:1px;height:9px;}
.mdl-chat-my-entry .bottom {background:url(horizontal.png) repeat-x bottom;height:12px;}
.mdl-chat-my-entry .left {background:url(vertical.png) repeat-y -29px 0;width:11px;}
.mdl-chat-my-entry .right {background:url(vertical.png) repeat-y right;width:18px;}
.mdl-chat-my-entry .conmts {background:#C0E668;color:#000;}

#chat-input-area,
#chat-input-area table.generaltable,
#chat-input-area table.generaltable td.cell {background: #92B3E8;border: 0;}
#chat-userlist {background: #E3E8F0;height: 100%;}

.dir-rtl .mdl-chat-entry .topleft {background-position: -18px 0;width:11px;}
.dir-rtl .mdl-chat-entry .topright {background-position: 0 0;width:18px;}
.dir-rtl .mdl-chat-entry .bottomleft {background-position: -18px -9px;width:11px;}
.dir-rtl .mdl-chat-entry .bottomright {background-position: 0 -9px;width:18px;}
.dir-rtl .mdl-chat-entry .right {background-position: 0 0;width:18px;}
.dir-rtl .mdl-chat-entry .left {background-position: -18px 0;width:11px;}

.dir-rtl .mdl-chat-my-entry .topleft {background-position: -13px -21px;width:18px;}
.dir-rtl .mdl-chat-my-entry .topright {background-position: 0 -21px;width:11px;}
.dir-rtl .mdl-chat-my-entry .bottomleft {background-position: -13px -30px;width:18px;}
.dir-rtl .mdl-chat-my-entry .bottomright {background-position: 0 -30px;width:11px;}
.dir-rtl .mdl-chat-my-entry .right {background-position: -29px 0;width:11px;}
.dir-rtl .mdl-chat-my-entry .left {background-position: -42px 0;width:18px;}
5 changes: 4 additions & 1 deletion mod/chat/gui_ajax/theme/compact/chat.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.yui-skin-sam .yui-layout .yui-layout-hd { border:0; }
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd { border:0; }
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd { border:0; }
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd { border:0; }
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-unit-right { background: white; }
.yui-skin-sam .yui-layout-unit-bottom { background: #F2F2F2; }
Expand Down Expand Up @@ -59,3 +59,6 @@
background: #E3E8F0;
height: 100%;
}

.dir-rtl .chat-message {text-align:right;}
.dir-rtl .mdl-chat-my-entry .chat-message .text {text-align:right;}
60 changes: 28 additions & 32 deletions mod/data/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,50 +500,46 @@ function data_generate_default_template(&$data, $template, $recordid=0, $form=fa
// get all the fields for that database
if ($fields = $DB->get_records('data_fields', array('dataid'=>$data->id), 'id')) {

$str = '<div class="defaulttemplate">';
$str .= '<table cellpadding="5">';

$table = new html_table();
$table->attributes['class'] = 'mod-data-default-template';
$table->colclasses = array('template-field', 'template-token');
$table->data = array();
foreach ($fields as $field) {

$str .= '<tr><td valign="top" align="right">';
// Yu: commenting this out, the id was wrong and will fix later
//if ($template == 'addtemplate') {
//$str .= '<label';
//if (!in_array($field->type, array('picture', 'checkbox', 'date', 'latlong', 'radiobutton'))) {
// $str .= ' for="[['.$field->name.'#id]]"';
//}
//$str .= '>'.$field->name.'</label>';

//} else {
$str .= $field->name.': ';
//}
$str .= '</td>';

$str .='<td align="left">';
if ($form) { // Print forms instead of data
$fieldobj = data_get_field($field, $data);
$str .= $fieldobj->display_add_field($recordid);

$token = $fieldobj->display_add_field($recordid);
} else { // Just print the tag
$str .= '[['.$field->name.']]';
$token = '[['.$field->name.']]';
}
$str .= '</td></tr>';

$table->data[] = array(
$field->name.': ',
$token
);
}
if ($template == 'listtemplate') {
$str .= '<tr><td align="center" colspan="2">##edit## ##more## ##delete## ##approve## ##export##</td></tr>';
$cell = new html_table_cell('##edit## ##more## ##delete## ##approve## ##export##');
$cell->colspan = 2;
$cell->attributes['class'] = 'controls';
$table->data[] = new html_table_row(array($cell));
} else if ($template == 'singletemplate') {
$str .= '<tr><td align="center" colspan="2">##edit## ##delete## ##approve## ##export##</td></tr>';
$cell = new html_table_cell('##edit## ##delete## ##approve## ##export##');
$cell->colspan = 2;
$cell->attributes['class'] = 'controls';
$table->data[] = new html_table_row(array($cell));
} else if ($template == 'asearchtemplate') {
$str .= '<tr><td valign="top" align="right">'.get_string('authorfirstname', 'data').': </td><td>##firstname##</td></tr>';
$str .= '<tr><td valign="top" align="right">'.get_string('authorlastname', 'data').': </td><td>##lastname##</td></tr>';
$row = new html_table_row(get_string('authorfirstname', 'data').': ', '##firstname##');
$row->attributes['class'] = 'searchcontrols';
$table->data[] = $row;
$row = new html_table_row(get_string('authorlastname', 'data').': ', '##lastname##');
$row->attributes['class'] = 'searchcontrols';
$table->data[] = $row;
}

$str .= '</table>';
$str .= '</div>';

$str = html_writer::start_tag('div', array('class' => 'defaulttemplate'));
$str .= html_writer::table($table);
$str .= html_writer::end_tag('div');
if ($template == 'listtemplate'){
$str .= '<hr />';
$str .= html_writer::empty_tag('hr');
}

if ($update) {
Expand Down
16 changes: 15 additions & 1 deletion mod/data/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,18 @@
.path-mod-data-field .fieldadd select,
.path-mod-data-field .sortdefault select {margin-left: 1em;}
.path-mod-data-field .fieldname,
.path-mod-data-field .fielddescription {width:300px;}
.path-mod-data-field .fielddescription {width:300px;}

/** UI Usability Hacks **/
#page-mod-data-export #notice span {padding:0 10px;}
#page-mod-data-edit input[id*="url"] {text-align:left;direction:ltr;}

.mod-data-default-template td {vertical-align:top;}
.mod-data-default-template .template-field {text-align:right;}
.mod-data-default-template .template-token {text-align:left;}
.mod-data-default-template .controls {text-align:center;}
.mod-data-default-template searchcontrols {text-align:right;}

.dir-rtl .mod-data-default-template .template-field {text-align:left;}
.dir-rtl .mod-data-default-template .template-token {text-align:right;}
.dir-rtl .mod-data-default-template searchcontrols {text-align:left;}
4 changes: 4 additions & 0 deletions mod/wiki/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ a.wiki_edit_section {
text-align: left;
}

.dir-rtl #wiki_printable_content {
text-align: right;
}

#wiki_printable_content a {
color: black;
}
Expand Down
Binary file added theme/base/pix/yui2-treeview-sprite-rtl.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 11 additions & 9 deletions theme/base/style/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
#page-admin-index .c0 {vertical-align: top;}
#page-admin-index .c1 {vertical-align: middle;}

#page-admin-blocks table.generaltable th,
#page-admin-filters table.generaltable th,
#page-admin-auth table.generaltable th,
#page-admin-modules table.generaltable th,
#page-admin-modules table.generaltable td.c0 {white-space: nowrap;padding: 4px;}
#page-admin-blocks .generaltable th,
#page-admin-filters .generaltable th,
#page-admin-auth .generaltable th,
#page-admin-modules .generaltable th,
#page-admin-modules .generaltable td.c0 {white-space: nowrap;padding: 4px;}

#page-admin-blocks table.generaltable td.cell,
#page-admin-filters table.generaltable td.cell,
#page-admin-modules table.generaltable td.cell,
#page-admin-auth table.generaltable td.cell{padding: 4px;}
#page-admin-blocks .generaltable td.cell,
#page-admin-filters .generaltable td.cell,
#page-admin-modules .generaltable td.cell,
#page-admin-auth .generaltable td.cell{padding: 4px;}

.path-admin .incompatibleblockstable td.c0 {font-weight: bold;}

Expand Down Expand Up @@ -111,6 +111,7 @@

.path-admin table.rolecap {margin-left: auto;margin-right: auto;}
.path-admin table.rolecap tr.rolecap th {text-align: left;font-weight: normal;}
.path-admin.dir-rtl table.rolecap tr.rolecap th {text-align: right;}
.path-admin .rolecap .hiddenrow {display: none;}
.path-admin .rolecap .inherit,
.path-admin .rolecap .allow,
Expand Down Expand Up @@ -169,6 +170,7 @@
.dir-rtl #adminsettings .form-item .form-setting,
.dir-rtl #adminsettings .form-item .form-label,
.dir-rtl #adminsettings .form-item .form-description { float: right;text-align: right}
.dir-rtl.path-admin .roleassigntable p {text-align: right;}

/** Plugins check */
#page-admin-index #plugins-check-info {text-align:center;margin:1em;}
Expand Down
3 changes: 2 additions & 1 deletion theme/base/style/blocks.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
.block.hidden .block-hider-show {display:inline;}

/** Overide for RTL layout **/
.dir-rtl .block .header .block_action {float:left;}
.dir-rtl .block .header,
.dir-rtl .block h2.header {text-align:right;}
.dir-rtl .block .header .commands { text-align: right;}
Loading

0 comments on commit b41fc49

Please sign in to comment.