Esempio n. 1
0
 public function getAllowedActions($config)
 {
     $pid = $config['row']['pid'];
     $tsConfig = t3lib_befunc::getPagesTSconfig($pid);
     $flexConfig =& $tsConfig['options.']['cz_simple_cal_pi1.']['flexform.'];
     if (empty($flexConfig) || !isset($flexConfig['allowedActions.'])) {
         return;
     }
     $allowedActions = array();
     if (isset($flexConfig['allowedActions'])) {
         $enabled = array();
         foreach (t3lib_div::trimExplode(',', $flexConfig['allowedActions'], true) as $i) {
             $enabled[$i . '.'] = '';
         }
         $allowedActions = array_intersect_key($flexConfig['allowedActions.'], $enabled);
     } else {
         $allowedActions = $flexConfig['allowedActions.'];
     }
     foreach ($allowedActions as $name => $action) {
         $name = rtrim($name, '.');
         $label = $GLOBALS['LANG']->sL($action['label']);
         if (empty($label)) {
             $label = $name;
         }
         $config['items'][$name] = array($label, $name);
     }
 }
 /**
  * Returns the page TypoScript configuration.
  *
  * @return array The pageTS
  */
 protected function getPageTS()
 {
     if ($this->pageTS === null) {
         $id = $this->page;
         if ($id <= 0) {
             return array();
         }
         $rootline = array();
         foreach ($this->localRepository->getRootline($id) as $uid => $page) {
             array_unshift($rootline, $page);
         }
         $pageTS = t3lib_befunc::getPagesTSconfig($id, $rootline);
         $this->pageTS = $this->convertTypoScriptArrayToPlainArray($pageTS['tx_contentstage.']);
     }
     return $this->pageTS;
 }