// 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;
}
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;
$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;
}
?>><?php echo get_string("no") ?>
</option>
- </select> <?php helpbutton("linkcategory", get_string("linkcategory", "glossary"), "glossary") ?>
+ </select> <?php echo $OUTPUT->help_icon(moodle_help_icon::make("linkcategory", get_string("linkcategory", "glossary"), "glossary")) ?>
</td>
</tr>
<tr>
$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 "<div style=\"text-align:center\">" . get_string("categorydeleted","glossary") ."</div>";
echo "</center>";
- 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);
} else {
echo "<p style=\"text-align:center\">" . get_string("delete"). " " . get_string("category","glossary"). "</p>";
- print_simple_box_start("center","40%", "#FFBBBB");
+ echo $OUTPUT->box_start('generalbox boxaligncenter errorboxcontent boxwidthnarrow');
echo "<div class=\"boxaligncenter\"><b>".format_text($category->name, FORMAT_PLAIN)."</b><br/>";
$num_entries = $DB->count_records("glossary_entries_categories", array("categoryid"=>$category->id));
print_single_button("editcategories.php", $options, get_string("no") );
echo "</td></tr></table>";
echo "</div>";
- print_simple_box_end();
+ echo $OUTPUT->box_end();
}
}
if ( $dupcategory ) {
echo "<p style=\"text-align:center\">" . get_string("add"). " " . get_string("category","glossary");
- print_simple_box_start("center","40%", "#FFBBBB");
+ echo $OUTPUT->box_start('generalbox boxaligncenter errorboxcontent boxwidthnarrow');
echo "<div style=\"text-align:center\">" . get_string("duplicatedcategory","glossary") ."</div>";
- print_simple_box_end();
+ echo $OUTPUT->box_end();
redirect("editcategories.php?id=$cm->id&action=add&&name=$name");
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;
}
echo $OUTPUT->heading($strmodulename . ': ' . get_string("displayformats","glossary"));
- print_simple_box("<center>".get_string("configwarning", 'admin')."</center>", "center", "60%");
+ echo $OUTPUT->box(get_string("configwarning", 'admin'), "generalbox boxaligncenter boxwidthnormal");
echo "<br />";
$yes = get_string("yes");
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"));
?>
</b></td>
<td style="width:70%">
<td style="width:25%"><select size="1" name="dest">
<option selected="selected" value="current"><?php print_string("currentglossary","glossary") ?></option>
<option value="new"><?php print_string("newglossary","glossary") ?></option>
- </select> <?php helpbutton("destination", get_string("destination", "glossary"), "glossary") ?></td>
+ </select> <?php echo $OUTPUT->help_icon(moodle_help_icon::make("destination", get_string("destination", "glossary"), "glossary")) ?></td>
<td style="width:25%" align="right"><?php print_string("importcategories","glossary") ?>:</td>
- <td style="width:25%"><input type="checkbox" name="catsincl" value="1" alt="<?php print_string("importcategories","glossary") ?>" /> <?php helpbutton("importcategories", get_string("importcategories", "glossary"), "glossary") ?></td>
+ <td style="width:25%"><input type="checkbox" name="catsincl" value="1" alt="<?php print_string("importcategories","glossary") ?>" />
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make("importcategories", get_string("importcategories", "glossary"), "glossary")) ?>
+ </td>
</tr>
</table>
</td>
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();
// 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 '</center>';
glossary_print_tabbed_table_end();
echo $OUTPUT->footer();
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 '<p>';
}
} 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;
}
}
/// 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 {
}
}
if ( !$entriesshown ) {
- print_simple_box('<div style="text-align:center">' . get_string("noentries","glossary") . '</div>',"center","95%");
+ echo $OUTPUT->box(get_string("noentries","glossary"), "generalbox boxaligncenter boxwidthwide");
}