@@ -134,17 +134,17 @@ |
||
134 | 134 | public function resolveTemplateFileForVariant($extensionKey, $contentType, $variant = NULL, $version = NULL) { |
135 | 135 | $paths = $this->getViewConfigurationForExtensionName(FALSE === empty($variant) ? $variant : $extensionKey); |
136 | 136 | $templatePaths = new TemplatePaths($paths); |
137 | - $controllerName = 'CoreContent'; |
|
137 | + $controllerName = 'CoreContent'; |
|
138 | 138 | $controllerAction = FALSE === empty($version) ? $contentType . '/' . $version : $contentType; |
139 | 139 | return $templatePaths->resolveTemplateFileForControllerAndActionAndFormat($controllerName, $controllerAction); |
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
143 | - * @param string $extension |
|
144 | - * @param string $contentType |
|
145 | - * @param string $version |
|
146 | - * @return string |
|
147 | - */ |
|
143 | + * @param string $extension |
|
144 | + * @param string $contentType |
|
145 | + * @param string $version |
|
146 | + * @return string |
|
147 | + */ |
|
148 | 148 | public function getIconFromVersion($extension, $contentType, $version = NULL) { |
149 | 149 | $extensionKey = ExtensionNamingUtility::getExtensionKey($extension); |
150 | 150 | $templatePathAndFilename = $this->resolveTemplateFileForVariant($extensionKey, $contentType, $extension, $version); |
@@ -49,36 +49,36 @@ discard block |
||
49 | 49 | */ |
50 | 50 | protected function initializeDefaults() { |
51 | 51 | $typoScript = $this->getAllTypoScript(); |
52 | - $this->defaults = (array) $typoScript['plugin']['tx_mooxcore']['settings']['defaults']; |
|
52 | + $this->defaults = (array)$typoScript['plugin']['tx_mooxcore']['settings']['defaults']; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @return void |
57 | 57 | */ |
58 | 58 | protected function initializeVariants() { |
59 | - $variants = (array) $this->getAllRegisteredVariants(); |
|
59 | + $variants = (array)$this->getAllRegisteredVariants(); |
|
60 | 60 | foreach ($variants as $contentType => $registeredVariantExtensions) { |
61 | - if (TRUE === empty($registeredVariantExtensions)) { |
|
61 | + if (TRUE===empty($registeredVariantExtensions)) { |
|
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | $this->variants[$contentType] = array(); |
65 | 65 | foreach ($registeredVariantExtensions as $extensionKeyOrArray) { |
66 | 66 | $icon = NULL; |
67 | 67 | $versions = array(); |
68 | - if (TRUE === is_array($extensionKeyOrArray) && 3 === count($extensionKeyOrArray)) { |
|
68 | + if (TRUE===is_array($extensionKeyOrArray) && 3===count($extensionKeyOrArray)) { |
|
69 | 69 | list ($extensionKey, $labelReference, $icon) = $extensionKeyOrArray; |
70 | - } elseif (TRUE === is_array($extensionKeyOrArray) && 2 === count($extensionKeyOrArray)) { |
|
70 | + } elseif (TRUE===is_array($extensionKeyOrArray) && 2===count($extensionKeyOrArray)) { |
|
71 | 71 | list ($extensionKey, $labelReference) = $extensionKeyOrArray; |
72 | - } else { |
|
72 | + }else { |
|
73 | 73 | $extensionKey = ExtensionNamingUtility::getExtensionKey($extensionKeyOrArray); |
74 | 74 | $labelReference = 'moox_core.variantLabel'; |
75 | 75 | } |
76 | - $controllerName = 'CoreContent/' . ucfirst($contentType); |
|
76 | + $controllerName = 'CoreContent/'.ucfirst($contentType); |
|
77 | 77 | $paths = $this->getViewConfigurationForExtensionName($extensionKey); |
78 | 78 | $templatePaths = new TemplatePaths($paths); |
79 | 79 | $files = $templatePaths->resolveAvailableTemplateFiles($controllerName); |
80 | 80 | foreach ($files as $file) { |
81 | - $versions[] = basename($file, '.' . TemplatePaths::DEFAULT_FORMAT); |
|
81 | + $versions[] = basename($file, '.'.TemplatePaths::DEFAULT_FORMAT); |
|
82 | 82 | } |
83 | 83 | $versions = array_unique($versions); |
84 | 84 | $this->versions[$contentType] = array($extensionKey => $versions); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return array |
99 | 99 | */ |
100 | 100 | public function getAllRegisteredVariants() { |
101 | - return (array) $GLOBALS['TYPO3_CONF_VARS']['DCNGmbH.MooxCore']['variants']; |
|
101 | + return (array)$GLOBALS['TYPO3_CONF_VARS']['DCNGmbH.MooxCore']['variants']; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @return array |
107 | 107 | */ |
108 | 108 | public function getVariantExtensionKeysForContentType($contentType) { |
109 | - if (TRUE === isset($this->variants[$contentType])) { |
|
109 | + if (TRUE===isset($this->variants[$contentType])) { |
|
110 | 110 | return $this->variants[$contentType]; |
111 | 111 | } |
112 | 112 | return array(); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @return array |
119 | 119 | */ |
120 | 120 | public function getVariantVersions($contentType, $variant) { |
121 | - if (TRUE === isset($this->versions[$contentType][$variant])) { |
|
121 | + if (TRUE===isset($this->versions[$contentType][$variant])) { |
|
122 | 122 | return $this->versions[$contentType][$variant]; |
123 | 123 | } |
124 | 124 | return array(); |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | * @return string |
133 | 133 | */ |
134 | 134 | public function resolveTemplateFileForVariant($extensionKey, $contentType, $variant = NULL, $version = NULL) { |
135 | - $paths = $this->getViewConfigurationForExtensionName(FALSE === empty($variant) ? $variant : $extensionKey); |
|
135 | + $paths = $this->getViewConfigurationForExtensionName(FALSE===empty($variant) ? $variant : $extensionKey); |
|
136 | 136 | $templatePaths = new TemplatePaths($paths); |
137 | 137 | $controllerName = 'CoreContent'; |
138 | - $controllerAction = FALSE === empty($version) ? $contentType . '/' . $version : $contentType; |
|
138 | + $controllerAction = FALSE===empty($version) ? $contentType.'/'.$version : $contentType; |
|
139 | 139 | return $templatePaths->resolveTemplateFileForControllerAndActionAndFormat($controllerName, $controllerAction); |
140 | 140 | } |
141 | 141 | |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | $viewContext->setTemplatePaths($templatePaths); |
155 | 155 | $viewContext->setSectionName('Configuration'); |
156 | 156 | $form = FluxService::getFormFromTemplateFile($viewContext); |
157 | - if (FALSE === $form instanceof Form) { |
|
157 | + if (FALSE===$form instanceof Form) { |
|
158 | 158 | return ''; |
159 | - } else { |
|
159 | + }else { |
|
160 | 160 | return MiscellaneousUtility::getIconForTemplate($form); |
161 | 161 | } |
162 | 162 | } |
@@ -10,103 +10,103 @@ |
||
10 | 10 | */ |
11 | 11 | class UpdateService { |
12 | 12 | |
13 | - /** |
|
14 | - * @var string |
|
15 | - */ |
|
16 | - protected $sourceConfigurationLines = array( |
|
17 | - '$GLOBALS[\'TYPO3_CONF_VARS\'][\'FE\'][\'contentRenderingTemplates\'] = array(\'mooxcore/Configuration/TypoScript/\');', |
|
18 | - '$GLOBALS[\'TYPO3_CONF_VARS\'][\'FE\'][\'activateContentAdapter\'] = 0;' |
|
19 | - ); |
|
13 | + /** |
|
14 | + * @var string |
|
15 | + */ |
|
16 | + protected $sourceConfigurationLines = array( |
|
17 | + '$GLOBALS[\'TYPO3_CONF_VARS\'][\'FE\'][\'contentRenderingTemplates\'] = array(\'mooxcore/Configuration/TypoScript/\');', |
|
18 | + '$GLOBALS[\'TYPO3_CONF_VARS\'][\'FE\'][\'activateContentAdapter\'] = 0;' |
|
19 | + ); |
|
20 | 20 | |
21 | - /** |
|
22 | - * @var string |
|
23 | - */ |
|
24 | - protected $targetConfigurationFile = 'typo3conf/AdditionalConfiguration.php'; |
|
21 | + /** |
|
22 | + * @var string |
|
23 | + */ |
|
24 | + protected $targetConfigurationFile = 'typo3conf/AdditionalConfiguration.php'; |
|
25 | 25 | |
26 | - /** |
|
27 | - * Constructor |
|
28 | - */ |
|
29 | - public function __construct() { |
|
30 | - $this->targetConfigurationFile = GeneralUtility::getFileAbsFileName($this->targetConfigurationFile); |
|
31 | - } |
|
26 | + /** |
|
27 | + * Constructor |
|
28 | + */ |
|
29 | + public function __construct() { |
|
30 | + $this->targetConfigurationFile = GeneralUtility::getFileAbsFileName($this->targetConfigurationFile); |
|
31 | + } |
|
32 | 32 | |
33 | - /** |
|
34 | - * @return array |
|
35 | - */ |
|
36 | - protected function getCurrentConfigurationLines() { |
|
37 | - if (FALSE === file_exists($this->targetConfigurationFile)) { |
|
38 | - // We return not a completely empty array but an array containing the |
|
39 | - // expected opening PHP tag; to make sure it ends up in the output. |
|
40 | - return array('<?php'); |
|
41 | - } |
|
42 | - $lines = explode(PHP_EOL, trim(file_get_contents($this->targetConfigurationFile))); |
|
43 | - if (0 === count($lines) || '<?php' !== $lines[0]) { |
|
44 | - array_unshift($lines, '<?php'); |
|
45 | - } |
|
46 | - return $lines; |
|
47 | - } |
|
33 | + /** |
|
34 | + * @return array |
|
35 | + */ |
|
36 | + protected function getCurrentConfigurationLines() { |
|
37 | + if (FALSE === file_exists($this->targetConfigurationFile)) { |
|
38 | + // We return not a completely empty array but an array containing the |
|
39 | + // expected opening PHP tag; to make sure it ends up in the output. |
|
40 | + return array('<?php'); |
|
41 | + } |
|
42 | + $lines = explode(PHP_EOL, trim(file_get_contents($this->targetConfigurationFile))); |
|
43 | + if (0 === count($lines) || '<?php' !== $lines[0]) { |
|
44 | + array_unshift($lines, '<?php'); |
|
45 | + } |
|
46 | + return $lines; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * Returns TRUE if either of the expected configuration lines |
|
51 | - * do not currently exist. If both exist, returns FALSE |
|
52 | - * meaning "no need to run the script" |
|
53 | - * |
|
54 | - * NOTE: Is required by the extension manager, do not remove or make protected |
|
55 | - * @api |
|
56 | - * @return boolean |
|
57 | - */ |
|
58 | - public function access() { |
|
59 | - $currentConfiguration = $this->getCurrentConfigurationLines(); |
|
60 | - foreach ($this->sourceConfigurationLines as $expectedConfigurationLine) { |
|
61 | - if (FALSE === in_array($expectedConfigurationLine, $currentConfiguration)) { |
|
62 | - return TRUE; |
|
63 | - } |
|
64 | - } |
|
65 | - return FALSE; |
|
66 | - } |
|
49 | + /** |
|
50 | + * Returns TRUE if either of the expected configuration lines |
|
51 | + * do not currently exist. If both exist, returns FALSE |
|
52 | + * meaning "no need to run the script" |
|
53 | + * |
|
54 | + * NOTE: Is required by the extension manager, do not remove or make protected |
|
55 | + * @api |
|
56 | + * @return boolean |
|
57 | + */ |
|
58 | + public function access() { |
|
59 | + $currentConfiguration = $this->getCurrentConfigurationLines(); |
|
60 | + foreach ($this->sourceConfigurationLines as $expectedConfigurationLine) { |
|
61 | + if (FALSE === in_array($expectedConfigurationLine, $currentConfiguration)) { |
|
62 | + return TRUE; |
|
63 | + } |
|
64 | + } |
|
65 | + return FALSE; |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * NOTE: Is required by the extension manager, do not remove or make protected |
|
70 | - * @api |
|
71 | - * @return string |
|
72 | - */ |
|
73 | - public function main() { |
|
74 | - $this->installAdditionalConfiguration(); |
|
75 | - return 'Additional configuration lines added to AdditionalConfiguration.php'; |
|
76 | - } |
|
68 | + /** |
|
69 | + * NOTE: Is required by the extension manager, do not remove or make protected |
|
70 | + * @api |
|
71 | + * @return string |
|
72 | + */ |
|
73 | + public function main() { |
|
74 | + $this->installAdditionalConfiguration(); |
|
75 | + return 'Additional configuration lines added to AdditionalConfiguration.php'; |
|
76 | + } |
|
77 | 77 | |
78 | - /** |
|
79 | - * Install expected lines missing from AdditionalConfiguration file |
|
80 | - * |
|
81 | - * @return void |
|
82 | - */ |
|
83 | - protected function installAdditionalConfiguration() { |
|
84 | - $currentConfigurationLines = $this->getCurrentConfigurationLines(); |
|
85 | - // remove trailing empty spaces and closing PHP tag to ensure predictable appending: |
|
86 | - for ($i = count($currentConfigurationLines) - 1; $i--; $i >= 0) { |
|
87 | - $line = trim($currentConfigurationLines[$i]); |
|
88 | - if (TRUE === empty($line) || '?>' === $line) { |
|
89 | - unset($currentConfigurationLines[$i]); |
|
90 | - } |
|
91 | - } |
|
92 | - // add expected lines if they are not found: |
|
93 | - foreach ($this->sourceConfigurationLines as $expectedConfigurationLine) { |
|
94 | - if (FALSE === in_array($expectedConfigurationLine, $currentConfigurationLines)) { |
|
95 | - $currentConfigurationLines[] = $expectedConfigurationLine; |
|
96 | - } |
|
97 | - } |
|
98 | - $this->writeAdditionalConfigurationFile($currentConfigurationLines); |
|
99 | - } |
|
78 | + /** |
|
79 | + * Install expected lines missing from AdditionalConfiguration file |
|
80 | + * |
|
81 | + * @return void |
|
82 | + */ |
|
83 | + protected function installAdditionalConfiguration() { |
|
84 | + $currentConfigurationLines = $this->getCurrentConfigurationLines(); |
|
85 | + // remove trailing empty spaces and closing PHP tag to ensure predictable appending: |
|
86 | + for ($i = count($currentConfigurationLines) - 1; $i--; $i >= 0) { |
|
87 | + $line = trim($currentConfigurationLines[$i]); |
|
88 | + if (TRUE === empty($line) || '?>' === $line) { |
|
89 | + unset($currentConfigurationLines[$i]); |
|
90 | + } |
|
91 | + } |
|
92 | + // add expected lines if they are not found: |
|
93 | + foreach ($this->sourceConfigurationLines as $expectedConfigurationLine) { |
|
94 | + if (FALSE === in_array($expectedConfigurationLine, $currentConfigurationLines)) { |
|
95 | + $currentConfigurationLines[] = $expectedConfigurationLine; |
|
96 | + } |
|
97 | + } |
|
98 | + $this->writeAdditionalConfigurationFile($currentConfigurationLines); |
|
99 | + } |
|
100 | 100 | |
101 | - /** |
|
102 | - * Wrapping method to write array to file |
|
103 | - * |
|
104 | - * @param array $lines |
|
105 | - * @return void |
|
106 | - */ |
|
107 | - protected function writeAdditionalConfigurationFile(array $lines) { |
|
108 | - $content = implode(PHP_EOL, $lines) . PHP_EOL; |
|
109 | - file_put_contents($this->targetConfigurationFile, $content); |
|
110 | - } |
|
101 | + /** |
|
102 | + * Wrapping method to write array to file |
|
103 | + * |
|
104 | + * @param array $lines |
|
105 | + * @return void |
|
106 | + */ |
|
107 | + protected function writeAdditionalConfigurationFile(array $lines) { |
|
108 | + $content = implode(PHP_EOL, $lines) . PHP_EOL; |
|
109 | + file_put_contents($this->targetConfigurationFile, $content); |
|
110 | + } |
|
111 | 111 | |
112 | 112 | } |
113 | 113 | \ No newline at end of file |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | * @return array |
35 | 35 | */ |
36 | 36 | protected function getCurrentConfigurationLines() { |
37 | - if (FALSE === file_exists($this->targetConfigurationFile)) { |
|
37 | + if (FALSE===file_exists($this->targetConfigurationFile)) { |
|
38 | 38 | // We return not a completely empty array but an array containing the |
39 | 39 | // expected opening PHP tag; to make sure it ends up in the output. |
40 | 40 | return array('<?php'); |
41 | 41 | } |
42 | 42 | $lines = explode(PHP_EOL, trim(file_get_contents($this->targetConfigurationFile))); |
43 | - if (0 === count($lines) || '<?php' !== $lines[0]) { |
|
43 | + if (0===count($lines) || '<?php'!==$lines[0]) { |
|
44 | 44 | array_unshift($lines, '<?php'); |
45 | 45 | } |
46 | 46 | return $lines; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | public function access() { |
59 | 59 | $currentConfiguration = $this->getCurrentConfigurationLines(); |
60 | 60 | foreach ($this->sourceConfigurationLines as $expectedConfigurationLine) { |
61 | - if (FALSE === in_array($expectedConfigurationLine, $currentConfiguration)) { |
|
61 | + if (FALSE===in_array($expectedConfigurationLine, $currentConfiguration)) { |
|
62 | 62 | return TRUE; |
63 | 63 | } |
64 | 64 | } |
@@ -83,15 +83,15 @@ discard block |
||
83 | 83 | protected function installAdditionalConfiguration() { |
84 | 84 | $currentConfigurationLines = $this->getCurrentConfigurationLines(); |
85 | 85 | // remove trailing empty spaces and closing PHP tag to ensure predictable appending: |
86 | - for ($i = count($currentConfigurationLines) - 1; $i--; $i >= 0) { |
|
86 | + for ($i = count($currentConfigurationLines)-1; $i--; $i>=0) { |
|
87 | 87 | $line = trim($currentConfigurationLines[$i]); |
88 | - if (TRUE === empty($line) || '?>' === $line) { |
|
88 | + if (TRUE===empty($line) || '?>'===$line) { |
|
89 | 89 | unset($currentConfigurationLines[$i]); |
90 | 90 | } |
91 | 91 | } |
92 | 92 | // add expected lines if they are not found: |
93 | 93 | foreach ($this->sourceConfigurationLines as $expectedConfigurationLine) { |
94 | - if (FALSE === in_array($expectedConfigurationLine, $currentConfigurationLines)) { |
|
94 | + if (FALSE===in_array($expectedConfigurationLine, $currentConfigurationLines)) { |
|
95 | 95 | $currentConfigurationLines[] = $expectedConfigurationLine; |
96 | 96 | } |
97 | 97 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @return void |
106 | 106 | */ |
107 | 107 | protected function writeAdditionalConfigurationFile(array $lines) { |
108 | - $content = implode(PHP_EOL, $lines) . PHP_EOL; |
|
108 | + $content = implode(PHP_EOL, $lines).PHP_EOL; |
|
109 | 109 | file_put_contents($this->targetConfigurationFile, $content); |
110 | 110 | } |
111 | 111 |
@@ -84,12 +84,12 @@ discard block |
||
84 | 84 | $extensionKeys = $this->configurationService->getVariantExtensionKeysForContentType($parameters['row']['CType']); |
85 | 85 | $defaults = $this->configurationService->getDefaults(); |
86 | 86 | $preSelected = $parameters['row']['content_variant']; |
87 | - if (CoreContentProvider::MODE_PRESELECT === $defaults['mode'] && TRUE === empty($preSelected)) { |
|
87 | + if (CoreContentProvider::MODE_PRESELECT===$defaults['mode'] && TRUE===empty($preSelected)) { |
|
88 | 88 | $preSelected = $defaults['variant']; |
89 | 89 | } |
90 | - if (TRUE === is_array($extensionKeys) && 0 < count($extensionKeys)) { |
|
90 | + if (TRUE===is_array($extensionKeys) && 0<count($extensionKeys)) { |
|
91 | 91 | $options = $this->renderOptions($extensionKeys); |
92 | - } else { |
|
92 | + }else { |
|
93 | 93 | $options = array(); |
94 | 94 | } |
95 | 95 | return $this->renderSelectField($parameters, $options, $preSelected); |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | foreach ($variants as $variantSetup) { |
105 | 105 | list ($extensionKey, $labelReference, $icon) = $variantSetup; |
106 | 106 | $translatedLabel = LocalizationUtility::translate($labelReference, $extensionKey); |
107 | - if (NULL === $translatedLabel) { |
|
107 | + if (NULL===$translatedLabel) { |
|
108 | 108 | $translatedLabel = $extensionKey; |
109 | 109 | } |
110 | - $optionsIcon = '<img src="' . $icon . '" alt="' . $extensionKey . '" /> '; |
|
110 | + $optionsIcon = '<img src="'.$icon.'" alt="'.$extensionKey.'" /> '; |
|
111 | 111 | $options[$extensionKey] = array($optionsIcon, $translatedLabel); |
112 | 112 | } |
113 | 113 | return $options; |
@@ -126,24 +126,24 @@ discard block |
||
126 | 126 | foreach ($options as $extensionKey => $optionsSetup) { |
127 | 127 | list($optionsIcons[$extensionKey], $optionsLabels[$extensionKey]) = $optionsSetup; |
128 | 128 | } |
129 | - $hasSelectedValue = (TRUE === empty($selectedValue) || TRUE === array_key_exists($selectedValue, $optionsLabels)); |
|
130 | - $selected = (TRUE === empty($selectedValue) ? ' selected="selected"' : NULL); |
|
129 | + $hasSelectedValue = (TRUE===empty($selectedValue) || TRUE===array_key_exists($selectedValue, $optionsLabels)); |
|
130 | + $selected = (TRUE===empty($selectedValue) ? ' selected="selected"' : NULL); |
|
131 | 131 | foreach ($optionsIcons as $value => $img) { |
132 | - if ($value === $selectedValue) { |
|
132 | + if ($value===$selectedValue) { |
|
133 | 133 | $selectedIcon = $img; |
134 | 134 | break; |
135 | 135 | } |
136 | 136 | } |
137 | 137 | $html = array( |
138 | - '<div class="form-control-wrap"><div class="input-group"><div class="input-group-addon input-group-icon">' . $selectedIcon . '</div><select class="select form-control" name="' . $parameters['itemFormElName'] . '" onchange="' . $parameters['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] . ';' . $parameters['fieldChangeFunc']['alert'] . '">', |
|
139 | - '<option' . $selected . ' value="">' . LocalizationUtility::translate('tt_content.nativeLabel', 'MooxCore') . '</option>' |
|
138 | + '<div class="form-control-wrap"><div class="input-group"><div class="input-group-addon input-group-icon">'.$selectedIcon.'</div><select class="select form-control" name="'.$parameters['itemFormElName'].'" onchange="'.$parameters['fieldChangeFunc']['TBE_EDITOR_fieldChanged'].';'.$parameters['fieldChangeFunc']['alert'].'">', |
|
139 | + '<option'.$selected.' value="">'.LocalizationUtility::translate('tt_content.nativeLabel', 'MooxCore').'</option>' |
|
140 | 140 | ); |
141 | 141 | foreach ($optionsLabels as $value => $label) { |
142 | - $selected = $value === $selectedValue ? ' selected="selected"' : NULL; |
|
143 | - $html[] = '<option' . $selected . ' value="' . $value . '">' . $label . '</option>'; |
|
142 | + $selected = $value===$selectedValue ? ' selected="selected"' : NULL; |
|
143 | + $html[] = '<option'.$selected.' value="'.$value.'">'.$label.'</option>'; |
|
144 | 144 | } |
145 | - if (FALSE === $hasSelectedValue) { |
|
146 | - $html[] = '<option selected="selected">INVALID: ' . $selectedValue . '</option>'; |
|
145 | + if (FALSE===$hasSelectedValue) { |
|
146 | + $html[] = '<option selected="selected">INVALID: '.$selectedValue.'</option>'; |
|
147 | 147 | } |
148 | 148 | $html[] = '</select></div></div>'; |
149 | 149 | return implode(LF, $html); |
@@ -159,20 +159,20 @@ discard block |
||
159 | 159 | $defaults = $this->configurationService->getDefaults(); |
160 | 160 | $preSelectedVariant = $parameters['row']['content_variant']; |
161 | 161 | $preSelectedVersion = $parameters['row']['content_version']; |
162 | - if (CoreContentProvider::MODE_PRESELECT === $defaults['mode']) { |
|
163 | - if (TRUE === empty($preSelectedVariant)) { |
|
162 | + if (CoreContentProvider::MODE_PRESELECT===$defaults['mode']) { |
|
163 | + if (TRUE===empty($preSelectedVariant)) { |
|
164 | 164 | $preSelectedVariant = $defaults['variant']; |
165 | 165 | } |
166 | - if (TRUE === empty($preSelectedVersion)) { |
|
166 | + if (TRUE===empty($preSelectedVersion)) { |
|
167 | 167 | $preSelectedVersion = $defaults['version']; |
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
171 | 171 | $versions = $this->configurationService->getVariantVersions($parameters['row']['CType'], $preSelectedVariant); |
172 | - if (TRUE === is_array($versions) && 0 < count($versions)) { |
|
172 | + if (TRUE===is_array($versions) && 0<count($versions)) { |
|
173 | 173 | foreach ($versions as $version) { |
174 | 174 | $icon = $this->configurationService->getIconFromVersion($preSelectedVariant, $parameters['row']['CType'], $version); |
175 | - $versionIcon = '<img src="' . $icon . '" alt="" /> '; |
|
175 | + $versionIcon = '<img src="'.$icon.'" alt="" /> '; |
|
176 | 176 | $options[$version] = array($versionIcon, $version); |
177 | 177 | } |
178 | 178 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | * @codeCoverageIgnore |
187 | 187 | */ |
188 | 188 | protected function loadRecord($table, $uid) { |
189 | - return \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, (integer) $uid); |
|
189 | + return \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, (integer)$uid); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | } |
193 | 193 | \ No newline at end of file |
@@ -15,9 +15,9 @@ |
||
15 | 15 | */ |
16 | 16 | public function render() { |
17 | 17 | |
18 | - if(!$GLOBALS['TBE_STYLES']['logo']) { |
|
19 | - return parent::render(); |
|
20 | - } |
|
18 | + if(!$GLOBALS['TBE_STYLES']['logo']) { |
|
19 | + return parent::render(); |
|
20 | + } |
|
21 | 21 | |
22 | 22 | // Overwrite with custom logo |
23 | 23 | if ($GLOBALS['TBE_STYLES']['logo']) { |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function render() { |
17 | 17 | |
18 | - if(!$GLOBALS['TBE_STYLES']['logo']) { |
|
18 | + if (!$GLOBALS['TBE_STYLES']['logo']) { |
|
19 | 19 | return parent::render(); |
20 | 20 | } |
21 | 21 | |
22 | 22 | // Overwrite with custom logo |
23 | 23 | if ($GLOBALS['TBE_STYLES']['logo']) { |
24 | - $imgInfo = @getimagesize(\TYPO3\CMS\Core\Utility\GeneralUtility::resolveBackPath((PATH_typo3 . $GLOBALS['TBE_STYLES']['logo']), 3)); |
|
24 | + $imgInfo = @getimagesize(\TYPO3\CMS\Core\Utility\GeneralUtility::resolveBackPath((PATH_typo3.$GLOBALS['TBE_STYLES']['logo']), 3)); |
|
25 | 25 | $imgUrl = $GLOBALS['TBE_STYLES']['logo']; |
26 | 26 | } |
27 | 27 | |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | $height = $imgInfo[1]; |
31 | 31 | |
32 | 32 | if (strpos($imgUrl, '@2x.')) { |
33 | - $width = $width/2; |
|
34 | - $height = $height/2; |
|
33 | + $width = $width / 2; |
|
34 | + $height = $height / 2; |
|
35 | 35 | } |
36 | 36 | |
37 | - $logoTag = '<img src="' . $imgUrl . '" width="' . $width . '" height="' . $height . '" title="'. $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '" alt="" />'; |
|
38 | - $siteName = '<span class="typo3-sitename"><a style="color:#fff;" href="http://'.$GLOBALS['_SERVER']['HTTP_HOST'].'/" target="_blank">'. $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . ' [' . TYPO3_version . ']</a></span>'; |
|
39 | - return '<a href="http://typo3.org/" target="_blank">' . $logoTag . '</a>' . $siteName; |
|
37 | + $logoTag = '<img src="'.$imgUrl.'" width="'.$width.'" height="'.$height.'" title="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'].'" alt="" />'; |
|
38 | + $siteName = '<span class="typo3-sitename"><a style="color:#fff;" href="http://'.$GLOBALS['_SERVER']['HTTP_HOST'].'/" target="_blank">'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'].' ['.TYPO3_version.']</a></span>'; |
|
39 | + return '<a href="http://typo3.org/" target="_blank">'.$logoTag.'</a>'.$siteName; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -1,132 +1,132 @@ |
||
1 | 1 | <?php |
2 | 2 | $TYPO3_CONF_VARS['FE']['addRootLineFields'].= ',tx_realurl_pathsegment'; |
3 | 3 | $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array( |
4 | - 'pagePath' => array( |
|
5 | - 'type' => 'user', |
|
6 | - 'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main', |
|
7 | - 'spaceCharacter' => '-', |
|
8 | - 'languageGetVar' => 'L', |
|
9 | - 'expireDays' => '3', |
|
10 | - 'firstHitPathCache'=>1 |
|
11 | - ), |
|
12 | - 'init' => array( |
|
13 | - 'enableCHashCache' => TRUE, |
|
14 | - 'respectSimulateStaticURLs' => 0, |
|
15 | - 'appendMissingSlash' => 'ifNotFile', |
|
16 | - 'enableUrlDecodeCache' => TRUE, |
|
17 | - 'enableUrlEncodeCache' => TRUE, |
|
18 | - 'emptyUrlReturnValue' => \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'), |
|
19 | - ), |
|
20 | - 'preVars' => array( |
|
21 | - array( |
|
22 | - 'GETvar' => 'L', |
|
23 | - 'valueMap' => array( |
|
24 | - 'en' => '1', |
|
25 | - ), |
|
26 | - 'noMatch' => 'bypass', |
|
27 | - ), |
|
28 | - array( |
|
29 | - 'GETvar' => 'no_cache', |
|
30 | - 'valueMap' => array( |
|
31 | - 'nc' => 1, |
|
32 | - ), |
|
33 | - 'noMatch' => 'bypass', |
|
34 | - ), |
|
35 | - ), |
|
36 | - 'fixedPostVars' => array( |
|
37 | - ), |
|
38 | - 'fileName' => array ( |
|
39 | - 'index' => array( |
|
40 | - '_DEFAULT' => array( |
|
41 | - 'keyValues' => array( |
|
42 | - ) |
|
43 | - ), |
|
44 | - 'sitemap.xml' => array( |
|
45 | - 'keyValues' => array( |
|
46 | - 'type' => 1234, |
|
47 | - ), |
|
48 | - ), |
|
49 | - ), |
|
50 | - 'defaultToHTMLsuffixOnPrev' => '.html', |
|
51 | - ), |
|
52 | - 'postVarSets' => array( |
|
53 | - '_DEFAULT' => array( |
|
54 | - 'controller' => array( |
|
55 | - array( |
|
56 | - 'GETvar' => 'tx_mooxnews_pi1[action]', |
|
57 | - 'noMatch' => 'bypass' |
|
58 | - ), |
|
59 | - array( |
|
60 | - 'GETvar' => 'tx_mooxnews_pi1[controller]', |
|
61 | - 'noMatch' => 'bypass' |
|
62 | - ) |
|
63 | - ), |
|
64 | - 'dateFilter' => array( |
|
65 | - array( |
|
66 | - 'GETvar' => 'tx_mooxnews_pi1[overwriteDemand][year]', |
|
67 | - ), |
|
68 | - array( |
|
69 | - 'GETvar' => 'tx_mooxnews_pi1[overwriteDemand][month]', |
|
70 | - ), |
|
71 | - ), |
|
72 | - 'archive' => array ( |
|
73 | - '0' => array ( |
|
74 | - 'GETvar' => 'tx_mooxnews_pi1[year]', |
|
75 | - ), |
|
76 | - '1' => array ( |
|
77 | - 'GETvar' => 'tx_mooxnews_pi1[month]', |
|
78 | - 'valueMap' => array ( |
|
79 | - 'january' => '01', |
|
80 | - 'february' => '02', |
|
81 | - 'march' => '03', |
|
82 | - 'april' => '04', |
|
83 | - 'may' => '05', |
|
84 | - 'june' => '06', |
|
85 | - 'july' => '07', |
|
86 | - 'august' => '08', |
|
87 | - 'september' => '09', |
|
88 | - 'october' => '10', |
|
89 | - 'november' => '11', |
|
90 | - 'december' => '12', |
|
91 | - ), |
|
92 | - ), |
|
93 | - ), |
|
94 | - 'browse' => array ( |
|
95 | - '0' => array ( |
|
96 | - 'GETvar' => 'tx_mooxnews_pi1[pointer]', |
|
97 | - ), |
|
98 | - ), |
|
99 | - 'select_category' => array ( |
|
100 | - '0' => array ( |
|
101 | - 'GETvar' => 'tx_mooxnews_pi1[cat]', |
|
102 | - ), |
|
103 | - ), |
|
104 | - 'article' => array ( |
|
105 | - '0' => array ( |
|
106 | - 'GETvar' => 'tx_mooxnews_pi1[news]', |
|
107 | - 'lookUpTable' => array ( |
|
108 | - 'table' => 'tx_mooxnews_domain_model_news', |
|
109 | - 'id_field' => 'uid', |
|
110 | - 'alias_field' => 'title', |
|
111 | - 'addWhereClause' => ' AND NOT deleted', |
|
112 | - 'useUniqueCache' => '1', |
|
113 | - 'useUniqueCache_conf' => array ( |
|
114 | - 'strtolower' => '1', |
|
115 | - 'spaceCharacter' => '-', |
|
116 | - ), |
|
117 | - ), |
|
118 | - ), |
|
119 | - '1' => array ( |
|
120 | - 'GETvar' => 'tx_mooxnews_pi1[swords]', |
|
121 | - ), |
|
122 | - ), |
|
123 | - 'page' => array( |
|
124 | - array( |
|
125 | - 'GETvar' => 'tx_mooxnews_pi1[@widget_0][currentPage]', |
|
126 | - ), |
|
127 | - ), |
|
128 | - ), |
|
129 | - ), |
|
4 | + 'pagePath' => array( |
|
5 | + 'type' => 'user', |
|
6 | + 'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main', |
|
7 | + 'spaceCharacter' => '-', |
|
8 | + 'languageGetVar' => 'L', |
|
9 | + 'expireDays' => '3', |
|
10 | + 'firstHitPathCache'=>1 |
|
11 | + ), |
|
12 | + 'init' => array( |
|
13 | + 'enableCHashCache' => TRUE, |
|
14 | + 'respectSimulateStaticURLs' => 0, |
|
15 | + 'appendMissingSlash' => 'ifNotFile', |
|
16 | + 'enableUrlDecodeCache' => TRUE, |
|
17 | + 'enableUrlEncodeCache' => TRUE, |
|
18 | + 'emptyUrlReturnValue' => \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'), |
|
19 | + ), |
|
20 | + 'preVars' => array( |
|
21 | + array( |
|
22 | + 'GETvar' => 'L', |
|
23 | + 'valueMap' => array( |
|
24 | + 'en' => '1', |
|
25 | + ), |
|
26 | + 'noMatch' => 'bypass', |
|
27 | + ), |
|
28 | + array( |
|
29 | + 'GETvar' => 'no_cache', |
|
30 | + 'valueMap' => array( |
|
31 | + 'nc' => 1, |
|
32 | + ), |
|
33 | + 'noMatch' => 'bypass', |
|
34 | + ), |
|
35 | + ), |
|
36 | + 'fixedPostVars' => array( |
|
37 | + ), |
|
38 | + 'fileName' => array ( |
|
39 | + 'index' => array( |
|
40 | + '_DEFAULT' => array( |
|
41 | + 'keyValues' => array( |
|
42 | + ) |
|
43 | + ), |
|
44 | + 'sitemap.xml' => array( |
|
45 | + 'keyValues' => array( |
|
46 | + 'type' => 1234, |
|
47 | + ), |
|
48 | + ), |
|
49 | + ), |
|
50 | + 'defaultToHTMLsuffixOnPrev' => '.html', |
|
51 | + ), |
|
52 | + 'postVarSets' => array( |
|
53 | + '_DEFAULT' => array( |
|
54 | + 'controller' => array( |
|
55 | + array( |
|
56 | + 'GETvar' => 'tx_mooxnews_pi1[action]', |
|
57 | + 'noMatch' => 'bypass' |
|
58 | + ), |
|
59 | + array( |
|
60 | + 'GETvar' => 'tx_mooxnews_pi1[controller]', |
|
61 | + 'noMatch' => 'bypass' |
|
62 | + ) |
|
63 | + ), |
|
64 | + 'dateFilter' => array( |
|
65 | + array( |
|
66 | + 'GETvar' => 'tx_mooxnews_pi1[overwriteDemand][year]', |
|
67 | + ), |
|
68 | + array( |
|
69 | + 'GETvar' => 'tx_mooxnews_pi1[overwriteDemand][month]', |
|
70 | + ), |
|
71 | + ), |
|
72 | + 'archive' => array ( |
|
73 | + '0' => array ( |
|
74 | + 'GETvar' => 'tx_mooxnews_pi1[year]', |
|
75 | + ), |
|
76 | + '1' => array ( |
|
77 | + 'GETvar' => 'tx_mooxnews_pi1[month]', |
|
78 | + 'valueMap' => array ( |
|
79 | + 'january' => '01', |
|
80 | + 'february' => '02', |
|
81 | + 'march' => '03', |
|
82 | + 'april' => '04', |
|
83 | + 'may' => '05', |
|
84 | + 'june' => '06', |
|
85 | + 'july' => '07', |
|
86 | + 'august' => '08', |
|
87 | + 'september' => '09', |
|
88 | + 'october' => '10', |
|
89 | + 'november' => '11', |
|
90 | + 'december' => '12', |
|
91 | + ), |
|
92 | + ), |
|
93 | + ), |
|
94 | + 'browse' => array ( |
|
95 | + '0' => array ( |
|
96 | + 'GETvar' => 'tx_mooxnews_pi1[pointer]', |
|
97 | + ), |
|
98 | + ), |
|
99 | + 'select_category' => array ( |
|
100 | + '0' => array ( |
|
101 | + 'GETvar' => 'tx_mooxnews_pi1[cat]', |
|
102 | + ), |
|
103 | + ), |
|
104 | + 'article' => array ( |
|
105 | + '0' => array ( |
|
106 | + 'GETvar' => 'tx_mooxnews_pi1[news]', |
|
107 | + 'lookUpTable' => array ( |
|
108 | + 'table' => 'tx_mooxnews_domain_model_news', |
|
109 | + 'id_field' => 'uid', |
|
110 | + 'alias_field' => 'title', |
|
111 | + 'addWhereClause' => ' AND NOT deleted', |
|
112 | + 'useUniqueCache' => '1', |
|
113 | + 'useUniqueCache_conf' => array ( |
|
114 | + 'strtolower' => '1', |
|
115 | + 'spaceCharacter' => '-', |
|
116 | + ), |
|
117 | + ), |
|
118 | + ), |
|
119 | + '1' => array ( |
|
120 | + 'GETvar' => 'tx_mooxnews_pi1[swords]', |
|
121 | + ), |
|
122 | + ), |
|
123 | + 'page' => array( |
|
124 | + array( |
|
125 | + 'GETvar' => 'tx_mooxnews_pi1[@widget_0][currentPage]', |
|
126 | + ), |
|
127 | + ), |
|
128 | + ), |
|
129 | + ), |
|
130 | 130 | ); |
131 | 131 | |
132 | 132 | ?> |
133 | 133 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -$TYPO3_CONF_VARS['FE']['addRootLineFields'].= ',tx_realurl_pathsegment'; |
|
2 | +$TYPO3_CONF_VARS['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment'; |
|
3 | 3 | $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array( |
4 | 4 | 'pagePath' => array( |
5 | 5 | 'type' => 'user', |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | ), |
36 | 36 | 'fixedPostVars' => array( |
37 | 37 | ), |
38 | - 'fileName' => array ( |
|
38 | + 'fileName' => array( |
|
39 | 39 | 'index' => array( |
40 | 40 | '_DEFAULT' => array( |
41 | 41 | 'keyValues' => array( |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | 'GETvar' => 'tx_mooxnews_pi1[overwriteDemand][month]', |
70 | 70 | ), |
71 | 71 | ), |
72 | - 'archive' => array ( |
|
73 | - '0' => array ( |
|
72 | + 'archive' => array( |
|
73 | + '0' => array( |
|
74 | 74 | 'GETvar' => 'tx_mooxnews_pi1[year]', |
75 | 75 | ), |
76 | - '1' => array ( |
|
76 | + '1' => array( |
|
77 | 77 | 'GETvar' => 'tx_mooxnews_pi1[month]', |
78 | - 'valueMap' => array ( |
|
78 | + 'valueMap' => array( |
|
79 | 79 | 'january' => '01', |
80 | 80 | 'february' => '02', |
81 | 81 | 'march' => '03', |
@@ -91,32 +91,32 @@ discard block |
||
91 | 91 | ), |
92 | 92 | ), |
93 | 93 | ), |
94 | - 'browse' => array ( |
|
95 | - '0' => array ( |
|
94 | + 'browse' => array( |
|
95 | + '0' => array( |
|
96 | 96 | 'GETvar' => 'tx_mooxnews_pi1[pointer]', |
97 | 97 | ), |
98 | 98 | ), |
99 | - 'select_category' => array ( |
|
100 | - '0' => array ( |
|
99 | + 'select_category' => array( |
|
100 | + '0' => array( |
|
101 | 101 | 'GETvar' => 'tx_mooxnews_pi1[cat]', |
102 | 102 | ), |
103 | 103 | ), |
104 | - 'article' => array ( |
|
105 | - '0' => array ( |
|
104 | + 'article' => array( |
|
105 | + '0' => array( |
|
106 | 106 | 'GETvar' => 'tx_mooxnews_pi1[news]', |
107 | - 'lookUpTable' => array ( |
|
107 | + 'lookUpTable' => array( |
|
108 | 108 | 'table' => 'tx_mooxnews_domain_model_news', |
109 | 109 | 'id_field' => 'uid', |
110 | 110 | 'alias_field' => 'title', |
111 | 111 | 'addWhereClause' => ' AND NOT deleted', |
112 | 112 | 'useUniqueCache' => '1', |
113 | - 'useUniqueCache_conf' => array ( |
|
113 | + 'useUniqueCache_conf' => array( |
|
114 | 114 | 'strtolower' => '1', |
115 | 115 | 'spaceCharacter' => '-', |
116 | 116 | ), |
117 | 117 | ), |
118 | 118 | ), |
119 | - '1' => array ( |
|
119 | + '1' => array( |
|
120 | 120 | 'GETvar' => 'tx_mooxnews_pi1[swords]', |
121 | 121 | ), |
122 | 122 | ), |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | 'text' => 'mimetypes-x-content-text' |
11 | 11 | ) |
12 | 12 | ); |
13 | -if (TRUE === isset($GLOBALS['TCA']['tt_content']['ctrl']['typeicons'])) { |
|
13 | +if (TRUE===isset($GLOBALS['TCA']['tt_content']['ctrl']['typeicons'])) { |
|
14 | 14 | $GLOBALS['TCA']['tt_content']['ctrl']['typeicons'] = array_merge( |
15 | 15 | $GLOBALS['TCA']['tt_content']['ctrl']['typeicons'], |
16 | 16 | array( |
@@ -299,12 +299,12 @@ discard block |
||
299 | 299 | $GLOBALS['TCA']['tt_content']['palettes']['table'] |
300 | 300 | ); |
301 | 301 | |
302 | -if (FALSE === \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) { |
|
303 | - unset( $GLOBALS['TCA']['tt_content']['types']['mailform'] ); |
|
302 | +if (FALSE===\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) { |
|
303 | + unset($GLOBALS['TCA']['tt_content']['types']['mailform']); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | foreach ($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'] as $index => $item) { |
307 | - if ($item[1] === 'multimedia') { |
|
307 | + if ($item[1]==='multimedia') { |
|
308 | 308 | unset($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'][$index]); |
309 | 309 | } |
310 | 310 | }; |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | * @return void |
29 | 29 | * @throws Exception If there was an error in registration |
30 | 30 | */ |
31 | - public static function register(){ |
|
32 | - if( self::$registered ){ |
|
31 | + public static function register() { |
|
32 | + if (self::$registered) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
36 | 36 | self::$libDir = dirname(__FILE__); |
37 | 37 | |
38 | - if(false === spl_autoload_register(array('Less_Autoloader', 'loadClass'))){ |
|
38 | + if (false===spl_autoload_register(array('Less_Autoloader', 'loadClass'))) { |
|
39 | 39 | throw new Exception('Unable to register Less_Autoloader::loadClass as an autoloading method.'); |
40 | 40 | } |
41 | 41 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @return void |
49 | 49 | */ |
50 | - public static function unregister(){ |
|
50 | + public static function unregister() { |
|
51 | 51 | spl_autoload_unregister(array('Less_Autoloader', 'loadClass')); |
52 | 52 | self::$registered = false; |
53 | 53 | } |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @param string $className The class to load |
59 | 59 | */ |
60 | - public static function loadClass($className){ |
|
60 | + public static function loadClass($className) { |
|
61 | 61 | |
62 | 62 | |
63 | 63 | // handle only package classes |
64 | - if(strpos($className, 'Less_') !== 0){ |
|
64 | + if (strpos($className, 'Less_')!==0) { |
|
65 | 65 | return; |
66 | 66 | } |
67 | 67 | |
68 | - $className = substr($className,5); |
|
69 | - $fileName = self::$libDir . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; |
|
68 | + $className = substr($className, 5); |
|
69 | + $fileName = self::$libDir.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php'; |
|
70 | 70 | |
71 | - if(file_exists($fileName)){ |
|
71 | + if (file_exists($fileName)) { |
|
72 | 72 | require $fileName; |
73 | 73 | return true; |
74 | - }else{ |
|
74 | + }else { |
|
75 | 75 | throw new Exception('file not loadable '.$fileName); |
76 | 76 | } |
77 | 77 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $this->$funcName( $node ); |
34 | 34 | } |
35 | 35 | |
36 | - }else{ |
|
36 | + } else{ |
|
37 | 37 | $node->accept($this); |
38 | 38 | } |
39 | 39 |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | * @param array|object $options |
34 | 34 | * |
35 | 35 | */ |
36 | - public function setOptions($options){ |
|
37 | - $options = array_intersect_key($options,$this->defaultOptions); |
|
36 | + public function setOptions($options) { |
|
37 | + $options = array_intersect_key($options, $this->defaultOptions); |
|
38 | 38 | $this->options = array_merge($this->defaultOptions, $this->options, $options); |
39 | 39 | } |
40 | 40 | |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | * @param mixed $default Default value if confiuration of $name is not present |
49 | 49 | * @return mixed |
50 | 50 | */ |
51 | - public function getOption($name, $default = null){ |
|
52 | - if(isset($this->options[$name])){ |
|
51 | + public function getOption($name, $default = null) { |
|
52 | + if (isset($this->options[$name])) { |
|
53 | 53 | return $this->options[$name]; |
54 | 54 | } |
55 | 55 | return $default; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @param string $name |
63 | 63 | * @param mixed $value |
64 | 64 | */ |
65 | - public function setOption($name, $value){ |
|
65 | + public function setOption($name, $value) { |
|
66 | 66 | $this->options[$name] = $value; |
67 | 67 | } |
68 | 68 |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | '~' => '~', |
73 | 73 | '>' => '>', |
74 | 74 | '|' => '|', |
75 | - '^' => '^', |
|
76 | - '^^' => '^^' |
|
75 | + '^' => '^', |
|
76 | + '^^' => '^^' |
|
77 | 77 | ); |
78 | 78 | |
79 | 79 | }else{ |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | '~' => ' ~ ', |
89 | 89 | '>' => ' > ', |
90 | 90 | '|' => '|', |
91 | - '^' => ' ^ ', |
|
92 | - '^^' => ' ^^ ' |
|
91 | + '^' => ' ^ ', |
|
92 | + '^^' => ' ^^ ' |
|
93 | 93 | ); |
94 | 94 | |
95 | 95 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * @package Less |
8 | 8 | * @subpackage environment |
9 | 9 | */ |
10 | -class Less_Environment{ |
|
10 | +class Less_Environment { |
|
11 | 11 | |
12 | 12 | //public $paths = array(); // option - unmodified - paths to search for imports on |
13 | 13 | //public static $files = array(); // list of files that have been imported, used for import-once |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | //public $processImports; // option - whether to process imports. if false then imports will not be imported |
18 | 18 | //public $javascriptEnabled; // option - whether JavaScript is enabled. if undefined, defaults to true |
19 | 19 | //public $useFileCache; // browser only - whether to use the per file session cache |
20 | - public $currentFileInfo; // information about the current file - for error reporting and importing and making urls relative etc. |
|
20 | + public $currentFileInfo; // information about the current file - for error reporting and importing and making urls relative etc. |
|
21 | 21 | |
22 | - public $importMultiple = false; // whether we are currently importing multiple copies |
|
22 | + public $importMultiple = false; // whether we are currently importing multiple copies |
|
23 | 23 | |
24 | 24 | |
25 | 25 | /** |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | public $functions = array(); |
54 | 54 | |
55 | 55 | |
56 | - public function Init(){ |
|
56 | + public function Init() { |
|
57 | 57 | |
58 | 58 | self::$parensStack = 0; |
59 | 59 | self::$tabLevel = 0; |
60 | 60 | self::$lastRule = false; |
61 | 61 | self::$mixin_stack = 0; |
62 | 62 | |
63 | - if( Less_Parser::$options['compress'] ){ |
|
63 | + if (Less_Parser::$options['compress']) { |
|
64 | 64 | |
65 | 65 | Less_Environment::$_outputMap = array( |
66 | 66 | ',' => ',', |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | '^^' => '^^' |
77 | 77 | ); |
78 | 78 | |
79 | - }else{ |
|
79 | + }else { |
|
80 | 80 | |
81 | 81 | Less_Environment::$_outputMap = array( |
82 | 82 | ',' => ', ', |
@@ -96,19 +96,19 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | |
99 | - public function copyEvalEnv($frames = array() ){ |
|
99 | + public function copyEvalEnv($frames = array()) { |
|
100 | 100 | $new_env = new Less_Environment(); |
101 | 101 | $new_env->frames = $frames; |
102 | 102 | return $new_env; |
103 | 103 | } |
104 | 104 | |
105 | 105 | |
106 | - public static function isMathOn(){ |
|
106 | + public static function isMathOn() { |
|
107 | 107 | return !Less_Parser::$options['strictMath'] || Less_Environment::$parensStack; |
108 | 108 | } |
109 | 109 | |
110 | - public static function isPathRelative($path){ |
|
111 | - return !preg_match('/^(?:[a-z-]+:|\/)/',$path); |
|
110 | + public static function isPathRelative($path) { |
|
111 | + return !preg_match('/^(?:[a-z-]+:|\/)/', $path); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | |
@@ -119,26 +119,26 @@ discard block |
||
119 | 119 | * @return string Canonicalized path |
120 | 120 | * |
121 | 121 | */ |
122 | - public static function normalizePath($path){ |
|
122 | + public static function normalizePath($path) { |
|
123 | 123 | |
124 | - $segments = explode('/',$path); |
|
124 | + $segments = explode('/', $path); |
|
125 | 125 | $segments = array_reverse($segments); |
126 | 126 | |
127 | 127 | $path = array(); |
128 | 128 | $path_len = 0; |
129 | 129 | |
130 | - while( $segments ){ |
|
130 | + while ($segments) { |
|
131 | 131 | $segment = array_pop($segments); |
132 | - switch( $segment ) { |
|
132 | + switch ($segment) { |
|
133 | 133 | |
134 | 134 | case '.': |
135 | 135 | break; |
136 | 136 | |
137 | 137 | case '..': |
138 | - if( !$path_len || ( $path[$path_len-1] === '..') ){ |
|
138 | + if (!$path_len || ($path[$path_len-1]==='..')) { |
|
139 | 139 | $path[] = $segment; |
140 | 140 | $path_len++; |
141 | - }else{ |
|
141 | + }else { |
|
142 | 142 | array_pop($path); |
143 | 143 | $path_len--; |
144 | 144 | } |
@@ -151,15 +151,15 @@ discard block |
||
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
154 | - return implode('/',$path); |
|
154 | + return implode('/', $path); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | |
158 | - public function unshiftFrame($frame){ |
|
158 | + public function unshiftFrame($frame) { |
|
159 | 159 | array_unshift($this->frames, $frame); |
160 | 160 | } |
161 | 161 | |
162 | - public function shiftFrame(){ |
|
162 | + public function shiftFrame() { |
|
163 | 163 | return array_shift($this->frames); |
164 | 164 | } |
165 | 165 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | '^^' => '^^' |
77 | 77 | ); |
78 | 78 | |
79 | - }else{ |
|
79 | + } else{ |
|
80 | 80 | |
81 | 81 | Less_Environment::$_outputMap = array( |
82 | 82 | ',' => ', ', |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | if( !$path_len || ( $path[$path_len-1] === '..') ){ |
139 | 139 | $path[] = $segment; |
140 | 140 | $path_len++; |
141 | - }else{ |
|
141 | + } else{ |
|
142 | 142 | array_pop($path); |
143 | 143 | $path_len--; |
144 | 144 | } |