fixed an issue where when the user has no personal tags defined, he/she sees an empty line in tags page

This commit is contained in:
toyomoyo
2006-04-21 02:07:10 +00:00
parent a80722bc33
commit 1d27654a19
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -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>';
}
+1 -1
View File
@@ -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;
}