* @version $Revision: 17580 $ */ class GalleryDynamicAlbum extends GalleryItem { /** * Type name info for this dynamic album * @var array * @access private */ var $_itemTypeName; /** * Initialize dynamic album * * @param string $title localized title * @param array $itemTypeNameData itemTypeName data, eg. array(Photo, photo), array(Foto, foto) */ function create($title, $itemTypeNameData=null) { global $gallery; $this->setId(null); $this->setParentId(null); $this->setPathComponent(null); $this->setEntityType($this->getClassName()); $this->setIsLinkable(false); $this->setLinkId(null); $this->setLinkedEntity(null); $this->setOnLoadHandlers(null); $this->setTitle($title); $this->setSummary(null); $this->setDescription(null); $this->setKeywords(null); $this->setCreationTimestamp(time()); $this->setOriginationTimestamp(time()); $this->setModificationTimestamp(time()); $this->setViewedSinceTimestamp(time()); $this->setCanContainChildren(true); $this->setOwnerId($gallery->getActiveUserId()); if (!empty($itemTypeNameData)) { $this->_itemTypeName = $itemTypeNameData; } else { $this->_itemTypeName = array(array('Dynamic Album', 'dynamic album')); list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'core'); if ($ret) { $this->_itemTypeName[] = $this->_itemTypeName[0]; } else { $this->_itemTypeName[] = array($module->translate('Dynamic Album'), $module->translate('dynamic album')); } } return null; } /** * @see GalleryEntity::itemTypeName */ function itemTypeName($localized = true) { return $this->_itemTypeName[$localized ? 1 : 0]; } /** * @see GalleryEntity::itemTypeName */ function getClassName() { return 'GalleryDynamicAlbum'; } /** * @see GalleryEntity::delete */ function delete() { return GalleryCoreApi::error(ERROR_UNSUPPORTED_OPERATION); } /** * @see GalleryItem::move */ function move($newParentId) { return GalleryCoreApi::error(ERROR_UNSUPPORTED_OPERATION); } /** * @see GalleryEntity::save */ function save($postEvent=true) { return GalleryCoreApi::error(ERROR_UNSUPPORTED_OPERATION); } /** * @see GalleryEntity::refresh */ function refresh() { return array(null, $this); } } ?>