Index: class.tx_dam_db.php =================================================================== --- class.tx_dam_db.php (Revision 36174) +++ class.tx_dam_db.php (Arbeitskopie) @@ -102,6 +102,9 @@ */ class tx_dam_db { + // @author Thomas Maroschik + protected static $pid=0; + /*************************************** * * DAM record access @@ -1173,6 +1176,8 @@ * Returns a single pid of a DAM folder. * This pid have to be used for storage of DAM records. * + * @author Modified by Thomas Maroschik + * * For fetching data getPidList() have to be used. * * @return integer Current/default DAM folder pid for storage. @@ -1180,26 +1185,39 @@ function getPid () { global $TYPO3_CONF_VARS; - static $pid = 0; - - if(!$pid AND is_object($GLOBALS['TSFE'])) { + if(!self::$pid AND is_object($GLOBALS['TSFE'])) { // get pid from TS // // plugin.tx_dam.defaults { // // The pid of the media folder. Needs to be set when multiple media folders exist // pid = - $pid = intval(tx_dam::config_getValue('plugin.defaults.pid')); # $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dam.']['defaults.']['pid']); + self::$pid = intval(tx_dam::config_getValue('plugin.defaults.pid')); # $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dam.']['defaults.']['pid']); } - if(!$pid) { + if(!self::$pid) { require_once(PATH_txdam.'lib/class.tx_dam_sysfolder.php'); - $pid = tx_dam_sysfolder::init(); + self::$pid = tx_dam_sysfolder::init(); } - return $pid; + return self::$pid; } + /** + * Sets the internal Pid property + * This pid have to be used for storage of DAM records. + * + * @author Thomas Maroschik + * + * @param int Pid to set + * @return void + */ + function setPid($pid) { + $pid = intval($pid); + if($pid) { + self::$pid = $pid; + } + }