コード例 #1
0
 /**
  * initialize the browsable trees
  *
  * @param	array		$TYPO3_CONF_VARS['EXTCONF']['dam']['selectionClasses']
  * @param	string		script name to link to
  * @param	boolean		Element browser mode
  * @return	void
  */
 function initSelectionClasses($selectionClassesArr, $thisScript, $mode = 'browse', $excludeReadOnlyMounts = false)
 {
     global $BE_USER, $LANG, $BACK_PATH, $TYPO3_CONF_VARS;
     $this->selectionClasses = $selectionClassesArr;
     // configuration - default
     $default_modeSelIcons = tx_dam::config_checkValueEnabled('setup.selections.default.modeSelIcons', true);
     if (is_array($this->selectionClasses)) {
         foreach ($this->selectionClasses as $classKey => $classRef) {
             // configuration - class
             if (!tx_dam::config_checkValueEnabled('setup.selections.' . $classKey, true)) {
                 continue;
             }
             $config = tx_dam::config_getValue('setup.selections.' . $classKey, true);
             if (is_object($obj =& t3lib_div::getUserObj($classRef))) {
                 if (!$obj->isPureSelectionClass) {
                     if ($obj->isTreeViewClass) {
                         // object is a treeview class itself
                         $this->treeObjArr[$classKey] = $obj;
                         $this->treeObjArr[$classKey]->init('', '', $excludeReadOnlyMounts);
                     } else {
                         // object does not include treeview functionality. Therefore the standard browsetree is used with setup from the object
                         $this->treeObjArr[$classKey] =& t3lib_div::makeInstance('tx_dam_browseTree');
                         $this->treeObjArr[$classKey]->init();
                         $this->treeObjArr[$classKey]->title = $obj->getTreeTitle();
                         $this->treeObjArr[$classKey]->treeName = $obj->getTreeName();
                         $this->treeObjArr[$classKey]->domIdPrefix = $obj->domIdPrefix ? $obj->domIdPrefix : $obj->getTreeName();
                         $this->treeObjArr[$classKey]->rootIcon = PATH_txdam_rel . 'i/cat2folder.gif';
                         $this->treeObjArr[$classKey]->iconName = tx_dam::file_basename($obj->getDefaultIcon());
                         $this->treeObjArr[$classKey]->iconPath = tx_dam::file_dirname($obj->getDefaultIcon());
                         // workaround: Only variables can be passed by reference
                         $this->treeObjArr[$classKey]->_data = $obj->getTreeArray();
                         $this->treeObjArr[$classKey]->setDataFromArray($this->treeObjArr[$classKey]->_data);
                     }
                     $this->treeObjArr[$classKey]->thisScript = $thisScript;
                     $this->treeObjArr[$classKey]->BE_USER = $BE_USER;
                     $this->treeObjArr[$classKey]->mode = $mode;
                     $this->treeObjArr[$classKey]->ext_IconMode = '1';
                     // no context menu on icons
                     if (!$default_modeSelIcons or !tx_dam::config_isEnabledOption($config, 'modeSelIcons', true)) {
                         $this->treeObjArr[$classKey]->modeSelIcons = false;
                     }
                 }
                 if ($this->treeObjArr[$classKey]->supportMounts) {
                     $mounts = $this->getMountsForTreeClass($classKey, $this->treeObjArr[$classKey]->getTreeName());
                     if (count($mounts)) {
                         $this->treeObjArr[$classKey]->setMounts($mounts);
                     } else {
                         unset($this->treeObjArr[$classKey]);
                     }
                 }
             }
         }
     }
 }