/** * Renders link for an album * * @param Tx_Yag_Domain_Model_Album $album Album object to render link for * @param Tx_Yag_Domain_Model_Gallery $gallery Gallery object to render link for * @param integer $pageUid * @param integer $pageType type of the target page. See typolink.parameter * @param integer $pageType type of the target page. See typolink.parameter * @param boolean $noCache set this to disable caching for the target page. You should not need this. * @param boolean $noCacheHash set this to supress the cHash query parameter created by TypoLink. You should not need this. * @param string $section the anchor to be added to the URI * @param string $format The requested format, e.g. ".html" * @return string Rendered link for album * @throws Exception */ public function render(Tx_Yag_Domain_Model_Album $album = null, Tx_Yag_Domain_Model_Gallery $gallery = null, $pageUid = null, $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $format = '') { // TODO implement gallery download if ($album instanceof Tx_Yag_Domain_Model_Album) { $namespace = Tx_Yag_Domain_Context_YagContextFactory::getInstance()->getObjectNamespace() . '.albumUid'; $arguments = Tx_PtExtbase_Utility_NameSpace::saveDataInNamespaceTree($namespace, array(), $album->getUid()); } Tx_PtExtbase_State_Session_SessionPersistenceManagerFactory::getInstance()->addSessionRelatedArguments($arguments); return parent::render('downloadAsZip', $arguments, 'ItemList', null, null, $pageUid, $pageType, $noCache, $noCacheHash, $section, $format); }
/** * Renders the link to an image * * @param array $arguments Arguments * @param integer $pageUid target page. See TypoLink destination * @param integer $pageType type of the target page. See typolink.parameter * @param boolean $noCache set this to disable caching for the target page. You should not need this. * @param boolean $noCacheHash set this to supress the cHash query parameter created by TypoLink. You should not need this. * @param string $section the anchor to be added to the URI * @param string $format The requested format, e.g. ".html" * @param boolean $linkAccessRestrictedPages If set, links pointing to access restricted pages will still link to the page even though the page cannot be accessed. * @param array $additionalParams additional query parameters that won't be prefixed like $arguments (overrule $arguments) * @param boolean $absolute If set, the URI of the rendered link is absolute * @param boolean $addQueryString If set, the current query parameters will be kept in the URI * @param array $argumentsToBeExcludedFromQueryString arguments to be removed from the URI. Only active if $addQueryString = TRUE * @return string Rendered link */ public function render($pageUid = null, $pageType = 0, array $arguments = array(), $noCache = false, $noCacheHash = false, $section = '', $format = '', $linkAccessRestrictedPages = false, array $additionalParams = array(), $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = array()) { $objectNameSpace = $namespace = Tx_Yag_Domain_Context_YagContextFactory::getInstance()->getObjectNamespace(); $arguments = array(); if (isset($this->arguments['album'])) { $albumUid = $this->arguments['album']->getUid(); $arguments = Tx_PtExtbase_Utility_NameSpace::saveDataInNamespaceTree($objectNameSpace . '.albumUid', $arguments, $albumUid); } if (isset($this->arguments['gallery'])) { $galleryUid = $this->arguments['gallery']->getUid(); $arguments = Tx_PtExtbase_Utility_NameSpace::saveDataInNamespaceTree($objectNameSpace . '.galleryUid', $arguments, $galleryUid); } Tx_PtExtbase_State_Session_SessionPersistenceManagerFactory::getInstance()->addSessionRelatedArguments($arguments); return parent::render('show', $arguments, 'Item', null, null, $pageUid, $pageType, $noCache, $noCacheHash, $section, $format, $linkAccessRestrictedPages, $additionalParams, $absolute, $addQueryString, $argumentsToBeExcludedFromQueryString); }
/** * This is only used during refactoring. As session persistence manager is created * via Tx_PtExtbase_State_Session_SessionPersistenceManagerBuilder::getInstance() in some * places, we have to set singleton instance of this object here to make sure, that no second * instance is created, once builder created one. * * TODO remove this, once refactoring is finished! * * @static * @param Tx_PtExtbase_State_Session_SessionPersistenceManager $sessionPersistenceManager */ public static function setInstance(Tx_PtExtbase_State_Session_SessionPersistenceManager $sessionPersistenceManager) { self::$instance = $sessionPersistenceManager; }
/** @test */ public function getInstanceReturnsInstanceOfSessionPersistenceManager() { $firstInstance = Tx_PtExtbase_State_Session_SessionPersistenceManagerFactory::getInstance(); $this->assertTrue(is_a($firstInstance, Tx_PtExtbase_State_Session_SessionPersistenceManager)); }