2 $otags = get_records_sql('SELECT * from '.$CFG->prefix
.'tags WHERE type=\'official\' ORDER by text ASC');
3 $ptags1 = get_records_sql('SELECT * from '.$CFG->prefix
.'tags WHERE type=\'personal\' AND userid = '.$USER->id
.' ORDER by text ASC');
4 $ptags2 = get_records_sql('SELECT * from '.$CFG->prefix
.'tags WHERE type=\'personal\' AND userid <> '.$USER->id
.' ORDER by text ASC');
6 print_heading(get_string('tagmanagement'));
11 <td width=
"50%" align=
"left"><label for=
"otags"><?php print_string('otags','blog');?></label></td>
12 <td width=
"50%" align=
"left"><label for=
"ptags"><?php print_string('ptags','blog');?></label></td>
17 <form action=
"tags.php" method=
"post">
18 <input type=
"hidden" name=
"sesskey" value=
"<?php echo sesskey(); ?>" />
20 if (has_capability('moodle/blog:manageofficialtags', $sitecontext)) {
22 <select name=
"tags[]" id=
"otags" multiple=
"multiple" size=
"8">
25 foreach ($otags as $otag) {
26 echo '<option value="'.$otag->id
.'">'.$otag->text
.'</option>';
31 <input type=
"hidden" name=
"action" value=
"delete" />
33 <input type=
"submit" value=
"<?php print_string('delete');?>" />
37 foreach ($otags as $otag) {
38 echo '<br />'.$otag->text
;
47 <form action=
"tags.php" method=
"post">
48 <input type=
"hidden" name=
"sesskey" value=
"<?php echo sesskey(); ?>" />
49 <select name
="tags[]" multiple
="multiple" id
="ptags" size
="8">
54 // Not sure if this sowring is needed anymore
55 if (!empty($ptags1)) { // user's own tag exists
56 if (!empty($ptags2)) { // user's own tags, and other users tags exist, we merge
57 $ptags = array_merge($ptags1, $ptags2);
58 } else { // user's own tags exist, no other personal tags, just use that
61 } else if (!empty($ptags2)) {
66 foreach ($ptags as $ptag) {
67 echo '<option value="'.$ptag->id
.'">'.$ptag->text
.'</option>';
72 <input type=
"hidden" name=
"action" value=
"delete" />
74 <input type=
"submit" value=
"<?php print_string('delete');?>" />
81 <?php
if (has_capability('moodle/blog:manageofficialtags', $sitecontext)) { ?>
82 <form action=
"tags.php" method=
"post">
83 <input type=
"hidden" name=
"sesskey" value=
"<?php echo sesskey(); ?>" />
84 <label
for="newotag"><?php
print_string('addotags','blog');?></label>:
<br/>
85 <input type=
"text" name=
"otag" id=
"newotag" />
86 <input type=
"submit" value=
"<?php print_string('add');?>" />
87 <input type
="hidden" name
="action" value
="addofficial" />
99 <a href=
"#" onclick=
"window.close()"><?php print_string('closewindow');?></a>