Example #1
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;
 }
 /**
  * Sorts datastructure alphabetically
  *
  * @param	tx_templavoila_template $obj1
  * @param	tx_templavoila_template $obj2
  * @return	int	Result of the comparison (see strcmp())
  * @see	usort()
  * @see	strcmp()
  */
 public function sortTemplates($obj1, $obj2)
 {
     return strcmp(strtolower($obj1->getSortingFieldValue()), strtolower($obj2->getSortingFieldValue()));
 }