@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | return $result; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - if (! is_array($messageId)) { |
|
| 27 | + if (!is_array($messageId)) { |
|
| 28 | 28 | try { |
| 29 | 29 | $entity = LangEntity::getByNamespace($messageId); |
| 30 | 30 | } catch (SS_DatabaseException $ex) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function getFromCache($namespace, $locale = null) { |
| 60 | 60 | $namespace = static::filterCacheKey($namespace); |
| 61 | 61 | |
| 62 | - if (! is_null($locale)) { |
|
| 62 | + if (!is_null($locale)) { |
|
| 63 | 63 | $locale = strtoupper(explode('_', $locale)[0]); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public function storeToCache($namespace, $value, $locale = null) { |
| 85 | 85 | $namespace = static::filterCacheKey($namespace); |
| 86 | 86 | |
| 87 | - if (! is_null($locale)) { |
|
| 87 | + if (!is_null($locale)) { |
|
| 88 | 88 | $locale = strtoupper(explode('_', $locale)[0]); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * @return string |
| 43 | 43 | */ |
| 44 | 44 | protected function addStarsToKeywords($keywords) { |
| 45 | - if (! trim($keywords)) { |
|
| 45 | + if (!trim($keywords)) { |
|
| 46 | 46 | return ""; |
| 47 | 47 | } |
| 48 | 48 | // Add * to each keyword |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public static function getByName($name) { |
| 57 | - if(($module = static::get()->filter('Name', $name)->first()) instanceof LangModule) { |
|
| 57 | + if (($module = static::get()->filter('Name', $name)->first()) instanceof LangModule) { |
|
| 58 | 58 | return $module; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | if ($merge) { // if we can overwrite value |
| 70 | 70 | $entity->Value = $value; |
| 71 | 71 | |
| 72 | - if (! empty($title)) { |
|
| 72 | + if (!empty($title)) { |
|
| 73 | 73 | $entity->Title = $title; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $entity->write(); |
| 77 | 77 | |
| 78 | - if (! ($this->Entities()->byID($entity->ID) instanceof LangEntity)) { |
|
| 78 | + if (!($this->Entities()->byID($entity->ID) instanceof LangEntity)) { |
|
| 79 | 79 | $entity->ModuleID = $this->ID; |
| 80 | 80 | $entity->write(); |
| 81 | 81 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $entityField = TextField::create("Entities[{$entity->ID}]", $entity->Namespace, $entity->Value) |
| 18 | 18 | ); |
| 19 | 19 | |
| 20 | - if (! empty($entity->Title)) { |
|
| 20 | + if (!empty($entity->Title)) { |
|
| 21 | 21 | $entityField->setRightTitle($entity->Title); |
| 22 | 22 | $entityField->setAttribute('title', $entity->Namespace); |
| 23 | 23 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if (! Director::is_ajax()) { |
|
| 45 | + if (!Director::is_ajax()) { |
|
| 46 | 46 | return $form->getController()->redirectBack(); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | parent::init(); |
| 47 | 47 | |
| 48 | 48 | $canAccess = (Director::isDev() || Director::is_cli() || Permission::check("ADMIN")); |
| 49 | - if (! $canAccess) { |
|
| 49 | + if (!$canAccess) { |
|
| 50 | 50 | return Security::permissionFailure($this); |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @throws InvalidLocaleException |
| 121 | 121 | */ |
| 122 | 122 | protected function mergeWith($options = []) { |
| 123 | - if (! array_key_exists('module', $options) || empty($options['module'])) { |
|
| 123 | + if (!array_key_exists('module', $options) || empty($options['module'])) { |
|
| 124 | 124 | throw new EmptyModuleException("Please set one or more (comma-separated) module names"); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | unset($parameters['start']); |
| 87 | 87 | unset($parameters['search']); |
| 88 | 88 | |
| 89 | - LangModule::get()->each(function (LangModule $module) use ($parameters, &$list) { |
|
| 89 | + LangModule::get()->each(function(LangModule $module) use ($parameters, &$list) { |
|
| 90 | 90 | if (array_key_exists('moduleId', $parameters) && $parameters['moduleId'] == $module->ID) { |
| 91 | 91 | $module->Current = true; |
| 92 | 92 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $list->push($module); |
| 102 | 102 | }); |
| 103 | 103 | |
| 104 | - if (! $list->filter('Current', true)->first() && $list->count() > 0) { |
|
| 104 | + if (!$list->filter('Current', true)->first() && $list->count() > 0) { |
|
| 105 | 105 | $list->first()->Current = true; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $entities = $module->Entities(); |
| 123 | 123 | $searchTerm = $this->getRequest()->getVar('search'); |
| 124 | 124 | |
| 125 | - if (! empty($searchTerm)) { |
|
| 125 | + if (!empty($searchTerm)) { |
|
| 126 | 126 | $entities = $entities->filter('SearchFields:LangFulltextBoolean', $searchTerm); |
| 127 | 127 | } |
| 128 | 128 | |