From ee9e63b5a1bf83b53d604be2a15bf2cf8e39403f Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Tue, 18 Aug 2009 05:14:52 +0000 Subject: [PATCH] MDL-19809 Upgraded calls to helpbutton, print_simple_box* and notify --- mod/glossary/db/upgrade.php | 6 +++--- mod/glossary/editcategories.html | 2 +- mod/glossary/editcategories.php | 12 ++++++------ mod/glossary/exportentry.php | 6 +++--- mod/glossary/formats.php | 2 +- mod/glossary/import.html | 8 +++++--- mod/glossary/import.php | 12 ++++++------ mod/glossary/view.php | 2 +- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/mod/glossary/db/upgrade.php b/mod/glossary/db/upgrade.php index 61f374549d..0a3b5063f8 100644 --- a/mod/glossary/db/upgrade.php +++ b/mod/glossary/db/upgrade.php @@ -21,7 +21,7 @@ // before any action that may take longer time to finish. function xmldb_glossary_upgrade($oldversion) { - global $CFG, $DB; + global $CFG, $DB, $OUTPUT; $dbman = $DB->get_manager(); $result = true; @@ -64,7 +64,7 @@ function xmldb_glossary_upgrade($oldversion) { } if (!is_readable($filepath)) { //file missing?? - notify("File not readable, skipping: $filepath"); + echo $OUTPUT->notification("File not readable, skipping: $filepath"); $entry->attachment = ''; $DB->update_record('glossary_entries', $entry); continue; @@ -74,7 +74,7 @@ function xmldb_glossary_upgrade($oldversion) { $filearea = 'glossary_attachment'; $filename = clean_param($entry->attachment, PARAM_FILE); if ($filename === '') { - notify("Unsupported entry filename, skipping: ".$filepath); + echo $OUTPUT->notification("Unsupported entry filename, skipping: ".$filepath); $entry->attachment = ''; $DB->update_record('glossary_entries', $entry); continue; diff --git a/mod/glossary/editcategories.html b/mod/glossary/editcategories.html index 0dd66b12bf..3698148c84 100644 --- a/mod/glossary/editcategories.html +++ b/mod/glossary/editcategories.html @@ -27,7 +27,7 @@ } ?>> - + help_icon(moodle_help_icon::make("linkcategory", get_string("linkcategory", "glossary"), "glossary")) ?> diff --git a/mod/glossary/editcategories.php b/mod/glossary/editcategories.php index 3d17803e69..6f8e56ffbb 100644 --- a/mod/glossary/editcategories.php +++ b/mod/glossary/editcategories.php @@ -86,10 +86,10 @@ $DB->delete_records("glossary_entries_categories", array("categoryid"=>$hook)); $DB->delete_records("glossary_categories", array("id"=>$hook)); - print_simple_box_start("center","40%", "#FFBBBB"); + echo $OUTPUT->box_start('generalbox boxaligncenter errorboxcontent boxwidthnarrow'); echo "
" . get_string("categorydeleted","glossary") ."
"; echo ""; - print_simple_box_end(); + echo $OUTPUT->box_end(); echo $OUTPUT->footer(); add_to_log($course->id, "glossary", "delete category", "editcategories.php?id=$cm->id", $hook,$cm->id); @@ -98,7 +98,7 @@ } else { echo "

" . get_string("delete"). " " . get_string("category","glossary"). "

"; - print_simple_box_start("center","40%", "#FFBBBB"); + echo $OUTPUT->box_start('generalbox boxaligncenter errorboxcontent boxwidthnarrow'); echo "
".format_text($category->name, FORMAT_PLAIN)."
"; $num_entries = $DB->count_records("glossary_entries_categories", array("categoryid"=>$category->id)); @@ -132,7 +132,7 @@ print_single_button("editcategories.php", $options, get_string("no") ); echo ""; echo "
"; - print_simple_box_end(); + echo $OUTPUT->box_end(); } } @@ -143,9 +143,9 @@ if ( $dupcategory ) { echo "

" . get_string("add"). " " . get_string("category","glossary"); - print_simple_box_start("center","40%", "#FFBBBB"); + echo $OUTPUT->box_start('generalbox boxaligncenter errorboxcontent boxwidthnarrow'); echo "

