Merge branch 'MDL-31496_master' of git://github.com/dmonllao/moodle

This commit is contained in:
Sam Hemelryk 2012-09-03 12:20:38 +12:00
commit c367e7fe4e
11 changed files with 67 additions and 40 deletions

View File

@ -9,6 +9,6 @@
</tr>
<tr>
<td class="c0" valign="top"><label for="param1"><?php echo get_string('fieldoptions', 'data'); ?></label></td>
<td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
<td class="c1"><textarea class="optionstextarea" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
</tr>
</table>

View File

@ -130,7 +130,6 @@ class data_field_latlong extends data_field_base {
} 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 @@ class data_field_latlong extends data_field_base {
);
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 @@ class data_field_latlong extends data_field_base {
// 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 File

@ -9,6 +9,6 @@
</tr>
<tr>
<td class="c0" valign="top"><label for="param1"><?php echo get_string('fieldoptions', 'data'); ?></label></td>
<td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
<td class="c1"><textarea class="optionstextarea" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
</tr>
</table>

View File

@ -9,6 +9,6 @@
</tr>
<tr>
<td class="c0" valign="top"><label for="param1"><?php echo get_string('fieldoptions', 'data'); ?></label></td>
<td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
<td class="c1"><textarea class="optionstextarea" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
</tr>
</table>

View File

@ -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 = '<a href="view.php?d='.$this->field->dataid.'&amp;rid='.$recordid.'"><img src="'.$src.'" alt="'.s($alt).'" title="'.s($title).'" style="border:0px" /></a>';
$str = '<a href="view.php?d='.$this->field->dataid.'&amp;rid='.$recordid.'"><img src="'.$src.'" alt="'.s($alt).'" title="'.s($title).'" class="list_picture"/></a>';
} 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 = '<a href="'.$src.'"><img '.$width.$height.' src="'.$src.'" alt="'.s($alt).'" title="'.s($title).'" style="border:0px" /></a>';
$str = '<a href="'.$src.'"><img '.$width.$height.' src="'.$src.'" alt="'.s($alt).'" title="'.s($title).'" class="list_picture"/></a>';
}
return $str;

View File

@ -16,27 +16,27 @@
<td class="c0"><label for="param1">
<?php echo get_string('fieldwidthsingleview', 'data');?></label></td>
<td class="c1">
<input style="width:70px;" type="text" name="param1" id="param1" value="<?php if (!empty($this->field->param1)) p($this->field->param1); ?>" />
<input class="picturefieldsize" type="text" name="param1" id="param1" value="<?php if (!empty($this->field->param1)) p($this->field->param1); ?>" />
</td>
</tr>
<tr>
<td class="c0"><label for="param2">
<?php echo get_string('fieldheightsingleview', 'data');?></label></td>
<td class="c1">
<input style="width:70px;" type="text" name="param2" id="param2" value="<?php if (!empty($this->field->param2)) p($this->field->param2); ?>" />
<input class="picturefieldsize" type="text" name="param2" id="param2" value="<?php if (!empty($this->field->param2)) p($this->field->param2); ?>" />
</td>
</tr>
<tr>
<td class="c0"><label for="param4">
<?php echo get_string('fieldwidthlistview', 'data');?></label></td>
<td class="c1"><input style="width:70px;" type="text" name="param4" id="param4" value="<?php if (!empty($this->field->param4)) p($this->field->param4); ?>" />
<td class="c1"><input class="picturefieldsize" type="text" name="param4" id="param4" value="<?php if (!empty($this->field->param4)) p($this->field->param4); ?>" />
</td>
</tr>
<tr>
<td class="c0"><label for="param5">
<?php echo get_string('fieldheightlistview', 'data');?></label></td>
<td class="c1">
<input style="width:70px;" type="text" name="param5" id="param5" value="<?php if (!empty($this->field->param5)) p($this->field->param5); ?>" />
<input class="picturefieldsize" type="text" name="param5" id="param5" value="<?php if (!empty($this->field->param5)) p($this->field->param5); ?>" />
</td>
</tr>
<tr>

View File

@ -9,6 +9,6 @@
</tr>
<tr>
<td class="c0" valign="top"><label for="param1"><?php echo get_string('fieldoptions', 'data'); ?></label></td>
<td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
<td class="c1"><textarea class="optionstextarea" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
</tr>
</table>

View File

@ -14,7 +14,7 @@
<td class="c0"><label for="param2">
<?php echo get_string('fieldwidth', 'data'); ?></label></td>
<td class="c1">
<input style="width:50px;" type="text" name="param2" id="param2" value=
<input class="textareafieldsize" type="text" name="param2" id="param2" value=
<?php
if (empty($this->field->param2)) {
echo('"60"');
@ -28,7 +28,7 @@
<td class="c0"><label for="param3">
<?php echo get_string('fieldheight', 'data'); ?></label></td>
<td class="c1">
<input style="width:50px;" type="text" name="param3" id="param3" value=
<input class="textareafieldsize" type="text" name="param3" id="param3" value=
<?php
if (empty($this->field->param3)) {
echo('"35"');

View File

@ -244,7 +244,7 @@ class data_field_base { // Base class for Database Field Types (see field/*/
$str = '<div title="'.s($this->field->description).'">';
$str .= '<label class="accesshide" for="field_'.$this->field->id.'">'.$this->field->description.'</label>';
$str .= '<input style="width:300px;" type="text" name="field_'.$this->field->id.'" id="field_'.$this->field->id.'" value="'.s($content).'" />';
$str .= '<input class="basefieldinput" type="text" name="field_'.$this->field->id.'" id="field_'.$this->field->id.'" value="'.s($content).'" />';
$str .= '</div>';
return $str;
@ -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';
$regsearchclass = 'search_none';
$advancedsearchclass = 'search_inline';
} else {
$regsearchclass = 'search_inline';
$advancedsearchclass = 'search_none';
}
else {
echo 'inline';
}
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 File

@ -7,6 +7,24 @@
.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-view div.search_none {
display: none;
}
#page-mod-data-view div.search_inline,
#page-mod-data-view form#latlongfieldbrowse {
display: inline;
}
#page-mod-data-view div#data_adv_form {
margin-left:auto;
margin-right:auto;
}
#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 +38,16 @@
.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;
}
.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;}
@ -30,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 File

@ -141,7 +141,7 @@ if (($mytemplate = data_submitted()) && confirm_sesskey()) {
}
}
} 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 @@ if ($mode == 'listtemplate'){
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>';
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 @@ if ($mode == 'listtemplate'){
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 @@ if ($mode == 'listtemplate'){
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 @@ if ($mode == 'listtemplate'){
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>';