From b859dc533fe32afeaa8e00125fdd092227200abc Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 20 Aug 2012 16:35:28 +0800 Subject: [PATCH 1/4] MDL-31496 mod_data Replacing inline styles for CSS classes in textarea elements --- mod/data/field/checkbox/mod.html | 2 +- mod/data/field/menu/mod.html | 2 +- mod/data/field/multimenu/mod.html | 2 +- mod/data/field/picture/field.class.php | 4 ++-- mod/data/field/radiobutton/mod.html | 2 +- mod/data/lib.php | 2 +- mod/data/styles.css | 11 +++++++++++ 7 files changed, 18 insertions(+), 7 deletions(-) diff --git a/mod/data/field/checkbox/mod.html b/mod/data/field/checkbox/mod.html index 6d8bef38234..a8812926b95 100644 --- a/mod/data/field/checkbox/mod.html +++ b/mod/data/field/checkbox/mod.html @@ -9,6 +9,6 @@ - + diff --git a/mod/data/field/menu/mod.html b/mod/data/field/menu/mod.html index 58fa709c2bc..f92fb136b23 100644 --- a/mod/data/field/menu/mod.html +++ b/mod/data/field/menu/mod.html @@ -9,6 +9,6 @@ - + diff --git a/mod/data/field/multimenu/mod.html b/mod/data/field/multimenu/mod.html index 6d8bef38234..a8812926b95 100644 --- a/mod/data/field/multimenu/mod.html +++ b/mod/data/field/multimenu/mod.html @@ -9,6 +9,6 @@ - + diff --git a/mod/data/field/picture/field.class.php b/mod/data/field/picture/field.class.php index 6b3935ef4e8..37b320d8a9d 100644 --- a/mod/data/field/picture/field.class.php +++ b/mod/data/field/picture/field.class.php @@ -152,13 +152,13 @@ class data_field_picture extends data_field_base { if ($template == 'listtemplate') { $src = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.$this->context->id.'/mod_data/content/'.$content->id.'/'.'thumb_'.$content->content); // no need to add width/height, because the thumb is resized properly - $str = ''.s($alt).''; + $str = ''.s($alt).''; } else { $src = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.$this->context->id.'/mod_data/content/'.$content->id.'/'.$content->content); $width = $this->field->param1 ? ' width="'.s($this->field->param1).'" ':' '; $height = $this->field->param2 ? ' height="'.s($this->field->param2).'" ':' '; - $str = ''.s($alt).''; + $str = ''.s($alt).''; } return $str; diff --git a/mod/data/field/radiobutton/mod.html b/mod/data/field/radiobutton/mod.html index 6d8bef38234..a8812926b95 100644 --- a/mod/data/field/radiobutton/mod.html +++ b/mod/data/field/radiobutton/mod.html @@ -9,6 +9,6 @@ - + diff --git a/mod/data/lib.php b/mod/data/lib.php index fa660c0dc50..d12e916ad8c 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -244,7 +244,7 @@ class data_field_base { // Base class for Database Field Types (see field/*/ $str = '
'; $str .= ''; - $str .= ''; + $str .= ''; $str .= '
'; return $str; diff --git a/mod/data/styles.css b/mod/data/styles.css index 4f6846540c8..c2ce0dc1497 100644 --- a/mod/data/styles.css +++ b/mod/data/styles.css @@ -7,6 +7,13 @@ .path-mod-data-field .c0, #page-mod-data-view #sortsearch .c0 {text-align: right;} #page-mod-data-view .approve img.icon {width:34px;height:34px;} +#page-mod-data-view img.list_picture { + border:0px; +} + +#page-mod-data-edit .basefieldinput { + width:300px; +} /** Styles for preset.php **/ #page-mod-data-preset .presetmapping table {text-align: left;margin-left: auto;margin-right: auto;} @@ -20,6 +27,10 @@ .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 textarea.optionstextarea { + width:300px; + height:150px; +} /** UI Usability Hacks **/ #page-mod-data-export #notice span {padding:0 10px;} From 0d284a8bd68cc55d9e367244af809729ef7c3a78 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 20 Aug 2012 17:16:15 +0800 Subject: [PATCH 2/4] MDL-31496 mod_data Replacing inline styles for CSS classes in search containers --- mod/data/lib.php | 26 ++++++++++---------------- mod/data/styles.css | 10 ++++++++++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/mod/data/lib.php b/mod/data/lib.php index d12e916ad8c..83303be9fe2 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -1480,14 +1480,16 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order=' $pagesizes = array(2=>2,3=>3,4=>4,5=>5,6=>6,7=>7,8=>8,9=>9,10=>10,15=>15, 20=>20,30=>30,40=>40,50=>50,100=>100,200=>200,300=>300,400=>400,500=>500,1000=>1000); echo html_writer::select($pagesizes, 'perpage', $perpage, false, array('id'=>'pref_perpage')); - echo ''; + echo ''; echo '    '; // foreach field, print the option echo ''; echo '
'; - echo '
'; + echo '
'; echo ''; // print ASC or DESC @@ -1620,7 +1614,7 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order=' echo format_text($newtext, FORMAT_HTML, $options); echo ''; - echo ''; + echo ''; echo '


'; echo '
'; echo '
'; diff --git a/mod/data/styles.css b/mod/data/styles.css index c2ce0dc1497..b9636ac11d9 100644 --- a/mod/data/styles.css +++ b/mod/data/styles.css @@ -10,6 +10,16 @@ #page-mod-data-view img.list_picture { border:0px; } +#page-mod-data-view div.search_none { + display: none; +} +#page-mod-data-view div.search_inline { + display: inline; +} +#page-mod-data-view div#data_adv_form { + margin-left:auto; + margin-right:auto; +} #page-mod-data-edit .basefieldinput { width:300px; From f70a4f124b3958b02ea89ad9108dcf8601b72854 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 20 Aug 2012 17:17:24 +0800 Subject: [PATCH 3/4] MDL-31496 mod_data Replacing inline styles for CSS classes in text inputs --- mod/data/field/picture/mod.html | 8 ++++---- mod/data/field/textarea/mod.html | 4 ++-- mod/data/styles.css | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mod/data/field/picture/mod.html b/mod/data/field/picture/mod.html index 4b32474bbe7..2ea07789ab3 100644 --- a/mod/data/field/picture/mod.html +++ b/mod/data/field/picture/mod.html @@ -16,27 +16,27 @@ - + - + - + - + diff --git a/mod/data/field/textarea/mod.html b/mod/data/field/textarea/mod.html index fb684245bfa..e75365abf9f 100644 --- a/mod/data/field/textarea/mod.html +++ b/mod/data/field/textarea/mod.html @@ -14,7 +14,7 @@ - field->param2)) { echo('"60"'); @@ -28,7 +28,7 @@ - field->param3)) { echo('"35"'); diff --git a/mod/data/styles.css b/mod/data/styles.css index b9636ac11d9..ba002fd8703 100644 --- a/mod/data/styles.css +++ b/mod/data/styles.css @@ -41,6 +41,12 @@ width:300px; height:150px; } +.path-mod-data-field input.textareafieldsize { + width:50px; +} +.path-mod-data-field input.picturefieldsize { + width:70px; +} /** UI Usability Hacks **/ #page-mod-data-export #notice span {padding:0 10px;} From 649ac85dec64bfa59fc422519b15fef2dc756deb Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 20 Aug 2012 17:24:34 +0800 Subject: [PATCH 4/4] MDL-31496 mod_data Replacing inline styles for CSS classes in templates and browse view --- mod/data/field/latlong/field.class.php | 9 +++++---- mod/data/styles.css | 7 ++++++- mod/data/templates.php | 14 +++++++------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/mod/data/field/latlong/field.class.php b/mod/data/field/latlong/field.class.php index a6f688961fb..e94169996bc 100644 --- a/mod/data/field/latlong/field.class.php +++ b/mod/data/field/latlong/field.class.php @@ -130,7 +130,6 @@ class data_field_latlong extends data_field_base { } else { $compasslong = sprintf('%01.4f', $long) . '°E'; } - $str = '
'; // Now let's create the jump-to-services link $servicesshown = explode(',', $this->field->param1); @@ -148,10 +147,11 @@ class data_field_latlong extends data_field_base { ); if(sizeof($servicesshown)==1 && $servicesshown[0]) { - $str .= " linkoutservices[$servicesshown[0]]) ."' title='$servicesshown[0]'>$compasslat, $compasslong"; } elseif (sizeof($servicesshown)>1) { + $str = ''; $str .= "$compasslat, $compasslong\n"; $str .= ""; $str .= ""; + $str .= '
'; } else { - $str.= "$compasslat, $compasslong"; + $str = "$compasslat, $compasslong"; } - $str.= ''; + return $str; } return false; diff --git a/mod/data/styles.css b/mod/data/styles.css index ba002fd8703..600c79d4d8b 100644 --- a/mod/data/styles.css +++ b/mod/data/styles.css @@ -13,7 +13,8 @@ #page-mod-data-view div.search_none { display: none; } -#page-mod-data-view div.search_inline { +#page-mod-data-view div.search_inline, +#page-mod-data-view form#latlongfieldbrowse { display: inline; } #page-mod-data-view div#data_adv_form { @@ -57,6 +58,10 @@ .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;} +#page-mod-data-templates td.save_template, +#page-mod-data-templates .template_heading { + text-align:center; +} .dir-rtl .mod-data-default-template .template-field {text-align:left;} .dir-rtl .mod-data-default-template .template-token {text-align:right;} diff --git a/mod/data/templates.php b/mod/data/templates.php index 4751732f8ec..c551e03a10c 100644 --- a/mod/data/templates.php +++ b/mod/data/templates.php @@ -141,7 +141,7 @@ if (($mytemplate = data_submitted()) && confirm_sesskey()) { } } } else { - echo '
'.get_string('header'.$mode,'data').'
'; + echo '
'.get_string('header'.$mode,'data').'
'; } /// If everything is empty then generate some defaults @@ -198,7 +198,7 @@ if ($mode == 'listtemplate'){ echo ''; echo ' '; echo ''; - echo '
'; + echo '
'; $field = 'listtemplateheader'; $editor->use_editor($field, $options); @@ -290,9 +290,9 @@ echo ''; echo ''; if ($mode == 'listtemplate'){ - echo '
'; + echo '
'; } else { - echo '
'; + echo '
'; } $field = 'template'; @@ -305,7 +305,7 @@ if ($mode == 'listtemplate'){ echo ''; echo ' '; echo ''; - echo '
'; + echo '
'; $field = 'listtemplatefooter'; $editor->use_editor($field, $options); @@ -316,7 +316,7 @@ if ($mode == 'listtemplate'){ echo ''; echo ' '; echo ''; - echo '
'; + echo '
'; $field = 'rsstitletemplate'; $editor->use_editor($field, $options); @@ -325,7 +325,7 @@ if ($mode == 'listtemplate'){ echo ''; } -echo ''; +echo ''; echo ' '; echo '';