Ansel_Gallery::setTags PHP Method

setTags() public method

Set/replace this gallery's tags.
public setTags ( array $tags, $replace = true )
$tags array An array of tag names to associate with this image.
    public function setTags(array $tags, $replace = true)
    {
        if ($this->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
            if ($replace) {
                $GLOBALS['injector']->getInstance('Ansel_Tagger')->replaceTags($this->id, $tags, $this->get('owner'), 'gallery');
            } else {
                $GLOBALS['injector']->getInstance('Ansel_Tagger')->tag($this->id, $tags, $this->get('owner'), 'gallery');
            }
        } else {
            throw new Horde_Exception_PermissionDenied(_("Access denied adding tags to this gallery."));
        }
    }