<?php
class TagService {
- var $db;
- var $tablename;
-
- function &getInstance(&$db) {
- static $instance;
- if (!isset($instance))
- $instance =& new TagService($db);
- return $instance;
- }
+ var $db;
+ var $tablename;
- function TagService(&$db) {
- $this->db =& $db;
- $this->tablename = $GLOBALS['tableprefix'] .'tags';
+ function &getInstance(&$db) {
+ static $instance;
+ if (!isset($instance)) {
+ $instance = new TagService($db);
}
+ return $instance;
+ }
- function isNotSystemTag($var) {
- if (utf8_substr($var, 0, 7) == 'system:')
- return false;
- else
- return true;
- }
+ function TagService(&$db) {
+ $this->db =& $db;
+ $this->tablename = $GLOBALS['tableprefix'] .'tags';
+ }
+
+ function isNotSystemTag($var) {
+ return !(utf8_substr($var, 0, 7) == 'system:');
+ }
function attachTags($bookmarkid, $tags, $fromApi = false, $extension = NULL, $replace = true, $fromImport = false) {
// Make sure that categories is an array of trimmed strings, and that if the categories are
for ($i = 0; $i < $tags_count; $i++) {
$tags[$i] = trim(strtolower($tags[$i]));
if ($fromApi) {
- include_once(dirname(__FILE__) .'/../functions.inc.php');
+ include_once dirname(__FILE__) .'/../functions.inc.php';
$tags[$i] = convertTag($tags[$i], 'in');
}
}
// Media and file types
if (!is_null($extension)) {
- include_once(dirname(__FILE__) .'/../functions.inc.php');
+ include_once dirname(__FILE__) .'/../functions.inc.php';
if ($keys = multi_array_search($extension, $GLOBALS['filetypes'])) {
$tags[] = 'system:filetype:'. $extension;
$tags[] = 'system:media:'. array_shift($keys);
}
if ($sortOrder == 'alphabet_asc') {
- usort($output, create_function('$a,$b','return strcasecmp(utf8_deaccent($a["tag"]), utf8_deaccent($b["tag"]));'));
+ usort($output, create_function('$a,$b','return strcmp(utf8_strtolower($a["tag"]), utf8_strtolower($b["tag"]));'));
}
return $output;
function getTableName() { return $this->tablename; }
function setTableName($value) { $this->tablename = $value; }
}
-?>
\ No newline at end of file