]> git.mjollnir.org Git - moodle.git/commitdiff
Now glossary "add entry" is a button instead of a tab. Part of MDL-8746
authorstronk7 <stronk7>
Mon, 19 Mar 2007 18:22:59 +0000 (18:22 +0000)
committerstronk7 <stronk7>
Mon, 19 Mar 2007 18:22:59 +0000 (18:22 +0000)
Merged from MOODLE_18_STABLE

mod/glossary/tabs.php
mod/glossary/view.php

index 23fb0473659202f5a6d28ce9df793a4e9d12ff4f..de601d6d4f562d1c4de2b187e895dcd5c7b716a0 100644 (file)
     $inactive = array();
     $activated = array();
 
-
-    if (has_capability('mod/glossary:write', $context)) {
-        $toolsrow[] = new tabobject(GLOSSARY_ADDENTRY_VIEW, 
-                                    $CFG->wwwroot.'/mod/glossary/edit.php?id='.$cm->id, 
-                                    get_string('addentry', 'glossary'));
-    }
     if (has_capability('mod/glossary:import', $context)) {
         $toolsrow[] = new tabobject(GLOSSARY_IMPORT_VIEW, 
                                     $CFG->wwwroot.'/mod/glossary/import.php?id='.$cm->id, 
index 01ace7c3d54afa43c548dc9b614e8aa68ab3ca1c..53836a51b7e4a8f2a54f400f8e0192d967a82309 100644 (file)
     }
 
 /// Search box
-
     echo '<form method="post" action="view.php">';
 
     echo '<table align="center" width="70%" border="0">';
     echo '</td></tr></table>';
 
     echo '</form>';
+
+    echo '<br />';
+
+/// Show the add entry button if allowed
+    if (has_capability('mod/glossary:write', $context)) {
+        echo '<div class="singlebutton glossaryaddentry">';
+        echo "<form id=\"newentryform\" method=\"get\" action=\"$CFG->wwwroot/mod/glossary/edit.php\">";
+        echo '<div>';
+        echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />";
+        echo '<input type="submit" value="';
+        print_string('addentry', 'glossary');
+        echo '" />';
+        echo '</div>';
+        echo '</form>';
+        echo "</div>\n";
+    }
+
     echo '<br />';
 
     include("tabs.php");