diff --git a/mod/data/edit.php b/mod/data/edit.php
index 39af5e2bc8f..4dcf608e573 100644
--- a/mod/data/edit.php
+++ b/mod/data/edit.php
@@ -352,12 +352,17 @@ foreach ($generalnotifications as $notification) {
}
echo $newtext;
-echo '
';
+echo '
';
if ($rid) {
- echo ' ';
+ echo ' ';
} else {
- if ((!$data->maxentries) || has_capability('mod/data:manageentries', $context) || (data_numentries($data) < ($data->maxentries - 1))) {
- echo ' ';
+ if ((!$data->maxentries) ||
+ has_capability('mod/data:manageentries', $context) ||
+ (data_numentries($data) < ($data->maxentries - 1))) {
+ echo ' ';
}
}
echo '
';
diff --git a/mod/data/export_form.php b/mod/data/export_form.php
index a5abd773015..1377e6c73a6 100644
--- a/mod/data/export_form.php
+++ b/mod/data/export_form.php
@@ -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, '
' . $field->field->name . '
', ' (' . $field->name() . ')', array('group'=>1));
- $mform->setDefault('field_'.$field->field->id, 1);
+ $html = '
' . $field->field->name . '
';
+ $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);
diff --git a/mod/data/field/checkbox/field.class.php b/mod/data/field/checkbox/field.class.php
index f1b46dbe24c..4a871c44843 100644
--- a/mod/data/field/checkbox/field.class.php
+++ b/mod/data/field/checkbox/field.class.php
@@ -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;
}
diff --git a/mod/data/field/file/field.class.php b/mod/data/field/file/field.class.php
index 522e11f52fe..363fe847c35 100644
--- a/mod/data/field/file/field.class.php
+++ b/mod/data/field/file/field.class.php
@@ -104,7 +104,8 @@ class data_field_file extends data_field_base {
function display_search_field($value = '') {
return '
' .
- '
';
+ '
';
}
function generate_sql($tablealias, $value) {
diff --git a/mod/data/field/latlong/field.class.php b/mod/data/field/latlong/field.class.php
index cbe567567bc..ce9fba78423 100644
--- a/mod/data/field/latlong/field.class.php
+++ b/mod/data/field/latlong/field.class.php
@@ -62,20 +62,27 @@ class data_field_latlong extends data_field_base {
$str = '
';
$str .= '
';
@@ -139,8 +141,9 @@ class data_field_picture extends data_field_base {
}
function display_search_field($value = '') {
- return '
' .
- '
';
+ return '
' .
+ '
';
}
function parse_search_field() {
diff --git a/mod/data/field/text/field.class.php b/mod/data/field/text/field.class.php
index fea218508dd..4c255953c3e 100644
--- a/mod/data/field/text/field.class.php
+++ b/mod/data/field/text/field.class.php
@@ -33,7 +33,9 @@ class data_field_text extends data_field_base {
protected static $priority = self::MAX_PRIORITY;
function display_search_field($value = '') {
- return '
' . '
';
+ return '
' .
+ '
field->id . '" value="' . s($value) . '" />';
}
function parse_search_field() {
diff --git a/mod/data/field/textarea/field.class.php b/mod/data/field/textarea/field.class.php
index ec9b6610fa7..0fbd34ca352 100644
--- a/mod/data/field/textarea/field.class.php
+++ b/mod/data/field/textarea/field.class.php
@@ -172,7 +172,8 @@ class data_field_textarea extends data_field_base {
function display_search_field($value = '') {
return '
' .
- '
';
+ '
';
}
function parse_search_field() {
diff --git a/mod/data/field/url/field.class.php b/mod/data/field/url/field.class.php
index fb32bdb888c..38b719474b3 100644
--- a/mod/data/field/url/field.class.php
+++ b/mod/data/field/url/field.class.php
@@ -87,11 +87,13 @@ class data_field_url extends data_field_base {
}
$str .= '
';
$str .= $label;
- $str .= '';
- $str .= ' | ';
- $str .= '
| '.get_string('text', 'data').': | ';
- $str .= 'field->id . '_0" id="' . $fieldid . '" value="' . s($url) . '" ' .
+ 'size="40" class="form-control d-inline"/>';
+ $str .= ' |
';
+ $str .= '
| ' . get_string('text', 'data') . ': | ';
+ $str .= ' |
';
$str .= '';
} else {
// Just the URL field
@@ -99,7 +101,8 @@ class data_field_url extends data_field_base {
$str .= '
repositories) > 0) {
- $str .= '
';
+ $str .= '
';
}
}
@@ -113,8 +116,9 @@ class data_field_url extends data_field_base {
}
function display_search_field($value = '') {
- return '
' .
- '
';
+ return '
' .
+ '
';
}
function parse_search_field() {
diff --git a/mod/data/lib.php b/mod/data/lib.php
index 0fc5b0f4a5d..2d859c30989 100644
--- a/mod/data/lib.php
+++ b/mod/data/lib.php
@@ -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 .= '
field->id . '" value="'.s($content).'" />';
+ $str .= '
field->id . '" value="' . s($content) . '" />';
$str .= '
';
return $str;
@@ -1663,7 +1664,7 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
echo '