@@ -107,7 +107,7 @@ |
||
| 107 | 107 | /** |
| 108 | 108 | * Used for preview controls, mainly links which switch between different states of the page. |
| 109 | 109 | * |
| 110 | - * @return ArrayData |
|
| 110 | + * @return SilverStripe\Model\FieldType\DBField |
|
| 111 | 111 | */ |
| 112 | 112 | public function getSilverStripeNavigator() |
| 113 | 113 | { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | )->setHTMLID('Form_EditForm'); |
| 71 | 71 | $form->setValidationResponseCallback(function() use ($negotiator, $form) { |
| 72 | 72 | $request = $this->getRequest(); |
| 73 | - if($request->isAjax() && $negotiator) { |
|
| 73 | + if ($request->isAjax() && $negotiator) { |
|
| 74 | 74 | $form->setupFormErrors(); |
| 75 | 75 | $result = $form->forTemplate(); |
| 76 | 76 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | try { |
| 130 | 130 | $siteConfig->write(); |
| 131 | - } catch(ValidationException $ex) { |
|
| 131 | + } catch (ValidationException $ex) { |
|
| 132 | 132 | $form->sessionMessage($ex->getResult()->message(), 'bad'); |
| 133 | 133 | return $this->getResponseNegotiator()->respond($this->request); |
| 134 | 134 | } |
@@ -54,6 +54,9 @@ discard block |
||
| 54 | 54 | $this->requireFile(BASE_PATH . '/themes/' . $theme . '/templates/' . $template, $content); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + /** |
|
| 58 | + * @param string $filename |
|
| 59 | + */ |
|
| 57 | 60 | protected function requireFile($filename, $content) |
| 58 | 61 | { |
| 59 | 62 | // Already exists |
@@ -71,6 +74,9 @@ discard block |
||
| 71 | 74 | } |
| 72 | 75 | } |
| 73 | 76 | |
| 77 | + /** |
|
| 78 | + * @param string $dirname |
|
| 79 | + */ |
|
| 74 | 80 | protected function requireDir($dirname) |
| 75 | 81 | { |
| 76 | 82 | // Directory doesn't exist, create it and mark it for deletion |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | throw new \InvalidArgumentException("Bad theme '$theme'"); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - $this->requireDir(BASE_PATH . '/themes'); |
|
| 35 | - $this->requireDir(BASE_PATH . '/themes/' . $theme); |
|
| 36 | - $this->requireDir(BASE_PATH . '/themes/' . $theme . '/templates'); |
|
| 34 | + $this->requireDir(BASE_PATH.'/themes'); |
|
| 35 | + $this->requireDir(BASE_PATH.'/themes/'.$theme); |
|
| 36 | + $this->requireDir(BASE_PATH.'/themes/'.$theme.'/templates'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $this->stepCreateTheme($theme); |
| 54 | - $this->requireFile(BASE_PATH . '/themes/' . $theme . '/templates/' . $template, $content); |
|
| 54 | + $this->requireFile(BASE_PATH.'/themes/'.$theme.'/templates/'.$template, $content); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | protected function requireFile($filename, $content) |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | // Add extra contexts with more steps |
| 35 | 35 | $this->useContext('ThemeContext', new \SilverStripe\Siteconfig\Test\Behaviour\ThemeContext($parameters)); |
| 36 | - if(!class_exists('SiteTree')) { |
|
| 36 | + if (!class_exists('SiteTree')) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $factory = $fixtureContext->getFixtureFactory(); |
| 42 | 42 | foreach (\ClassInfo::subclassesFor('SiteTree') as $id => $class) { |
| 43 | 43 | $blueprint = \Injector::inst()->create('FixtureBlueprint', $class); |
| 44 | - $blueprint->addCallback('afterCreate', function ($obj, $identifier, &$data, &$fixtures) { |
|
| 44 | + $blueprint->addCallback('afterCreate', function($obj, $identifier, &$data, &$fixtures) { |
|
| 45 | 45 | $obj->publish('Stage', 'Live'); |
| 46 | 46 | }); |
| 47 | 47 | $factory->define($class, $blueprint); |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | $fields->makeFieldReadonly($titleField); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if (file_exists(BASE_PATH . '/install.php')) { |
|
| 144 | + if (file_exists(BASE_PATH.'/install.php')) { |
|
| 145 | 145 | $fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader", |
| 146 | - "<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING", |
|
| 146 | + "<p class=\"message warning\">"._t("SiteTree.REMOVE_INSTALL_WARNING", |
|
| 147 | 147 | "Warning: You should remove install.php from this SilverStripe install for security reasons.") |
| 148 | 148 | . "</p>"), "Title"); |
| 149 | 149 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | public function getAvailableThemes($baseDir = null) |
| 166 | 166 | { |
| 167 | 167 | $themes = SSViewer::get_themes($baseDir); |
| 168 | - $disabled = (array)$this->config()->disabled_themes; |
|
| 168 | + $disabled = (array) $this->config()->disabled_themes; |
|
| 169 | 169 | |
| 170 | 170 | foreach ($disabled as $theme) { |
| 171 | 171 | if (isset($themes[$theme])) { |
@@ -26,16 +26,16 @@ |
||
| 26 | 26 | { |
| 27 | 27 | $config = $this->objFromFixture('SiteConfig', 'default'); |
| 28 | 28 | $ds = DIRECTORY_SEPARATOR; |
| 29 | - $testThemeBaseDir = TEMP_FOLDER . $ds . 'test-themes'; |
|
| 29 | + $testThemeBaseDir = TEMP_FOLDER.$ds.'test-themes'; |
|
| 30 | 30 | |
| 31 | 31 | if (file_exists($testThemeBaseDir)) { |
| 32 | 32 | Filesystem::removeFolder($testThemeBaseDir); |
| 33 | 33 | } |
| 34 | 34 | mkdir($testThemeBaseDir); |
| 35 | - mkdir($testThemeBaseDir . $ds . 'blackcandy'); |
|
| 36 | - mkdir($testThemeBaseDir . $ds . 'blackcandy_blog'); |
|
| 37 | - mkdir($testThemeBaseDir . $ds . 'darkshades'); |
|
| 38 | - mkdir($testThemeBaseDir . $ds . 'darkshades_blog'); |
|
| 35 | + mkdir($testThemeBaseDir.$ds.'blackcandy'); |
|
| 36 | + mkdir($testThemeBaseDir.$ds.'blackcandy_blog'); |
|
| 37 | + mkdir($testThemeBaseDir.$ds.'darkshades'); |
|
| 38 | + mkdir($testThemeBaseDir.$ds.'darkshades_blog'); |
|
| 39 | 39 | |
| 40 | 40 | $themes = $config->getAvailableThemes($testThemeBaseDir); |
| 41 | 41 | $this->assertContains('blackcandy', $themes, 'Test themes contain blackcandy theme'); |