]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19809 Upgraded calls to helpbutton, print_simple_box* and notify
authornicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:14:52 +0000 (05:14 +0000)
committernicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:14:52 +0000 (05:14 +0000)
mod/glossary/db/upgrade.php
mod/glossary/editcategories.html
mod/glossary/editcategories.php
mod/glossary/exportentry.php
mod/glossary/formats.php
mod/glossary/import.html
mod/glossary/import.php
mod/glossary/view.php

index 61f374549dc5e862c03b267ba7f95e8b52c90de2..0a3b5063f8540692dc3e89422f085d4ada96204c 100644 (file)
@@ -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;
index 0dd66b12bfd1bfa3b53be4498b6935c443f02d38..3698148c84ce0b0b1780d96a7964abc2d9a5e710 100644 (file)
@@ -27,7 +27,7 @@
        }
        ?>><?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>
index 3d17803e6913a5bb111bbc4359f410edd34090b7..6f8e56ffbbfeefc3a6d0c115d1b08847496b176f 100644 (file)
                 $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);
@@ -98,7 +98,7 @@
             } 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&amp;action=add&&amp;name=$name");
 
index ce9d2f90850289903c38603ffc6e514ab1dcb753..6b436340e4dd0ce757aec94578e2d5c1916805e0 100644 (file)
@@ -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;
         }
index f7557732a5bd297ef0fd36473c29a65488fa2e5d..18ab1747fd6c65b58aca2a1bd7c8052eaa5e3bbc 100644 (file)
@@ -47,7 +47,7 @@
 
     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");
index 0f450498c445d80f2bb5be762af536eb497939d7..8589153c3b17c49c3d7aeacb27ec762ed2e5d905 100644 (file)
@@ -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")); 
         ?>
     </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>
index b47454e3dced57bd9bd0f9c4ff2708346686b5aa..417ed1b9afabd60c32b6bc38c139853f548cea6a 100644 (file)
@@ -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();
 
                 // 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 {
index 318263ec57ecad304581387c42a3a0c3db988896..885ee6f350864133f68e7adf8448e5b0bfb19ce8 100644 (file)
         }
     }
     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");
     }