Skip to content
Browse files

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

…es and browse view
  • Loading branch information...
1 parent e8e8e49 commit a0e94952d0fb415a84116d867208ca952a61cea5 @dmonllao dmonllao committed
Showing with 18 additions and 12 deletions.
  1. +5 −4 mod/data/field/latlong/field.class.php
  2. +6 −1 mod/data/styles.css
  3. +7 −7 mod/data/templates.php
View
9 mod/data/field/latlong/field.class.php
@@ -130,7 +130,6 @@ function display_browse_field($recordid, $template) {
} else {
$compasslong = sprintf('%01.4f', $long) . '°E';
}
- $str = '<form style="display:inline;">';
// Now let's create the jump-to-services link
$servicesshown = explode(',', $this->field->param1);
@@ -148,10 +147,11 @@ function display_browse_field($recordid, $template) {
);
if(sizeof($servicesshown)==1 && $servicesshown[0]) {
- $str .= " <a href='"
+ $str = " <a href='"
. str_replace(array_keys($urlreplacements), array_values($urlreplacements), $this->linkoutservices[$servicesshown[0]])
."' title='$servicesshown[0]'>$compasslat, $compasslong</a>";
} elseif (sizeof($servicesshown)>1) {
+ $str = '<form id="latlongfieldbrowse">';
$str .= "$compasslat, $compasslong\n";
$str .= "<label class='accesshide' for='jumpto'>". get_string('jumpto') ."</label>";
$str .= "<select id='jumpto' name='jumpto'>";
@@ -164,10 +164,11 @@ function display_browse_field($recordid, $template) {
// NB! If you are editing this, make sure you don't break the javascript reference "previousSibling"
// which allows the "Go" button to refer to the drop-down selector.
$str .= "\n</select><input type='button' value='" . get_string('go') . "' onclick='if(previousSibling.value){self.location=previousSibling.value}'/>";
+ $str .= '</form>';
} else {
- $str.= "$compasslat, $compasslong";
+ $str = "$compasslat, $compasslong";
}
- $str.= '</form>';
+
return $str;
}
return false;
View
7 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;}
View
14 mod/data/templates.php
@@ -141,7 +141,7 @@
}
}
} else {
- echo '<div class="littleintro" style="text-align:center">'.get_string('header'.$mode,'data').'</div>';
+ echo '<div class="template_heading">'.get_string('header'.$mode,'data').'</div>';
}
/// If everything is empty then generate some defaults
@@ -198,7 +198,7 @@
echo '<tr>';
echo '<td>&nbsp;</td>';
echo '<td>';
- echo '<div style="text-align:center"><label for="edit-listtemplateheader">'.get_string('header','data').'</label></div>';
+ echo '<div class="template_heading"><label for="edit-listtemplateheader">'.get_string('header','data').'</label></div>';
$field = 'listtemplateheader';
$editor->use_editor($field, $options);
@@ -290,9 +290,9 @@
echo '<td valign="top">';
if ($mode == 'listtemplate'){
- echo '<div style="text-align:center"><label for="edit-template">'.get_string('multientry','data').'</label></div>';
+ echo '<div class="template_heading"><label for="edit-template">'.get_string('multientry','data').'</label></div>';
} else {
- echo '<div style="text-align:center"><label for="edit-template">'.get_string($mode,'data').'</label></div>';
+ echo '<div class="template_heading"><label for="edit-template">'.get_string($mode,'data').'</label></div>';
}
$field = 'template';
@@ -305,7 +305,7 @@
echo '<tr>';
echo '<td>&nbsp;</td>';
echo '<td>';
- echo '<div style="text-align:center"><label for="edit-listtemplatefooter">'.get_string('footer','data').'</label></div>';
+ echo '<div class="template_heading"><label for="edit-listtemplatefooter">'.get_string('footer','data').'</label></div>';
$field = 'listtemplatefooter';
$editor->use_editor($field, $options);
@@ -316,7 +316,7 @@
echo '<tr>';
echo '<td>&nbsp;</td>';
echo '<td>';
- echo '<div style="text-align:center"><label for="edit-rsstitletemplate">'.get_string('rsstitletemplate','data').'</label></div>';
+ echo '<div class="template_heading"><label for="edit-rsstitletemplate">'.get_string('rsstitletemplate','data').'</label></div>';
$field = 'rsstitletemplate';
$editor->use_editor($field, $options);
@@ -325,7 +325,7 @@
echo '</tr>';
}
-echo '<tr><td style="text-align:center" colspan="2">';
+echo '<tr><td class="save_template" colspan="2">';
echo '<input type="submit" value="'.get_string('savetemplate','data').'" />&nbsp;';
echo '</td></tr></table>';

0 comments on commit a0e9495

Please sign in to comment.
Something went wrong with that request. Please try again.