/** * @param Tx_PtExtlist_Domain_Model_List_Header_HeaderColumn $headerColumn * @return string */ public function renderColumnLabel(Tx_PtExtlist_Domain_Model_List_Header_HeaderColumn $headerColumn) { $label = $headerColumn->getLabel(); $label = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($label); if (\TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($label, 'LLL:')) { $label = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($label, ''); } return $label; }
/** * Set and validate the config values * * @return void */ protected function initByTsConfig() { $this->dateIteratorStart = (int) Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->filterConfig->getSettings('dateIteratorStart')); Tx_PtExtbase_Assertions_Assert::isPositiveInteger($this->dateIteratorStart, false, array('message' => 'The Value dateIteratorStart is not given. 1314608757')); $this->dateIteratorEnd = (int) Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->filterConfig->getSettings('dateIteratorEnd')); Tx_PtExtbase_Assertions_Assert::isPositiveInteger($this->dateIteratorEnd, false, array('message' => 'The Value dateIteratorEnd is not given. 1314608758')); $this->dateIteratorFormat = $this->filterConfig->getSettings('dateIteratorFormat'); Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->dateIteratorFormat, array('message' => 'The Value dateIteratorFormat is not given. 1314608759')); $this->dateIteratorIncrement = strtolower(trim($this->filterConfig->getSettings('dateIteratorIncrement'))); Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->dateIteratorIncrement, array('message' => 'The Value dateIteratorIncrement is not given. 1314608760')); Tx_PtExtbase_Assertions_Assert::isTrue(in_array($this->dateIteratorIncrement, array('s', 'i', 'h', 'd', 'm', 'y')), array('message' => "The parameter dateIteratorIncrement has to be out of 's', 'i', 'h', 'd', 'm', 'y'")); Tx_PtExtbase_Assertions_Assert::isTrue($this->dateIteratorStart < $this->dateIteratorEnd, array('message' => 'The Value dateIteratorStart (' . $this->dateIteratorStart . ') is higher than dateIteratorEnd (' . $this->dateIteratorEnd . ')')); }
/** * (non-PHPdoc) * @see \PunktDe\PtExtbase\Configuration\AbstractConfiguration::init() */ public function init() { // required $this->setRequiredValue('filterboxIdentifier', 'Filterbox identifier must not be empty. 1277889652'); $this->setRequiredValue('filterIdentifier', 'No filterIdentifier specified in config. 1277889452'); $this->setRequiredValue('filterClassName', 'No filterClassName specified for filter ' . $this->filterIdentifier . '. 1277889552'); $this->setRequiredValue('fieldIdentifier', 'No fieldIdentifier set in TS config for filter ' . $this->fieldIdentifier . ' 1280762513'); $this->setRequiredValue('partialPath', 'No partial path is configured for ' . $this->filterIdentifier . ' (TS key partialPath). 1281013746'); $this->processAndSetFieldIdentifier($this->settings['fieldIdentifier']); // optional $this->setBooleanIfExistsAndNotNothing('disableFilterQuery'); $this->setBooleanIfExistsAndNotNothing('invert'); $this->setBooleanIfExistsAndNotNothing('invertable'); $this->setBooleanIfExistsAndNotNothing('submitOnChange'); $this->setBooleanIfExistsAndNotNothing('resetToDefaultValue'); $this->setBooleanIfExistsAndNotNothing('hidden'); $this->setBooleanIfExistsAndNotNothing('showRowCount'); $this->setBooleanIfExistsAndNotNothing('cacheRendering'); $this->setValueIfExists('inactiveValue'); $this->setValueIfExists('breadCrumbString'); $this->setValueIfExists('label'); $this->setValueIfExists('description'); $this->setValueIfExists('ajaxPartialPath'); $this->setValueIfExistsAndNotNothing('defaultValue'); if ($this->defaultValue) { $this->renderDefaultValue(); } $this->setValueIfExistsAndNotNothing('renderUserFunctions'); $this->setValueIfExistsAndNotNothing('renderTemplate'); if ($this->configValueExistsAndNotNothing('inactiveOption')) { $this->inactiveOption = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->settings['inactiveOption']); if (GeneralUtility::isFirstPartOfStr($this->inactiveOption, 'LLL:')) { $this->inactiveOption = LocalizationUtility::translate($this->inactiveOption, ''); } } if ($this->configValueExistsAndNotNothing('label')) { $this->label = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->settings['label']); if (GeneralUtility::isFirstPartOfStr($this->label, 'LLL:')) { $this->label = LocalizationUtility::translate($this->label, ''); } } if (array_key_exists('renderObj', $this->settings)) { $this->renderObj = GeneralUtility::makeInstance(TypoScriptService::class)->convertPlainArrayToTypoScriptArray(['renderObj' => $this->settings['renderObj']]); } if (array_key_exists('accessGroups', $this->settings)) { $this->accessGroups = GeneralUtility::trimExplode(',', $this->settings['accessGroups']); } }
/** * (non-PHPdoc) * @see Classes/Domain/DataBackend/Tx_PtExtlist_Domain_DataBackend_AbstractDataBackend::initBackendByTsConfig() */ protected function initBackendByTsConfig() { $this->tables = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->backendConfiguration->getDataBackendSettings('tables')); $this->baseWhereClause = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->backendConfiguration->getDataBackendSettings('baseWhereClause')); $this->baseFromClause = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->backendConfiguration->getDataBackendSettings('baseFromClause')); $this->baseGroupByClause = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->backendConfiguration->getDataBackendSettings('baseGroupByClause')); }
/** * Template method for initializing filter by TS configuration */ protected function initFilterByTsConfig() { $filterValue = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->filterConfig->getSettings('filterValue')); $this->filterValue = $filterValue; }
/** * @return void */ protected function renderFreeText() { $activeSheet = $this->objPHPExcel->getActiveSheet(); $freeText = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->freeText); $activeSheet->getStyleByColumnAndRow(0, $this->rowNumber)->applyFromArray(array('font' => array('bold' => true))); $activeSheet->setCellValueByColumnAndRow(0, $this->rowNumber++, $freeText); $activeSheet->setCellValueByColumnAndRow(0, $this->rowNumber++, ''); }
/** * (non-PHPdoc) * @see \PunktDe\PtExtbase\Configuration\AbstractConfiguration::init() */ protected function init() { $this->setRequiredValue('identifier', 'No field identifier specified. 1277889450'); $this->table = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->settings['table']); $this->field = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->settings['field']); $this->special = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->settings['special']); if (!trim($this->special) && (!trim($this->table) || !trim($this->field))) { throw new Exception('Configuration error for field: "' . $this->identifier . '" Either a table and a field or a special string has to be given! 1281353522'); } $this->setBooleanIfExistsAndNotNothing('isSortable'); $this->setBooleanIfExistsAndNotNothing('expandGroupRows'); $this->setBooleanIfExistsAndNotNothing('isRelation'); $this->setValueIfExists('expandGroupRowsSeparator'); if (array_key_exists('accessGroups', $this->settings)) { $this->accessGroups = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->settings['accessGroups']); } }
/** * Init the data provider */ public function init() { // TODO use DI here! $this->dbObj = $GLOBALS['TYPO3_DB']; $sqlQuerySettings = $this->filterConfig->getSettings('optionsSqlQuery'); foreach ($sqlQuerySettings as $type => $part) { if (!is_array($part)) { $sqlQuerySettings[$type] = trim($part); } } if ($sqlQuerySettings['select']) { $this->selectPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['select']); } if ($sqlQuerySettings['from']) { $this->fromPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['from']); } if ($sqlQuerySettings['where']) { $this->wherePart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['where']); } if ($sqlQuerySettings['orderBy']) { $this->orderByPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['orderBy']); } if ($sqlQuerySettings['groupBy']) { $this->groupByPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['groupBy']); } if ($sqlQuerySettings['limit']) { $this->limitPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['limit']); } $this->filterField = trim($this->filterConfig->getSettings('filterField')); $this->displayFields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->filterConfig->getSettings('displayFields')); Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->filterField, array('info' => 'No filter field is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221957')); Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->selectPart, array('info' => 'No Select part is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221958')); Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->fromPart, array('info' => 'No from part is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221959')); }