]> git.mjollnir.org Git - moodle.git/commitdiff
fixed an issue where when the user has no personal tags defined, he/she sees an empty...
authortoyomoyo <toyomoyo>
Fri, 21 Apr 2006 02:07:10 +0000 (02:07 +0000)
committertoyomoyo <toyomoyo>
Fri, 21 Apr 2006 02:07:10 +0000 (02:07 +0000)
blog/tags.html
blog/tags.php

index c664b83577073b25b966f098a511eabf32a98c77..a4c60cc186a5c4f559c56ce02f57ba162bdfe149 100755 (executable)
@@ -42,8 +42,14 @@ print_heading(get_string('tagmanagement'));
             <select name="tags[]" multiple="multiple" size="8">
             <?php
                 $ptags1 = get_records_sql('SELECT * from '.$CFG->prefix.'tags WHERE type=\'personal\' AND userid = '.$USER->id.' ORDER by text ASC');
-                $ptags2 = get_records_sql('SELECT * from '.$CFG->prefix.'tags WHERE type=\'personal\' AND userid <> '.$USER->id.' ORDER by text ASC');;
-                $ptags = array_merge($ptags1, $ptags2);
+                $ptags2 = get_records_sql('SELECT * from '.$CFG->prefix.'tags WHERE type=\'personal\' AND userid <> '.$USER->id.' ORDER by text ASC');
+                
+                if (!empty($ptags1)) {
+                    $ptags = array_merge($ptags1, $ptags2);
+                } else {
+                    $ptags = $ptags2;
+                }
+
                 foreach ($ptags as $ptag) {
                     echo '<option value="'.$ptag->id.'">'.$ptag->text.'</option>';
                 }
index 7d5593939425724abe3d36b1c5d114f44313e52b..1d909ea0f51ae8ca0476a082c8ad2e10fec45cd8 100755 (executable)
@@ -71,7 +71,7 @@ switch ($mode) {
 
                 // you can only delete your own tags, or you have to be an admin
                 if (!isadmin() and $USER->id != $blogtag->userid) {
-                    notify('no right to delete');
+                    notify(get_string('norighttodeletetag','blog', $blogtag->text));
                     continue;
                 }