Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

- fixing some issues of MDL-11048

  • Loading branch information...
commit ab86d9c772fb78572f428e57330191bfca5bbc09 1 parent f88b7a4
luizlaydner authored

Showing 1 changed file with 155 additions and 81 deletions. Show diff stats Hide diff stats

  1. +155 81 tag/lib.php
236 tag/lib.php
... ... @@ -1,7 +1,8 @@
1 1 <?php // $Id$
2 2
3   -require_once(dirname(__FILE__) . '/../config.php');
4   -
  3 +global $CFG;
  4 +require_once($CFG->libdir.'/textlib.class.php');
  5 +
5 6 define('DEFAULT_TAG_TABLE_FIELDS', 'id, tagtype, name, rawname, flag');
6 7 define('MAX_TAG_LENGTH',50);
7 8
@@ -19,7 +20,8 @@
19 20 */
20 21 function tag_create($tag_names_csv, $tag_type="default") {
21 22 global $USER;
22   -
  23 + $textlib = textlib_get_instance();
  24 +
23 25 $tags = explode(",", $tag_names_csv );
24 26
25 27 $tag_object = new StdClass;
@@ -53,7 +55,7 @@ function tag_create($tag_names_csv, $tag_type="default") {
53 55 }
54 56 }
55 57
56   - $norm_tag_names_csv = substr($norm_tag_names_csv,0,-1);
  58 + $norm_tag_names_csv = $textlib->substr($norm_tag_names_csv,0,-1);
