@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Apps\ActiveRecord\Profile; |
| 6 | 6 | use Apps\ActiveRecord\User; |
| 7 | -use Apps\Controller\Console\Db; |
|
| 8 | 7 | use Ffcms\Core\App; |
| 9 | 8 | use Ffcms\Core\Arch\Model; |
| 10 | 9 | use Ffcms\Core\Helper\FileSystem\File; |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * Labels for installation form |
|
| 29 | - */ |
|
| 28 | + * Labels for installation form |
|
| 29 | + */ |
|
| 30 | 30 | public function labels() |
| 31 | 31 | { |
| 32 | 32 | return [ |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * Installation post data validation |
|
| 50 | - */ |
|
| 49 | + * Installation post data validation |
|
| 50 | + */ |
|
| 51 | 51 | public function rules() |
| 52 | 52 | { |
| 53 | 53 | return [ |
@@ -71,14 +71,14 @@ |
||
| 71 | 71 | $cfg['database'] = $this->db; |
| 72 | 72 | $cfg['adminEmail'] = $this->email; |
| 73 | 73 | $cfg['singleLanguage'] = $this->singleLanguage; |
| 74 | - $cfg['multiLanguage'] = (bool)$this->multiLanguage; |
|
| 75 | - $cfg['passwordSalt'] = '$2a$07$' . Str::randomLatinNumeric(mt_rand(21, 30)) . '$'; |
|
| 76 | - $cfg['debug']['cookie']['key'] = 'fdebug_' . Str::randomLatinNumeric(mt_rand(4, 16)); |
|
| 74 | + $cfg['multiLanguage'] = (bool) $this->multiLanguage; |
|
| 75 | + $cfg['passwordSalt'] = '$2a$07$'.Str::randomLatinNumeric(mt_rand(21, 30)).'$'; |
|
| 76 | + $cfg['debug']['cookie']['key'] = 'fdebug_'.Str::randomLatinNumeric(mt_rand(4, 16)); |
|
| 77 | 77 | $cfg['debug']['cookie']['value'] = Str::randomLatinNumeric(mt_rand(32, 128)); |
| 78 | 78 | |
| 79 | 79 | // import database tables |
| 80 | 80 | $connectName = 'install'; |
| 81 | - include(root . '/Private/Database/install.php'); |
|
| 81 | + include(root.'/Private/Database/install.php'); |
|
| 82 | 82 | |
| 83 | 83 | // insert admin user |
| 84 | 84 | $user = new User(); |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | public $chmodCheck = []; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * Get default server information and prepare chmod info |
|
| 24 | - */ |
|
| 23 | + * Get default server information and prepare chmod info |
|
| 24 | + */ |
|
| 25 | 25 | public function before() |
| 26 | 26 | { |
| 27 | 27 | $this->phpVersion = phpversion(); |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | ]); |
| 55 | 55 | ?> |
| 56 | 56 | |
| 57 | -<?php if($model->checkAll()): ?> |
|
| 57 | +<?php if ($model->checkAll()): ?> |
|
| 58 | 58 | <?= \Ffcms\Core\Helper\Url::link('main/install', __('Start install'), ['class' => 'btn btn-success btn-block']) ?> |
| 59 | 59 | <?php else: ?> |
| 60 | 60 | <?= \Ffcms\Core\Helper\Url::link('main/index', __('Check again'), ['class' => 'btn btn-warning btn-block']) ?> |
@@ -56,7 +56,10 @@ |
||
| 56 | 56 | |
| 57 | 57 | <?php if($model->checkAll()): ?> |
| 58 | 58 | <?= \Ffcms\Core\Helper\Url::link('main/install', __('Start install'), ['class' => 'btn btn-success btn-block']) ?> |
| 59 | -<?php else: ?> |
|
| 59 | +<?php else { |
|
| 60 | + : ?> |
|
| 60 | 61 | <?= \Ffcms\Core\Helper\Url::link('main/index', __('Check again'), ['class' => 'btn btn-warning btn-block']) ?> |
| 61 | -<?php endif; ?> |
|
| 62 | +<?php endif; |
|
| 63 | +} |
|
| 64 | +?> |
|
| 62 | 65 | |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | Illuminate\Database\Capsule\Manager::schema($connectName)->create('sessions', function($table) { |
| 4 | - $table->string('sess_id', 128)->index()->primary() ; |
|
| 4 | + $table->string('sess_id', 128)->index()->primary(); |
|
| 5 | 5 | $table->binary('sess_data'); |
| 6 | 6 | $table->string('sess_lifetime', 16); // shutout to laravel, if i make it like "integer" it automaticlly add "primary" key for it, hate this!!! |
| 7 | 7 | $table->string('sess_time', 16); |
@@ -67,17 +67,23 @@ |
||
| 67 | 67 | <?php if ($properties['author'] === true): ?> |
| 68 | 68 | <?php if ($model->authorId !== null && $model->authorId > 0): ?> |
| 69 | 69 | <span><i class="fa fa-user"></i><?= Url::link(['profile/show', $model->authorId], $model->authorName, ['itemprop' => 'author']) ?></span> |
| 70 | - <?php else: ?> |
|
| 70 | + <?php else { |
|
| 71 | + : ?> |
|
| 71 | 72 | <span><i class="fa fa-user"></i><s><?= $model->authorName ?></s></span> |
| 72 | - <?php endif; ?> |
|
| 73 | + <?php endif; |
|
| 74 | +} |
|
| 75 | +?> |
|
| 73 | 76 | <?php endif; ?> |
| 74 | 77 | <?php if ($properties['views'] === true): ?> |
| 75 | 78 | <span><i class="fa fa-eye"></i><?= $model->views ?></span> |
| 76 | 79 | <?php endif ?> |
| 77 | 80 | </div> |
| 78 | - <?php else: ?> |
|
| 81 | + <?php else { |
|
| 82 | + : ?> |
|
| 79 | 83 | <hr /> |
| 80 | - <?php endif; ?> |
|
| 84 | + <?php endif; |
|
| 85 | +} |
|
| 86 | +?> |
|
| 81 | 87 | <?php if ($trash): ?> |
| 82 | 88 | <p class="alert alert-danger"><i class="fa fa-trash-o"></i> <?= __('This content is placed in trash') ?></p> |
| 83 | 89 | <?php endif; ?> |
@@ -159,12 +159,12 @@ |
||
| 159 | 159 | <div class="col-md-12"> |
| 160 | 160 | <div class="pull-left"> |
| 161 | 161 | <?php if ($properties['rating']) { |
| 162 | - echo \App::$View->render('content/_rate', [ |
|
| 163 | - 'id' => $model->id, |
|
| 164 | - 'rating' => $model->rating, |
|
| 165 | - 'canRate' => $model->canRate |
|
| 166 | - ]); |
|
| 167 | - } ?> |
|
| 162 | + echo \App::$View->render('content/_rate', [ |
|
| 163 | + 'id' => $model->id, |
|
| 164 | + 'rating' => $model->rating, |
|
| 165 | + 'canRate' => $model->canRate |
|
| 166 | + ]); |
|
| 167 | + } ?> |
|
| 168 | 168 | <?= \App::$View->render('content/_rateJs') ?> |
| 169 | 169 | </div> |
| 170 | 170 | <div class="pull-right"> |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // don't use breadcrumbs on injected pathway rule |
| 26 | -if (!\App::$Request->isPathInjected() && (bool)$model->getCategory()->getProperty('showCategory')) { |
|
| 26 | +if (!\App::$Request->isPathInjected() && (bool) $model->getCategory()->getProperty('showCategory')) { |
|
| 27 | 27 | $breadcrumbs = [ |
| 28 | 28 | Url::to('/') => __('Home') |
| 29 | 29 | ]; |
@@ -35,21 +35,21 @@ discard block |
||
| 35 | 35 | $breadcrumbs[Url::to('content/list', $cat['path'], null, [], false)] = $cat['name']; |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | - $breadcrumbs[] = __('Content') . ': ' . Str::sub($this->title, 0, 40); |
|
| 38 | + $breadcrumbs[] = __('Content').': '.Str::sub($this->title, 0, 40); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $this->breadcrumbs = $breadcrumbs; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $properties = [ |
| 45 | - 'date' => (bool)$model->getCategory()->getProperty('showDate'), |
|
| 46 | - 'author' => (bool)$model->getCategory()->getProperty('showAuthor'), |
|
| 47 | - 'views' => (bool)$model->getCategory()->getProperty('showViews'), |
|
| 48 | - 'category' => (bool)$model->getCategory()->getProperty('showCategory'), |
|
| 49 | - 'rating' => (bool)$model->getCategory()->getProperty('showRating') |
|
| 45 | + 'date' => (bool) $model->getCategory()->getProperty('showDate'), |
|
| 46 | + 'author' => (bool) $model->getCategory()->getProperty('showAuthor'), |
|
| 47 | + 'views' => (bool) $model->getCategory()->getProperty('showViews'), |
|
| 48 | + 'category' => (bool) $model->getCategory()->getProperty('showCategory'), |
|
| 49 | + 'rating' => (bool) $model->getCategory()->getProperty('showRating') |
|
| 50 | 50 | ]; |
| 51 | -$showComments = (bool)$model->getCategory()->getProperty('showComments'); |
|
| 52 | -$showPoster = (bool)$model->getCategory()->getProperty('showPoster'); |
|
| 51 | +$showComments = (bool) $model->getCategory()->getProperty('showComments'); |
|
| 52 | +$showPoster = (bool) $model->getCategory()->getProperty('showPoster'); |
|
| 53 | 53 | |
| 54 | 54 | ?> |
| 55 | 55 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | <span class="spaced"><i class="fa fa-eye"></i> <?= $model->views ?></span> |
| 75 | 75 | <?php endif ?> |
| 76 | 76 | <?php if (\App::$User->isAuth() && \App::$User->identity()->getRole()->can('Admin/Content/Update')): ?> |
| 77 | - <span class="pull-right"><a href="<?= \App::$Alias->scriptUrl . '/admin/content/update/' . $model->id ?>" target="_blank"><i class="fa fa-pencil" style="color: #ff0000;"></i></a></span> |
|
| 77 | + <span class="pull-right"><a href="<?= \App::$Alias->scriptUrl.'/admin/content/update/'.$model->id ?>" target="_blank"><i class="fa fa-pencil" style="color: #ff0000;"></i></a></span> |
|
| 78 | 78 | <?php endif; ?> |
| 79 | 79 | </div> |
| 80 | 80 | <?php else: ?> |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | <div id="content-text"> |
| 87 | 87 | <?php if ($showPoster === true && $model->posterFull !== null && $model->posterThumb !== null): ?> |
| 88 | 88 | <a href="#showPoster" data-toggle="modal" data-target="#showPoster"> |
| 89 | - <img alt="<?= __('Poster for') ?>: <?= Str::lowerCase(\App::$Security->strip_tags($model->title)) ?>" src="<?= \App::$Alias->scriptUrl . $model->posterThumb ?>" class="image_poster img-thumbnail" /> |
|
| 89 | + <img alt="<?= __('Poster for') ?>: <?= Str::lowerCase(\App::$Security->strip_tags($model->title)) ?>" src="<?= \App::$Alias->scriptUrl.$model->posterThumb ?>" class="image_poster img-thumbnail" /> |
|
| 90 | 90 | </a> |
| 91 | 91 | |
| 92 | 92 | <!-- Modal poster pop-up --> |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | <h4 class="modal-title" id="myModalLabel"><?= __('View poster') ?></h4> |
| 99 | 99 | </div> |
| 100 | 100 | <div class="modal-body"> |
| 101 | - <img class="img-responsive" src="<?= \App::$Alias->scriptUrl . $model->posterFull ?>" alt="<?= __('Poster image') ?>" style="margin: 0 auto;" /> |
|
| 101 | + <img class="img-responsive" src="<?= \App::$Alias->scriptUrl.$model->posterFull ?>" alt="<?= __('Poster image') ?>" style="margin: 0 auto;" /> |
|
| 102 | 102 | </div> |
| 103 | 103 | </div> |
| 104 | 104 | </div> |
| 105 | 105 | </div> |
| 106 | - <?php endif ;?> |
|
| 106 | + <?php endif; ?> |
|
| 107 | 107 | <?= $model->text ?> |
| 108 | 108 | </div> |
| 109 | 109 | <?php if ($model->galleryItems !== null && Obj::isArray($model->galleryItems)): ?> |
| 110 | 110 | <div class="row"> |
| 111 | 111 | <?php foreach ($model->galleryItems as $thumbPic => $fullPic): ?> |
| 112 | 112 | <div class="col-md-2 well"> |
| 113 | - <a href="#showGallery" class="modalGallery" content="<?= \App::$Alias->scriptUrl . $fullPic ?>"><img src="<?= \App::$Alias->scriptUrl . $thumbPic ?>" class="img-responsive image-item" /></a> |
|
| 113 | + <a href="#showGallery" class="modalGallery" content="<?= \App::$Alias->scriptUrl.$fullPic ?>"><img src="<?= \App::$Alias->scriptUrl.$thumbPic ?>" class="img-responsive image-item" /></a> |
|
| 114 | 114 | </div> |
| 115 | 115 | <?php endforeach; ?> |
| 116 | 116 | </div> |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | <h4 class="modal-title" id="showModalLabel"><?= __('View picture') ?></h4> |
| 123 | 123 | </div> |
| 124 | 124 | <div class="modal-body" id="modal-gallery-body"> |
| 125 | - <img class="img-responsive" src="<?= \App::$Alias->scriptUrl . $model->posterFull ?>" alt="<?= __('Gallery picture') ?>" style="margin: 0 auto;" /> |
|
| 125 | + <img class="img-responsive" src="<?= \App::$Alias->scriptUrl.$model->posterFull ?>" alt="<?= __('Gallery picture') ?>" style="margin: 0 auto;" /> |
|
| 126 | 126 | </div> |
| 127 | 127 | </div> |
| 128 | 128 | </div> |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | </div> |
| 144 | 144 | <div id="similar<?= $idx ?>" class="panel-collapse collapse"> |
| 145 | 145 | <div class="panel-body"> |
| 146 | - <a href="<?= \App::$Alias->baseUrl . $item['uri'] ?>"> |
|
| 146 | + <a href="<?= \App::$Alias->baseUrl.$item['uri'] ?>"> |
|
| 147 | 147 | <?= $item['snippet'] ?> |
| 148 | 148 | </a> |
| 149 | 149 | </div> |
@@ -167,14 +167,14 @@ discard block |
||
| 167 | 167 | <?= \App::$View->render('content/_rateJs') ?> |
| 168 | 168 | </div> |
| 169 | 169 | <div class="pull-right"> |
| 170 | - <?php if ((int)$configs['keywordsAsTags'] === 1): ?> |
|
| 170 | + <?php if ((int) $configs['keywordsAsTags'] === 1): ?> |
|
| 171 | 171 | <div id="content-tags"> |
| 172 | 172 | <?php |
| 173 | 173 | if (Obj::isArray($model->metaKeywords) && count($model->metaKeywords) > 0 && Str::length($model->metaKeywords[0]) > 0) { |
| 174 | 174 | echo '<i class="fa fa-tags hidden-xs"></i> '; |
| 175 | 175 | foreach ($model->metaKeywords as $tag) { |
| 176 | 176 | $tag = \App::$Security->strip_tags(trim($tag)); |
| 177 | - echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default']) . " "; |
|
| 177 | + echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default'])." "; |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | ?> |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * Validation rules |
|
| 37 | - */ |
|
| 36 | + * Validation rules |
|
| 37 | + */ |
|
| 38 | 38 | public function rules() |
| 39 | 39 | { |
| 40 | 40 | return [ |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public function before() |
| 40 | 40 | { |
| 41 | 41 | foreach ($this->_apps as $app) { |
| 42 | - $this->_definedControllers[] = (string)$app->sys_name; |
|
| 42 | + $this->_definedControllers[] = (string) $app->sys_name; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | parent::before(); |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | public function make() |
| 71 | 71 | { |
| 72 | 72 | $cName = ucfirst(Str::lowerCase($this->sysname)); |
| 73 | - $cPath = 'Apps\Controller\Admin\\' . $cName; |
|
| 73 | + $cPath = 'Apps\Controller\Admin\\'.$cName; |
|
| 74 | 74 | // if object class is not loaded - prevent install |
| 75 | - if (!class_exists($cPath) || !defined($cPath . '::VERSION')) { |
|
| 75 | + if (!class_exists($cPath) || !defined($cPath.'::VERSION')) { |
|
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | // get ext version |
| 80 | - $cVersion = (float)constant($cPath . '::VERSION'); |
|
| 80 | + $cVersion = (float) constant($cPath.'::VERSION'); |
|
| 81 | 81 | if ($cVersion < 0.1) { |
| 82 | 82 | $cVersion = 0.1; |
| 83 | 83 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | // callback to install method in extension |
| 95 | 95 | if (method_exists($cPath, 'install')) { |
| 96 | - call_user_func($cPath . '::install'); |
|
| 96 | + call_user_func($cPath.'::install'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | return true; |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Ffcms\Core\App; |
| 10 | 10 | use Ffcms\Core\Exception\SyntaxException; |
| 11 | 11 | use Ffcms\Core\Helper\FileSystem\File; |
| 12 | -use Ffcms\Core\Helper\Type\Arr; |
|
| 13 | 12 | use Ffcms\Core\Helper\Type\Integer; |
| 14 | 13 | use Ffcms\Core\Helper\Type\Str; |
| 15 | 14 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | public function actionIndex() |
| 39 | 39 | { |
| 40 | 40 | // set current page and offset |
| 41 | - $page = (int)App::$Request->query->get('page'); |
|
| 41 | + $page = (int) App::$Request->query->get('page'); |
|
| 42 | 42 | $offset = $page * self::ITEM_PER_PAGE; |
| 43 | 43 | |
| 44 | 44 | $query = null; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | if ($type === 'trash') { |
| 48 | 48 | $query = ContentEntity::onlyTrashed(); |
| 49 | 49 | } elseif (Obj::isLikeInt($type)) { // sounds like category id ;) |
| 50 | - $query = ContentEntity::where('category_id', '=', (int)$type); |
|
| 50 | + $query = ContentEntity::where('category_id', '=', (int) $type); |
|
| 51 | 51 | } else { |
| 52 | 52 | $query = new ContentEntity(); |
| 53 | 53 | $type = 'all'; |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | if ($model->send() && $model->validate()) { |
| 194 | 194 | // remove all trashed items |
| 195 | 195 | foreach ($records->get() as $item) { |
| 196 | - $galleryPath = '/upload/gallery/' . (int)$item->id; |
|
| 196 | + $galleryPath = '/upload/gallery/'.(int) $item->id; |
|
| 197 | 197 | if (Directory::exist($galleryPath)) { |
| 198 | 198 | Directory::remove($galleryPath); |
| 199 | 199 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | public function actionCategoryupdate($id = null) |
| 266 | 266 | { |
| 267 | 267 | // get owner id for new rows |
| 268 | - $parentId = (int)App::$Request->query->get('parent'); |
|
| 268 | + $parentId = (int) App::$Request->query->get('parent'); |
|
| 269 | 269 | |
| 270 | 270 | // get relation and pass to model |
| 271 | 271 | $record = ContentCategory::findOrNew($id); |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | /** |
| 124 | 124 | * Get current extension active record |
| 125 | 125 | * @param string|null $type |
| 126 | - * @return mixed |
|
| 126 | + * @return AppRecord |
|
| 127 | 127 | */ |
| 128 | 128 | public function getTypeItem($type = null) |
| 129 | 129 | { |
@@ -86,18 +86,18 @@ discard block |
||
| 86 | 86 | $user = App::$User->identity(); |
| 87 | 87 | // user is not authed ? |
| 88 | 88 | if ($user === null || !App::$User->isAuth()) { |
| 89 | - $redirectUrl = App::$Alias->scriptUrl . '/user/login'; |
|
| 89 | + $redirectUrl = App::$Alias->scriptUrl.'/user/login'; |
|
| 90 | 90 | App::$Response->redirect($redirectUrl, true); |
| 91 | 91 | exit(); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - $permission = env_name . '/' . App::$Request->getController() . '/' . App::$Request->getAction(); |
|
| 94 | + $permission = env_name.'/'.App::$Request->getController().'/'.App::$Request->getAction(); |
|
| 95 | 95 | |
| 96 | 96 | // doesn't have permission? get the f*ck out |
| 97 | 97 | if (!$user->getRole()->can($permission)) { |
| 98 | 98 | App::$Session->invalidate(); |
| 99 | 99 | |
| 100 | - $redirectUrl = App::$Alias->scriptUrl . '/user/login'; |
|
| 100 | + $redirectUrl = App::$Alias->scriptUrl.'/user/login'; |
|
| 101 | 101 | App::$Response->redirect($redirectUrl, true); |
| 102 | 102 | exit(); |
| 103 | 103 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function getConfigs() |
| 146 | 146 | { |
| 147 | - return $this->type === 'widget' ? (array)Serialize::decode($this->widget->configs) : (array)Serialize::decode($this->application->configs); |
|
| 147 | + return $this->type === 'widget' ? (array) Serialize::decode($this->widget->configs) : (array) Serialize::decode($this->application->configs); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -1,6 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use Ffcms\Core\Helper\Date; |
|
| 4 | 3 | use Ffcms\Core\Helper\HTML\Form; |
| 5 | 4 | use Ffcms\Core\Helper\Type\Str; |
| 6 | 5 | use Ffcms\Core\Helper\Url; |