$this->addVariable(_("Name"), 'name', 'text', true);
$this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
- $this->addVariable(_("Tags"), 'tags', 'text', false);
$this->setButtons(array(_("Create")));
}
}
$calendar->set('name', $this->_vars->get('name'));
$calendar->set('desc', $this->_vars->get('description'));
- $tagger = new Kronolith_Tagger();
- $tagger->tag($calendar->getName(), explode(',', $this->_vars->get('tags')), 'calendar');
return $GLOBALS['kronolith_shares']->addShare($calendar);
}
$this->addHidden('', 'c', 'text', true);
$this->addVariable(_("Name"), 'name', 'text', true);
$this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
- $this->addVariable(_("Tags"), 'tags', 'text', false);
$this->setButtons(array(_("Save")));
}
$new_name = $this->_vars->get('name');
$this->_calendar->set('name', $new_name);
$this->_calendar->set('desc', $this->_vars->get('description'));
- $tagger = new Kronolith_Tagger();
- $tagger->tag($this->_calendar->getName(), explode(',', $this->_vars->get('tags')), 'calendar');
if ($original_name != $new_name) {
$result = $GLOBALS['kronolith_driver']->rename($original_name, $new_name);
if (is_a($result, 'PEAR_Error')) {
}
/**
- * Retrieve the tags on a given object(s)
+ * Retrieve the tags on given object(s).
+ *
+ * @param string $localId The identifier of the kronolith object.
+ * @param string $type The type of object $localId represents.
+ *
+ * @return a tag_id => tag_name hash.
*/
public function getTags($localId, $type = 'event')
{
return $tags;
}
+ /**
+ * Remove a tag from a kronolith object. Removes *all* tags - regardless of
+ * the user that added the tag.
+ *
+ * @param string $localId The kronolith object identifier.
+ * @param mixed $tag Either a tag_id, tag_name or an array of
+ * ids or names to remove.
+ * @param string $content_type The type of object that $localId represents.
+ *
+ * @return void
+ */
public function untag($localId, $tag, $content_type = 'event')
{
- self::$_tagger->removeTagFromObject(array('object' => $localId, 'type' => $content_type), $tag);
+ self::$_tagger->removeTagFromObject(
+ array('object' => $localId, 'type' => $content_type),
+ $tag);
}
/**
- * tag search - return all types of content we care about tagged with
- * the passed in tags
- *
+ * @TODO
* @param array $tags An array of tag ids.
*/
public function search($tags, $content_type = null)
{
- $this->getObjects(array('tagId' => $tags, ''));
+ //TODO
}
}