" . get_string("duplicatedcategory","glossary") ."
"; - print_simple_box_end(); + echo $OUTPUT->box_end(); redirect("editcategories.php?id=$cm->id&action=add&&name=$name"); diff --git a/mod/glossary/exportentry.php b/mod/glossary/exportentry.php index ce9d2f9085..6b436340e4 100644 --- a/mod/glossary/exportentry.php +++ b/mod/glossary/exportentry.php @@ -63,9 +63,9 @@ if (!$mainglossary->allowduplicatedentries) { if ($DB->get_record('glossary_entries', array('glossaryid'=>$mainglossary->id, 'lower(concept)'=>moodle_strtolower($entry->concept)))) { print_header_simple(format_string($glossary->name), '', $navigation, '', '', true, '', navmenu($course, $cm)); - nootify(get_string('errconceptalreadyexists', 'glossary')); - print_continue($returnurl); - print_simple_box_end(); + echo $OUTPUT->notification(get_string('errconceptalreadyexists', 'glossary')); + echo $OUTPUT->continue_button($returnurl); + echo $OUTPUT->box_end(); echo $OUTPUT->footer(); die; } diff --git a/mod/glossary/formats.php b/mod/glossary/formats.php index f7557732a5..18ab1747fd 100644 --- a/mod/glossary/formats.php +++ b/mod/glossary/formats.php @@ -47,7 +47,7 @@ echo $OUTPUT->heading($strmodulename . ': ' . get_string("displayformats","glossary")); - print_simple_box("
".get_string("configwarning", 'admin')."
", "center", "60%"); + echo $OUTPUT->box(get_string("configwarning", 'admin'), "generalbox boxaligncenter boxwidthnormal"); echo "
"; $yes = get_string("yes"); diff --git a/mod/glossary/import.html b/mod/glossary/import.html index 0f450498c4..8589153c3b 100644 --- a/mod/glossary/import.html +++ b/mod/glossary/import.html @@ -6,7 +6,7 @@ echo '('; print_string("maxsize", "", display_size(get_max_upload_file_size($CFG->maxbytes, $course->maxbytes))); echo ') '; - helpbutton("filetoimport", get_string("filetoimport", "glossary"), "glossary"); + echo $OUTPUT->help_icon(moodle_help_icon::make("filetoimport", get_string("filetoimport", "glossary"), "glossary")); ?> @@ -24,9 +24,11 @@ + help_icon(moodle_help_icon::make("destination", get_string("destination", "glossary"), "glossary")) ?> : - " /> + " /> + help_icon(moodle_help_icon::make("importcategories", get_string("importcategories", "glossary"), "glossary")) ?> + diff --git a/mod/glossary/import.php b/mod/glossary/import.php index b47454e3dc..417ed1b9af 100644 --- a/mod/glossary/import.php +++ b/mod/glossary/import.php @@ -68,7 +68,7 @@ if (!$um->preprocess_files()) { echo $OUTPUT->box_start('glossarydisplay generalbox'); - print_continue('import.php?id='.$id); + echo $OUTPUT->continue_button('import.php?id='.$id); echo $OUTPUT->box_end(); echo $OUTPUT->footer(); @@ -131,7 +131,7 @@ // Include new glossary and return the new ID if ( !$glossary->id = glossary_add_instance($glossary) ) { - notify("Error while trying to create the new glossary."); + echo $OUTPUT->notification("Error while trying to create the new glossary."); echo ''; glossary_print_tabbed_table_end(); echo $OUTPUT->footer(); @@ -175,11 +175,11 @@ rebuild_course_cache($course->id); - print_simple_box(get_string("newglossarycreated","glossary"),"center","70%"); + echo $OUTPUT->box(get_string("newglossarycreated","glossary"),'generalbox boxaligncenter boxwidthnormal'); echo '

'; } } else { - notify("Error while trying to create the new glossary."); + echo $OUTPUT->notification("Error while trying to create the new glossary."); echo $OUTPUT->footer(); exit; } @@ -341,9 +341,9 @@ } /// Print continue button, based on results if ($importedentries) { - print_continue('view.php?id='.$id); + echo $OUTPUT->continue_button('view.php?id='.$id); } else { - print_continue('import.php?id='.$id); + echo $OUTPUT->continue_button('import.php?id='.$id); } echo $OUTPUT->box_end(); } else { diff --git a/mod/glossary/view.php b/mod/glossary/view.php index 318263ec57..885ee6f350 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -486,7 +486,7 @@ } } if ( !$entriesshown ) { - print_simple_box('

' . get_string("noentries","glossary") . '
',"center","95%"); + echo $OUTPUT->box(get_string("noentries","glossary"), "generalbox boxaligncenter boxwidthwide"); } -- 2.39.5