@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | //-- router |
| 28 | 28 | $router = self::$box->get('HexMakina\BlackBox\RouterInterface'); |
| 29 | - $router->addRoutes(require(__DIR__ . '/routes.php')); |
|
| 29 | + $router->addRoutes(require(__DIR__.'/routes.php')); |
|
| 30 | 30 | |
| 31 | 31 | //-- session |
| 32 | 32 | $StateAgent = self::$box->get('HexMakina\BlackBox\StateAgentInterface'); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | self::$box->get('\Smarty')->assign('lezer', $lezer); |
| 52 | 52 | self::$box->get('\Smarty')->assign('language', $language); |
| 53 | 53 | |
| 54 | - setcookie('lang', $language, time() + (365 * 24 * 60 * 60), "/", ""); |
|
| 54 | + setcookie('lang', $language, time()+(365 * 24 * 60 * 60), "/", ""); |
|
| 55 | 55 | |
| 56 | 56 | return self::$box; |
| 57 | 57 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $setting = 'settings.default.charset'; |
| 63 | 63 | if (is_string(self::$box->get($setting))) { |
| 64 | 64 | ini_set('default_charset', self::$box->get($setting)); |
| 65 | - header('Content-type: text/html; charset=' . strtolower(self::$box->get($setting))); |
|
| 65 | + header('Content-type: text/html; charset='.strtolower(self::$box->get($setting))); |
|
| 66 | 66 | } else { |
| 67 | 67 | throw new \UnexpectedValueException($setting); |
| 68 | 68 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | // ---- parametroj:linguo |
| 71 | 71 | $setting = 'settings.default.language'; |
| 72 | 72 | if (is_string(self::$box->get($setting))) { |
| 73 | - putenv('LANG=' . self::$box->get($setting)); |
|
| 73 | + putenv('LANG='.self::$box->get($setting)); |
|
| 74 | 74 | setlocale(LC_ALL, self::$box->get($setting)); |
| 75 | 75 | } else { |
| 76 | 76 | throw new \UnexpectedValueException($setting); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | foreach (self::$box->get('settings.smarty.template_extra_directories') as $i => $template_dir) { |
| 95 | 95 | $smarty->addTemplateDir($template_dir); |
| 96 | 96 | } |
| 97 | - $smarty->addTemplateDir(__DIR__ . '/Views/'); //kadro templates |
|
| 97 | + $smarty->addTemplateDir(__DIR__.'/Views/'); //kadro templates |
|
| 98 | 98 | |
| 99 | 99 | $setting = 'settings.smarty.compiled_path'; |
| 100 | 100 | if (is_string(self::$box->get($setting))) { |
@@ -43,12 +43,12 @@ |
||
| 43 | 43 | |
| 44 | 44 | public static function enhance_query_retrieve($Query, $filters, $options) |
| 45 | 45 | { |
| 46 | - AutoJoin::join($Query,[ACL::table(),'ACL'], null, 'LEFT OUTER'); |
|
| 47 | - $permission_alias = AutoJoin::join($Query,[Permission::table(), 'permission'], null, 'LEFT OUTER'); |
|
| 46 | + AutoJoin::join($Query, [ACL::table(), 'ACL'], null, 'LEFT OUTER'); |
|
| 47 | + $permission_alias = AutoJoin::join($Query, [Permission::table(), 'permission'], null, 'LEFT OUTER'); |
|
| 48 | 48 | |
| 49 | 49 | $permission_ids_and_names = []; |
| 50 | - $permission_ids_and_names [] = sprintf('GROUP_CONCAT(DISTINCT %s.%s) as %s', $permission_alias, 'id', $permission_alias . '_ids'); |
|
| 51 | - $permission_ids_and_names [] = sprintf('GROUP_CONCAT(DISTINCT %s.%s) as %s', $permission_alias, 'name', $permission_alias . '_names'); |
|
| 50 | + $permission_ids_and_names [] = sprintf('GROUP_CONCAT(DISTINCT %s.%s) as %s', $permission_alias, 'id', $permission_alias.'_ids'); |
|
| 51 | + $permission_ids_and_names [] = sprintf('GROUP_CONCAT(DISTINCT %s.%s) as %s', $permission_alias, 'name', $permission_alias.'_names'); |
|
| 52 | 52 | $Query->selectAlso($permission_ids_and_names); |
| 53 | 53 | |
| 54 | 54 | $Query->selectAlso(['operator.name as operator_name', 'operator.active as operator_active']); |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | use HexMakina\BlackBox\Auth\OperatorInterface; |
| 7 | 7 | use HexMakina\Crudites\Queries\AutoJoin; |
| 8 | 8 | |
| 9 | -use HexMakina\TightORM\{TightModel,RelationManyToMany}; |
|
| 9 | +use HexMakina\TightORM\{TightModel, RelationManyToMany}; |
|
| 10 | 10 | |
| 11 | 11 | class Operator extends TightModel implements OperatorInterface |
| 12 | 12 | { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | if (isset($filters['model']) && !empty($filters['model'])) { |
| 96 | - $Query->join([static::otm('t'), static::otm('a')], [[static::otm('a'),static::otm('k'), 't_from','id']], 'INNER'); |
|
| 96 | + $Query->join([static::otm('t'), static::otm('a')], [[static::otm('a'), static::otm('k'), 't_from', 'id']], 'INNER'); |
|
| 97 | 97 | $Query->whereFieldsEQ(['model_id' => $filters['model']->getId(), 'model_type' => get_class($filters['model'])::model_type()], static::otm('a')); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | public function hasPermission($p): bool |
| 149 | 149 | { |
| 150 | 150 | // new instances or inactive operators, none shall pass |
| 151 | - if ($this->isNew() === true || $this->isActive() === false) { |
|
| 151 | + if ($this->isNew() === true || $this->isActive() === false) { |
|
| 152 | 152 | return false; |
| 153 | 153 | } |
| 154 | 154 | |