39 $this->_controller = $instance;
40 $this->_tbl_data = self::$_tbl_tag;
42 $this->_fields_label = array(
46 parent::__construct($id);
48 $this->_model_label = $this->
id ? $this->name :
'';
63 $rows = $db->select(array(
'id',
'name'), self::$_tbl_tag,
"instance='$instance'",
'name', null);
65 foreach($rows as $row) {
66 if(gOpt(
'jsescape', $options,
false)) {
67 $name = jsVar($row[
'name']);
70 $name = htmlChars($row[
'name']);
72 $res[$row[
'id']] = $name;
87 public static function saveTag($instance, $tag) {
91 if($tag ==
'')
return null;
93 $rows = $db->select(
'id', self::$_tbl_tag,
"instance='$instance' AND name='$tag'", null);
94 if(count($rows) and $rows) {
95 return $rows[0][
'id'];
98 $query =
"INSERT INTO ".self::$_tbl_tag.
" (instance, name) VALUES ('$instance', '$tag')";
99 $res = $db->actionquery($query);
100 return $db->getlastid(self::$_tbl_tag);