mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-56725 mod_data: coding style
Fixes from lines in the previous commit.
This commit is contained in:
parent
e85fda95c6
commit
398be7c897
@ -352,12 +352,17 @@ foreach ($generalnotifications as $notification) {
|
||||
}
|
||||
echo $newtext;
|
||||
|
||||
echo '<div class="mdl-align m-t-1"><input type="submit" class="btn btn-primary" name="saveandview" value="'.get_string('saveandview','data').'" />';
|
||||
echo '<div class="mdl-align m-t-1"><input type="submit" class="btn btn-primary" name="saveandview" ' .
|
||||
'value="' . get_string('saveandview', 'data') . '" />';
|
||||
if ($rid) {
|
||||
echo ' <input type="submit" class="btn btn-primary" name="cancel" value="'.get_string('cancel').'" onclick="javascript:history.go(-1)" />';
|
||||
echo ' <input type="submit" class="btn btn-primary" name="cancel" ' .
|
||||
'value="' . get_string('cancel') . '" onclick="javascript:history.go(-1)" />';
|
||||
} else {
|
||||
if ((!$data->maxentries) || has_capability('mod/data:manageentries', $context) || (data_numentries($data) < ($data->maxentries - 1))) {
|
||||
echo ' <input type="submit" class="btn btn-primary" name="saveandadd" value="' . get_string('saveandadd', 'data') . '" />';
|
||||
if ((!$data->maxentries) ||
|
||||
has_capability('mod/data:manageentries', $context) ||
|
||||
(data_numentries($data) < ($data->maxentries - 1))) {
|
||||
echo ' <input type="submit" class="btn btn-primary" name="saveandadd" ' .
|
||||
'value="' . get_string('saveandadd', 'data') . '" />';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
|
@ -41,7 +41,8 @@ class mod_data_export_form extends moodleform {
|
||||
unset($choices[$key]);
|
||||
}
|
||||
$typesarray = array();
|
||||
$typesarray[] = $mform->createElement('radio', 'exporttype', null, get_string('csvwithselecteddelimiter', 'data') . ' ', 'csv');
|
||||
$str = get_string('csvwithselecteddelimiter', 'data');
|
||||
$typesarray[] = $mform->createElement('radio', 'exporttype', null, $str . ' ', 'csv');
|
||||
$typesarray[] = $mform->createElement('select', 'delimiter_name', null, $choices);
|
||||
//temporarily commenting out Excel export option. See MDL-19864
|
||||
//$typesarray[] = $mform->createElement('radio', 'exporttype', null, get_string('excel', 'data'), 'xls');
|
||||
@ -59,12 +60,16 @@ class mod_data_export_form extends moodleform {
|
||||
$mform->addElement('header', 'notice', get_string('chooseexportfields', 'data'));
|
||||
foreach($this->_datafields as $field) {
|
||||
if($field->text_export_supported()) {
|
||||
$mform->addElement('advcheckbox', 'field_'.$field->field->id, '<div title="' . s($field->field->description) . '" class="d-inline-block">' . $field->field->name . '</div>', ' (' . $field->name() . ')', array('group'=>1));
|
||||
$mform->setDefault('field_'.$field->field->id, 1);
|
||||
$html = '<div title="' . s($field->field->description) . '" ' .
|
||||
'class="d-inline-block">' . $field->field->name . '</div>';
|
||||
$name = ' (' . $field->name() . ')';
|
||||
$mform->addElement('advcheckbox', 'field_' . $field->field->id, $html, $name, array('group' => 1));
|
||||
$mform->setDefault('field_' . $field->field->id, 1);
|
||||
} else {
|
||||
$a = new stdClass();
|
||||
$a->fieldtype = $field->name();
|
||||
$mform->addElement('static', 'unsupported'.$field->field->id, $field->field->name, get_string('unsupportedexport', 'data', $a));
|
||||
$str = get_string('unsupportedexport', 'data', $a);
|
||||
$mform->addElement('static', 'unsupported' . $field->field->id, $field->field->name, $str);
|
||||
}
|
||||
}
|
||||
$this->add_checkbox_controller(1, null, null, 1);
|
||||
|
@ -95,13 +95,13 @@ class data_field_checkbox extends data_field_base {
|
||||
|
||||
$str = '';
|
||||
$found = false;
|
||||
$marginclass = ['class' => 'm-r-1'];
|
||||
foreach (explode("\n",$this->field->param1) as $checkbox) {
|
||||
$checkbox = trim($checkbox);
|
||||
|
||||
if (in_array($checkbox, $content)) {
|
||||
$str .= html_writer::checkbox('f_'.$this->field->id.'[]', s($checkbox), true, $checkbox, array('class' => 'm-r-1'));
|
||||
$str .= html_writer::checkbox('f_'.$this->field->id.'[]', s($checkbox), true, $checkbox, $marginclass);
|
||||
} else {
|
||||
$str .= html_writer::checkbox('f_'.$this->field->id.'[]', s($checkbox), false, $checkbox, array('class' => 'm-r-1'));
|
||||
$str .= html_writer::checkbox('f_'.$this->field->id.'[]', s($checkbox), false, $checkbox, $marginclass);
|
||||
}
|
||||
$str .= html_writer::empty_tag('br');
|
||||
$found = true;
|
||||
@ -110,7 +110,8 @@ class data_field_checkbox extends data_field_base {
|
||||
return '';
|
||||
}
|
||||
|
||||
$str .= html_writer::checkbox('f_'.$this->field->id.'_allreq', null, $allrequired, get_string('selectedrequired', 'data'), array('class' => 'm-r-1'));
|
||||
$requiredstr = get_string('selectedrequired', 'data');
|
||||
$str .= html_writer::checkbox('f_'.$this->field->id.'_allreq', null, $allrequired, $requiredstr, $marginclass);
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,8 @@ class data_field_file extends data_field_base {
|
||||
|
||||
function display_search_field($value = '') {
|
||||
return '<label class="accesshide" for="f_' . $this->field->id . '">' . $this->field->name . '</label>' .
|
||||
'<input type="text" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" value="'.s($value).'" class="form-control" />';
|
||||
'<input type="text" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" ' .
|
||||
'value="'.s($value).'" class="form-control"/>';
|
||||
}
|
||||
|
||||
function generate_sql($tablealias, $value) {
|
||||
|
@ -62,20 +62,27 @@ class data_field_latlong extends data_field_base {
|
||||
$str = '<div title="'.s($this->field->description).'">';
|
||||
$str .= '<fieldset><legend><span class="accesshide">'.$this->field->name.'</span></legend>';
|
||||
$str .= '<table class="form-inline"><tr><td align="right">';
|
||||
$str .= '<label for="field_'.$this->field->id.'_0" class="mod-data-input form-control-static">' . get_string('latitude', 'data');
|
||||
$classes = 'mod-data-input form-control-static';
|
||||
$str .= '<label for="field_'.$this->field->id.'_0" class="' . $classes . '">' . get_string('latitude', 'data');
|
||||
if ($this->field->required) {
|
||||
$str .= html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
|
||||
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
|
||||
}
|
||||
$str .= '</label></td><td><input class="form-control m-x-1" type="text" name="field_'.$this->field->id.'_0" id="field_'.$this->field->id.'_0" value="';
|
||||
$classes = 'form-control m-x-1';
|
||||
$str .= '</label></td><td>';
|
||||
$str .= '<input class="' . $classes . '" type="text" name="field_'.$this->field->id.'_0" ';
|
||||
$str .= ' id="field_'.$this->field->id.'_0" value="';
|
||||
$str .= s($lat).'" size="10" />°N</td></tr>';
|
||||
$str .= '<tr><td align="right"><label for="field_'.$this->field->id.'_1" class="mod-data-input form-control-static">';
|
||||
$classes = 'mod-data-input form-control-static';
|
||||
$str .= '<tr><td align="right"><label for="field_'.$this->field->id.'_1" class="' . $classes . '">';
|
||||
$str .= get_string('longitude', 'data');
|
||||
if ($this->field->required) {
|
||||
$str .= html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
|
||||
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
|
||||
}
|
||||
$str .= '</label></td><td><input class="form-control m-x-1" type="text" name="field_'.$this->field->id.'_1" id="field_'.$this->field->id.'_1" value="';
|
||||
$classes = 'form-control m-x-1';
|
||||
$str .= '</label></td><td><input class="' . $classes . '" type="text" ';
|
||||
$str .= 'name="field_'.$this->field->id.'_1" id="field_'.$this->field->id.'_1" value="';
|
||||
$str .= s($long).'" size="10" />°E</td>';
|
||||
$str .= '</tr>';
|
||||
$str .= '</table>';
|
||||
@ -103,8 +110,10 @@ class data_field_latlong extends data_field_base {
|
||||
}
|
||||
$latlongsrs->close();
|
||||
|
||||
$return = html_writer::label(get_string('latlong', 'data'), 'menuf_'.$this->field->id, false, array('class' => 'accesshide'));
|
||||
$return .= html_writer::select($options, 'f_'.$this->field->id, $value, null, array('class' => 'custom-select'));
|
||||
$classes = array('class' => 'accesshide');
|
||||
$return = html_writer::label(get_string('latlong', 'data'), 'menuf_'.$this->field->id, false, $classes);
|
||||
$classes = array('class' => 'custom-select');
|
||||
$return .= html_writer::select($options, 'f_'.$this->field->id, $value, null, $classes);
|
||||
return $return;
|
||||
}
|
||||
|
||||
@ -185,7 +194,8 @@ 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' class='btn m-l-1 btn-secondary' value='" . get_string('go') . "' onclick='if(previousSibling.value){self.location=previousSibling.value}'/>";
|
||||
$str .= '\n</select><input type="button" class="btn m-l-1 btn-secondary" value="' . get_string('go');
|
||||
$str .= '" onclick="if(previousSibling.value){self.location=previousSibling.value}"/>';
|
||||
$str .= '</form>';
|
||||
} else {
|
||||
$str = "$compasslat, $compasslong";
|
||||
|
@ -140,7 +140,8 @@ class data_field_multimenu extends data_field_base {
|
||||
|
||||
$str .= '</select>';
|
||||
|
||||
$str .= html_writer::checkbox('f_'.$this->field->id.'_allreq', null, $allrequired, get_string('selectedrequired', 'data'), array('class' => 'm-r-1'));
|
||||
$str .= html_writer::checkbox('f_'.$this->field->id.'_allreq', null, $allrequired,
|
||||
get_string('selectedrequired', 'data'), array('class' => 'm-r-1'));
|
||||
|
||||
return $str;
|
||||
|
||||
|
@ -71,7 +71,8 @@ class data_field_number extends data_field_base {
|
||||
|
||||
function display_search_field($value = '') {
|
||||
return '<label class="accesshide" for="f_'.$this->field->id.'">' . get_string('fieldname', 'data') . '</label>' .
|
||||
'<input type="text" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" value="'.s($value).'" class="form-control d-inline"/>';
|
||||
'<input type="text" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" ' .
|
||||
'value="'.s($value).'" class="form-control d-inline"/>';
|
||||
}
|
||||
|
||||
function parse_search_field() {
|
||||
|
@ -109,9 +109,11 @@ class data_field_picture extends data_field_base {
|
||||
$str .= $output->render($fm);
|
||||
|
||||
$str .= '<div class="mdl-left">';
|
||||
$str .= '<input type="hidden" name="field_'.$this->field->id.'_file" value="'.s($itemid).'" />';
|
||||
$str .= '<label for="field_'.$this->field->id.'_alttext">'.get_string('alttext','data') .'</label> <input type="text" class="form-control" name="field_'
|
||||
.$this->field->id.'_alttext" id="field_'.$this->field->id.'_alttext" value="'.s($alttext).'" />';
|
||||
$str .= '<input type="hidden" name="field_' . $this->field->id . '_file" value="' . s($itemid) . '" />';
|
||||
$str .= '<label for="field_' . $this->field->id . '_alttext">' .
|
||||
get_string('alttext', 'data') .
|
||||
'</label> <input type="text" class="form-control" name="field_' .
|
||||
$this->field->id . '_alttext" id="field_' . $this->field->id . '_alttext" value="' . s($alttext) . '" />';
|
||||
$str .= '</div>';
|
||||
$str .= '</div>';
|
||||
|
||||
@ -139,8 +141,9 @@ class data_field_picture extends data_field_base {
|
||||
}
|
||||
|
||||
function display_search_field($value = '') {
|
||||
return '<label class="accesshide" for="f_'.$this->field->id.'">' . get_string('fieldname', 'data') . '</label>' .
|
||||
'<input type="text" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" value="'.s($value).'" class="form-control"/>';
|
||||
return '<label class="accesshide" for="f_' . $this->field->id . '">' . get_string('fieldname', 'data') . '</label>' .
|
||||
'<input type="text" size="16" id="f_' . $this->field->id . '" name="f_' . $this->field->id . '" ' .
|
||||
'value="' . s($value) . '" class="form-control"/>';
|
||||
}
|
||||
|
||||
function parse_search_field() {
|
||||
|
@ -33,7 +33,9 @@ class data_field_text extends data_field_base {
|
||||
protected static $priority = self::MAX_PRIORITY;
|
||||
|
||||
function display_search_field($value = '') {
|
||||
return '<label class="accesshide" for="f_' . $this->field->id . '">'. $this->field->name.'</label>' . '<input type="text" class="form-control" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" value="'.s($value).'" />';
|
||||
return '<label class="accesshide" for="f_' . $this->field->id . '">' . $this->field->name.'</label>' .
|
||||
'<input type="text" class="form-control" size="16" id="f_' . $this->field->id . '" ' .
|
||||
'name="f_' . $this->field->id . '" value="' . s($value) . '" />';
|
||||
}
|
||||
|
||||
function parse_search_field() {
|
||||
|
@ -172,7 +172,8 @@ class data_field_textarea extends data_field_base {
|
||||
|
||||
function display_search_field($value = '') {
|
||||
return '<label class="accesshide" for="f_' . $this->field->id . '">' . $this->field->name . '</label>' .
|
||||
'<input type="text" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" value="'.s($value).'" class="form-control"/>';
|
||||
'<input type="text" size="16" id="f_' . $this->field->id . '" name="f_' . $this->field->id . '" ' .
|
||||
'value="' . s($value) . '" class="form-control"/>';
|
||||
}
|
||||
|
||||
function parse_search_field() {
|
||||
|
@ -87,11 +87,13 @@ class data_field_url extends data_field_base {
|
||||
}
|
||||
$str .= '</td><td>';
|
||||
$str .= $label;
|
||||
$str .= '<input type="text" name="field_'.$this->field->id.'_0" id="'.$fieldid.'" value="'.s($url).'" size="40" class="form-control d-inline"/>';
|
||||
$str .= '<button class="btn btn-secondary m-l-1" id="filepicker-button-'.$options->client_id.'" style="display:none">'.$straddlink.'</button></td></tr>';
|
||||
$str .= '<tr><td align="right"><span class="mod-data-input">'.get_string('text', 'data').':</span></td><td>';
|
||||
$str .= '<input type="text" name="field_'.$this->field->id.'_1" id="field_'.$this->field->id.'_1" value="'.s($text).'"';
|
||||
$str .= ' size="40" class="form-control d-inline"/></td></tr>';
|
||||
$str .= '<input type="text" name="field_' . $this->field->id . '_0" id="' . $fieldid . '" value="' . s($url) . '" ' .
|
||||
'size="40" class="form-control d-inline"/>';
|
||||
$str .= '<button class="btn btn-secondary m-l-1" id="filepicker-button-' . $options->client_id . '" ' .
|
||||
'style="display:none">' . $straddlink . '</button></td></tr>';
|
||||
$str .= '<tr><td align="right"><span class="mod-data-input">' . get_string('text', 'data') . ':</span></td><td>';
|
||||
$str .= '<input type="text" name="field_' . $this->field->id . '_1" id="field_' . $this->field->id . '_1" ' .
|
||||
'value="' . s($text) . '" size="40" class="form-control d-inline"/></td></tr>';
|
||||
$str .= '</table>';
|
||||
} else {
|
||||
// Just the URL field
|
||||
@ -99,7 +101,8 @@ class data_field_url extends data_field_base {
|
||||
$str .= '<input type="text" name="field_'.$this->field->id.'_0" id="'.$fieldid.'" value="'.s($url).'"';
|
||||
$str .= ' size="40" class="mod-data-input form-control d-inline" />';
|
||||
if (count($options->repositories) > 0) {
|
||||
$str .= '<button id="filepicker-button-'.$options->client_id.'" class="visibleifjs btn btn-secondary m-l-1">'.$straddlink.'</button>';
|
||||
$str .= '<button id="filepicker-button-' . $options->client_id . '" class="visibleifjs btn btn-secondary m-l-1">' .
|
||||
$straddlink . '</button>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,8 +116,9 @@ class data_field_url extends data_field_base {
|
||||
}
|
||||
|
||||
function display_search_field($value = '') {
|
||||
return '<label class="accesshide" for="f_'.$this->field->id.'">' . get_string('fieldname', 'data') . '</label>' .
|
||||
'<input type="text" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" value="'.s($value).'" class="form-control d-inline"/>';
|
||||
return '<label class="accesshide" for="f_' . $this->field->id . '">' . get_string('fieldname', 'data') . '</label>' .
|
||||
'<input type="text" size="16" id="f_' . $this->field->id . '" '.
|
||||
' name="f_' . $this->field->id . '" value="' . s($value) . '" class="form-control d-inline"/>';
|
||||
}
|
||||
|
||||
function parse_search_field() {
|
||||
|
@ -308,8 +308,9 @@ class data_field_base { // Base class for Database Field Types (see field/*/
|
||||
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
|
||||
$str .= html_writer::div($image, 'inline-req');
|
||||
}
|
||||
$str .= '</label><input class="basefieldinput form-control d-inline mod-data-input" type="text" name="field_'.$this->field->id.'"';
|
||||
$str .= ' id="field_' . $this->field->id . '" value="'.s($content).'" />';
|
||||
$str .= '</label><input class="basefieldinput form-control d-inline mod-data-input" ' .
|
||||
'type="text" name="field_' . $this->field->id . '" ' .
|
||||
'id="field_' . $this->field->id . '" value="' . s($content) . '" />';
|
||||
$str .= '</div>';
|
||||
|
||||
return $str;
|
||||
@ -1663,7 +1664,7 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
|
||||
echo '<label for="pref_perpage">'.get_string('pagesize','data').'</label> ';
|
||||
$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', 'class' => 'custom-select'));
|
||||
echo html_writer::select($pagesizes, 'perpage', $perpage, false, array('id' => 'pref_perpage', 'class' => 'custom-select'));
|
||||
|
||||
if ($advanced) {
|
||||
$regsearchclass = 'search_none';
|
||||
@ -1673,7 +1674,8 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
|
||||
$advancedsearchclass = 'search_none';
|
||||
}
|
||||
echo '<div id="reg_search" class="' . $regsearchclass . ' form-inline" > ';
|
||||
echo '<label for="pref_search">'.get_string('search').'</label> <input type="text" class="form-control" size="16" name="search" id= "pref_search" value="'.s($search).'" /></div>';
|
||||
echo '<label for="pref_search">' . get_string('search') . '</label> <input type="text" ' .
|
||||
'class="form-control" size="16" name="search" id= "pref_search" value="' . s($search) . '" /></div>';
|
||||
echo ' <label for="pref_sortby">'.get_string('sortby').'</label> ';
|
||||
// foreach field, print the option
|
||||
echo '<select name="sort" id="pref_sortby" class="custom-select m-r-1">';
|
||||
@ -1729,8 +1731,10 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
|
||||
$PAGE->requires->js('/mod/data/data.js');
|
||||
echo ' <input type="hidden" name="advanced" value="0" />';
|
||||
echo ' <input type="hidden" name="filter" value="1" />';
|
||||
echo ' <input type="checkbox" id="advancedcheckbox" name="advanced" value="1" '.$checked.' onchange="showHideAdvSearch(this.checked);" class="m-x-1" /><label for="advancedcheckbox">'.get_string('advancedsearch', 'data').'</label>';
|
||||
echo ' <input type="submit" class="btn btn-secondary" value="'.get_string('savesettings','data').'" />';
|
||||
echo ' <input type="checkbox" id="advancedcheckbox" name="advanced" value="1" ' . $checked . ' ' .
|
||||
'onchange="showHideAdvSearch(this.checked);" class="m-x-1" />' .
|
||||
'<label for="advancedcheckbox">' . get_string('advancedsearch', 'data') . '</label>';
|
||||
echo ' <input type="submit" class="btn btn-secondary" value="' . get_string('savesettings', 'data') . '" />';
|
||||
|
||||
echo '<br />';
|
||||
echo '<div class="' . $advancedsearchclass . '" id="data_adv_form">';
|
||||
@ -1781,9 +1785,11 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
|
||||
$fn = !empty($search_array[DATA_FIRSTNAME]->data) ? $search_array[DATA_FIRSTNAME]->data : '';
|
||||
$ln = !empty($search_array[DATA_LASTNAME]->data) ? $search_array[DATA_LASTNAME]->data : '';
|
||||
$patterns[] = '/##firstname##/';
|
||||
$replacement[] = '<label class="accesshide" for="u_fn">'.get_string('authorfirstname', 'data').'</label><input type="text" class="form-control" size="16" id="u_fn" name="u_fn" value="'.s($fn).'" />';
|
||||
$replacement[] = '<label class="accesshide" for="u_fn">' . get_string('authorfirstname', 'data') . '</label>' .
|
||||
'<input type="text" class="form-control" size="16" id="u_fn" name="u_fn" value="' . s($fn) . '" />';
|
||||
$patterns[] = '/##lastname##/';
|
||||
$replacement[] = '<label class="accesshide" for="u_ln">'.get_string('authorlastname', 'data').'</label><input type="text" class="form-control" size="16" id="u_ln" name="u_ln" value="'.s($ln).'" />';
|
||||
$replacement[] = '<label class="accesshide" for="u_ln">' . get_string('authorlastname', 'data') . '</label>' .
|
||||
'<input type="text" class="form-control" size="16" id="u_ln" name="u_ln" value="' . s($ln) . '" />';
|
||||
|
||||
// actual replacement of the tags
|
||||
$newtext = preg_replace($patterns, $replacement, $data->asearchtemplate);
|
||||
@ -1795,7 +1801,10 @@ 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"><br/><input type="submit" class="btn btn-primary m-r-1" value="'.get_string('savesettings','data').'" /><input type="submit" class="btn btn-secondary" name="resetadv" value="'.get_string('resetsettings','data').'" /></td></tr>';
|
||||
echo '<tr><td colspan="4"><br/>' .
|
||||
'<input type="submit" class="btn btn-primary m-r-1" value="' . get_string('savesettings', 'data') . '" />' .
|
||||
'<input type="submit" class="btn btn-secondary" name="resetadv" value="' . get_string('resetsettings', 'data') . '" />' .
|
||||
'</td></tr>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
@ -40,7 +40,8 @@ class mod_data_renderer extends plugin_renderer_base {
|
||||
foreach ($newfields as $nid => $newfield) {
|
||||
$row = array();
|
||||
$row[0] = html_writer::tag('label', $newfield->name, array('for'=>'id_'.$newfield->name));
|
||||
$row[1] = html_writer::start_tag('select', array('name'=>'field_'.$nid, 'id'=>'id_'.$newfield->name, 'class' => 'custom-select'));
|
||||
$attrs = array('name' => 'field_' . $nid, 'id' => 'id_' . $newfield->name, 'class' => 'custom-select');
|
||||
$row[1] = html_writer::start_tag('select', $attrs);
|
||||
|
||||
$selected = false;
|
||||
foreach ($currentfields as $cid => $currentfield) {
|
||||
@ -71,10 +72,11 @@ class mod_data_renderer extends plugin_renderer_base {
|
||||
}
|
||||
|
||||
$html .= html_writer::start_tag('div', array('class'=>'overwritesettings'));
|
||||
$html .= html_writer::tag('label', get_string('overwritesettings', 'data'), array('for'=>'overwritesettings'));
|
||||
$html .= html_writer::empty_tag('input', array('type'=>'checkbox', 'name'=>'overwritesettings', 'id'=>'overwritesettings', 'class'=>'m-l-1'));
|
||||
$html .= html_writer::tag('label', get_string('overwritesettings', 'data'), array('for' => 'overwritesettings'));
|
||||
$attrs = array('type' => 'checkbox', 'name' => 'overwritesettings', 'id' => 'overwritesettings', 'class' => 'm-l-1');
|
||||
$html .= html_writer::empty_tag('input', $attrs);
|
||||
$html .= html_writer::end_tag('div');
|
||||
$html .= html_writer::empty_tag('input', array('type'=>'submit', 'class'=>'btn btn-primary', 'value'=>$strcontinue));
|
||||
$html .= html_writer::empty_tag('input', array('type' => 'submit', 'class' => 'btn btn-primary', 'value' => $strcontinue));
|
||||
|
||||
$html .= html_writer::end_tag('div');
|
||||
$html .= html_writer::end_tag('form');
|
||||
|
@ -300,7 +300,8 @@ if ($mode != 'csstemplate' and $mode != 'jstemplate') {
|
||||
|
||||
echo '</select>';
|
||||
echo '</div>';
|
||||
echo '<br /><br /><br /><br /><input type="submit" class="btn btn-secondary" name="defaultform" value="'.get_string('resettemplate','data').'" />';
|
||||
echo '<br /><br /><br /><br />';
|
||||
echo '<input type="submit" class="btn btn-secondary" name="defaultform" value="'.get_string('resettemplate', 'data').'" />';
|
||||
echo '<br /><br />';
|
||||
if ($usehtmleditor) {
|
||||
$switchlink = new moodle_url($PAGE->url, ['useeditor' => false]);
|
||||
@ -315,7 +316,8 @@ if ($mode != 'csstemplate' and $mode != 'jstemplate') {
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
echo '<br /><br /><br /><br /><input type="submit" class="btn btn-primary" name="defaultform" value="'.get_string('resettemplate','data').'" />';
|
||||
echo '<br /><br /><br /><br />';
|
||||
echo '<input type="submit" class="btn btn-primary" name="defaultform" value="' . get_string('resettemplate', 'data') . '" />';
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
@ -329,7 +331,10 @@ if ($mode == 'listtemplate'){
|
||||
$field = 'template';
|
||||
$editor->set_text($data->{$mode});
|
||||
$editor->use_editor($field, $options);
|
||||
echo '<div><textarea class="form-control" id="'.$field.'" name="'.$field.'" rows="15" cols="80">'.s($data->{$mode}).'</textarea></div>';
|
||||
echo '<div>';
|
||||
echo '<textarea class="form-control" id="' . $field . '" ' .
|
||||
'name="' . $field . '" rows="15" cols="80">' . s($data->{$mode}) . '</textarea>';
|
||||
echo '</div>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
@ -342,19 +347,27 @@ if ($mode == 'listtemplate'){
|
||||
$field = 'listtemplatefooter';
|
||||
$editor->set_text($data->listtemplatefooter);
|
||||
$editor->use_editor($field, $options);
|
||||
echo '<div><textarea id="'.$field.'" class="form-control" name="'.$field.'" rows="15" cols="80">'.s($data->listtemplatefooter).'</textarea></div>';
|
||||
echo '<div>';
|
||||
echo '<textarea id="' . $field . '" class="form-control" ' .
|
||||
'name="' . $field . '" rows="15" cols="80">' . s($data->listtemplatefooter) . '</textarea>';
|
||||
echo '</div>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
} else if ($mode == 'rsstemplate') {
|
||||
echo '<tr>';
|
||||
echo '<td> </td>';
|
||||
echo '<td>';
|
||||
echo '<div class="template_heading"><label for="edit-rsstitletemplate">'.get_string('rsstitletemplate','data').'</label></div>';
|
||||
echo '<div class="template_heading">';
|
||||
echo '<label for="edit-rsstitletemplate">' . get_string('rsstitletemplate', 'data') . '</label>';
|
||||
echo '</div>';
|
||||
|
||||
$field = 'rsstitletemplate';
|
||||
$editor->set_text($data->rsstitletemplate);
|
||||
$editor->use_editor($field, $options);
|
||||
echo '<div><textarea id="'.$field.'" name="'.$field.'" class="form-control" rows="15" cols="80">'.s($data->rsstitletemplate).'</textarea></div>';
|
||||
echo '<div>';
|
||||
echo '<textarea id="' . $field . '" name="' . $field . '" ' .
|
||||
'class="form-control" rows="15" cols="80">' . s($data->rsstitletemplate) . '</textarea>';
|
||||
echo '</div>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user