@@ -17,21 +17,21 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class IsVisibleViewHelper extends AbstractViewHelper |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * @return void |
|
| 22 | - */ |
|
| 23 | - public function initializeArguments() |
|
| 24 | - { |
|
| 25 | - $this->registerArgument('name', 'string', 'The column name', true); |
|
| 26 | - } |
|
| 20 | + /** |
|
| 21 | + * @return void |
|
| 22 | + */ |
|
| 23 | + public function initializeArguments() |
|
| 24 | + { |
|
| 25 | + $this->registerArgument('name', 'string', 'The column name', true); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Returns whether the column is visible. |
|
| 30 | - * |
|
| 31 | - * @return bool |
|
| 32 | - */ |
|
| 33 | - public function render() |
|
| 34 | - { |
|
| 35 | - return Tca::grid()->isVisible($this->arguments['name']); |
|
| 36 | - } |
|
| 28 | + /** |
|
| 29 | + * Returns whether the column is visible. |
|
| 30 | + * |
|
| 31 | + * @return bool |
|
| 32 | + */ |
|
| 33 | + public function render() |
|
| 34 | + { |
|
| 35 | + return Tca::grid()->isVisible($this->arguments['name']); |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -17,24 +17,24 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class LabelViewHelper extends AbstractViewHelper |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * @return void |
|
| 22 | - */ |
|
| 23 | - public function initializeArguments() |
|
| 24 | - { |
|
| 25 | - $this->registerArgument('dataType', 'string', '', true); |
|
| 26 | - $this->registerArgument('fieldName', 'string', '', true); |
|
| 27 | - } |
|
| 20 | + /** |
|
| 21 | + * @return void |
|
| 22 | + */ |
|
| 23 | + public function initializeArguments() |
|
| 24 | + { |
|
| 25 | + $this->registerArgument('dataType', 'string', '', true); |
|
| 26 | + $this->registerArgument('fieldName', 'string', '', true); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Returns the label of a field |
|
| 31 | - * |
|
| 32 | - * @return string |
|
| 33 | - */ |
|
| 34 | - public function render() |
|
| 35 | - { |
|
| 36 | - $dataType = $this->arguments['dataType']; |
|
| 37 | - $fieldName = $this->arguments['fieldName']; |
|
| 38 | - return Tca::table($dataType)->field($fieldName)->getLabel(); |
|
| 39 | - } |
|
| 29 | + /** |
|
| 30 | + * Returns the label of a field |
|
| 31 | + * |
|
| 32 | + * @return string |
|
| 33 | + */ |
|
| 34 | + public function render() |
|
| 35 | + { |
|
| 36 | + $dataType = $this->arguments['dataType']; |
|
| 37 | + $fieldName = $this->arguments['fieldName']; |
|
| 38 | + return Tca::table($dataType)->field($fieldName)->getLabel(); |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -17,39 +17,39 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class TableViewHelper extends AbstractViewHelper |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * @return void |
|
| 22 | - */ |
|
| 23 | - public function initializeArguments() |
|
| 24 | - { |
|
| 25 | - $this->registerArgument('key', 'string', '', true); |
|
| 26 | - $this->registerArgument('dataType', 'string', '', false, ''); |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - /** |
|
| 30 | - * Returns a value from the TCA Table service according to a key. |
|
| 31 | - * |
|
| 32 | - * @return string |
|
| 33 | - */ |
|
| 34 | - public function render() |
|
| 35 | - { |
|
| 36 | - $key = $this->arguments['key']; |
|
| 37 | - $dataType = $this->arguments['dataType']; |
|
| 38 | - |
|
| 39 | - $result = Tca::table($dataType)->getTca(); |
|
| 40 | - |
|
| 41 | - // Explode segment and loop around. |
|
| 42 | - $keys = explode('|', $key); |
|
| 43 | - foreach ($keys as $key) { |
|
| 44 | - if (!empty($result[$key])) { |
|
| 45 | - $result = $result[$key]; |
|
| 46 | - } else { |
|
| 47 | - // not found value |
|
| 48 | - $result = false; |
|
| 49 | - break; |
|
| 50 | - } |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - return $result; |
|
| 54 | - } |
|
| 20 | + /** |
|
| 21 | + * @return void |
|
| 22 | + */ |
|
| 23 | + public function initializeArguments() |
|
| 24 | + { |
|
| 25 | + $this->registerArgument('key', 'string', '', true); |
|
| 26 | + $this->registerArgument('dataType', 'string', '', false, ''); |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + /** |
|
| 30 | + * Returns a value from the TCA Table service according to a key. |
|
| 31 | + * |
|
| 32 | + * @return string |
|
| 33 | + */ |
|
| 34 | + public function render() |
|
| 35 | + { |
|
| 36 | + $key = $this->arguments['key']; |
|
| 37 | + $dataType = $this->arguments['dataType']; |
|
| 38 | + |
|
| 39 | + $result = Tca::table($dataType)->getTca(); |
|
| 40 | + |
|
| 41 | + // Explode segment and loop around. |
|
| 42 | + $keys = explode('|', $key); |
|
| 43 | + foreach ($keys as $key) { |
|
| 44 | + if (!empty($result[$key])) { |
|
| 45 | + $result = $result[$key]; |
|
| 46 | + } else { |
|
| 47 | + // not found value |
|
| 48 | + $result = false; |
|
| 49 | + break; |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + return $result; |
|
| 54 | + } |
|
| 55 | 55 | } |
@@ -17,17 +17,17 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class IsLanguageApplicableViewHelper extends AbstractViewHelper |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * Returns whether the field in the context is localizable or not. |
|
| 22 | - * |
|
| 23 | - * @return string |
|
| 24 | - */ |
|
| 25 | - public function render() |
|
| 26 | - { |
|
| 27 | - $dataType = $this->templateVariableContainer->get('dataType'); |
|
| 28 | - $fieldName = $this->templateVariableContainer->get('fieldName'); |
|
| 20 | + /** |
|
| 21 | + * Returns whether the field in the context is localizable or not. |
|
| 22 | + * |
|
| 23 | + * @return string |
|
| 24 | + */ |
|
| 25 | + public function render() |
|
| 26 | + { |
|
| 27 | + $dataType = $this->templateVariableContainer->get('dataType'); |
|
| 28 | + $fieldName = $this->templateVariableContainer->get('fieldName'); |
|
| 29 | 29 | |
| 30 | - $isLanguageApplicable = Tca::table($dataType)->hasLanguageSupport() && Tca::table($dataType)->field($fieldName)->isLocalized(); |
|
| 31 | - return $isLanguageApplicable; |
|
| 32 | - } |
|
| 30 | + $isLanguageApplicable = Tca::table($dataType)->hasLanguageSupport() && Tca::table($dataType)->field($fieldName)->isLocalized(); |
|
| 31 | + return $isLanguageApplicable; |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -18,24 +18,24 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class TitleViewHelper extends AbstractViewHelper |
| 20 | 20 | { |
| 21 | - /** |
|
| 22 | - * @return void |
|
| 23 | - */ |
|
| 24 | - public function initializeArguments() |
|
| 25 | - { |
|
| 26 | - $this->registerArgument('content', Content::class, '', true); |
|
| 27 | - } |
|
| 21 | + /** |
|
| 22 | + * @return void |
|
| 23 | + */ |
|
| 24 | + public function initializeArguments() |
|
| 25 | + { |
|
| 26 | + $this->registerArgument('content', Content::class, '', true); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Returns the title of a content object. |
|
| 31 | - * |
|
| 32 | - * @return string |
|
| 33 | - */ |
|
| 34 | - public function render() |
|
| 35 | - { |
|
| 36 | - /** @var Content $content */ |
|
| 37 | - $content = $this->arguments['content']; |
|
| 38 | - $table = Tca::table($content->getDataType()); |
|
| 39 | - return $content[$table->getLabelField()]; |
|
| 40 | - } |
|
| 29 | + /** |
|
| 30 | + * Returns the title of a content object. |
|
| 31 | + * |
|
| 32 | + * @return string |
|
| 33 | + */ |
|
| 34 | + public function render() |
|
| 35 | + { |
|
| 36 | + /** @var Content $content */ |
|
| 37 | + $content = $this->arguments['content']; |
|
| 38 | + $table = Tca::table($content->getDataType()); |
|
| 39 | + return $content[$table->getLabelField()]; |
|
| 40 | + } |
|
| 41 | 41 | } |
@@ -16,32 +16,32 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class Datetime implements FormatterInterface, SingletonInterface |
| 18 | 18 | { |
| 19 | - /** |
|
| 20 | - * Format a date |
|
| 21 | - * |
|
| 22 | - * @param int $value |
|
| 23 | - * @return string |
|
| 24 | - * @throws \Exception |
|
| 25 | - */ |
|
| 26 | - public function format($value) |
|
| 27 | - { |
|
| 28 | - $result = ''; |
|
| 29 | - if ($value > 0) { |
|
| 30 | - $timeStamp = '@' . $value; |
|
| 31 | - try { |
|
| 32 | - $date = new \DateTime($timeStamp); |
|
| 33 | - $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
|
| 34 | - } catch (\Exception $exception) { |
|
| 35 | - throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 36 | - } |
|
| 19 | + /** |
|
| 20 | + * Format a date |
|
| 21 | + * |
|
| 22 | + * @param int $value |
|
| 23 | + * @return string |
|
| 24 | + * @throws \Exception |
|
| 25 | + */ |
|
| 26 | + public function format($value) |
|
| 27 | + { |
|
| 28 | + $result = ''; |
|
| 29 | + if ($value > 0) { |
|
| 30 | + $timeStamp = '@' . $value; |
|
| 31 | + try { |
|
| 32 | + $date = new \DateTime($timeStamp); |
|
| 33 | + $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
|
| 34 | + } catch (\Exception $exception) { |
|
| 35 | + throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; |
|
| 39 | - if (strpos($format, '%') !== false) { |
|
| 40 | - $result = strftime($format, $date->format('U')); |
|
| 41 | - } else { |
|
| 42 | - $result = $date->format($format); |
|
| 43 | - } |
|
| 44 | - } |
|
| 45 | - return $result; |
|
| 46 | - } |
|
| 38 | + $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; |
|
| 39 | + if (strpos($format, '%') !== false) { |
|
| 40 | + $result = strftime($format, $date->format('U')); |
|
| 41 | + } else { |
|
| 42 | + $result = $date->format($format); |
|
| 43 | + } |
|
| 44 | + } |
|
| 45 | + return $result; |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -27,15 +27,15 @@ |
||
| 27 | 27 | { |
| 28 | 28 | $result = ''; |
| 29 | 29 | if ($value > 0) { |
| 30 | - $timeStamp = '@' . $value; |
|
| 30 | + $timeStamp = '@'.$value; |
|
| 31 | 31 | try { |
| 32 | 32 | $date = new \DateTime($timeStamp); |
| 33 | 33 | $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
| 34 | 34 | } catch (\Exception $exception) { |
| 35 | - throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 35 | + throw new \Exception('"'.$timeStamp.'" could not be parsed by \DateTime constructor: '.$exception->getMessage(), 1447153621); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; |
|
| 38 | + $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' '.$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; |
|
| 39 | 39 | if (strpos($format, '%') !== false) { |
| 40 | 40 | $result = strftime($format, $date->format('U')); |
| 41 | 41 | } else { |
@@ -14,11 +14,11 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | interface FormatterInterface |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * Format a date |
|
| 19 | - * |
|
| 20 | - * @param string $value |
|
| 21 | - * @return string |
|
| 22 | - */ |
|
| 23 | - public function format($value); |
|
| 17 | + /** |
|
| 18 | + * Format a date |
|
| 19 | + * |
|
| 20 | + * @param string $value |
|
| 21 | + * @return string |
|
| 22 | + */ |
|
| 23 | + public function format($value); |
|
| 24 | 24 | } |
@@ -16,32 +16,32 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class Date implements FormatterInterface, SingletonInterface |
| 18 | 18 | { |
| 19 | - /** |
|
| 20 | - * Format a date |
|
| 21 | - * |
|
| 22 | - * @param int $value |
|
| 23 | - * @return string |
|
| 24 | - * @throws \Exception |
|
| 25 | - */ |
|
| 26 | - public function format($value) |
|
| 27 | - { |
|
| 28 | - $result = ''; |
|
| 29 | - if ((int)$value > 0) { |
|
| 30 | - $timeStamp = '@' . $value; |
|
| 31 | - try { |
|
| 32 | - $date = new \DateTime($timeStamp); |
|
| 33 | - $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
|
| 34 | - } catch (\Exception $exception) { |
|
| 35 | - throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 36 | - } |
|
| 19 | + /** |
|
| 20 | + * Format a date |
|
| 21 | + * |
|
| 22 | + * @param int $value |
|
| 23 | + * @return string |
|
| 24 | + * @throws \Exception |
|
| 25 | + */ |
|
| 26 | + public function format($value) |
|
| 27 | + { |
|
| 28 | + $result = ''; |
|
| 29 | + if ((int)$value > 0) { |
|
| 30 | + $timeStamp = '@' . $value; |
|
| 31 | + try { |
|
| 32 | + $date = new \DateTime($timeStamp); |
|
| 33 | + $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
|
| 34 | + } catch (\Exception $exception) { |
|
| 35 | + throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] ?: 'Y-m-d'; |
|
| 39 | - if (strpos($format, '%') !== false) { |
|
| 40 | - $result = strftime($format, $date->format('U')); |
|
| 41 | - } else { |
|
| 42 | - $result = $date->format($format); |
|
| 43 | - } |
|
| 44 | - } |
|
| 45 | - return $result; |
|
| 46 | - } |
|
| 38 | + $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] ?: 'Y-m-d'; |
|
| 39 | + if (strpos($format, '%') !== false) { |
|
| 40 | + $result = strftime($format, $date->format('U')); |
|
| 41 | + } else { |
|
| 42 | + $result = $date->format($format); |
|
| 43 | + } |
|
| 44 | + } |
|
| 45 | + return $result; |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -27,12 +27,12 @@ |
||
| 27 | 27 | { |
| 28 | 28 | $result = ''; |
| 29 | 29 | if ((int)$value > 0) { |
| 30 | - $timeStamp = '@' . $value; |
|
| 30 | + $timeStamp = '@'.$value; |
|
| 31 | 31 | try { |
| 32 | 32 | $date = new \DateTime($timeStamp); |
| 33 | 33 | $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
| 34 | 34 | } catch (\Exception $exception) { |
| 35 | - throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 35 | + throw new \Exception('"'.$timeStamp.'" could not be parsed by \DateTime constructor: '.$exception->getMessage(), 1447153621); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] ?: 'Y-m-d'; |
@@ -18,27 +18,27 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class VidiModulesAspect implements TableConfigurationPostProcessingHookInterface |
| 20 | 20 | { |
| 21 | - /** |
|
| 22 | - * Initialize and populate TBE_MODULES_EXT with default data. |
|
| 23 | - * |
|
| 24 | - * @return void |
|
| 25 | - */ |
|
| 26 | - public function processData() |
|
| 27 | - { |
|
| 28 | - /** @var ModuleLoader $moduleLoader */ |
|
| 29 | - $moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class); |
|
| 21 | + /** |
|
| 22 | + * Initialize and populate TBE_MODULES_EXT with default data. |
|
| 23 | + * |
|
| 24 | + * @return void |
|
| 25 | + */ |
|
| 26 | + public function processData() |
|
| 27 | + { |
|
| 28 | + /** @var ModuleLoader $moduleLoader */ |
|
| 29 | + $moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class); |
|
| 30 | 30 | |
| 31 | 31 | |
| 32 | - $configuration = GeneralUtility::makeInstance( |
|
| 33 | - ExtensionConfiguration::class |
|
| 34 | - )->get('vidi'); |
|
| 32 | + $configuration = GeneralUtility::makeInstance( |
|
| 33 | + ExtensionConfiguration::class |
|
| 34 | + )->get('vidi'); |
|
| 35 | 35 | |
| 36 | - foreach (GeneralUtility::trimExplode(',', $configuration['data_types'], true) as $dataType) { |
|
| 37 | - if (!$moduleLoader->isRegistered($dataType)) { |
|
| 38 | - $moduleLoader->setDataType($dataType) |
|
| 39 | - #->isShown(false) |
|
| 40 | - ->register(); |
|
| 41 | - } |
|
| 42 | - } |
|
| 43 | - } |
|
| 36 | + foreach (GeneralUtility::trimExplode(',', $configuration['data_types'], true) as $dataType) { |
|
| 37 | + if (!$moduleLoader->isRegistered($dataType)) { |
|
| 38 | + $moduleLoader->setDataType($dataType) |
|
| 39 | + #->isShown(false) |
|
| 40 | + ->register(); |
|
| 41 | + } |
|
| 42 | + } |
|
| 43 | + } |
|
| 44 | 44 | } |