';
echo ''.get_string('uploadrecords', 'data').'';
diff --git a/mod/data/field.php b/mod/data/field.php
index 158be8dd3e1..c42e9d98945 100755
--- a/mod/data/field.php
+++ b/mod/data/field.php
@@ -241,8 +241,8 @@
data_print_header($course, $cm, $data,'fields');
if (!$DB->record_exists('data_fields', array('dataid'=>$data->id))) {
- notify(get_string('nofieldindatabase','data')); // nothing in database
- notify(get_string('pleaseaddsome','data', 'preset.php?id='.$cm->id)); // link to presets
+ echo $OUTPUT->notification(get_string('nofieldindatabase','data')); // nothing in database
+ echo $OUTPUT->notification(get_string('pleaseaddsome','data', 'preset.php?id='.$cm->id)); // link to presets
} else { //else print quiz style list of fields
@@ -281,7 +281,7 @@
echo '';
$popupurl = $CFG->wwwroot.'/mod/data/field.php?d='.$data->id.'&mode=new&sesskey='. sesskey();
echo $OUTPUT->select(html_select::make_popup_form($popupurl, 'newtype', $menufield, "fieldform"));
- helpbutton('fields', get_string('addafield','data'), 'data');
+ echo $OUTPUT->help_icon(moodle_help_icon::make('fields', get_string('addafield','data'), 'data'));
echo '
';
echo '
';
diff --git a/mod/data/field/picture/field.class.php b/mod/data/field/picture/field.class.php
index 6d9b3ac6498..f0ce2f5b9e8 100755
--- a/mod/data/field/picture/field.class.php
+++ b/mod/data/field/picture/field.class.php
@@ -136,7 +136,7 @@ class data_field_picture extends data_field_base {
}
function update_field() {
- global $DB;
+ global $DB, $OUTPUT;
// Get the old field data so that we can check whether the thumbnail dimensions have changed
$oldfield = $DB->get_record('data_fields', array('id'=>$this->field->id));
@@ -148,7 +148,7 @@ class data_field_picture extends data_field_base {
if ($contents = $DB->get_records('data_content', array('fieldid'=>$this->field->id))) {
$fs = get_file_storage();
if (count($contents) > 20) {
- notify(get_string('resizingimages', 'data'), 'notifysuccess');
+ echo $OUTPUT->notification(get_string('resizingimages', 'data'), 'notifysuccess');
echo "\n\n";
// To make sure that ob_flush() has the desired effect
ob_flush();
diff --git a/mod/data/field/textarea/field.class.php b/mod/data/field/textarea/field.class.php
index 573105ddb4d..6b401f47a58 100755
--- a/mod/data/field/textarea/field.class.php
+++ b/mod/data/field/textarea/field.class.php
@@ -43,7 +43,7 @@ class data_field_textarea extends data_field_base {
if (can_use_html_editor()) {
// Show a rich text html editor.
$str .= $this->gen_textarea(true, $text);
- $str .= helpbutton("richtext2", get_string("helprichtext"), 'moodle', true, true, '', true);
+ $str .= $OUTPUT->help_icon(moodle_help_icon::make("richtext2", get_string("helprichtext"), 'moodle', true));
$str .= '';
} else {
@@ -57,7 +57,7 @@ class data_field_textarea extends data_field_base {
$select->nothingvalue = '';
$str .= $OUTPUT->select($select);
- $str .= helpbutton('textformat', get_string('helpformatting'), 'moodle', true, false, '', true);
+ $str .= $OUTPUT->help_icon(moodle_help_icon::make('textformat', get_string('helpformatting'), 'moodle'));
}
$str .= '
';
return $str;
diff --git a/mod/data/import.php b/mod/data/import.php
index 311aa9c10ad..878d565a2d8 100755
--- a/mod/data/import.php
+++ b/mod/data/import.php
@@ -170,9 +170,9 @@
}
if ($recordsadded > 0) {
- notify($recordsadded. ' '. get_string('recordssaved', 'data'));
+ echo $OUTPUT->notification($recordsadded. ' '. get_string('recordssaved', 'data'));
} else {
- notify(get_string('recordsnotsaved', 'data'));
+ echo $OUTPUT->notification(get_string('recordsnotsaved', 'data'));
}
echo '';
diff --git a/mod/data/lib.php b/mod/data/lib.php
index aece792adec..6a674619bea 100755
--- a/mod/data/lib.php
+++ b/mod/data/lib.php
@@ -122,8 +122,9 @@ class data_field_base { // Base class for Database Field Types (see field/*/
* @return bool
*/
function define_default_field() {
+ global $OUTPUT;
if (empty($this->data->id)) {
- notify('Programmer error: dataid not defined in field class');
+ echo $OUTPUT->notification('Programmer error: dataid not defined in field class');
}
$this->field = new object;
$this->field->id = 0;
@@ -177,10 +178,10 @@ class data_field_base { // Base class for Database Field Types (see field/*/
* @return bool
*/
function insert_field() {
- global $DB;
+ global $DB, $OUTPUT;
if (empty($this->field)) {
- notify('Programmer error: Field has not been defined yet! See define_field()');
+ echo $OUTPUT->notification('Programmer error: Field has not been defined yet! See define_field()');
return false;
}
@@ -260,7 +261,7 @@ class data_field_base { // Base class for Database Field Types (see field/*/
if (empty($this->field)) { // No field has been defined yet, try and make one
$this->define_default_field();
}
- print_simple_box_start('center','80%');
+ echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
echo '';
- print_simple_box_end();
+ echo $OUTPUT->box_end();
}
/**
@@ -807,7 +808,7 @@ function data_add_record($data, $groupid=0){
* @return bool
*/
function data_tags_check($dataid, $template) {
- global $DB;
+ global $DB, $OUTPUT;
// first get all the possible tags
$fields = $DB->get_records('data_fields', array('dataid'=>$dataid));
@@ -817,7 +818,7 @@ function data_tags_check($dataid, $template) {
$pattern="/\[\[".$field->name."\]\]/i";
if (preg_match_all($pattern, $template, $dummy)>1){
$tagsok = false;
- notify ('[['.$field->name.']] - '.get_string('multipletags','data'));
+ echo $OUTPUT->notification('[['.$field->name.']] - '.get_string('multipletags','data'));
}
}
// else return true
@@ -855,7 +856,7 @@ function data_add_instance($data) {
* @return bool
*/
function data_update_instance($data) {
- global $DB;
+ global $DB, $OUTPUT;
$data->timemodified = time();
$data->id = $data->instance;
@@ -1825,7 +1826,7 @@ function data_convert_arrays_to_strings(&$fieldinput) {
* @return boolean data module was converted or not
*/
function data_convert_to_roles($data, $teacherroles=array(), $studentroles=array(), $cmid=NULL) {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
if (!isset($data->participants) && !isset($data->assesspublic)
&& !isset($data->groupmode)) {
@@ -1838,7 +1839,7 @@ function data_convert_to_roles($data, $teacherroles=array(), $studentroles=array
if (empty($cmid)) {
// We were not given the course_module id. Try to find it.
if (!$cm = get_coursemodule_from_instance('data', $data->id)) {
- notify('Could not get the course module for the data');
+ echo $OUTPUT->notification('Could not get the course module for the data');
return false;
} else {
$cmid = $cm->id;
@@ -2069,9 +2070,9 @@ function data_print_header($course, $cm, $data, $currenttab='') {
// Print any notices
if (!empty($displaynoticegood)) {
- notify($displaynoticegood, 'notifysuccess'); // good (usually green)
+ echo $OUTPUT->notification($displaynoticegood, 'notifysuccess'); // good (usually green)
} else if (!empty($displaynoticebad)) {
- notify($displaynoticebad); // bad (usuually red)
+ echo $OUTPUT->notification($displaynoticebad); // bad (usuually red)
}
}
@@ -2259,6 +2260,7 @@ class PresetImporter {
*
*/
function import_options() {
+ global $OUTPUT;
if (!confirm_sesskey()) {
print_error('invalidsesskey');
}
@@ -2282,7 +2284,7 @@ class PresetImporter {
if (!empty($currentfields) && !empty($newfields)) {
echo "