57 59
58 60 return tags_id( $norm_tag_names_csv );
59 61
@@ -74,16 +76,18 @@ function tag_create($tag_names_csv, $tag_type="default") {
74 76
75 77 function tag_delete($tag_names_or_ids_csv) {
76 78
77   - //covert all ids to names
78   - $tag_names_csv = tag_name_from_string($tag_names_or_ids_csv);
79   - $tag_ids_csv = tag_id_from_string($tag_names_csv);
80   - //put apostrophes in names
81   - $tag_names_csv_with_apos = "'" . str_replace(',', "','", $tag_names_csv) . "'";
  79 + //covert all names to ids
  80 + $tag_ids_csv = tag_id_from_string($tag_names_or_ids_csv);
  81 +
  82 + //put apostrophes
82 83 $tag_ids_csv_with_apos = "'" . str_replace(',', "','", $tag_ids_csv) . "'";
83 84
84 85 // tag instances needs to be deleted as well
85   - delete_records_select('tag_instance',"tagid IN ($tag_ids_csv_with_apos)");
86   - return delete_records_select('tag',"name IN ($tag_names_csv_with_apos)");
  86 + // delete_records_select('tag_instance',"tagid IN ($tag_ids_csv_with_apos)");
  87 + // Luiz: (in near future) tag instances should be cascade deleted by RDMS referential integrity constraints, when moodle implements it
  88 + // For now, tag_instance orphans should be removed using tag_instance_table_cleanup()
  89 +
  90 + return delete_records_select('tag',"name IN ($tag_ids_csv_with_apos)");
87 91
88 92 }
89 93
@@ -481,8 +485,7 @@ function update_item_tags($item_type, $item_id, $tag_names_or_ids_csv, $tag_type
481 485 *
482 486 * @param string $item_type name of the table where the item is stored. Ex: 'user'
483 487 * @param string $item_id id of the item to be untagged
484   - * @param string $tag_names_or_ids_csv comma separated tag **normalized** names or ids of existing tags (optional,
485   - * if none is given, all tags of the item will be removed)
  488 + * @param string $tag_names_or_ids_csv comma separated tag **normalized** names or ids of existing tags (optional, if none is given, all tags of the item will be removed)
486 489 */
487 490
488 491 function untag_an_item($item_type, $item_id, $tag_names_or_ids_csv='') {
@@ -494,12 +497,12 @@ function untag_an_item($item_type, $item_id, $tag_names_or_ids_csv='') {
494 497 }
495 498 else {
496 499
497   - $tag_ids_csv = tag_id_from_string($norm_tag_names_or_ids_csv);
  500 + $tag_ids_csv = tag_id_from_string($tag_names_or_ids_csv);
498 501
499 502 $tag_ids_csv_with_apos = "'" . str_replace(',', "','", $tag_ids_csv ) . "'";
500 503
501 504 delete_records_select('tag_instance',
502   - "tagid IN ($tags_id_csv_with_apos) AND itemtype='$item_type' AND itemid='$item_id'");
  505 + "tagid IN ({$tag_ids_csv_with_apos}) AND itemtype='$item_type' AND itemid='$item_id'");
503 506 }
504 507
505 508 //update_tag_correlations($item_type, $item_id);
@@ -513,7 +516,7 @@ function untag_an_item($item_type, $item_id, $tag_names_or_ids_csv='') {
513 516 *
514 517 * @param string $item_type name of the table where the item is stored. Ex: 'user'
515 518 * @param string $item_id id of the item beeing queried
516   - * @param string $sort an order to sort the results in, a valid SQL ORDER BY parameter (default is 'ti.order ASC')
  519 + * @param string $sort an order to sort the results in, a valid SQL ORDER BY parameter (default is 'ti.ordering ASC')
517 520 * @param string $fields tag fields to be selected (optional, default is 'id, name, rawname, tagtype, flag')
518 521 * @param int $limitfrom return a subset of records, starting at this point (optional, required if $limitnum is set).
519 522 * @param int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
@@ -532,9 +535,9 @@ function get_item_tags($item_type, $item_id, $sort='ti.ordering ASC', $fields=DE
532 535 }
533 536
534 537 if ($tagtype) {
535   - $tagwhere = " AND tg.tagtype = '$tagtype' ";
  538 + $tagwhere = " AND tg.tagtype = '$tagtype' ";
536 539 } else {
537   - $tagwhere = '';
  540 + $tagwhere = '';
538 541 }
539 542
540 543 $query = "
@@ -837,7 +840,8 @@ function update_tag_correlations($item_type, $item_id) {
837 840 function cache_correlated_tags($tag_name_or_id, $min_correlation=0.25, $limitnum=10) {
838 841
839 842 global $CFG;
840   -
  843 + $textlib = textlib_get_instance();
  844 +
841 845 $tag_id = tag_id_from_string($tag_name_or_id);
842 846
843 847 // query that counts how many times any tag appears together in items
@@ -868,7 +872,7 @@ function cache_correlated_tags($tag_name_or_id, $min_correlation=0.25, $limitnum
868 872 $tags_id_csv_with_apos .= $correlation->tagid."','";
869 873 }
870 874 }
871   - $tags_id_csv_with_apos = substr($tags_id_csv_with_apos,0,-2);
  875 + $tags_id_csv_with_apos = $textlib->substr($tags_id_csv_with_apos,0,-2);
872 876
873 877
874 878 //saves correlation info in the caching table
@@ -965,8 +969,10 @@ function tag_instance_table_cleanup() {
965 969
966 970 function tag_normalize($tag_names_csv, $lowercase=true) {
967 971
  972 + $textlib = textlib_get_instance();
  973 +
968 974 $tags = explode(',', $tag_names_csv);
969   -
  975 +
970 976 if (sizeof($tags) > 1) {
971 977
972 978 foreach ($tags as $key => $tag) {
@@ -993,7 +999,7 @@ function tag_normalize($tag_names_csv, $lowercase=true) {
993 999 //removes excess white spaces
994 1000 $value = preg_replace('/\s\s+/', ' ', $value);
995 1001
996   - return substr($value,0,MAX_TAG_LENGTH);
  1002 + return $textlib->substr($value,0,MAX_TAG_LENGTH);
997 1003 }
998 1004
999 1005 }
@@ -1160,7 +1166,7 @@ function popular_tags_count($nr_of_tags=20, $tag_type = 'default') {
1160 1166 count
1161 1167 DESC
1162 1168 ";
1163   -
  1169 +
1164 1170 return get_records_sql($query,0,$nr_of_tags);
1165 1171
1166 1172
@@ -1183,42 +1189,53 @@ function tag_cron(){
1183 1189 * Prints a box that contains the management links of a tag
1184 1190 *
1185 1191 * @param $tag_object
  1192 + * @param $return if true return html string
1186 1193 */
1187 1194
1188   -function print_tag_management_box($tag_object) {
  1195 +function print_tag_management_box($tag_object, $return=false) {
1189 1196
1190 1197 global $USER, $CFG;
1191 1198
1192 1199 $tagname = tag_display_name($tag_object);
1193 1200
1194   - print_box_start('box','tag-management-box');
  1201 + $output = '';
  1202 +
  1203 + $output .= print_box_start('box','tag-management-box', true);
1195 1204
1196 1205 $systemcontext = get_context_instance(CONTEXT_SYSTEM);
1197 1206
1198 1207 $addtaglink = '';
1199 1208 if ( has_capability('moodle/tag:manage',$systemcontext) ) {
1200 1209 $manage_link = "<a href=\"{$CFG->wwwroot}/tag/manage.php\">" . get_string('managetags', 'tag') . "</a>" ;
1201   - echo $manage_link .' | ';
  1210 + $output .= $manage_link .' | ';
1202 1211 }
1203 1212
1204 1213 // if the user is not tagged with the $tag_object tag, a link "add blahblah to my interests" will appear
1205 1214 if( !is_item_tagged_with('user', $USER->id, $tag_object->id )) {
1206 1215 $addtaglink = '<a href="' . $CFG->wwwroot . '/user/tag.php?action=addinterest&amp;id='. $tag_object->id .'">';
1207 1216 $addtaglink .= get_string('addtagtomyinterests','tag',$tagname). '</a>';
1208   - echo $addtaglink .' | ';
  1217 + $output .= $addtaglink .' | ';
1209 1218 }
1210 1219
1211 1220 // only people with moodle/tag:edit capability may edit the tag description
1212 1221 if ( has_capability('moodle/tag:edit',$systemcontext) && is_item_tagged_with('user', $USER->id, $tag_object->id ) ) {
1213   - echo ' <a href="'. $CFG->wwwroot . '/tag/edit.php?id='.$tag_object->id .'">'.get_string('edittag', 'tag').'</a> | ';
  1222 + $output .= ' <a href="'. $CFG->wwwroot . '/tag/edit.php?id='.$tag_object->id .'">'.get_string('edittag', 'tag').'</a> | ';
1214 1223 }
1215 1224
1216 1225 // flag as inappropriate link
1217 1226 $flagtaglink = '<a href="' . $CFG->wwwroot . '/user/tag.php?action=flaginappropriate&amp;id='. $tag_object->id .'">';
1218 1227 $flagtaglink .= get_string('flagasinappropriate','tag',$tagname). '</a>';
1219   - echo $flagtaglink;
  1228 + $output .= $flagtaglink;
  1229 +
  1230 + $output .= print_box_end(true);
  1231 +
  1232 + if ($return) {
  1233 + return $output;
  1234 + }
  1235 + else {
  1236 + echo $output;
  1237 + }
1220 1238
1221   - print_box_end();
1222 1239
1223 1240 }
1224 1241
@@ -1226,32 +1243,42 @@ function print_tag_management_box($tag_object) {
1226 1243 * Prints a box with the description of a tag and its related tags
1227 1244 *
1228 1245 * @param unknown_type $tag_object
  1246 + * @param $return if true return html string
1229 1247 */
1230 1248
1231   -function print_tag_description_box($tag_object) {
  1249 +function print_tag_description_box($tag_object, $return=false) {
1232 1250
1233 1251 global $USER, $CFG;
1234 1252
1235 1253 $tagname = tag_display_name($tag_object);
1236   - $related_tags = related_tags($tag_object->id); //get_item_tags('tags',$tag_object->id);
  1254 + $related_tags = related_tags($tag_object->id);
1237 1255
  1256 + $output = '';
1238 1257
1239   - print_box_start('generalbox', 'tag-description');
  1258 + $output .= print_box_start('generalbox', 'tag-description',true);
1240 1259
1241 1260 if (!empty($tag_object->description)) {
1242 1261 $options = new object;
1243 1262 $options->para=false;
1244   - echo format_text($tag_object->description, $tag_object->descriptionformat, $options );
  1263 + $output .= format_text($tag_object->description, $tag_object->descriptionformat, $options );
1245 1264 }
1246 1265 else {
1247   - echo format_text(get_string('thistaghasnodesc','tag'));
  1266 + $output .= format_text(get_string('thistaghasnodesc','tag'));
1248 1267 }
1249 1268
1250 1269 if ($related_tags) {
1251   - echo '<br/><br/><b>'.get_string('relatedtags','tag').': </b>' . tag_links_csv($related_tags);
  1270 + $output .= '<br/><br/><b>'.get_string('relatedtags','tag').': </b>' . tag_links_csv($related_tags);
  1271 + }
  1272 +
  1273 + $output .= print_box_end(true);
  1274 +
  1275 + if ($return) {
  1276 + return $output;
  1277 + }
  1278 + else {
  1279 + echo $output;
1252 1280 }
1253 1281
1254   - print_box_end();
1255 1282 }
1256 1283
1257 1284 /**
@@ -1261,9 +1288,10 @@ function print_tag_description_box($tag_object) {
1261 1288 * @param int $users_per_row number of users per row to display
1262 1289 * @param int $limitfrom prints users starting at this point (optional, required if $limitnum is set).
1263 1290 * @param int $limitnum prints this many users (optional, required if $limitfrom is set).
  1291 + * @param $return if true return html string
1264 1292 */
1265 1293
1266   -function print_tagged_users_table($tag_object, $limitfrom='' , $limitnum='') {
  1294 +function print_tagged_users_table($tag_object, $limitfrom='' , $limitnum='', $return=false) {
1267 1295
1268 1296 //List of users with this tag
1269 1297 $userlist = array_values( get_items_tagged_with(
@@ -1274,29 +1302,44 @@ function print_tagged_users_table($tag_object, $limitfrom='' , $limitnum='') {
1274 1302 $limitfrom,
1275 1303 $limitnum) );
1276 1304
  1305 + $output = '';
  1306 +
1277 1307 //user table box
1278   - print_box_start('generalbox', 'tag-user-table');
  1308 + $output .= print_box_start('generalbox', 'tag-user-table', true);
1279 1309
1280   - print_user_list($userlist);
  1310 + $output .= print_user_list($userlist, true);
1281 1311
1282   - print_box_end();
  1312 + $output .= print_box_end(true);
1283 1313 //end table box
1284 1314
1285   -
  1315 + if ($return) {
  1316 + return $output;
  1317 + }
  1318 + else {
  1319 + echo $output;
  1320 + }
1286 1321
1287 1322 }
1288 1323
1289 1324 /**
1290 1325 * Prints a list of users
1291   - *
1292 1326 * @param array $userlist an array of user objects
  1327 + * @param $return if true return html string
1293 1328 */
1294   -function print_user_list($userlist) {
  1329 +function print_user_list($userlist, $return=false) {
  1330 +
  1331 + $output = '';
1295 1332
1296 1333 foreach ($userlist as $user){
1297   - print_user_box( $user );
  1334 + $output .= print_user_box( $user , true);
1298 1335 }
1299 1336
  1337 + if ($return) {
  1338 + return $output;
  1339 + }
  1340 + else {
  1341 + echo $output;
  1342 + }
1300 1343
1301 1344 }
1302 1345
@@ -1304,11 +1347,13 @@ function print_user_list($userlist) {
1304 1347 * Prints an individual user box
1305 1348 *
1306 1349 * @param $user user object (contains the following fields: id, firstname, lastname and picture)
  1350 + * @param $return if true return html string
1307 1351 */
1308   -function print_user_box($user) {
  1352 +function print_user_box($user, $return=false) {
1309 1353
1310 1354 global $CFG;
1311   -
  1355 + $textlib = textlib_get_instance();
  1356 +
1312 1357 $usercontext = get_context_instance(CONTEXT_USER, $user->id);
1313 1358
1314 1359 $profilelink = '';
@@ -1316,53 +1361,71 @@ function print_user_box($user) {
1316 1361 $profilelink = $CFG->wwwroot.'/user/view.php?id='.$user->id;
1317 1362 }
1318 1363
1319   - print_box_start('user-box', 'user'.$user->id);
  1364 + $output = '';
  1365 +
  1366 + $output .= print_box_start('user-box', 'user'.$user->id, true);
1320 1367
1321 1368 if (!empty($profilelink)) {
1322   - echo '<a href="'.$profilelink.'">';
  1369 + $output .= '<a href="'.$profilelink.'">';
1323 1370 }
1324 1371
1325 1372 //print user image
1326 1373 if ($user->picture) {
1327   - echo '<img alt="" class="user-image" src="'. $CFG->wwwroot .'/user/pix.php/'. $user->id .'/f1.jpg"'.'/>';
  1374 + $output .= '<img alt="" class="user-image" src="'. $CFG->wwwroot .'/user/pix.php/'. $user->id .'/f1.jpg"'.'/>';
1328 1375 } else {
1329   - echo '<img alt="" class="user-image" src="'. $CFG->wwwroot .'/pix/u/f1.png"'.'/>';
  1376 + $output .= '<img alt="" class="user-image" src="'. $CFG->wwwroot .'/pix/u/f1.png"'.'/>';
1330 1377 }
1331 1378
1332   - echo '<br />';
  1379 + $output .= '<br />';
1333 1380
1334 1381 if (!empty($profilelink)) {
1335   - echo '</a>';
  1382 + $output .= '</a>';
1336 1383 }
1337 1384
1338 1385 $fullname = fullname($user);
1339 1386 //truncate name if it's too big
1340   - if (strlen($fullname) > 26) $fullname = substr($fullname,0,26) . '...';
  1387 + if ($textlib->strlen($fullname) > 26) $fullname = $textlib->substr($fullname,0,26) . '...';
  1388 +
  1389 + $output .= '<strong>' . $fullname . '</strong>';
1341 1390
1342   - echo '<strong>' . $fullname . '</strong>';
  1391 + $output .= print_box_end(true);
1343 1392
1344   - print_box_end();
  1393 + if ($return) {
  1394 + return $output;
  1395 + }
  1396 + else {
  1397 + echo $output;
  1398 + }
1345 1399
1346 1400 }
1347 1401
1348 1402 /**
1349 1403 * Prints the tag search box
  1404 + * @param $return if true return html string
1350 1405 *
1351 1406 */
1352   -function print_tag_search_box($search='') {
  1407 +function print_tag_search_box($return=false) {
1353 1408
1354 1409 global $CFG;
1355 1410
1356   - print_box_start('','tag-search-box');
  1411 + $output = '';
  1412 + $output .= print_box_start('','tag-search-box', true);
1357 1413
1358   - echo '<form action="'.$CFG->wwwroot.'/tag/search.php" style="display:inline">';
1359   - echo '<div>';
1360   - echo '<input id="searchform_search" name="query" type="text" size="40" />';
1361   - echo '<button id="searchform_button" type="submit">'. get_string('search', 'tag') .'</button><br />';
1362   - echo '</div>';
1363   - echo '</form>';
  1414 + $output .= '<form action="'.$CFG->wwwroot.'/tag/search.php" style="display:inline">';
  1415 + $output .= '<div>';
  1416 + $output .= '<input id="searchform_search" name="query" type="text" size="40" />';
  1417 + $output .= '<button id="searchform_button" type="submit">'. get_string('search', 'tag') .'</button><br />';
  1418 + $output .= '</div>';
  1419 + $output .= '</form>';
1364 1420
1365   - print_box_end();
  1421 + $output .= print_box_end(true);
  1422 +
  1423 + if ($return) {
  1424 + return $output;
  1425 + }
  1426 + else {
  1427 + echo $output;
  1428 + }
1366 1429 }
1367 1430
1368 1431 /**
@@ -1371,8 +1434,9 @@ function print_tag_search_box($search='') {
1371 1434 * @param string $query text that tag names will be matched against
1372 1435 * @param int $page current page
1373 1436 * @param int $perpage nr of users displayed per page
  1437 + * @param $return if true return html string
1374 1438 */
1375   -function print_tag_search_results($query, $page, $perpage) {
  1439 +function print_tag_search_results($query, $page, $perpage, $return=false) {
1376 1440
1377 1441 global $CFG, $USER;
1378 1442
@@ -1381,6 +1445,8 @@ function print_tag_search_results($query, $page, $perpage) {
1381 1445
1382 1446 $baseurl = $CFG->wwwroot.'/tag/search.php?query=' . $query;
1383 1447
  1448 + $output = '';
  1449 +
1384 1450 // link "Add $query to my interests"
1385 1451 $addtaglink = '';
1386 1452 if( !is_item_tagged_with('user', $USER->id, $query )) {
@@ -1391,41 +1457,48 @@ function print_tag_search_results($query, $page, $perpage) {
1391 1457
1392 1458 if($tags) { // there are results to display!!
1393 1459
1394   - print_heading(get_string('searchresultsfor', 'tag', $query) . " : {$count}", '', 3);
  1460 + $output .= print_heading(get_string('searchresultsfor', 'tag', $query) . " : {$count}", '', 3, null,true);
1395 1461
1396 1462 //print a link "Add $query to my interests"
1397 1463 if (!empty($addtaglink)) {
1398   - print_box($addtaglink,'box','tag-management-box');
  1464 + $output .= print_box($addtaglink,'box','tag-management-box',true);
1399 1465 }
1400 1466
1401 1467 $nr_of_lis_per_ul = 6;
1402 1468 $nr_of_uls = ceil( sizeof($tags) / $nr_of_lis_per_ul);
1403 1469
1404   - echo '<ul id="tag-search-results">';
  1470 + $output .= '<ul id="tag-search-results">';
1405 1471 for($i = 0; $i < $nr_of_uls; $i++) {
1406   - echo '<li>';
  1472 + $output .= '<li>';
1407 1473 foreach (array_slice($tags, $i * $nr_of_lis_per_ul, $nr_of_lis_per_ul ) as $tag) {
1408 1474 $tag_link = ' <a href="'.$CFG->wwwroot.'/tag/index.php?id='.$tag->id.'">'.tag_display_name($tag).'</a>';
1409   - echo '&#8226;' . $tag_link . '<br/>';
  1475 + $output .= '&#8226;' . $tag_link . '<br/>';
1410 1476 }
1411   - echo '</li>';
  1477 + $output .= '</li>';
1412 1478 }
1413   - echo '</ul>';
1414   - echo '<div>&nbsp;</div>'; // <-- small layout hack in order to look good in Firefox
  1479 + $output .= '</ul>';
  1480 + $output .= '<div>&nbsp;</div>'; // <-- small layout hack in order to look good in Firefox
1415 1481
1416   - print_paging_bar($count, $page, $perpage, $baseurl.'&amp;', 'page');
  1482 + $output .= print_paging_bar($count, $page, $perpage, $baseurl.'&amp;', 'page', null, true);
1417 1483 }
1418 1484 else { //no results were found!!
1419 1485
1420   - print_heading(get_string('noresultsfor', 'tag', $query), '', 3);
  1486 + $output .= print_heading(get_string('noresultsfor', 'tag', $query), '', 3, null, true);
1421 1487
1422 1488 //print a link "Add $query to my interests"
1423 1489 if (!empty($addtaglink)) {
1424   - print_box($addtaglink,'box','tag-management-box');
  1490 + $output .= print_box($addtaglink,'box','tag-management-box', true);
1425 1491 }
1426 1492
1427 1493 }
1428 1494
  1495 + if ($return) {
  1496 + return $output;
  1497 + }
  1498 + else {
  1499 + echo $output;
  1500 + }
  1501 +
1429 1502
1430 1503 }
1431 1504
@@ -1436,6 +1509,7 @@ function print_tag_search_results($query, $page, $perpage) {
1436 1509 * @param boolean $shuffle wether or not to shuffle the array passed
1437 1510 * @param int $max_size maximum text size, in percentage
1438 1511 * @param int $min_size minimum text size, in percentage
  1512 + * @param $return if true return html string
1439 1513 */
1440 1514 function print_tag_cloud($tagcloud, $shuffle=true, $max_size=180, $min_size=80, $return=false) {
1441 1515
@@ -1450,7 +1524,7 @@ function print_tag_cloud($tagcloud, $shuffle=true, $max_size=180, $min_size=80,
1450 1524 } else {
1451 1525 ksort($tagcloud);
1452 1526 }
1453   -
  1527 +
1454 1528 $count = array();
1455 1529 foreach ($tagcloud as $key => $value){
1456 1530 if(!empty($value->count)) {
@@ -1582,7 +1656,7 @@ function print_tag_management_list($perpage='100') {
1582 1656 ";
1583 1657
1584 1658
1585   - $totalcount = count_records_sql("SELECT COUNT(DISTINCT(tg.id))
  1659 + $totalcount = count_records_sql("SELECT COUNT(DISTINCT(tg.id))
1586 1660 FROM {$CFG->prefix}tag tg LEFT JOIN {$CFG->prefix}user u ON u.id = tg.userid
1587 1661 $where");
1588 1662
@@ -1609,7 +1683,7 @@ function print_tag_management_list($perpage='100') {
1609 1683 $timemodified = format_time(time() - $tag->timemodified);
1610 1684 $checkbox = '<input type="checkbox" name="tagschecked[]" value="'.$tag->id.'" />';
1611 1685 $text = '<input type="text" name="newname['.$tag->id.']" />';
1612   -
  1686 +
1613 1687 // get all the possible tag types from db
1614 1688 $tagtypes = array();
1615 1689 if ($ptypes = get_records_sql("SELECT DISTINCT(tagtype), id FROM {$CFG->prefix}tag")) {
@@ -1620,7 +1694,7 @@ function print_tag_management_list($perpage='100') {
1620 1694 // default types
1621 1695 $tagtypes['default']='default';
1622 1696 $tagtypes['official']='official';
1623   -
  1697 +
1624 1698 $tagtype = choose_from_menu ($tagtypes, 'tagtypes['.$tag->id.']', $tag->tagtype, '', '', '0', true);
1625 1699
1626 1700 //if the tag if flagged, highlight it

0 comments on commit ab86d9c

Please sign in to comment.
Something went wrong with that request. Please try again.