@@ -16,7 +16,9 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | $path = implode('/', $scheme); $path_full = (DIR_UPLOADS . (('' !== $path) ? ($path . '/') : '')); |
| 18 | 18 | |
| 19 | - if (!Explorer::isDir($path_full)) return; |
|
| 19 | + if (!Explorer::isDir($path_full)) { |
|
| 20 | + return; |
|
| 21 | + } |
|
| 20 | 22 | |
| 21 | 23 | $this->scheme = $scheme; $this->path = $path; $this->path_full = $path_full; |
| 22 | 24 | } |
@@ -27,9 +29,12 @@ discard block |
||
| 27 | 29 | |
| 28 | 30 | $scheme = []; $breadcrumbs = []; |
| 29 | 31 | |
| 30 | - if ([] !== $this->scheme) foreach ($this->scheme as $name) { |
|
| 32 | + if ([] !== $this->scheme) { |
|
| 33 | + foreach ($this->scheme as $name) { |
|
| 31 | 34 | |
| 32 | - $scheme[] = $name; $breadcrumbs[] = ['path' => implode('/', $scheme), 'name' => $name]; |
|
| 35 | + $scheme[] = $name; |
|
| 36 | + } |
|
| 37 | + $breadcrumbs[] = ['path' => implode('/', $scheme), 'name' => $name]; |
|
| 33 | 38 | } |
| 34 | 39 | |
| 35 | 40 | # ------------------------ |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | $scheme = array_diff(preg_split('/[\/\\\\]+/', $path, -1, PREG_SPLIT_NO_EMPTY), ['.', '..']); |
| 16 | 16 | |
| 17 | - $path = implode('/', $scheme); $path_full = (DIR_UPLOADS . (('' !== $path) ? ($path . '/') : '')); |
|
| 17 | + $path = implode('/', $scheme); $path_full = (DIR_UPLOADS.(('' !== $path) ? ($path.'/') : '')); |
|
| 18 | 18 | |
| 19 | 19 | if (!Explorer::isDir($path_full)) return; |
| 20 | 20 | |
@@ -12,7 +12,9 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | private function getPrototype(string $name) { |
| 14 | 14 | |
| 15 | - if (preg_match('/[\/\\\\]/', $name)) return false; |
|
| 15 | + if (preg_match('/[\/\\\\]/', $name)) { |
|
| 16 | + return false; |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | 19 | $path = (($this->parent->path() ? ($this->parent->path() . '/') : '') . $name); |
| 18 | 20 | |
@@ -34,11 +36,17 @@ discard block |
||
| 34 | 36 | |
| 35 | 37 | public function init(string $name) { |
| 36 | 38 | |
| 37 | - if (false === ($prototype = $this->getPrototype($name))) return false; |
|
| 39 | + if (false === ($prototype = $this->getPrototype($name))) { |
|
| 40 | + return false; |
|
| 41 | + } |
|
| 38 | 42 | |
| 39 | - if (!Explorer::{static::$checker}($prototype['path_full'])) return false; |
|
| 43 | + if (!Explorer::{static::$checker}($prototype['path_full'])) { |
|
| 44 | + return false; |
|
| 45 | + } |
|
| 40 | 46 | |
| 41 | - foreach ($prototype as $var => $value) $this->$var = $value; |
|
| 47 | + foreach ($prototype as $var => $value) { |
|
| 48 | + $this->$var = $value; |
|
| 49 | + } |
|
| 42 | 50 | |
| 43 | 51 | # ------------------------ |
| 44 | 52 | |
@@ -49,11 +57,17 @@ discard block |
||
| 49 | 57 | |
| 50 | 58 | public function create(string $name) { |
| 51 | 59 | |
| 52 | - if (('' !== $this->name) || (false === ($prototype = $this->getPrototype($name)))) return false; |
|
| 60 | + if (('' !== $this->name) || (false === ($prototype = $this->getPrototype($name)))) { |
|
| 61 | + return false; |
|
| 62 | + } |
|
| 53 | 63 | |
| 54 | - if (!Explorer::{static::$creator}($prototype['path_full'])) return false; |
|
| 64 | + if (!Explorer::{static::$creator}($prototype['path_full'])) { |
|
| 65 | + return false; |
|
| 66 | + } |
|
| 55 | 67 | |
| 56 | - foreach ($prototype as $var => $value) $this->$var = $value; |
|
| 68 | + foreach ($prototype as $var => $value) { |
|
| 69 | + $this->$var = $value; |
|
| 70 | + } |
|
| 57 | 71 | |
| 58 | 72 | # ------------------------ |
| 59 | 73 | |
@@ -64,11 +78,17 @@ discard block |
||
| 64 | 78 | |
| 65 | 79 | public function rename(string $name) { |
| 66 | 80 | |
| 67 | - if (('' === $this->name) || (false === ($prototype = $this->getPrototype($name)))) return false; |
|
| 81 | + if (('' === $this->name) || (false === ($prototype = $this->getPrototype($name)))) { |
|
| 82 | + return false; |
|
| 83 | + } |
|
| 68 | 84 | |
| 69 | - if (!@rename($this->path_full, $prototype['path_full'])) return false; |
|
| 85 | + if (!@rename($this->path_full, $prototype['path_full'])) { |
|
| 86 | + return false; |
|
| 87 | + } |
|
| 70 | 88 | |
| 71 | - foreach ($prototype as $var => $value) $this->$var = $value; |
|
| 89 | + foreach ($prototype as $var => $value) { |
|
| 90 | + $this->$var = $value; |
|
| 91 | + } |
|
| 72 | 92 | |
| 73 | 93 | # ------------------------ |
| 74 | 94 | |
@@ -79,9 +99,13 @@ discard block |
||
| 79 | 99 | |
| 80 | 100 | public function remove() { |
| 81 | 101 | |
| 82 | - if ('' === $this->name) return false; |
|
| 102 | + if ('' === $this->name) { |
|
| 103 | + return false; |
|
| 104 | + } |
|
| 83 | 105 | |
| 84 | - if (!Explorer::{static::$remover}($this->path_full, true)) return false; |
|
| 106 | + if (!Explorer::{static::$remover}($this->path_full, true)) { |
|
| 107 | + return false; |
|
| 108 | + } |
|
| 85 | 109 | |
| 86 | 110 | $this->name = ''; $this->path = ''; $this->path_full = ''; |
| 87 | 111 | |
@@ -14,9 +14,9 @@ |
||
| 14 | 14 | |
| 15 | 15 | if (preg_match('/[\/\\\\]/', $name)) return false; |
| 16 | 16 | |
| 17 | - $path = (($this->parent->path() ? ($this->parent->path() . '/') : '') . $name); |
|
| 17 | + $path = (($this->parent->path() ? ($this->parent->path().'/') : '').$name); |
|
| 18 | 18 | |
| 19 | - $path_full = ($this->parent->pathFull() . $name); |
|
| 19 | + $path_full = ($this->parent->pathFull().$name); |
|
| 20 | 20 | |
| 21 | 21 | # ------------------------ |
| 22 | 22 | |
@@ -12,19 +12,33 @@ |
||
| 12 | 12 | |
| 13 | 13 | $extension = strtolower(Explorer::extension($file_name, false)); |
| 14 | 14 | |
| 15 | - if (self::isImage($extension)) return 'image'; |
|
| 15 | + if (self::isImage($extension)) { |
|
| 16 | + return 'image'; |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | - if (self::isAudio($extension)) return 'audio'; |
|
| 19 | + if (self::isAudio($extension)) { |
|
| 20 | + return 'audio'; |
|
| 21 | + } |
|
| 18 | 22 | |
| 19 | - if (self::isVideo($extension)) return 'video'; |
|
| 23 | + if (self::isVideo($extension)) { |
|
| 24 | + return 'video'; |
|
| 25 | + } |
|
| 20 | 26 | |
| 21 | - if (in_array($extension, ['doc', 'docx'], true)) return 'word'; |
|
| 27 | + if (in_array($extension, ['doc', 'docx'], true)) { |
|
| 28 | + return 'word'; |
|
| 29 | + } |
|
| 22 | 30 | |
| 23 | - if (in_array($extension, ['xls', 'xlsx'], true)) return 'excel'; |
|
| 31 | + if (in_array($extension, ['xls', 'xlsx'], true)) { |
|
| 32 | + return 'excel'; |
|
| 33 | + } |
|
| 24 | 34 | |
| 25 | - if (in_array($extension, ['ppt', 'pptx'], true)) return 'powerpoint'; |
|
| 35 | + if (in_array($extension, ['ppt', 'pptx'], true)) { |
|
| 36 | + return 'powerpoint'; |
|
| 37 | + } |
|
| 26 | 38 | |
| 27 | - if ($extension === 'pdf') return 'pdf'; |
|
| 39 | + if ($extension === 'pdf') { |
|
| 40 | + return 'pdf'; |
|
| 41 | + } |
|
| 28 | 42 | |
| 29 | 43 | # ------------------------ |
| 30 | 44 | |
@@ -39,7 +39,9 @@ |
||
| 39 | 39 | |
| 40 | 40 | $modifier = ((0 === $this->menuitem->id) ? 'create' : 'edit'); |
| 41 | 41 | |
| 42 | - if (!$this->menuitem->$modifier($data)) return 'MENUITEM_ERROR_MODIFY'; |
|
| 42 | + if (!$this->menuitem->$modifier($data)) { |
|
| 43 | + return 'MENUITEM_ERROR_MODIFY'; |
|
| 44 | + } |
|
| 43 | 45 | |
| 44 | 46 | # ------------------------ |
| 45 | 47 | |
@@ -58,43 +58,43 @@ |
||
| 58 | 58 | 'INSTALL_PAGE_INDEX_TITLE' => 'Головна', |
| 59 | 59 | |
| 60 | 60 | 'INSTALL_PAGE_INDEX_CONTENTS' => '<h2>Ласкаво просимо!</h2>' . |
| 61 | - '<p>Це демонстраційний сайт, що працює на <strong>Cadmium CMS</strong>.</p>' . |
|
| 62 | - '<p>Ви можете увійти в панель керування, перейшовши за <a href="$install_path$/admin">цим посиланням</a>.</p>' . |
|
| 63 | - '<h2>Дивіться також</h2>' . |
|
| 64 | - '<ul><li><a href="http://cadmium-cms.com" target="_blank">Офіційний сайт</a></li>' . |
|
| 65 | - '<li><a href="https://github.com/cadmium-org/cadmium-cms" target="_blank">Сторінка проекту на GitHub</a></li></ul>', |
|
| 61 | + '<p>Це демонстраційний сайт, що працює на <strong>Cadmium CMS</strong>.</p>' . |
|
| 62 | + '<p>Ви можете увійти в панель керування, перейшовши за <a href="$install_path$/admin">цим посиланням</a>.</p>' . |
|
| 63 | + '<h2>Дивіться також</h2>' . |
|
| 64 | + '<ul><li><a href="http://cadmium-cms.com" target="_blank">Офіційний сайт</a></li>' . |
|
| 65 | + '<li><a href="https://github.com/cadmium-org/cadmium-cms" target="_blank">Сторінка проекту на GitHub</a></li></ul>', |
|
| 66 | 66 | |
| 67 | 67 | 'INSTALL_PAGE_DEMO_TITLE' => 'Сторінка', |
| 68 | 68 | |
| 69 | 69 | 'INSTALL_PAGE_DEMO_CONTENTS' => '<h2>Lorem ipsum</h2>' . |
| 70 | 70 | |
| 71 | - '<p>Lorem ipsum dolor sit amet, ex etiam facilis vim. ' . |
|
| 72 | - 'Qui etiam soluta nostro no, te praesent consulatu eos. ' . |
|
| 73 | - 'His at modus diceret referrentur, exerci viderer aperiri et sed. ' . |
|
| 74 | - 'Ne errem appareat apeirian has, ut has eligendi comprehensam. ' . |
|
| 75 | - 'His ea adipisci eloquentiam, nec id temporibus appellantur. ' . |
|
| 76 | - 'Pri ut inermis persequeris contentiones, vel vidit ponderum cu.</p>' . |
|
| 71 | + '<p>Lorem ipsum dolor sit amet, ex etiam facilis vim. ' . |
|
| 72 | + 'Qui etiam soluta nostro no, te praesent consulatu eos. ' . |
|
| 73 | + 'His at modus diceret referrentur, exerci viderer aperiri et sed. ' . |
|
| 74 | + 'Ne errem appareat apeirian has, ut has eligendi comprehensam. ' . |
|
| 75 | + 'His ea adipisci eloquentiam, nec id temporibus appellantur. ' . |
|
| 76 | + 'Pri ut inermis persequeris contentiones, vel vidit ponderum cu.</p>' . |
|
| 77 | 77 | |
| 78 | - '<h3>Vix no suas populo</h3>' . |
|
| 78 | + '<h3>Vix no suas populo</h3>' . |
|
| 79 | 79 | |
| 80 | - '<p>Vix no suas populo. Mea inani utinam ex. Duo vocibus noluisse partiendo ei. ' . |
|
| 81 | - 'Impedit voluptatibus pro ut, ea probatus reformidans pri. ' . |
|
| 82 | - 'An vix repudiandae complectitur, ex soluta numquam splendide nam.</p>' . |
|
| 80 | + '<p>Vix no suas populo. Mea inani utinam ex. Duo vocibus noluisse partiendo ei. ' . |
|
| 81 | + 'Impedit voluptatibus pro ut, ea probatus reformidans pri. ' . |
|
| 82 | + 'An vix repudiandae complectitur, ex soluta numquam splendide nam.</p>' . |
|
| 83 | 83 | |
| 84 | - '<p>Mea ex novum contentiones, eleifend ocurreret voluptaria et usu. ' . |
|
| 85 | - 'No mel illum nonumy maiorum, pro saperet disputando in. Cum ei tritani accusam incorrupte. ' . |
|
| 86 | - 'Per animal saperet suavitate id, vim ex quod delicatissimi.</p>' . |
|
| 84 | + '<p>Mea ex novum contentiones, eleifend ocurreret voluptaria et usu. ' . |
|
| 85 | + 'No mel illum nonumy maiorum, pro saperet disputando in. Cum ei tritani accusam incorrupte. ' . |
|
| 86 | + 'Per animal saperet suavitate id, vim ex quod delicatissimi.</p>' . |
|
| 87 | 87 | |
| 88 | - '<h3>Ea mea tantas delenit</h3>' . |
|
| 88 | + '<h3>Ea mea tantas delenit</h3>' . |
|
| 89 | 89 | |
| 90 | - '<p>Ea mea tantas delenit, ut usu alii commune. ' . |
|
| 91 | - 'Te vix decore dolore scribentur. Ad pri malis invidunt ullamcorper, ' . |
|
| 92 | - 'qui eu laboramus vulputate scriptorem, id veri audiam integre pro. ' . |
|
| 93 | - 'Saperet luptatum recusabo quo cu, ' .'vix facer dolores persecuti no. ' . |
|
| 94 | - 'Eos id omnes affert possim. Vix id commune urbanitas.</p>' . |
|
| 90 | + '<p>Ea mea tantas delenit, ut usu alii commune. ' . |
|
| 91 | + 'Te vix decore dolore scribentur. Ad pri malis invidunt ullamcorper, ' . |
|
| 92 | + 'qui eu laboramus vulputate scriptorem, id veri audiam integre pro. ' . |
|
| 93 | + 'Saperet luptatum recusabo quo cu, ' .'vix facer dolores persecuti no. ' . |
|
| 94 | + 'Eos id omnes affert possim. Vix id commune urbanitas.</p>' . |
|
| 95 | 95 | |
| 96 | - '<p>Cu eum quod prodesset, vix sale democritum delicatissimi et, ' . |
|
| 97 | - 'putant viderer inimicus pro ut. Sea ut tamquam hendrerit definitionem, ' . |
|
| 98 | - 'an quo illud persecuti, debet affert vis te. Mei ea omnes saepe nostrum. ' . |
|
| 99 | - 'In sed denique iudicabit. Id eos equidem scribentur.</p>' |
|
| 96 | + '<p>Cu eum quod prodesset, vix sale democritum delicatissimi et, ' . |
|
| 97 | + 'putant viderer inimicus pro ut. Sea ut tamquam hendrerit definitionem, ' . |
|
| 98 | + 'an quo illud persecuti, debet affert vis te. Mei ea omnes saepe nostrum. ' . |
|
| 99 | + 'In sed denique iudicabit. Id eos equidem scribentur.</p>' |
|
| 100 | 100 | ]; |
@@ -60,44 +60,44 @@ |
||
| 60 | 60 | |
| 61 | 61 | 'INSTALL_PAGE_INDEX_TITLE' => 'Головна', |
| 62 | 62 | |
| 63 | - 'INSTALL_PAGE_INDEX_CONTENTS' => '<h2>Ласкаво просимо!</h2>' . |
|
| 64 | - '<p>Це демонстраційний сайт, що працює на <strong>Cadmium CMS</strong>.</p>' . |
|
| 65 | - '<p>Ви можете увійти в панель керування, перейшовши за <a href="$install_path$/admin">цим посиланням</a>.</p>' . |
|
| 66 | - '<h2>Дивіться також</h2>' . |
|
| 67 | - '<ul><li><a href="http://cadmium-cms.com" target="_blank">Офіційний сайт</a></li>' . |
|
| 63 | + 'INSTALL_PAGE_INDEX_CONTENTS' => '<h2>Ласкаво просимо!</h2>'. |
|
| 64 | + '<p>Це демонстраційний сайт, що працює на <strong>Cadmium CMS</strong>.</p>'. |
|
| 65 | + '<p>Ви можете увійти в панель керування, перейшовши за <a href="$install_path$/admin">цим посиланням</a>.</p>'. |
|
| 66 | + '<h2>Дивіться також</h2>'. |
|
| 67 | + '<ul><li><a href="http://cadmium-cms.com" target="_blank">Офіційний сайт</a></li>'. |
|
| 68 | 68 | '<li><a href="https://github.com/cadmium-org/cadmium-cms" target="_blank">Сторінка проекту на GitHub</a></li></ul>', |
| 69 | 69 | |
| 70 | 70 | 'INSTALL_PAGE_DEMO_TITLE' => 'Сторінка', |
| 71 | 71 | |
| 72 | - 'INSTALL_PAGE_DEMO_CONTENTS' => '<h2>Lorem ipsum</h2>' . |
|
| 72 | + 'INSTALL_PAGE_DEMO_CONTENTS' => '<h2>Lorem ipsum</h2>'. |
|
| 73 | 73 | |
| 74 | - '<p>Lorem ipsum dolor sit amet, ex etiam facilis vim. ' . |
|
| 75 | - 'Qui etiam soluta nostro no, te praesent consulatu eos. ' . |
|
| 76 | - 'His at modus diceret referrentur, exerci viderer aperiri et sed. ' . |
|
| 77 | - 'Ne errem appareat apeirian has, ut has eligendi comprehensam. ' . |
|
| 78 | - 'His ea adipisci eloquentiam, nec id temporibus appellantur. ' . |
|
| 79 | - 'Pri ut inermis persequeris contentiones, vel vidit ponderum cu.</p>' . |
|
| 74 | + '<p>Lorem ipsum dolor sit amet, ex etiam facilis vim. '. |
|
| 75 | + 'Qui etiam soluta nostro no, te praesent consulatu eos. '. |
|
| 76 | + 'His at modus diceret referrentur, exerci viderer aperiri et sed. '. |
|
| 77 | + 'Ne errem appareat apeirian has, ut has eligendi comprehensam. '. |
|
| 78 | + 'His ea adipisci eloquentiam, nec id temporibus appellantur. '. |
|
| 79 | + 'Pri ut inermis persequeris contentiones, vel vidit ponderum cu.</p>'. |
|
| 80 | 80 | |
| 81 | - '<h3>Vix no suas populo</h3>' . |
|
| 81 | + '<h3>Vix no suas populo</h3>'. |
|
| 82 | 82 | |
| 83 | - '<p>Vix no suas populo. Mea inani utinam ex. Duo vocibus noluisse partiendo ei. ' . |
|
| 84 | - 'Impedit voluptatibus pro ut, ea probatus reformidans pri. ' . |
|
| 85 | - 'An vix repudiandae complectitur, ex soluta numquam splendide nam.</p>' . |
|
| 83 | + '<p>Vix no suas populo. Mea inani utinam ex. Duo vocibus noluisse partiendo ei. '. |
|
| 84 | + 'Impedit voluptatibus pro ut, ea probatus reformidans pri. '. |
|
| 85 | + 'An vix repudiandae complectitur, ex soluta numquam splendide nam.</p>'. |
|
| 86 | 86 | |
| 87 | - '<p>Mea ex novum contentiones, eleifend ocurreret voluptaria et usu. ' . |
|
| 88 | - 'No mel illum nonumy maiorum, pro saperet disputando in. Cum ei tritani accusam incorrupte. ' . |
|
| 89 | - 'Per animal saperet suavitate id, vim ex quod delicatissimi.</p>' . |
|
| 87 | + '<p>Mea ex novum contentiones, eleifend ocurreret voluptaria et usu. '. |
|
| 88 | + 'No mel illum nonumy maiorum, pro saperet disputando in. Cum ei tritani accusam incorrupte. '. |
|
| 89 | + 'Per animal saperet suavitate id, vim ex quod delicatissimi.</p>'. |
|
| 90 | 90 | |
| 91 | - '<h3>Ea mea tantas delenit</h3>' . |
|
| 91 | + '<h3>Ea mea tantas delenit</h3>'. |
|
| 92 | 92 | |
| 93 | - '<p>Ea mea tantas delenit, ut usu alii commune. ' . |
|
| 94 | - 'Te vix decore dolore scribentur. Ad pri malis invidunt ullamcorper, ' . |
|
| 95 | - 'qui eu laboramus vulputate scriptorem, id veri audiam integre pro. ' . |
|
| 96 | - 'Saperet luptatum recusabo quo cu, ' .'vix facer dolores persecuti no. ' . |
|
| 97 | - 'Eos id omnes affert possim. Vix id commune urbanitas.</p>' . |
|
| 93 | + '<p>Ea mea tantas delenit, ut usu alii commune. '. |
|
| 94 | + 'Te vix decore dolore scribentur. Ad pri malis invidunt ullamcorper, '. |
|
| 95 | + 'qui eu laboramus vulputate scriptorem, id veri audiam integre pro. '. |
|
| 96 | + 'Saperet luptatum recusabo quo cu, '.'vix facer dolores persecuti no. '. |
|
| 97 | + 'Eos id omnes affert possim. Vix id commune urbanitas.</p>'. |
|
| 98 | 98 | |
| 99 | - '<p>Cu eum quod prodesset, vix sale democritum delicatissimi et, ' . |
|
| 100 | - 'putant viderer inimicus pro ut. Sea ut tamquam hendrerit definitionem, ' . |
|
| 101 | - 'an quo illud persecuti, debet affert vis te. Mei ea omnes saepe nostrum. ' . |
|
| 99 | + '<p>Cu eum quod prodesset, vix sale democritum delicatissimi et, '. |
|
| 100 | + 'putant viderer inimicus pro ut. Sea ut tamquam hendrerit definitionem, '. |
|
| 101 | + 'an quo illud persecuti, debet affert vis te. Mei ea omnes saepe nostrum. '. |
|
| 102 | 102 | 'In sed denique iudicabit. Id eos equidem scribentur.</p>' |
| 103 | 103 | ]; |
@@ -58,43 +58,43 @@ |
||
| 58 | 58 | 'INSTALL_PAGE_INDEX_TITLE' => 'Главная', |
| 59 | 59 | |
| 60 | 60 | 'INSTALL_PAGE_INDEX_CONTENTS' => '<h2>Добро пожаловать!</h2>' . |
| 61 | - '<p>Это демонстрационный сайт, работающий на <strong>Cadmium CMS</strong>.</p>' . |
|
| 62 | - '<p>Вы можете войти в панель управления, перейдя по <a href="$install_path$/admin">этой ссылке</a>.</p>' . |
|
| 63 | - '<h2>Смотрите также</h2>' . |
|
| 64 | - '<ul><li><a href="http://cadmium-cms.com" target="_blank">Официальный сайт</a></li>' . |
|
| 65 | - '<li><a href="https://github.com/cadmium-org/cadmium-cms" target="_blank">Страница проекта на GitHub</a></li></ul>', |
|
| 61 | + '<p>Это демонстрационный сайт, работающий на <strong>Cadmium CMS</strong>.</p>' . |
|
| 62 | + '<p>Вы можете войти в панель управления, перейдя по <a href="$install_path$/admin">этой ссылке</a>.</p>' . |
|
| 63 | + '<h2>Смотрите также</h2>' . |
|
| 64 | + '<ul><li><a href="http://cadmium-cms.com" target="_blank">Официальный сайт</a></li>' . |
|
| 65 | + '<li><a href="https://github.com/cadmium-org/cadmium-cms" target="_blank">Страница проекта на GitHub</a></li></ul>', |
|
| 66 | 66 | |
| 67 | 67 | 'INSTALL_PAGE_DEMO_TITLE' => 'Страница', |
| 68 | 68 | |
| 69 | 69 | 'INSTALL_PAGE_DEMO_CONTENTS' => '<h2>Lorem ipsum</h2>' . |
| 70 | 70 | |
| 71 | - '<p>Lorem ipsum dolor sit amet, ex etiam facilis vim. ' . |
|
| 72 | - 'Qui etiam soluta nostro no, te praesent consulatu eos. ' . |
|
| 73 | - 'His at modus diceret referrentur, exerci viderer aperiri et sed. ' . |
|
| 74 | - 'Ne errem appareat apeirian has, ut has eligendi comprehensam. ' . |
|
| 75 | - 'His ea adipisci eloquentiam, nec id temporibus appellantur. ' . |
|
| 76 | - 'Pri ut inermis persequeris contentiones, vel vidit ponderum cu.</p>' . |
|
| 71 | + '<p>Lorem ipsum dolor sit amet, ex etiam facilis vim. ' . |
|
| 72 | + 'Qui etiam soluta nostro no, te praesent consulatu eos. ' . |
|
| 73 | + 'His at modus diceret referrentur, exerci viderer aperiri et sed. ' . |
|
| 74 | + 'Ne errem appareat apeirian has, ut has eligendi comprehensam. ' . |
|
| 75 | + 'His ea adipisci eloquentiam, nec id temporibus appellantur. ' . |
|
| 76 | + 'Pri ut inermis persequeris contentiones, vel vidit ponderum cu.</p>' . |
|
| 77 | 77 | |
| 78 | - '<h3>Vix no suas populo</h3>' . |
|
| 78 | + '<h3>Vix no suas populo</h3>' . |
|
| 79 | 79 | |
| 80 | - '<p>Vix no suas populo. Mea inani utinam ex. Duo vocibus noluisse partiendo ei. ' . |
|
| 81 | - 'Impedit voluptatibus pro ut, ea probatus reformidans pri. ' . |
|
| 82 | - 'An vix repudiandae complectitur, ex soluta numquam splendide nam.</p>' . |
|
| 80 | + '<p>Vix no suas populo. Mea inani utinam ex. Duo vocibus noluisse partiendo ei. ' . |
|
| 81 | + 'Impedit voluptatibus pro ut, ea probatus reformidans pri. ' . |
|
| 82 | + 'An vix repudiandae complectitur, ex soluta numquam splendide nam.</p>' . |
|
| 83 | 83 | |
| 84 | - '<p>Mea ex novum contentiones, eleifend ocurreret voluptaria et usu. ' . |
|
| 85 | - 'No mel illum nonumy maiorum, pro saperet disputando in. Cum ei tritani accusam incorrupte. ' . |
|
| 86 | - 'Per animal saperet suavitate id, vim ex quod delicatissimi.</p>' . |
|
| 84 | + '<p>Mea ex novum contentiones, eleifend ocurreret voluptaria et usu. ' . |
|
| 85 | + 'No mel illum nonumy maiorum, pro saperet disputando in. Cum ei tritani accusam incorrupte. ' . |
|
| 86 | + 'Per animal saperet suavitate id, vim ex quod delicatissimi.</p>' . |
|
| 87 | 87 | |
| 88 | - '<h3>Ea mea tantas delenit</h3>' . |
|
| 88 | + '<h3>Ea mea tantas delenit</h3>' . |
|
| 89 | 89 | |
| 90 | - '<p>Ea mea tantas delenit, ut usu alii commune. ' . |
|
| 91 | - 'Te vix decore dolore scribentur. Ad pri malis invidunt ullamcorper, ' . |
|
| 92 | - 'qui eu laboramus vulputate scriptorem, id veri audiam integre pro. ' . |
|
| 93 | - 'Saperet luptatum recusabo quo cu, ' .'vix facer dolores persecuti no. ' . |
|
| 94 | - 'Eos id omnes affert possim. Vix id commune urbanitas.</p>' . |
|
| 90 | + '<p>Ea mea tantas delenit, ut usu alii commune. ' . |
|
| 91 | + 'Te vix decore dolore scribentur. Ad pri malis invidunt ullamcorper, ' . |
|
| 92 | + 'qui eu laboramus vulputate scriptorem, id veri audiam integre pro. ' . |
|
| 93 | + 'Saperet luptatum recusabo quo cu, ' .'vix facer dolores persecuti no. ' . |
|
| 94 | + 'Eos id omnes affert possim. Vix id commune urbanitas.</p>' . |
|
| 95 | 95 | |
| 96 | - '<p>Cu eum quod prodesset, vix sale democritum delicatissimi et, ' . |
|
| 97 | - 'putant viderer inimicus pro ut. Sea ut tamquam hendrerit definitionem, ' . |
|
| 98 | - 'an quo illud persecuti, debet affert vis te. Mei ea omnes saepe nostrum. ' . |
|
| 99 | - 'In sed denique iudicabit. Id eos equidem scribentur.</p>' |
|
| 96 | + '<p>Cu eum quod prodesset, vix sale democritum delicatissimi et, ' . |
|
| 97 | + 'putant viderer inimicus pro ut. Sea ut tamquam hendrerit definitionem, ' . |
|
| 98 | + 'an quo illud persecuti, debet affert vis te. Mei ea omnes saepe nostrum. ' . |
|
| 99 | + 'In sed denique iudicabit. Id eos equidem scribentur.</p>' |
|
| 100 | 100 | ]; |
@@ -60,44 +60,44 @@ |
||
| 60 | 60 | |
| 61 | 61 | 'INSTALL_PAGE_INDEX_TITLE' => 'Главная', |
| 62 | 62 | |
| 63 | - 'INSTALL_PAGE_INDEX_CONTENTS' => '<h2>Добро пожаловать!</h2>' . |
|
| 64 | - '<p>Это демонстрационный сайт, работающий на <strong>Cadmium CMS</strong>.</p>' . |
|
| 65 | - '<p>Вы можете войти в панель управления, перейдя по <a href="$install_path$/admin">этой ссылке</a>.</p>' . |
|
| 66 | - '<h2>Смотрите также</h2>' . |
|
| 67 | - '<ul><li><a href="http://cadmium-cms.com" target="_blank">Официальный сайт</a></li>' . |
|
| 63 | + 'INSTALL_PAGE_INDEX_CONTENTS' => '<h2>Добро пожаловать!</h2>'. |
|
| 64 | + '<p>Это демонстрационный сайт, работающий на <strong>Cadmium CMS</strong>.</p>'. |
|
| 65 | + '<p>Вы можете войти в панель управления, перейдя по <a href="$install_path$/admin">этой ссылке</a>.</p>'. |
|
| 66 | + '<h2>Смотрите также</h2>'. |
|
| 67 | + '<ul><li><a href="http://cadmium-cms.com" target="_blank">Официальный сайт</a></li>'. |
|
| 68 | 68 | '<li><a href="https://github.com/cadmium-org/cadmium-cms" target="_blank">Страница проекта на GitHub</a></li></ul>', |
| 69 | 69 | |
| 70 | 70 | 'INSTALL_PAGE_DEMO_TITLE' => 'Страница', |
| 71 | 71 | |
| 72 | - 'INSTALL_PAGE_DEMO_CONTENTS' => '<h2>Lorem ipsum</h2>' . |
|
| 72 | + 'INSTALL_PAGE_DEMO_CONTENTS' => '<h2>Lorem ipsum</h2>'. |
|
| 73 | 73 | |
| 74 | - '<p>Lorem ipsum dolor sit amet, ex etiam facilis vim. ' . |
|
| 75 | - 'Qui etiam soluta nostro no, te praesent consulatu eos. ' . |
|
| 76 | - 'His at modus diceret referrentur, exerci viderer aperiri et sed. ' . |
|
| 77 | - 'Ne errem appareat apeirian has, ut has eligendi comprehensam. ' . |
|
| 78 | - 'His ea adipisci eloquentiam, nec id temporibus appellantur. ' . |
|
| 79 | - 'Pri ut inermis persequeris contentiones, vel vidit ponderum cu.</p>' . |
|
| 74 | + '<p>Lorem ipsum dolor sit amet, ex etiam facilis vim. '. |
|
| 75 | + 'Qui etiam soluta nostro no, te praesent consulatu eos. '. |
|
| 76 | + 'His at modus diceret referrentur, exerci viderer aperiri et sed. '. |
|
| 77 | + 'Ne errem appareat apeirian has, ut has eligendi comprehensam. '. |
|
| 78 | + 'His ea adipisci eloquentiam, nec id temporibus appellantur. '. |
|
| 79 | + 'Pri ut inermis persequeris contentiones, vel vidit ponderum cu.</p>'. |
|
| 80 | 80 | |
| 81 | - '<h3>Vix no suas populo</h3>' . |
|
| 81 | + '<h3>Vix no suas populo</h3>'. |
|
| 82 | 82 | |
| 83 | - '<p>Vix no suas populo. Mea inani utinam ex. Duo vocibus noluisse partiendo ei. ' . |
|
| 84 | - 'Impedit voluptatibus pro ut, ea probatus reformidans pri. ' . |
|
| 85 | - 'An vix repudiandae complectitur, ex soluta numquam splendide nam.</p>' . |
|
| 83 | + '<p>Vix no suas populo. Mea inani utinam ex. Duo vocibus noluisse partiendo ei. '. |
|
| 84 | + 'Impedit voluptatibus pro ut, ea probatus reformidans pri. '. |
|
| 85 | + 'An vix repudiandae complectitur, ex soluta numquam splendide nam.</p>'. |
|
| 86 | 86 | |
| 87 | - '<p>Mea ex novum contentiones, eleifend ocurreret voluptaria et usu. ' . |
|
| 88 | - 'No mel illum nonumy maiorum, pro saperet disputando in. Cum ei tritani accusam incorrupte. ' . |
|
| 89 | - 'Per animal saperet suavitate id, vim ex quod delicatissimi.</p>' . |
|
| 87 | + '<p>Mea ex novum contentiones, eleifend ocurreret voluptaria et usu. '. |
|
| 88 | + 'No mel illum nonumy maiorum, pro saperet disputando in. Cum ei tritani accusam incorrupte. '. |
|
| 89 | + 'Per animal saperet suavitate id, vim ex quod delicatissimi.</p>'. |
|
| 90 | 90 | |
| 91 | - '<h3>Ea mea tantas delenit</h3>' . |
|
| 91 | + '<h3>Ea mea tantas delenit</h3>'. |
|
| 92 | 92 | |
| 93 | - '<p>Ea mea tantas delenit, ut usu alii commune. ' . |
|
| 94 | - 'Te vix decore dolore scribentur. Ad pri malis invidunt ullamcorper, ' . |
|
| 95 | - 'qui eu laboramus vulputate scriptorem, id veri audiam integre pro. ' . |
|
| 96 | - 'Saperet luptatum recusabo quo cu, ' .'vix facer dolores persecuti no. ' . |
|
| 97 | - 'Eos id omnes affert possim. Vix id commune urbanitas.</p>' . |
|
| 93 | + '<p>Ea mea tantas delenit, ut usu alii commune. '. |
|
| 94 | + 'Te vix decore dolore scribentur. Ad pri malis invidunt ullamcorper, '. |
|
| 95 | + 'qui eu laboramus vulputate scriptorem, id veri audiam integre pro. '. |
|
| 96 | + 'Saperet luptatum recusabo quo cu, '.'vix facer dolores persecuti no. '. |
|
| 97 | + 'Eos id omnes affert possim. Vix id commune urbanitas.</p>'. |
|
| 98 | 98 | |
| 99 | - '<p>Cu eum quod prodesset, vix sale democritum delicatissimi et, ' . |
|
| 100 | - 'putant viderer inimicus pro ut. Sea ut tamquam hendrerit definitionem, ' . |
|
| 101 | - 'an quo illud persecuti, debet affert vis te. Mei ea omnes saepe nostrum. ' . |
|
| 99 | + '<p>Cu eum quod prodesset, vix sale democritum delicatissimi et, '. |
|
| 100 | + 'putant viderer inimicus pro ut. Sea ut tamquam hendrerit definitionem, '. |
|
| 101 | + 'an quo illud persecuti, debet affert vis te. Mei ea omnes saepe nostrum. '. |
|
| 102 | 102 | 'In sed denique iudicabit. Id eos equidem scribentur.</p>' |
| 103 | 103 | ]; |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | |
| 24 | 24 | # Set defaults |
| 25 | 25 | |
| 26 | -if (function_exists('mb_internal_encoding')) mb_internal_encoding('UTF-8'); |
|
| 26 | +if (function_exists('mb_internal_encoding')) { |
|
| 27 | + mb_internal_encoding('UTF-8'); |
|
| 28 | +} |
|
| 27 | 29 | |
| 28 | 30 | date_default_timezone_set('UTC'); |
| 29 | 31 | |
@@ -2,24 +2,24 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | # Define constants |
| 4 | 4 | |
| 5 | -define('DIR_FRAMEWORK', (dirname(__FILE__) . '/')); |
|
| 5 | +define('DIR_FRAMEWORK', (dirname(__FILE__).'/')); |
|
| 6 | 6 | |
| 7 | -define('DIR_CLASSES', (DIR_FRAMEWORK . 'Classes/')); |
|
| 8 | -define('DIR_DATA', (DIR_FRAMEWORK . 'Data/')); |
|
| 9 | -define('DIR_INCLUDES', (DIR_FRAMEWORK . 'Includes/')); |
|
| 10 | -define('DIR_TEMPLATES', (DIR_FRAMEWORK . 'Templates/')); |
|
| 7 | +define('DIR_CLASSES', (DIR_FRAMEWORK.'Classes/')); |
|
| 8 | +define('DIR_DATA', (DIR_FRAMEWORK.'Data/')); |
|
| 9 | +define('DIR_INCLUDES', (DIR_FRAMEWORK.'Includes/')); |
|
| 10 | +define('DIR_TEMPLATES', (DIR_FRAMEWORK.'Templates/')); |
|
| 11 | 11 | |
| 12 | 12 | # Require classes |
| 13 | 13 | |
| 14 | -require_once (DIR_FRAMEWORK . 'Engine.php'); |
|
| 15 | -require_once (DIR_FRAMEWORK . 'Exception.php'); |
|
| 14 | +require_once (DIR_FRAMEWORK.'Engine.php'); |
|
| 15 | +require_once (DIR_FRAMEWORK.'Exception.php'); |
|
| 16 | 16 | |
| 17 | 17 | # Require configuration |
| 18 | 18 | |
| 19 | -require_once (DIR_INCLUDES . 'Constants.php'); |
|
| 20 | -require_once (DIR_INCLUDES . 'Regex.php'); |
|
| 21 | -require_once (DIR_INCLUDES . 'Headers/Mime.php'); |
|
| 22 | -require_once (DIR_INCLUDES . 'Headers/Status.php'); |
|
| 19 | +require_once (DIR_INCLUDES.'Constants.php'); |
|
| 20 | +require_once (DIR_INCLUDES.'Regex.php'); |
|
| 21 | +require_once (DIR_INCLUDES.'Headers/Mime.php'); |
|
| 22 | +require_once (DIR_INCLUDES.'Headers/Status.php'); |
|
| 23 | 23 | |
| 24 | 24 | # Set defaults |
| 25 | 25 | |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | # Set request constants |
| 31 | 31 | |
| 32 | -define('REQUEST_CLIENT_IP', Engine::getIP()); |
|
| 32 | +define('REQUEST_CLIENT_IP', Engine::getIP()); |
|
| 33 | 33 | |
| 34 | -define('REQUEST_TIME', $_SERVER['REQUEST_TIME']); |
|
| 35 | -define('REQUEST_TIME_FLOAT', $_SERVER['REQUEST_TIME_FLOAT']); |
|
| 34 | +define('REQUEST_TIME', $_SERVER['REQUEST_TIME']); |
|
| 35 | +define('REQUEST_TIME_FLOAT', $_SERVER['REQUEST_TIME_FLOAT']); |
|
| 36 | 36 | |
| 37 | 37 | # Set exception handler |
| 38 | 38 | |
@@ -10,14 +10,18 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | foreach (($string = explode("\n", $string)) as $key => $line) { |
| 12 | 12 | |
| 13 | - if ($multiline && $codestyle) $string[$key] = rtrim(preg_replace('/[\r\0\x0B]+/', '', $line)); |
|
| 14 | - |
|
| 15 | - else $string[$key] = trim(preg_replace(['/[ \t]+/', '/[\r\0\x0B]+/'], [' ', ''], $line)); |
|
| 13 | + if ($multiline && $codestyle) { |
|
| 14 | + $string[$key] = rtrim(preg_replace('/[\r\0\x0B]+/', '', $line)); |
|
| 15 | + } else { |
|
| 16 | + $string[$key] = trim(preg_replace(['/[ \t]+/', '/[\r\0\x0B]+/'], [' ', ''], $line)); |
|
| 17 | + } |
|
| 16 | 18 | } |
| 17 | 19 | |
| 18 | - if (!$multiline) $string = preg_replace('/ {2,}/', ' ', trim(implode(' ', $string), ' ')); |
|
| 19 | - |
|
| 20 | - else $string = preg_replace('/(\r\n){3,}/', "\r\n\r\n", trim(implode("\r\n", $string), "\r\n")); |
|
| 20 | + if (!$multiline) { |
|
| 21 | + $string = preg_replace('/ {2,}/', ' ', trim(implode(' ', $string), ' ')); |
|
| 22 | + } else { |
|
| 23 | + $string = preg_replace('/(\r\n){3,}/', "\r\n\r\n", trim(implode("\r\n", $string), "\r\n")); |
|
| 24 | + } |
|
| 21 | 25 | |
| 22 | 26 | # ------------------------ |
| 23 | 27 | |
@@ -136,7 +140,9 @@ discard block |
||
| 136 | 140 | |
| 137 | 141 | public static function cut(string $string, int $maxlength, bool $ellipsis = false) { |
| 138 | 142 | |
| 139 | - if (($maxlength < 1) || (self::length($string = trim($string)) <= $maxlength)) return $string; |
|
| 143 | + if (($maxlength < 1) || (self::length($string = trim($string)) <= $maxlength)) { |
|
| 144 | + return $string; |
|
| 145 | + } |
|
| 140 | 146 | |
| 141 | 147 | $string = (rtrim(self::substr($string, 0, $maxlength)) . ($ellipsis ? '...' : '')); |
| 142 | 148 | |
@@ -149,9 +155,13 @@ discard block |
||
| 149 | 155 | |
| 150 | 156 | public static function random(int $length, string $pool = STR_POOL_DEFAULT) { |
| 151 | 157 | |
| 152 | - if (($length < 1) || (0 === ($pool_length = self::length($pool)))) return ''; |
|
| 158 | + if (($length < 1) || (0 === ($pool_length = self::length($pool)))) { |
|
| 159 | + return ''; |
|
| 160 | + } |
|
| 153 | 161 | |
| 154 | - $string = ''; for ($i = 0; $i < $length; $i++) $string .= self::substr($pool, random_int(0, ($pool_length - 1)), 1); |
|
| 162 | + $string = ''; for ($i = 0; $i < $length; $i++) { |
|
| 163 | + $string .= self::substr($pool, random_int(0, ($pool_length - 1)), 1); |
|
| 164 | + } |
|
| 155 | 165 | |
| 156 | 166 | # ------------------------ |
| 157 | 167 | |
@@ -73,25 +73,25 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $pattern = [ |
| 75 | 75 | |
| 76 | - 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', |
|
| 77 | - 'Д' => 'D', 'Е' => 'E', 'Ж' => 'ZH', 'З' => 'Z', |
|
| 78 | - 'И' => 'I', 'Й' => 'J', 'К' => 'K', 'Л' => 'L', |
|
| 79 | - 'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', |
|
| 80 | - 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', |
|
| 81 | - 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C', 'Ч' => 'CH', |
|
| 82 | - 'Ш' => 'SH', 'Щ' => 'SCH', 'Ъ' => '', 'Ь' => '', |
|
| 83 | - 'Ы' => 'Y', 'Э' => 'E', 'Ю' => 'JU', 'Я' => 'JA', |
|
| 84 | - 'І' => 'I', 'Ї' => 'JI', 'Ё' => 'JO', |
|
| 85 | - |
|
| 86 | - 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', |
|
| 87 | - 'д' => 'd', 'е' => 'e', 'ж' => 'zh', 'з' => 'z', |
|
| 88 | - 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l', |
|
| 89 | - 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', |
|
| 90 | - 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', |
|
| 91 | - 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch', |
|
| 92 | - 'ш' => 'sh', 'щ' => 'sch', 'ъ' => '', 'ь' => '', |
|
| 93 | - 'ы' => 'y', 'э' => 'e', 'ю' => 'ju', 'я' => 'ja', |
|
| 94 | - 'і' => 'i', 'ї' => 'ji', 'ё' => 'jo' |
|
| 76 | + 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', |
|
| 77 | + 'Д' => 'D', 'Е' => 'E', 'Ж' => 'ZH', 'З' => 'Z', |
|
| 78 | + 'И' => 'I', 'Й' => 'J', 'К' => 'K', 'Л' => 'L', |
|
| 79 | + 'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', |
|
| 80 | + 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', |
|
| 81 | + 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C', 'Ч' => 'CH', |
|
| 82 | + 'Ш' => 'SH', 'Щ' => 'SCH', 'Ъ' => '', 'Ь' => '', |
|
| 83 | + 'Ы' => 'Y', 'Э' => 'E', 'Ю' => 'JU', 'Я' => 'JA', |
|
| 84 | + 'І' => 'I', 'Ї' => 'JI', 'Ё' => 'JO', |
|
| 85 | + |
|
| 86 | + 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', |
|
| 87 | + 'д' => 'd', 'е' => 'e', 'ж' => 'zh', 'з' => 'z', |
|
| 88 | + 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l', |
|
| 89 | + 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', |
|
| 90 | + 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', |
|
| 91 | + 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch', |
|
| 92 | + 'ш' => 'sh', 'щ' => 'sch', 'ъ' => '', 'ь' => '', |
|
| 93 | + 'ы' => 'y', 'э' => 'e', 'ю' => 'ju', 'я' => 'ja', |
|
| 94 | + 'і' => 'i', 'ї' => 'ji', 'ё' => 'jo' |
|
| 95 | 95 | ]; |
| 96 | 96 | |
| 97 | 97 | # ------------------------ |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | if (($maxlength < 1) || (self::length($string = trim($string)) <= $maxlength)) return $string; |
| 178 | 178 | |
| 179 | - $string = (rtrim(self::substr($string, 0, $maxlength)) . ($ellipsis ? '...' : '')); |
|
| 179 | + $string = (rtrim(self::substr($string, 0, $maxlength)).($ellipsis ? '...' : '')); |
|
| 180 | 180 | |
| 181 | 181 | # ------------------------ |
| 182 | 182 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | public static function encode(string $salt, string $string) { |
| 206 | 206 | |
| 207 | - return sha1($salt . substr(sha1($string), 8, 32)); |
|
| 207 | + return sha1($salt.substr(sha1($string), 8, 32)); |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | public function __construct(Form $form, string $key, string $value = '', |
| 46 | 46 | |
| 47 | - array $options = [], string $default = null, array $config = []) { |
|
| 47 | + array $options = [], string $default = null, array $config = []) { |
|
| 48 | 48 | |
| 49 | 49 | # Init field |
| 50 | 50 | |
@@ -77,9 +77,13 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | # Set appearance |
| 79 | 79 | |
| 80 | - if ($this->search) $tag->setAttribute('data-search', 'search'); |
|
| 80 | + if ($this->search) { |
|
| 81 | + $tag->setAttribute('data-search', 'search'); |
|
| 82 | + } |
|
| 81 | 83 | |
| 82 | - if ($this->auto) $tag->setAttribute('data-auto', 'auto'); |
|
| 84 | + if ($this->auto) { |
|
| 85 | + $tag->setAttribute('data-auto', 'auto'); |
|
| 86 | + } |
|
| 83 | 87 | |
| 84 | 88 | # Set options |
| 85 | 89 | |
@@ -87,7 +91,9 @@ discard block |
||
| 87 | 91 | |
| 88 | 92 | $option = (new Tag('option', [], $text))->setAttribute('value', $value); |
| 89 | 93 | |
| 90 | - if ($this->value === $value) $option->setAttribute('selected', ''); |
|
| 94 | + if ($this->value === $value) { |
|
| 95 | + $option->setAttribute('selected', ''); |
|
| 96 | + } |
|
| 91 | 97 | |
| 92 | 98 | $options->addItem($option->getBlock()); |
| 93 | 99 | } |