/**
  * Retrieve template objects which have a specific template as their parent
  *
  * @param tx_templavoila_datastructure
  * @param integer $pid
  * @return array
  */
 public function getTemplatesByParentTemplate(tx_templavoila_template $to, $storagePid = 0)
 {
     $toList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('tx_templavoila_tmplobj.uid', 'tx_templavoila_tmplobj', 'tx_templavoila_tmplobj.parent=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($to->getKey(), 'tx_templavoila_tmplobj') . (intval($storagePid) > 0 ? ' AND tx_templavoila_tmplobj.pid = ' . intval($storagePid) : ' AND pid!=-1') . t3lib_BEfunc::deleteClause('tx_templavoila_tmplobj') . t3lib_BEfunc::versioningPlaceholderClause('tx_templavoila_tmplobj'));
     $toCollection = array();
     foreach ($toList as $toRec) {
         $toCollection[] = $this->getTemplateByUid($toRec['uid']);
     }
     usort($toCollection, array($this, 'sortTemplates'));
     return $toCollection;
 }
Пример #2
0
 /**
  * Process the default-value settings
  *
  * @param tx_templavoila_template $toObj	LocalProcessing as array
  * @return string	additional URL arguments with configured default values
  */
 function getDsDefaultValues(tx_templavoila_template $toObj)
 {
     $dsStructure = $toObj->getLocalDataprotArray();
     $dsValues = '&defVals[tt_content][CType]=templavoila_pi1' . '&defVals[tt_content][tx_templavoila_ds]=' . $toObj->getDatastructure()->getKey() . '&defVals[tt_content][tx_templavoila_to]=' . $toObj->getKey();
     if (is_array($dsStructure) && is_array($dsStructure['meta']['default']['TCEForms'])) {
         foreach ($dsStructure['meta']['default']['TCEForms'] as $field => $value) {
             $dsValues .= '&defVals[tt_content][' . $field . ']=' . $value;
         }
     }
     return $dsValues;
 }