Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-31496 mod_data Replacing inline styles for CSS classes in search …

…containers
  • Loading branch information...
commit 0d284a8bd68cc55d9e367244af809729ef7c3a78 1 parent b859dc5
@dmonllao dmonllao authored
Showing with 20 additions and 16 deletions.
  1. +10 −16 mod/data/lib.php
  2. +10 −0 mod/data/styles.css
View
26 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 '<div id="reg_search" style="display: ';
+
if ($advanced) {
- echo 'none';
- }
- else {
- echo 'inline';
+ $regsearchclass = 'search_none';
+ $advancedsearchclass = 'search_inline';
+ } else {
+ $regsearchclass = 'search_inline';
+ $advancedsearchclass = 'search_none';
}
- echo ';" >&nbsp;&nbsp;&nbsp;<label for="pref_search">'.get_string('search').'</label> <input type="text" size="16" name="search" id= "pref_search" value="'.s($search).'" /></div>';
+ echo '<div id="reg_search" class="' . $regsearchclass . '" >&nbsp;&nbsp;&nbsp;';
+ echo '<label for="pref_search">'.get_string('search').'</label> <input type="text" size="16" name="search" id= "pref_search" value="'.s($search).'" /></div>';
echo '&nbsp;&nbsp;&nbsp;<label for="pref_sortby">'.get_string('sortby').'</label> ';
// foreach field, print the option
echo '<select name="sort" id="pref_sortby">';
@@ -1547,15 +1549,7 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
echo '&nbsp;<input type="submit" value="'.get_string('savesettings','data').'" />';
echo '<br />';
- echo '<div class="dataadvancedsearch" id="data_adv_form" style="display: ';
-
- if ($advanced) {
- echo 'inline';
- }
- else {
- echo 'none';
- }
- echo ';margin-left:auto;margin-right:auto;" >';
+ echo '<div class="' . $advancedsearchclass . '" id="data_adv_form">';
echo '<table class="boxaligncenter">';
// 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 '</td></tr>';
- echo '<tr><td colspan="4" style="text-align: center;"><br/><input type="submit" value="'.get_string('savesettings','data').'" /><input type="submit" name="resetadv" value="'.get_string('resetsettings','data').'" /></td></tr>';
+ echo '<tr><td colspan="4"><br/><input type="submit" value="'.get_string('savesettings','data').'" /><input type="submit" name="resetadv" value="'.get_string('resetsettings','data').'" /></td></tr>';
echo '</table>';
echo '</div>';
echo '</div>';
View
10 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;
Please sign in to comment.
Something went wrong with that request. Please try again.