@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Ffcms\Core\Helper\FileSystem\Directory; |
| 10 | 10 | use Ffcms\Core\Helper\FileSystem\Normalize; |
| 11 | 11 | use Ffcms\Core\Helper\Type\Any; |
| 12 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 13 | 12 | use Ffcms\Core\Helper\Type\Str; |
| 14 | 13 | use Gregwar\Image\Image; |
| 15 | 14 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | - * Set default values from database record |
|
| 48 | - */ |
|
| 47 | + * Set default values from database record |
|
| 48 | + */ |
|
| 49 | 49 | public function before() |
| 50 | 50 | { |
| 51 | 51 | // set data from db record |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * Form labels |
|
| 89 | - * @return array |
|
| 90 | - */ |
|
| 88 | + * Form labels |
|
| 89 | + * @return array |
|
| 90 | + */ |
|
| 91 | 91 | public function labels(): array |
| 92 | 92 | { |
| 93 | 93 | return [ |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | - * Content update form validation rules |
|
| 104 | - * @return array |
|
| 105 | - */ |
|
| 103 | + * Content update form validation rules |
|
| 104 | + * @return array |
|
| 105 | + */ |
|
| 106 | 106 | public function rules(): array |
| 107 | 107 | { |
| 108 | 108 | $r = [ |
@@ -57,13 +57,13 @@ discard block |
||
| 57 | 57 | // set current user id |
| 58 | 58 | $this->authorId = App::$User->identity()->getId(); |
| 59 | 59 | // set true if it is a new content item |
| 60 | - if ($this->_record->id === null || (int)$this->_record->id < 1) { |
|
| 60 | + if ($this->_record->id === null || (int) $this->_record->id < 1) { |
|
| 61 | 61 | $this->_new = true; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // set random path slug if not defined |
| 65 | 65 | if ($this->path === null || Str::likeEmpty($this->path)) { |
| 66 | - $randPath = date('d-m-Y') . '-' . Str::randomLatin(mt_rand(8, 12)); |
|
| 66 | + $randPath = date('d-m-Y').'-'.Str::randomLatin(mt_rand(8, 12)); |
|
| 67 | 67 | $this->path = Str::lowerCase($randPath); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -107,21 +107,21 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $r = [ |
| 109 | 109 | [['path', 'categoryId'], 'required'], |
| 110 | - ['title.' . App::$Request->getLanguage(), 'required'], |
|
| 111 | - ['text.' . App::$Request->getLanguage(), 'required', null, true, true], |
|
| 110 | + ['title.'.App::$Request->getLanguage(), 'required'], |
|
| 111 | + ['text.'.App::$Request->getLanguage(), 'required', null, true, true], |
|
| 112 | 112 | ['text', 'used', null, true, true], |
| 113 | 113 | ['path', 'direct_match', '/^[a-zA-Z0-9\-]+$/'], |
| 114 | 114 | ['categoryId', 'in', $this->categoryIds()], |
| 115 | 115 | ['path', 'Apps\Model\Front\Content\FormNarrowContentUpdate::validatePath'], |
| 116 | 116 | ['poster', 'used'], |
| 117 | 117 | ['poster', 'isFile', ['jpg', 'png', 'gif', 'jpeg']], |
| 118 | - ['poster', 'sizeFile', (int)$this->_configs['gallerySize'] * 1024] // in bytes |
|
| 118 | + ['poster', 'sizeFile', (int) $this->_configs['gallerySize'] * 1024] // in bytes |
|
| 119 | 119 | ]; |
| 120 | 120 | |
| 121 | 121 | foreach (App::$Properties->get('languages') as $lang) { |
| 122 | - $r[] = ['title.' . $lang, 'length_max', 120, null, true, true]; |
|
| 123 | - $r[] = ['keywords.' . $lang, 'length_max', 150]; |
|
| 124 | - $r[] = ['description.' . $lang, 'length_max', 250]; |
|
| 122 | + $r[] = ['title.'.$lang, 'length_max', 120, null, true, true]; |
|
| 123 | + $r[] = ['keywords.'.$lang, 'length_max', 150]; |
|
| 124 | + $r[] = ['description.'.$lang, 'length_max', 250]; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | return $r; |
@@ -147,9 +147,9 @@ discard block |
||
| 147 | 147 | $this->_record->title = $this->title; |
| 148 | 148 | $this->_record->text = $this->text; |
| 149 | 149 | $this->_record->path = $this->path; |
| 150 | - $this->_record->category_id = (int)$this->categoryId; |
|
| 150 | + $this->_record->category_id = (int) $this->categoryId; |
|
| 151 | 151 | $this->_record->display = 0; // set to premoderation |
| 152 | - $this->_record->author_id = (int)$this->authorId; |
|
| 152 | + $this->_record->author_id = (int) $this->authorId; |
|
| 153 | 153 | if ($this->_new) { |
| 154 | 154 | $this->_record->comment_hash = $this->generateCommentHash(); |
| 155 | 155 | } |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | // work with poster data |
| 160 | 160 | if ($this->poster !== null) { |
| 161 | 161 | // lets move poster from tmp to gallery |
| 162 | - $originDir = '/upload/gallery/' . $this->_record->id . '/orig/'; |
|
| 163 | - $thumbDir = '/upload/gallery/' . $this->_record->id . '/thumb/'; |
|
| 162 | + $originDir = '/upload/gallery/'.$this->_record->id.'/orig/'; |
|
| 163 | + $thumbDir = '/upload/gallery/'.$this->_record->id.'/thumb/'; |
|
| 164 | 164 | if (!Directory::exist($originDir)) { |
| 165 | 165 | Directory::create($originDir); |
| 166 | 166 | } |
@@ -169,17 +169,17 @@ discard block |
||
| 169 | 169 | Directory::create($thumbDir); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - $fileName = App::$Security->simpleHash($this->poster->getClientOriginalName() . $this->poster->getSize()); |
|
| 173 | - $newFullName = $fileName . '.' . $this->poster->guessExtension(); |
|
| 172 | + $fileName = App::$Security->simpleHash($this->poster->getClientOriginalName().$this->poster->getSize()); |
|
| 173 | + $newFullName = $fileName.'.'.$this->poster->guessExtension(); |
|
| 174 | 174 | // move poster to upload gallery directory |
| 175 | 175 | $this->poster->move(Normalize::diskFullPath($originDir), $newFullName); |
| 176 | 176 | // initialize image resizer |
| 177 | 177 | $thumb = new Image(); |
| 178 | - $thumb->setCacheDir(root . '/Private/Cache/images'); |
|
| 178 | + $thumb->setCacheDir(root.'/Private/Cache/images'); |
|
| 179 | 179 | |
| 180 | 180 | // open original file, resize it and save |
| 181 | - $thumbSaveName = Normalize::diskFullPath($thumbDir) . '/' . $fileName . '.jpg'; |
|
| 182 | - $thumb->open(Normalize::diskFullPath($originDir) . DIRECTORY_SEPARATOR . $newFullName) |
|
| 181 | + $thumbSaveName = Normalize::diskFullPath($thumbDir).'/'.$fileName.'.jpg'; |
|
| 182 | + $thumb->open(Normalize::diskFullPath($originDir).DIRECTORY_SEPARATOR.$newFullName) |
|
| 183 | 183 | ->cropResize($this->_configs['galleryResize']) |
| 184 | 184 | ->save($thumbSaveName, 'jpg', 90); |
| 185 | 185 | $thumb = null; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Apps\Model\Install\Main; |
| 4 | 4 | |
| 5 | -use Apps\ActiveRecord\Migration; |
|
| 6 | 5 | use Apps\ActiveRecord\Profile; |
| 7 | 6 | use Apps\ActiveRecord\System; |
| 8 | 7 | use Apps\ActiveRecord\User; |
@@ -105,14 +105,14 @@ |
||
| 105 | 105 | $cfg['baseDomain'] = $this->baseDomain; |
| 106 | 106 | $cfg['database'] = $this->db; |
| 107 | 107 | $cfg['singleLanguage'] = $this->singleLanguage; |
| 108 | - $cfg['multiLanguage'] = (bool)$this->multiLanguage; |
|
| 109 | - $cfg['passwordSalt'] = '$2a$07$' . Str::randomLatinNumeric(mt_rand(21, 30)) . '$'; |
|
| 110 | - $cfg['debug']['cookie']['key'] = 'fdebug_' . Str::randomLatinNumeric(mt_rand(4, 16)); |
|
| 108 | + $cfg['multiLanguage'] = (bool) $this->multiLanguage; |
|
| 109 | + $cfg['passwordSalt'] = '$2a$07$'.Str::randomLatinNumeric(mt_rand(21, 30)).'$'; |
|
| 110 | + $cfg['debug']['cookie']['key'] = 'fdebug_'.Str::randomLatinNumeric(mt_rand(4, 16)); |
|
| 111 | 111 | $cfg['debug']['cookie']['value'] = Str::randomLatinNumeric(mt_rand(32, 128)); |
| 112 | 112 | $cfg['mail'] = $this->mail; |
| 113 | 113 | |
| 114 | 114 | // initialize migrations table |
| 115 | - App::$Database->getConnection('install')->getSchemaBuilder()->create('migrations', function ($table) { |
|
| 115 | + App::$Database->getConnection('install')->getSchemaBuilder()->create('migrations', function($table) { |
|
| 116 | 116 | $table->increments('id'); |
| 117 | 117 | $table->string('migration', 128)->unique(); |
| 118 | 118 | $table->timestamps(); |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | use Ffcms\Core\Helper\HTML\Listing; |
| 4 | 4 | use Ffcms\Core\Helper\Type\Any; |
| 5 | 5 | use Ffcms\Core\Helper\Type\Arr; |
| 6 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 7 | 6 | use Ffcms\Core\Helper\Type\Str; |
| 8 | 7 | use Ffcms\Core\Helper\Url; |
| 9 | 8 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | <?php |
| 26 | 26 | $customCssCode = \App::$View->showPlainCode('css'); |
| 27 | 27 | if ($customCssCode !== null) { |
| 28 | - echo '<style>' . $customCssCode . '</style>'; |
|
| 28 | + echo '<style>'.$customCssCode.'</style>'; |
|
| 29 | 29 | } ?> |
| 30 | 30 | <script> |
| 31 | 31 | var script_url = '<?= \App::$Alias->scriptUrl ?>'; |
@@ -122,11 +122,11 @@ discard block |
||
| 122 | 122 | 'type' => 'ul', |
| 123 | 123 | 'property' => ['class' => 'nav nav-second-level'], |
| 124 | 124 | 'items' => [ |
| 125 | - ['type' => 'link', 'link' => ['main/settings'], 'text' => '<i class="fa fa-cogs"></i> ' . __('Settings'), 'html' => true], |
|
| 126 | - ['type' => 'link', 'link' => ['main/files'], 'text' => '<i class="fa fa-file-o"></i> ' . __('Files'), 'html' => true], |
|
| 127 | - ['type' => 'link', 'link' => ['main/antivirus'], 'text' => '<i class="fa fa-shield"></i> ' . __('Antivirus'), 'html' => true], |
|
| 128 | - ['type' => 'link', 'link' => ['main/routing'], 'text' => '<i class="fa fa-code"></i> ' . __('Routing'), 'html' => true], |
|
| 129 | - ['type' => 'link', 'link' => ['main/updates'], 'text' => '<i class="fa fa-gavel"></i> ' . __('Updates'), 'html' => true] |
|
| 125 | + ['type' => 'link', 'link' => ['main/settings'], 'text' => '<i class="fa fa-cogs"></i> '.__('Settings'), 'html' => true], |
|
| 126 | + ['type' => 'link', 'link' => ['main/files'], 'text' => '<i class="fa fa-file-o"></i> '.__('Files'), 'html' => true], |
|
| 127 | + ['type' => 'link', 'link' => ['main/antivirus'], 'text' => '<i class="fa fa-shield"></i> '.__('Antivirus'), 'html' => true], |
|
| 128 | + ['type' => 'link', 'link' => ['main/routing'], 'text' => '<i class="fa fa-code"></i> '.__('Routing'), 'html' => true], |
|
| 129 | + ['type' => 'link', 'link' => ['main/updates'], 'text' => '<i class="fa fa-gavel"></i> '.__('Updates'), 'html' => true] |
|
| 130 | 130 | ] |
| 131 | 131 | ]) ?> |
| 132 | 132 | <!-- /.nav-second-level --> |
@@ -146,22 +146,22 @@ discard block |
||
| 146 | 146 | foreach ($extTable as $item) { |
| 147 | 147 | $menuItem = [ |
| 148 | 148 | 'type' => 'link', |
| 149 | - 'link' => [Str::lowerCase($item->sys_name) . '/index'], |
|
| 150 | - 'text' => $item->getLocaleName() . (!$item->checkVersion() ? ' <i class="fa fa-wrench" style="color: #ffbd26;"></i>' : null), |
|
| 149 | + 'link' => [Str::lowerCase($item->sys_name).'/index'], |
|
| 150 | + 'text' => $item->getLocaleName().(!$item->checkVersion() ? ' <i class="fa fa-wrench" style="color: #ffbd26;"></i>' : null), |
|
| 151 | 151 | 'html' => true |
| 152 | 152 | ]; |
| 153 | 153 | if ($item->type === 'app') { |
| 154 | 154 | $appControllers[] = $item->sys_name; |
| 155 | 155 | $appMenuItems[] = $menuItem; |
| 156 | - } elseif($item->type === 'widget') { |
|
| 156 | + } elseif ($item->type === 'widget') { |
|
| 157 | 157 | $widgetControllers[] = $item->sys_name; |
| 158 | 158 | $widgetMenuItems[] = $menuItem; |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - $appMenuItems[] = ['type' => 'link', 'link' => ['application/index'], 'text' => __('All apps') . '...']; |
|
| 162 | + $appMenuItems[] = ['type' => 'link', 'link' => ['application/index'], 'text' => __('All apps').'...']; |
|
| 163 | 163 | $appControllers[] = 'Application'; |
| 164 | - $widgetMenuItems[] = ['type' => 'link', 'link' => ['widget/index'], 'text' => __('All widgets') . '...']; |
|
| 164 | + $widgetMenuItems[] = ['type' => 'link', 'link' => ['widget/index'], 'text' => __('All widgets').'...']; |
|
| 165 | 165 | $widgetControllers[] = 'Widget'; |
| 166 | 166 | ?> |
| 167 | 167 | <li<?= Arr::in(\App::$Request->getController(), $appControllers) ? ' class="active"' : null ?>> |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | echo $body; |
| 223 | 223 | } else { |
| 224 | 224 | \App::$Response->setStatusCode(404); |
| 225 | - echo '<p>' . __('Page is not founded!') . '</p>'; |
|
| 225 | + echo '<p>'.__('Page is not founded!').'</p>'; |
|
| 226 | 226 | } |
| 227 | 227 | ?> |
| 228 | 228 | </article> |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | <?php |
| 255 | 255 | $customJsCode = \App::$View->showPlainCode('js'); |
| 256 | 256 | if ($customJsCode !== null) { |
| 257 | - echo '<script>' . $customJsCode . '</script>'; |
|
| 257 | + echo '<script>'.$customJsCode.'</script>'; |
|
| 258 | 258 | } |
| 259 | 259 | ?> |
| 260 | 260 | </body> |
@@ -200,13 +200,16 @@ |
||
| 200 | 200 | <?php foreach ($this->breadcrumbs as $bUrl => $bText): ?> |
| 201 | 201 | <?php if (Any::isInt($bUrl)): // only text ?> |
| 202 | 202 | <li class="active"><?= \App::$Security->strip_tags($bText) ?></li> |
| 203 | - <?php else: ?> |
|
| 203 | + <?php else { |
|
| 204 | + : ?> |
|
| 204 | 205 | <li> |
| 205 | 206 | <a href="<?= \App::$Security->strip_tags($bUrl) ?>"> |
| 206 | 207 | <?= \App::$Security->strip_tags($bText) ?> |
| 207 | 208 | </a> |
| 208 | 209 | </li> |
| 209 | - <?php endif; ?> |
|
| 210 | + <?php endif; |
|
| 211 | +} |
|
| 212 | +?> |
|
| 210 | 213 | <?php endforeach; ?> |
| 211 | 214 | </ol> |
| 212 | 215 | <?php endif; ?> |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | use Ffcms\Core\Helper\Date; |
| 4 | 4 | use Ffcms\Core\Helper\Type\Any; |
| 5 | 5 | use Ffcms\Core\Helper\Type\Arr; |
| 6 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 7 | 6 | use Ffcms\Core\Helper\Type\Str; |
| 8 | 7 | use Ffcms\Core\Helper\Url; |
| 9 | 8 | |
@@ -124,12 +124,12 @@ |
||
| 124 | 124 | </div> |
| 125 | 125 | <div class="meta"> |
| 126 | 126 | <?php if ((int)$catConfigs['showRating'] === 1) { |
| 127 | - echo \App::$View->render('content/_rate', [ |
|
| 128 | - 'id' => $item['id'], |
|
| 129 | - 'canRate' => $item['canRate'], |
|
| 130 | - 'rating' => $item['rating'] |
|
| 131 | - ]); |
|
| 132 | - } ?> |
|
| 127 | + echo \App::$View->render('content/_rate', [ |
|
| 128 | + 'id' => $item['id'], |
|
| 129 | + 'canRate' => $item['canRate'], |
|
| 130 | + 'rating' => $item['rating'] |
|
| 131 | + ]); |
|
| 132 | + } ?> |
|
| 133 | 133 | |
| 134 | 134 | <span class="spaced hidden-xs"><i class="glyphicon glyphicon-comment"></i> |
| 135 | 135 | <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>#comments-list"><?= __('Comments') ?>: <span itemprop="commentCount" id="comment-count-<?= $item['id'] ?>">0</span></a> |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | $catConfigs = []; |
| 17 | 17 | foreach ($model->category['configs'] as $key=>$value) { |
| 18 | - $catConfigs[$key] = (int)$value === 1; |
|
| 18 | + $catConfigs[$key] = (int) $value === 1; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $catMeta = [ |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | <?php foreach ($model->items as $item): ?> |
| 69 | 69 | <article class="article-item" itemscope="itemscope" itemtype="https://schema.org/NewsArticle"> |
| 70 | 70 | <h2 itemprop="name"> |
| 71 | - <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>"> |
|
| 71 | + <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>"> |
|
| 72 | 72 | <?= $item['title'] ?> |
| 73 | 73 | </a> |
| 74 | 74 | <?php if ($item['important']): ?> |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | <?php |
| 99 | 99 | $ownerNick = $item['author']->profile->getNickname(); |
| 100 | 100 | if ($item['author']->getId() < 1) { |
| 101 | - echo '<s>' . $ownerNick . '</s>'; |
|
| 101 | + echo '<s>'.$ownerNick.'</s>'; |
|
| 102 | 102 | } else { |
| 103 | 103 | echo Url::link(['profile/show', $item['author']->getId()], $ownerNick, ['itemprop' => 'author']); |
| 104 | 104 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | <div class="row"> |
| 116 | 116 | <div class="col-md-12"> |
| 117 | 117 | <?php if ($catConfigs['showPoster'] === true && $item['thumb'] !== null): ?> |
| 118 | - <img src="<?= \App::$Alias->scriptUrl . $item['thumb'] ?>" class="image_poster img-thumbnail hidden-xs" alt="<?= __('Poster for') ?>: <?= Str::lowerCase($item['title']) ?>" /> |
|
| 118 | + <img src="<?= \App::$Alias->scriptUrl.$item['thumb'] ?>" class="image_poster img-thumbnail hidden-xs" alt="<?= __('Poster for') ?>: <?= Str::lowerCase($item['title']) ?>" /> |
|
| 119 | 119 | <?php endif; ?> |
| 120 | 120 | <div itemprop="text articleBody"> |
| 121 | 121 | <?= $item['text'] ?> |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | </div> |
| 124 | 124 | </div> |
| 125 | 125 | <div class="meta"> |
| 126 | - <?php if ((int)$catConfigs['showRating'] === 1) { |
|
| 126 | + <?php if ((int) $catConfigs['showRating'] === 1) { |
|
| 127 | 127 | echo \App::$View->render('content/_rate', [ |
| 128 | 128 | 'id' => $item['id'], |
| 129 | 129 | 'canRate' => $item['canRate'], |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | } ?> |
| 133 | 133 | |
| 134 | 134 | <span class="spaced hidden-xs"><i class="glyphicon glyphicon-comment"></i> |
| 135 | - <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>#comments-list"><?= __('Comments') ?>: <span itemprop="commentCount" id="comment-count-<?= $item['id'] ?>">0</span></a> |
|
| 135 | + <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>#comments-list"><?= __('Comments') ?>: <span itemprop="commentCount" id="comment-count-<?= $item['id'] ?>">0</span></a> |
|
| 136 | 136 | </span> |
| 137 | 137 | <span class="pull-right"> |
| 138 | - <?php if ((int)$catConfigs['showTags'] === 1 && $item['tags'] !== null && Any::isArray($item['tags'])): ?> |
|
| 138 | + <?php if ((int) $catConfigs['showTags'] === 1 && $item['tags'] !== null && Any::isArray($item['tags'])): ?> |
|
| 139 | 139 | <span class="spaced"><i class="glyphicon glyphicon-tags hidden-xs"></i> |
| 140 | 140 | <?php |
| 141 | 141 | foreach ($item['tags'] as $tag) { |
| 142 | 142 | $tag = trim($tag); |
| 143 | - echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default']) . " "; |
|
| 143 | + echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default'])." "; |
|
| 144 | 144 | } |
| 145 | 145 | ?> |
| 146 | 146 | </span> |
@@ -109,9 +109,12 @@ |
||
| 109 | 109 | <span class="spaced"><i class="glyphicon glyphicon-eye-open"></i> <?= $item['views'] ?></span> |
| 110 | 110 | <?php endif; ?> |
| 111 | 111 | </div> |
| 112 | - <?php else: ?> |
|
| 112 | + <?php else { |
|
| 113 | + : ?> |
|
| 113 | 114 | <hr /> |
| 114 | - <?php endif; ?> |
|
| 115 | + <?php endif; |
|
| 116 | +} |
|
| 117 | +?> |
|
| 115 | 118 | <div class="row"> |
| 116 | 119 | <div class="col-md-12"> |
| 117 | 120 | <?php if ($catConfigs['showPoster'] === true && $item['thumb'] !== null): ?> |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | use Apps\ActiveRecord\App as AppRecord; |
| 4 | 4 | use Ffcms\Core\Helper\HTML\Bootstrap\Navbar; |
| 5 | 5 | use Ffcms\Core\Helper\Type\Any; |
| 6 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 7 | 6 | use Widgets\Basic\LanguageSwitcher; |
| 8 | 7 | |
| 9 | 8 | ?> |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | <?php |
| 23 | 23 | $customCssCode = \App::$View->showPlainCode('css'); |
| 24 | 24 | if ($customCssCode !== null) { |
| 25 | - echo '<style>' . $customCssCode . '</style>'; |
|
| 25 | + echo '<style>'.$customCssCode.'</style>'; |
|
| 26 | 26 | } ?> |
| 27 | 27 | <script> |
| 28 | 28 | var script_url = '<?= \App::$Alias->scriptUrl ?>'; |
@@ -40,33 +40,33 @@ discard block |
||
| 40 | 40 | if (\App::$User->isAuth()) { |
| 41 | 41 | $userId = \App::$User->identity()->getId(); |
| 42 | 42 | // show 'add content' button if current controller is Content and user add is enabled |
| 43 | - if (\App::$Request->getController() === 'Content' && (bool)AppRecord::getConfig('app', 'Content', 'userAdd')) { |
|
| 44 | - $items[] = ['type' => 'link', 'link' => ['content/update'], 'text' => '<i class="glyphicon glyphicon-plus"></i> ' . __('Add content'), 'html' => true, 'position' => 'right']; |
|
| 43 | + if (\App::$Request->getController() === 'Content' && (bool) AppRecord::getConfig('app', 'Content', 'userAdd')) { |
|
| 44 | + $items[] = ['type' => 'link', 'link' => ['content/update'], 'text' => '<i class="glyphicon glyphicon-plus"></i> '.__('Add content'), 'html' => true, 'position' => 'right']; |
|
| 45 | 45 | } |
| 46 | 46 | $accountDropdown[] = ['link' => ['profile/show', $userId], 'text' => __('My profile')]; |
| 47 | - $accountDropdown[] = ['link' => ['profile/messages'], 'text' => __('Messages') . ' <span class="badge" id="pm-count-block">0</span>', 'html' => true, '!secure' => true]; |
|
| 47 | + $accountDropdown[] = ['link' => ['profile/messages'], 'text' => __('Messages').' <span class="badge" id="pm-count-block">0</span>', 'html' => true, '!secure' => true]; |
|
| 48 | 48 | $accountDropdown[] = ['link' => ['profile/feed'], 'text' => __('Feed')]; |
| 49 | - $accountDropdown[] = ['link' => ['profile/notifications'], 'text' => __('Notifications') . ' <span class="badge" id="notify-count-block">0</span>', 'html' => true, '!secure' => true]; |
|
| 50 | - if ((bool)AppRecord::getConfig('app', 'Content', 'userAdd')) { |
|
| 49 | + $accountDropdown[] = ['link' => ['profile/notifications'], 'text' => __('Notifications').' <span class="badge" id="notify-count-block">0</span>', 'html' => true, '!secure' => true]; |
|
| 50 | + if ((bool) AppRecord::getConfig('app', 'Content', 'userAdd')) { |
|
| 51 | 51 | $accountDropdown[] = ['link' => ['content/my'], 'text' => __('My content')]; |
| 52 | 52 | } |
| 53 | 53 | $accountDropdown[] = ['link' => ['profile/settings'], 'text' => __('Settings')]; |
| 54 | 54 | |
| 55 | 55 | $items[] = [ |
| 56 | 56 | 'type' => 'dropdown', |
| 57 | - 'text' => '<i class="glyphicon glyphicon-user"></i> ' . __('Account') . ' <span class="badge" id="summary-count-block">0</span>', |
|
| 57 | + 'text' => '<i class="glyphicon glyphicon-user"></i> '.__('Account').' <span class="badge" id="summary-count-block">0</span>', |
|
| 58 | 58 | 'html' => true, |
| 59 | 59 | '!secure' => true, |
| 60 | 60 | 'position' => 'right', |
| 61 | 61 | 'items' => $accountDropdown |
| 62 | 62 | ]; |
| 63 | 63 | if (\App::$User->identity()->role->can('Admin/Main/Index')) { |
| 64 | - $items[] = ['type' => 'link', 'link' => \App::$Alias->scriptUrl . '/admin/', 'text' => '<i class="glyphicon glyphicon-cog"></i> Admin', 'position' => 'right', 'html' => true]; |
|
| 64 | + $items[] = ['type' => 'link', 'link' => \App::$Alias->scriptUrl.'/admin/', 'text' => '<i class="glyphicon glyphicon-cog"></i> Admin', 'position' => 'right', 'html' => true]; |
|
| 65 | 65 | } |
| 66 | - $items[] = ['type' => 'link', 'link' => ['user/logout'], 'text' => '<i class="glyphicon glyphicon-log-out"></i> ' . __('Logout'), 'html' => true, 'position' => 'right']; |
|
| 66 | + $items[] = ['type' => 'link', 'link' => ['user/logout'], 'text' => '<i class="glyphicon glyphicon-log-out"></i> '.__('Logout'), 'html' => true, 'position' => 'right']; |
|
| 67 | 67 | } else { |
| 68 | - $items[] = ['type' => 'link', 'link' => ['user/login'], 'text' => '<i class="glyphicon glyphicon-log-in"></i> ' . __('Sign in'), 'position' => 'right', 'html' => true]; |
|
| 69 | - $items[] = ['type' => 'link', 'link' => ['user/signup'], 'text' => '<i class="glyphicon glyphicon-check"></i> ' . __('Sign up'), 'position' => 'right', 'html' => true]; |
|
| 68 | + $items[] = ['type' => 'link', 'link' => ['user/login'], 'text' => '<i class="glyphicon glyphicon-log-in"></i> '.__('Sign in'), 'position' => 'right', 'html' => true]; |
|
| 69 | + $items[] = ['type' => 'link', 'link' => ['user/signup'], 'text' => '<i class="glyphicon glyphicon-check"></i> '.__('Sign up'), 'position' => 'right', 'html' => true]; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | echo Navbar::display([ |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | 'container' => 'container', |
| 77 | 77 | 'collapseId' => 'collapse-object', |
| 78 | 78 | 'items' => $items |
| 79 | -]);?> |
|
| 79 | +]); ?> |
|
| 80 | 80 | </header> |
| 81 | 81 | |
| 82 | 82 | <div class="container body-container"> |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | echo $body; |
| 159 | 159 | } else { |
| 160 | 160 | \App::$Response->setStatusCode(404); |
| 161 | - echo '<p>' . __('Page is not founded!') . '</p>'; |
|
| 161 | + echo '<p>'.__('Page is not founded!').'</p>'; |
|
| 162 | 162 | } |
| 163 | 163 | ?> |
| 164 | 164 | </div> |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | <?php |
| 216 | 216 | $customJsCode = \App::$View->showPlainCode('js'); |
| 217 | 217 | if ($customJsCode !== null) { |
| 218 | - echo '<script>' . $customJsCode . '</script>'; |
|
| 218 | + echo '<script>'.$customJsCode.'</script>'; |
|
| 219 | 219 | } |
| 220 | 220 | // render google analytics code here |
| 221 | 221 | echo \App::$View->render('blocks/googleanalytics'); |
@@ -139,11 +139,14 @@ |
||
| 139 | 139 | <?php foreach ($this->breadcrumbs as $bUrl => $bText): ?> |
| 140 | 140 | <?php if (Any::isInt($bUrl)): // only text ?> |
| 141 | 141 | <li class="active"><?= \App::$Security->strip_tags($bText) ?></li> |
| 142 | - <?php else: ?> |
|
| 142 | + <?php else { |
|
| 143 | + : ?> |
|
| 143 | 144 | <li> |
| 144 | 145 | <a href="<?= \App::$Security->strip_tags($bUrl) ?>"><?= \App::$Security->strip_tags($bText) ?></a> |
| 145 | 146 | </li> |
| 146 | - <?php endif; ?> |
|
| 147 | + <?php endif; |
|
| 148 | +} |
|
| 149 | +?> |
|
| 147 | 150 | <?php endforeach; ?> |
| 148 | 151 | </ol> |
| 149 | 152 | <?php endif; ?> |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | /** @var $notify array */ |
| 3 | 3 | |
| 4 | 4 | use Ffcms\Core\Helper\Type\Any; |
| 5 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 6 | 5 | |
| 7 | 6 | /** |
| 8 | 7 | * Get html css class from notify response type |
@@ -31,9 +31,9 @@ |
||
| 31 | 31 | if (Any::isArray($notify) && count($notify) > 0) { |
| 32 | 32 | foreach ($notify as $type => $messages) { |
| 33 | 33 | foreach ($messages as $message) { |
| 34 | - echo '<p class="alert ' . type2html($type) . '"> |
|
| 34 | + echo '<p class="alert '.type2html($type).'"> |
|
| 35 | 35 | <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>' |
| 36 | - . \Ffcms\Core\App::$Security->strip_tags($message) . '</p>'; |
|
| 36 | + . \Ffcms\Core\App::$Security->strip_tags($message).'</p>'; |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | /** @var \Ffcms\Core\Helper\HTML\SimplePagination $pagination */ |
| 4 | 4 | |
| 5 | 5 | use Ffcms\Core\Helper\Date; |
| 6 | -use Ffcms\Core\Helper\Simplify; |
|
| 7 | 6 | use Ffcms\Core\Helper\Url; |
| 8 | 7 | |
| 9 | 8 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | <div class="row object-lightborder" id="wall-post-<?= $post->id ?>"> |
| 25 | 25 | <div class="col-xs-4 col-md-2"> |
| 26 | 26 | <div class="text-center"> |
| 27 | - <?= Url::link(['profile/show', $post->sender_id], $post->senderUser->profile->getNickname(), ['style' => 'color: ' . $post->senderUser->role->color]) ?> |
|
| 27 | + <?= Url::link(['profile/show', $post->sender_id], $post->senderUser->profile->getNickname(), ['style' => 'color: '.$post->senderUser->role->color]) ?> |
|
| 28 | 28 | <img class="img-responsive img-rounded" alt="Avatar of <?= $post->senderUser->profile->getNickname() ?>" src="<?= $post->senderUser->profile->getAvatarUrl('small') ?>" /> |
| 29 | 29 | <small><?= Date::humanize($post->updated_at); ?></small> |
| 30 | 30 | </div> |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | use Ffcms\Core\Helper\Type\Any; |
| 4 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 5 | 4 | use Ffcms\Core\Helper\Url; |
| 6 | 5 | |
| 7 | 6 | $this->title = __('My dialogs'); |
@@ -3,9 +3,7 @@ |
||
| 3 | 3 | use Ffcms\Core\Helper\Date; |
| 4 | 4 | use Ffcms\Core\Helper\HTML\Form; |
| 5 | 5 | use Ffcms\Core\Helper\HTML\Listing; |
| 6 | -use Ffcms\Core\Helper\Simplify; |
|
| 7 | 6 | use Ffcms\Core\Helper\Type\Any; |
| 8 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 9 | 7 | use Ffcms\Core\Helper\Type\Str; |
| 10 | 8 | use Ffcms\Core\Helper\Url; |
| 11 | 9 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | // $user is a target profile depended object(not current user!!!) |
| 23 | 23 | |
| 24 | 24 | $name = $user->profile->getNickname(); |
| 25 | -$this->title = __('Profile') . ': ' . $name; |
|
| 25 | +$this->title = __('Profile').': '.$name; |
|
| 26 | 26 | |
| 27 | 27 | $this->breadcrumbs = [ |
| 28 | 28 | Url::to('/') => __('Home'), |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | <?php |
| 46 | 46 | if ($ratingOn): |
| 47 | 47 | $rateClass = 'btn-default'; |
| 48 | - $rateValue = (int)$user->profile->rating; |
|
| 48 | + $rateValue = (int) $user->profile->rating; |
|
| 49 | 49 | if ($user->profile->rating > 0) { |
| 50 | 50 | $rateClass = 'btn-info'; |
| 51 | 51 | } elseif ($user->profile->rating < 0) { |
@@ -83,20 +83,20 @@ discard block |
||
| 83 | 83 | $userMenu = null; |
| 84 | 84 | if (true === $isSelf) { |
| 85 | 85 | $userMenu = [ |
| 86 | - ['type' => 'link', 'link' => ['profile/feed'], 'text' => '<i class="glyphicon glyphicon-fire"></i> ' . __('Feed'), 'html' => true], |
|
| 87 | - ['type' => 'link', 'link' => ['profile/avatar'], 'text' => '<i class="glyphicon glyphicon-camera"></i> ' . __('Avatar'), 'html' => true], |
|
| 88 | - ['type' => 'link', 'link' => ['profile/messages'], 'text' => '<i class="glyphicon glyphicon-envelope"></i> ' . __('Messages') . ' <span class="badge pm-count-block">0</span>', 'html' => true], |
|
| 89 | - ['type' => 'link', 'link' => ['profile/settings'], 'text' => '<i class="glyphicon glyphicon-cog"></i> ' . __('Settings'), 'html' => true] |
|
| 86 | + ['type' => 'link', 'link' => ['profile/feed'], 'text' => '<i class="glyphicon glyphicon-fire"></i> '.__('Feed'), 'html' => true], |
|
| 87 | + ['type' => 'link', 'link' => ['profile/avatar'], 'text' => '<i class="glyphicon glyphicon-camera"></i> '.__('Avatar'), 'html' => true], |
|
| 88 | + ['type' => 'link', 'link' => ['profile/messages'], 'text' => '<i class="glyphicon glyphicon-envelope"></i> '.__('Messages').' <span class="badge pm-count-block">0</span>', 'html' => true], |
|
| 89 | + ['type' => 'link', 'link' => ['profile/settings'], 'text' => '<i class="glyphicon glyphicon-cog"></i> '.__('Settings'), 'html' => true] |
|
| 90 | 90 | ]; |
| 91 | 91 | } elseif (\App::$User->isAuth()) { |
| 92 | 92 | $userMenu = [ |
| 93 | 93 | [ |
| 94 | 94 | 'type' => 'link', 'link' => Url::to('profile/messages', null, null, ['newdialog' => $user->id]), |
| 95 | - 'text' => '<i class="glyphicon glyphicon-envelope"></i> ' . __('Write message'), 'html' => true |
|
| 95 | + 'text' => '<i class="glyphicon glyphicon-envelope"></i> '.__('Write message'), 'html' => true |
|
| 96 | 96 | ], |
| 97 | 97 | [ |
| 98 | 98 | 'type' => 'link', 'link' => Url::to('profile/ignore', null, null, ['id' => $user->id]), |
| 99 | - 'text' => '<i class="glyphicon glyphicon-ban-circle"></i> ' . __('Block'), 'html' => true, 'property' => ['class' => 'alert-danger'] |
|
| 99 | + 'text' => '<i class="glyphicon glyphicon-ban-circle"></i> '.__('Block'), 'html' => true, 'property' => ['class' => 'alert-danger'] |
|
| 100 | 100 | ] |
| 101 | 101 | ]; |
| 102 | 102 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | foreach ($hobbyArray as $item) { |
| 177 | 177 | $item = \App::$Security->strip_tags($item); |
| 178 | 178 | if (!Str::likeEmpty($item)) { |
| 179 | - echo Url::link(['profile/index', 'hobby', trim($item, ' ')], $item, ['class' => 'label label-success']) . ' '; |
|
| 179 | + echo Url::link(['profile/index', 'hobby', trim($item, ' ')], $item, ['class' => 'label label-success']).' '; |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | ?> |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | <div class="text-right"><?= $form->submitButton(__('Send'), ['class' => 'btn btn-default']); ?></div> |
| 224 | 224 | <?= Ffcms\Widgets\Ckeditor\Ckeditor::widget(['targetClass' => 'wysiwyg', 'config' => 'config-small', 'jsConfig' => ['height' => '80']]); ?> |
| 225 | 225 | <?= $form->finish(); ?> |
| 226 | - <?php \App::$Alias->addPlainCode('js', "$('#" . $wall->getFormName() . "').on('change keyup keydown paste cut', 'textarea', function () { $(this).height(0).height(this.scrollHeight);}).find('textarea').change();") ?> |
|
| 226 | + <?php \App::$Alias->addPlainCode('js', "$('#".$wall->getFormName()."').on('change keyup keydown paste cut', 'textarea', function () { $(this).height(0).height(this.scrollHeight);}).find('textarea').change();") ?> |
|
| 227 | 227 | <?php endif; ?> |
| 228 | 228 | <?php |
| 229 | 229 | if ($wallRecords !== null): |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | <div class="col-xs-8 col-md-10"> |
| 240 | 240 | <h5 style="margin-top: 0;margin-bottom: 5px;"> |
| 241 | 241 | <i class="glyphicon glyphicon-user"></i> |
| 242 | - <?= Url::link(['profile/show', $post->sender_id], $post->senderUser->profile->getNickname(), ['style' => 'color: ' . $post->senderUser->role->color]) ?> |
|
| 242 | + <?= Url::link(['profile/show', $post->sender_id], $post->senderUser->profile->getNickname(), ['style' => 'color: '.$post->senderUser->role->color]) ?> |
|
| 243 | 243 | <small class="pull-right"><?= Date::humanize($post->updated_at); ?></small> |
| 244 | 244 | </h5> |
| 245 | 245 | <div class="object-text"> |
@@ -60,7 +60,8 @@ discard block |
||
| 60 | 60 | </a> |
| 61 | 61 | </div> |
| 62 | 62 | </div> |
| 63 | - <?php else: ?> |
|
| 63 | + <?php else { |
|
| 64 | + : ?> |
|
| 64 | 65 | <div class="row"> |
| 65 | 66 | <div class="col-md-8" style="padding-right: 0;"> |
| 66 | 67 | <a href="javascript:void(0);" class="btn btn-block <?= $rateClass ?>"> |
@@ -77,7 +78,9 @@ discard block |
||
| 77 | 78 | <button class="btn btn-block btn-danger" id="reduceRating">-</button> |
| 78 | 79 | </div> |
| 79 | 80 | </div> |
| 80 | - <?php endif; ?> |
|
| 81 | + <?php endif; |
|
| 82 | +} |
|
| 83 | +?> |
|
| 81 | 84 | <?php endif; ?> |
| 82 | 85 | <?php |
| 83 | 86 | $userMenu = null; |