From bada6a893fe788b7c9e0c0797878d9dab7c195ed Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 20 Jul 2017 17:03:52 +0300 Subject: [PATCH] -Artbox landing patched --- backend/config/main.php | 11 ++++++----- backend/controllers/SettingsController.php | 13 ++++++++++--- backend/views/layouts/main.php | 2 +- backend/views/layouts/menu_items.php | 17 +++++++++++++---- backend/views/settings/_mail_tab.php | 20 ++++++++++++++++++++ backend/views/settings/_main_tab.php | 2 +- backend/views/settings/settings.php | 10 ++++++++++ common/config/.gitignore | 3 ++- common/config/mail.php | 10 ++++++++++ common/config/main.php | 22 ++++++++++++++++++---- common/mail/feedback.php | 31 +++++++++++++++++++++++++++++++ common/models/Mail.php | 38 ++++++++++++++++++++++++++++++++++++++ common/models/Settings.php | 2 +- composer.lock | 278 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------ frontend/controllers/PageController.php | 1 + frontend/controllers/SiteController.php | 24 ++++++++++++++++++++++++ frontend/views/layouts/main.php | 81 +++++++++++++++++++++++++++++++++++++++++++++------------------------------------ frontend/views/page/view.php | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------- 18 files changed, 450 insertions(+), 255 deletions(-) create mode 100644 backend/views/settings/_mail_tab.php create mode 100755 common/config/mail.php create mode 100644 common/mail/feedback.php create mode 100644 common/models/Mail.php diff --git a/backend/config/main.php b/backend/config/main.php index 82916e0..4a53a93 100644 --- a/backend/config/main.php +++ b/backend/config/main.php @@ -17,11 +17,12 @@ 'controllerNamespace' => 'backend\controllers', 'bootstrap' => [ 'log' ], 'controllerMap' => [ - 'profile' => 'artbox\core\controllers\ProfileController', - 'page' => 'artbox\core\controllers\PageController', - 'alias' => 'artbox\core\controllers\AliasController', - 'seo' => 'artbox\core\controllers\SeoController', - 'feedback' => 'artbox\core\controllers\FeedbackController', + 'profile' => 'artbox\core\controllers\ProfileController', + 'page' => 'artbox\core\controllers\PageController', + 'page-category' => 'artbox\core\controllers\PageCategoryController', + 'alias' => 'artbox\core\controllers\AliasController', + 'seo' => 'artbox\core\controllers\SeoController', + 'feedback' => 'artbox\core\controllers\FeedbackController', ], 'components' => [ 'assetManager' => [ diff --git a/backend/controllers/SettingsController.php b/backend/controllers/SettingsController.php index 3be3b99..564e260 100644 --- a/backend/controllers/SettingsController.php +++ b/backend/controllers/SettingsController.php @@ -1,6 +1,7 @@ findSettings(); - + $mail = Mail::findOne(1); + + if ($mail->load(\Yii::$app->request->post())) { + $mail->save(); + } + if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->session->setFlash('success', \Yii::t('core', 'Settings saved')); - + return $this->goHome(); } - + return $this->render( 'settings', [ 'model' => $model, + 'mail' => $mail, ] ); } diff --git a/backend/views/layouts/main.php b/backend/views/layouts/main.php index 57f3331..5e9e53b 100644 --- a/backend/views/layouts/main.php +++ b/backend/views/layouts/main.php @@ -10,7 +10,7 @@ use artbox\core\models\UserData; use artbox\core\widgets\FeedbackWidget; use artbox\core\widgets\FlashWidget; - use noam148\imagemanager\components\ImageManagerGetPath; + use artbox\core\components\imagemanager\components\ImageManagerGetPath; use yii\bootstrap\Html; use yii\web\View; use yii\widgets\Breadcrumbs; diff --git a/backend/views/layouts/menu_items.php b/backend/views/layouts/menu_items.php index 709036b..763e35a 100644 --- a/backend/views/layouts/menu_items.php +++ b/backend/views/layouts/menu_items.php @@ -31,11 +31,20 @@ ], [ 'label' => \Yii::t('core', 'Static pages'), - 'url' => [ 'page/index' ], + 'url' => '#', 'icon' => 'file-text', - 'active' => function () { - return \Yii::$app->controller->id === 'page'; - }, + 'items' => [ + [ + 'label' => \Yii::t('core', 'Pages'), + 'url' => [ '/page/index' ], + 'icon' => 'file-text', + ], + [ + 'label' => \Yii::t('core', 'Categories'), + 'url' => [ '/page-category/index' ], + 'icon' => 'archive', + ] + ], ], [ 'label' => \Yii::t('core', 'SEO'), diff --git a/backend/views/settings/_mail_tab.php b/backend/views/settings/_mail_tab.php new file mode 100644 index 0000000..fbb1287 --- /dev/null +++ b/backend/views/settings/_mail_tab.php @@ -0,0 +1,20 @@ +field($mail, 'host') + ->textInput(); + + echo $form->field($mail, 'user') + ->textInput(); + + echo $form->field($mail, 'pass') + ->textInput(); \ No newline at end of file diff --git a/backend/views/settings/_main_tab.php b/backend/views/settings/_main_tab.php index da1a81e..497bd33 100644 --- a/backend/views/settings/_main_tab.php +++ b/backend/views/settings/_main_tab.php @@ -12,7 +12,7 @@ ->textInput(); echo $form->field($model, 'logo') ->widget( - \noam148\imagemanager\components\ImageManagerInputWidget::className(), + \artbox\core\components\imagemanager\components\ImageManagerInputWidget::className(), [ 'showPreview' => true, 'showDeletePickedImageConfirm' => false, diff --git a/backend/views/settings/settings.php b/backend/views/settings/settings.php index a3c67d6..81924a8 100644 --- a/backend/views/settings/settings.php +++ b/backend/views/settings/settings.php @@ -73,6 +73,16 @@ ] ), ], + [ + 'label' => \Yii::t('core', 'Email'), + 'content' => $this->render( + '_mail_tab', + [ + 'form' => $form, + 'mail' => $mail, + ] + ), + ], ], ] ); diff --git a/common/config/.gitignore b/common/config/.gitignore index 0be4f93..7f8b552 100644 --- a/common/config/.gitignore +++ b/common/config/.gitignore @@ -2,4 +2,5 @@ main-local.php db* params-local.php test-local.php -#settings.php \ No newline at end of file +settings.php +mail.php \ No newline at end of file diff --git a/common/config/mail.php b/common/config/mail.php new file mode 100755 index 0000000..0c56300 --- /dev/null +++ b/common/config/mail.php @@ -0,0 +1,10 @@ + [ + 'host' => '', + 'user' => '', + 'pass' => '', + 'id' => 1, + ], +]; \ No newline at end of file diff --git a/common/config/main.php b/common/config/main.php index 120f74b..192666a 100644 --- a/common/config/main.php +++ b/common/config/main.php @@ -1,11 +1,13 @@ dirname(dirname(__DIR__)) . '/vendor', 'modules' => [ 'imagemanager' => [ - 'class' => 'noam148\imagemanager\Module', + 'class' => 'artbox\core\components\imagemanager\Module', 'canUploadImage' => true, 'canRemoveImage' => function () { return true; @@ -45,14 +47,26 @@ 'class' => SeoComponent::className(), ], 'imagemanager' => [ - 'class' => 'noam148\imagemanager\components\ImageManagerGetPath', - 'mediaPath' => dirname(dirname(__DIR__)) . '/common/images', - 'cachePath' => 'assets/images', + 'class' => 'artbox\core\components\imagemanager\components\ImageManagerGetPath', + 'mediaPath' => dirname(dirname(__DIR__)) . '/storage', + 'cachePath' => '../../storage/cache', 'useFilename' => true, 'absoluteUrl' => false, ], 'aliasCache' => [ 'class' => \artbox\core\components\AliasCache::className(), ], + 'smtpmailer' => [ + 'class' => 'yii\swiftmailer\Mailer', + 'transport' => [ + 'class' => 'Swift_SmtpTransport', + 'host' => $mail[ 1 ][ 'host' ], + 'username' => $mail[ 1 ][ 'user' ], + 'password' => $mail[ 1 ][ 'pass' ], + 'port' => '587', + 'encryption' => 'tls', + ], + 'viewPath' => '@common/mail' + ], ], ]; diff --git a/common/mail/feedback.php b/common/mail/feedback.php new file mode 100644 index 0000000..3b0eabf --- /dev/null +++ b/common/mail/feedback.php @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + +
name ?>
phone ?>
email ?>
message ?>
diff --git a/common/models/Mail.php b/common/models/Mail.php new file mode 100644 index 0000000..d98ba7d --- /dev/null +++ b/common/models/Mail.php @@ -0,0 +1,38 @@ +=1.9.1,<4.0" + "bower-asset/jquery": ">=1.9.1,<=3" }, "type": "bower-asset-library", "extra": { @@ -548,16 +549,16 @@ }, { "name": "cebe/markdown", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/cebe/markdown.git", - "reference": "c30eb5e01fe021cc5bba2f9ee0eeef96d4931166" + "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cebe/markdown/zipball/c30eb5e01fe021cc5bba2f9ee0eeef96d4931166", - "reference": "c30eb5e01fe021cc5bba2f9ee0eeef96d4931166", + "url": "https://api.github.com/repos/cebe/markdown/zipball/25b28bae8a6f185b5030673af77b32e1163d5c6e", + "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e", "shasum": "" }, "require": { @@ -604,7 +605,7 @@ "markdown", "markdown-extra" ], - "time": "2016-09-14T20:40:20+00:00" + "time": "2017-07-16 21:13:23" }, { "name": "ezyang/htmlpurifier", @@ -651,7 +652,7 @@ "keywords": [ "html" ], - "time": "2017-06-03T02:28:16+00:00" + "time": "2017-06-03 02:28:16" }, { "name": "firebase/php-jwt", @@ -694,7 +695,7 @@ ], "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", "homepage": "https://github.com/firebase/php-jwt", - "time": "2016-07-18T04:51:16+00:00" + "time": "2016-07-18 04:51:16" }, { "name": "fortawesome/font-awesome", @@ -742,27 +743,27 @@ "font", "icon" ], - "time": "2016-10-24T15:52:54+00:00" + "time": "2016-10-24 15:52:54" }, { "name": "google/apiclient", - "version": "v2.1.3", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/google/google-api-php-client.git", - "reference": "43996f09df274158fd04fce98e8a82effe5f3717" + "reference": "f3fadd538315d62ebd1191d89ac791468c617260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-api-php-client/zipball/43996f09df274158fd04fce98e8a82effe5f3717", - "reference": "43996f09df274158fd04fce98e8a82effe5f3717", + "url": "https://api.github.com/repos/google/google-api-php-client/zipball/f3fadd538315d62ebd1191d89ac791468c617260", + "reference": "f3fadd538315d62ebd1191d89ac791468c617260", "shasum": "" }, "require": { - "firebase/php-jwt": "~2.0|~3.0|~4.0", - "google/apiclient-services": "^0.11", - "google/auth": "^0.11", - "guzzlehttp/guzzle": "~5.2|~6.0", + "firebase/php-jwt": "~2.0|~3.0|~4.0|~5.0", + "google/apiclient-services": "~0.13", + "google/auth": "^1.0", + "guzzlehttp/guzzle": "~5.3.1|~6.0", "guzzlehttp/psr7": "^1.2", "monolog/monolog": "^1.17", "php": ">=5.4", @@ -801,20 +802,20 @@ "keywords": [ "google" ], - "time": "2017-03-22T18:32:04+00:00" + "time": "2017-07-10 15:34:54" }, { "name": "google/apiclient-services", - "version": "v0.11", + "version": "v0.15", "source": { "type": "git", "url": "https://github.com/google/google-api-php-client-services.git", - "reference": "48c554aee06f2fd5700d7bdfa4fa6b82d184eb52" + "reference": "9eaaa1062fa2a7cd2d16d3b5ab39efc0bc02a37e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/48c554aee06f2fd5700d7bdfa4fa6b82d184eb52", - "reference": "48c554aee06f2fd5700d7bdfa4fa6b82d184eb52", + "url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/9eaaa1062fa2a7cd2d16d3b5ab39efc0bc02a37e", + "reference": "9eaaa1062fa2a7cd2d16d3b5ab39efc0bc02a37e", "shasum": "" }, "require": { @@ -838,25 +839,25 @@ "keywords": [ "google" ], - "time": "2017-03-13T17:40:44+00:00" + "time": "2017-07-13 19:18:11" }, { "name": "google/auth", - "version": "v0.11.1", + "version": "v1.0", "source": { "type": "git", "url": "https://github.com/google/google-auth-library-php.git", - "reference": "a240674b08a09949fd5597f7590b3ed83663a12d" + "reference": "db77bd2de0bcc40bf50ebe851e9eed332aeaa4df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-auth-library-php/zipball/a240674b08a09949fd5597f7590b3ed83663a12d", - "reference": "a240674b08a09949fd5597f7590b3ed83663a12d", + "url": "https://api.github.com/repos/google/google-auth-library-php/zipball/db77bd2de0bcc40bf50ebe851e9eed332aeaa4df", + "reference": "db77bd2de0bcc40bf50ebe851e9eed332aeaa4df", "shasum": "" }, "require": { "firebase/php-jwt": "~2.0|~3.0|~4.0", - "guzzlehttp/guzzle": "~5.3|~6.0", + "guzzlehttp/guzzle": "~5.3.1|~6.0", "guzzlehttp/psr7": "~1.2", "php": ">=5.4", "psr/cache": "^1.0", @@ -886,7 +887,7 @@ "google", "oauth2" ], - "time": "2016-11-02T14:59:14+00:00" + "time": "2017-06-13 18:00:07" }, { "name": "guzzlehttp/guzzle", @@ -951,7 +952,7 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "time": "2017-06-22 18:50:49" }, { "name": "guzzlehttp/promises", @@ -1002,7 +1003,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "time": "2016-12-20 10:07:11" }, { "name": "guzzlehttp/psr7", @@ -1067,7 +1068,7 @@ "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2017-03-20 17:10:46" }, { "name": "hiqdev/yii2-asset-icheck", @@ -1139,7 +1140,7 @@ "iCheck", "yii2" ], - "time": "2016-03-30T10:59:26+00:00" + "time": "2016-03-30 10:59:26" }, { "name": "hiqdev/yii2-asset-pnotify", @@ -1201,7 +1202,7 @@ "pnotify", "yii2" ], - "time": "2015-09-09T15:16:38+00:00" + "time": "2015-09-09 15:16:38" }, { "name": "imagine/imagine", @@ -1258,7 +1259,7 @@ "image manipulation", "image processing" ], - "time": "2015-09-19T16:54:05+00:00" + "time": "2015-09-19 16:54:05" }, { "name": "kartik-v/bootstrap-fileinput", @@ -1311,7 +1312,7 @@ "progress", "upload" ], - "time": "2017-06-24T05:15:30+00:00" + "time": "2017-06-24 05:15:30" }, { "name": "kartik-v/yii2-krajee-base", @@ -1362,7 +1363,7 @@ "widget", "yii2" ], - "time": "2017-02-22T05:58:53+00:00" + "time": "2017-02-22 05:58:53" }, { "name": "kartik-v/yii2-widget-fileinput", @@ -1417,7 +1418,7 @@ "widget", "yii2" ], - "time": "2017-05-25T20:12:30+00:00" + "time": "2017-05-25 20:12:30" }, { "name": "kartik-v/yii2-widget-select2", @@ -1548,7 +1549,7 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2017-06-19 01:22:40" }, { "name": "noam148/yii2-image-manager", @@ -1597,7 +1598,7 @@ "widget", "yii2" ], - "time": "2017-06-11T09:21:10+00:00" + "time": "2017-06-11 09:21:10" }, { "name": "noam148/yii2-image-resize", @@ -1643,7 +1644,7 @@ "resize", "yii2" ], - "time": "2016-11-29T18:17:37+00:00" + "time": "2016-11-29 18:17:37" }, { "name": "phpseclib/phpseclib", @@ -1735,7 +1736,7 @@ "x.509", "x509" ], - "time": "2017-06-05T06:31:10+00:00" + "time": "2017-06-05 06:31:10" }, { "name": "psr/cache", @@ -1781,7 +1782,7 @@ "psr", "psr-6" ], - "time": "2016-08-06T20:24:11+00:00" + "time": "2016-08-06 20:24:11" }, { "name": "psr/http-message", @@ -1831,7 +1832,7 @@ "request", "response" ], - "time": "2016-08-06T14:39:51+00:00" + "time": "2016-08-06 14:39:51" }, { "name": "psr/log", @@ -1878,7 +1879,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "rmrevin/yii2-fontawesome", @@ -1930,7 +1931,7 @@ "font", "yii" ], - "time": "2017-01-11T14:05:47+00:00" + "time": "2017-01-11 14:05:47" }, { "name": "speixoto/yii2-amcharts", @@ -1972,7 +1973,7 @@ "amcharts", "yii" ], - "time": "2016-08-23T13:52:28+00:00" + "time": "2016-08-23 13:52:28" }, { "name": "swiftmailer/swiftmailer", @@ -2026,7 +2027,7 @@ "mail", "mailer" ], - "time": "2017-05-01T15:54:03+00:00" + "time": "2017-05-01 15:54:03" }, { "name": "tinymce/tinymce", @@ -2072,20 +2073,20 @@ "tinymce", "wysiwyg" ], - "time": "2017-06-13T12:49:51+00:00" + "time": "2017-06-13 12:49:51" }, { "name": "yii2tech/filedb", - "version": "1.0.3", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/yii2tech/filedb.git", - "reference": "29af3a707fa2070b73b268e847b264f29c7dff31" + "reference": "6a6391b035da2bb2049813f8bce9f49ed9b01426" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yii2tech/filedb/zipball/29af3a707fa2070b73b268e847b264f29c7dff31", - "reference": "29af3a707fa2070b73b268e847b264f29c7dff31", + "url": "https://api.github.com/repos/yii2tech/filedb/zipball/6a6391b035da2bb2049813f8bce9f49ed9b01426", + "reference": "6a6391b035da2bb2049813f8bce9f49ed9b01426", "shasum": "" }, "require": { @@ -2120,7 +2121,7 @@ "static", "yii2" ], - "time": "2017-02-06T10:58:30+00:00" + "time": "2017-07-07 12:50:56" }, { "name": "yiisoft/yii2", @@ -2220,7 +2221,7 @@ "framework", "yii2" ], - "time": "2017-06-05T14:33:41+00:00" + "time": "2017-06-05 14:33:41" }, { "name": "yiisoft/yii2-bootstrap", @@ -2270,7 +2271,7 @@ "bootstrap", "yii2" ], - "time": "2016-03-17T03:29:28+00:00" + "time": "2016-03-17 03:29:28" }, { "name": "yiisoft/yii2-composer", @@ -2320,7 +2321,7 @@ "extension installer", "yii2" ], - "time": "2016-12-20T13:26:02+00:00" + "time": "2016-12-20 13:26:02" }, { "name": "yiisoft/yii2-imagine", @@ -2368,7 +2369,7 @@ "imagine", "yii2" ], - "time": "2016-11-03T19:28:39+00:00" + "time": "2016-11-03 19:28:39" }, { "name": "yiisoft/yii2-swiftmailer", @@ -2418,20 +2419,20 @@ "swiftmailer", "yii2" ], - "time": "2017-05-01T08:29:00+00:00" + "time": "2017-05-01 08:29:00" }, { "name": "yiister/yii2-gentelella", - "version": "1.2.3", + "version": "1.2.5", "source": { "type": "git", "url": "https://github.com/yiister/yii2-gentelella.git", - "reference": "ec02c7e89363ee2f2c074588f3f13d3751fea1b5" + "reference": "60e79128a3999c8d9ff826ee5ea26e74c7c64eed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiister/yii2-gentelella/zipball/ec02c7e89363ee2f2c074588f3f13d3751fea1b5", - "reference": "ec02c7e89363ee2f2c074588f3f13d3751fea1b5", + "url": "https://api.github.com/repos/yiister/yii2-gentelella/zipball/60e79128a3999c8d9ff826ee5ea26e74c7c64eed", + "reference": "60e79128a3999c8d9ff826ee5ea26e74c7c64eed", "shasum": "" }, "require": { @@ -2476,7 +2477,7 @@ "theme", "yii2" ], - "time": "2017-07-04T05:05:27+00:00" + "time": "2017-07-12 03:46:01" } ], "packages-dev": [ @@ -2537,7 +2538,7 @@ "gherkin", "parser" ], - "time": "2016-10-30T11:50:56+00:00" + "time": "2016-10-30 11:50:56" }, { "name": "bower-asset/typeahead.js", @@ -2568,16 +2569,16 @@ }, { "name": "codeception/base", - "version": "2.3.3", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/Codeception/base.git", - "reference": "6724500be5f890b086440a7f40941565b313b3d1" + "reference": "c146cf4888f5789d9dbd35d6204e2aa7aa2e94e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/base/zipball/6724500be5f890b086440a7f40941565b313b3d1", - "reference": "6724500be5f890b086440a7f40941565b313b3d1", + "url": "https://api.github.com/repos/Codeception/base/zipball/c146cf4888f5789d9dbd35d6204e2aa7aa2e94e9", + "reference": "c146cf4888f5789d9dbd35d6204e2aa7aa2e94e9", "shasum": "" }, "require": { @@ -2612,6 +2613,7 @@ "php-amqplib/php-amqplib": "~2.4", "predis/predis": "^1.0", "squizlabs/php_codesniffer": "~2.0", + "symfony/process": ">=2.7 <4.0", "vlucas/phpdotenv": "^2.4.0" }, "suggest": { @@ -2656,7 +2658,7 @@ "functional testing", "unit testing" ], - "time": "2017-06-02T00:30:24+00:00" + "time": "2017-07-10 20:30:59" }, { "name": "codeception/verify", @@ -2692,7 +2694,7 @@ } ], "description": "BDD assertion library for PHPUnit", - "time": "2017-01-09T10:58:51+00:00" + "time": "2017-01-09 10:58:51" }, { "name": "doctrine/instantiator", @@ -2746,7 +2748,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "fzaninotto/faker", @@ -2794,7 +2796,7 @@ "faker", "fixtures" ], - "time": "2016-04-29T12:21:54+00:00" + "time": "2016-04-29 12:21:54" }, { "name": "myclabs/deep-copy", @@ -2836,7 +2838,7 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2017-04-12 18:52:22" }, { "name": "phar-io/manifest", @@ -2891,7 +2893,7 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2017-03-05 18:14:27" }, { "name": "phar-io/version", @@ -2938,7 +2940,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2017-03-05 17:38:23" }, { "name": "phpdocumentor/reflection-common", @@ -2992,26 +2994,26 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/46f7e8bb075036c92695b15a1ddb6971c751e585", + "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585", "shasum": "" }, "require": { "php": ">=5.5", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -3037,24 +3039,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2017-07-15 11:38:20" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -3084,7 +3086,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2017-07-14 14:27:02" }, { "name": "phpspec/php-diff", @@ -3122,7 +3124,7 @@ } ], "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", - "time": "2016-04-07T12:29:16+00:00" + "time": "2016-04-07 12:29:16" }, { "name": "phpspec/prophecy", @@ -3185,7 +3187,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-03-02 20:05:34" }, { "name": "phpunit/php-code-coverage", @@ -3249,7 +3251,7 @@ "testing", "xunit" ], - "time": "2017-04-21T08:03:57+00:00" + "time": "2017-04-21 08:03:57" }, { "name": "phpunit/php-file-iterator", @@ -3296,7 +3298,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -3337,7 +3339,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -3386,7 +3388,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -3435,7 +3437,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-02-27 10:12:30" }, { "name": "phpunit/phpunit", @@ -3519,7 +3521,7 @@ "testing", "xunit" ], - "time": "2017-07-03T15:54:24+00:00" + "time": "2017-07-03 15:54:24" }, { "name": "phpunit/phpunit-mock-objects", @@ -3578,7 +3580,7 @@ "mock", "xunit" ], - "time": "2017-06-30T08:15:21+00:00" + "time": "2017-06-30 08:15:21" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -3623,7 +3625,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "time": "2017-03-04 06:30:41" }, { "name": "sebastian/comparator", @@ -3687,7 +3689,7 @@ "compare", "equality" ], - "time": "2017-03-03T06:26:08+00:00" + "time": "2017-03-03 06:26:08" }, { "name": "sebastian/diff", @@ -3739,7 +3741,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", @@ -3789,7 +3791,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2017-07-01 08:51:00" }, { "name": "sebastian/exporter", @@ -3856,7 +3858,7 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2017-04-03 13:19:02" }, { "name": "sebastian/global-state", @@ -3907,7 +3909,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2017-04-27 15:39:26" }, { "name": "sebastian/object-enumerator", @@ -3954,7 +3956,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-03-12T15:17:29+00:00" + "time": "2017-03-12 15:17:29" }, { "name": "sebastian/object-reflector", @@ -3999,7 +4001,7 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "time": "2017-03-29 09:07:27" }, { "name": "sebastian/recursion-context", @@ -4052,7 +4054,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "time": "2017-03-03 06:23:57" }, { "name": "sebastian/resource-operations", @@ -4094,7 +4096,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2015-07-28 20:34:47" }, { "name": "sebastian/version", @@ -4137,7 +4139,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2016-10-03 07:35:21" }, { "name": "stecman/symfony-console-completion", @@ -4182,20 +4184,20 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24T05:08:54+00:00" + "time": "2016-02-24 05:08:54" }, { "name": "symfony/browser-kit", - "version": "v3.3.4", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "3a4435e79a8401746e8525e98039199d0924b4e5" + "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/3a4435e79a8401746e8525e98039199d0924b4e5", - "reference": "3a4435e79a8401746e8525e98039199d0924b4e5", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", + "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", "shasum": "" }, "require": { @@ -4239,11 +4241,11 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-06-24T09:29:48+00:00" + "time": "2017-07-12 13:03:20" }, { "name": "symfony/console", - "version": "v3.3.4", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -4308,11 +4310,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-07-03T13:19:36+00:00" + "time": "2017-07-03 13:19:36" }, { "name": "symfony/css-selector", - "version": "v3.3.4", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -4361,11 +4363,11 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01T15:01:29+00:00" + "time": "2017-05-01 15:01:29" }, { "name": "symfony/debug", - "version": "v3.3.4", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", @@ -4417,11 +4419,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-07-05T13:02:37+00:00" + "time": "2017-07-05 13:02:37" }, { "name": "symfony/dom-crawler", - "version": "v3.3.4", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -4473,11 +4475,11 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-05-25T23:10:31+00:00" + "time": "2017-05-25 23:10:31" }, { "name": "symfony/event-dispatcher", - "version": "v3.3.4", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -4536,11 +4538,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-06-09T14:53:08+00:00" + "time": "2017-06-09 14:53:08" }, { "name": "symfony/finder", - "version": "v3.3.4", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -4585,7 +4587,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-06-01T21:01:25+00:00" + "time": "2017-06-01 21:01:25" }, { "name": "symfony/polyfill-mbstring", @@ -4644,11 +4646,11 @@ "portable", "shim" ], - "time": "2017-06-09T14:24:12+00:00" + "time": "2017-06-09 14:24:12" }, { "name": "symfony/yaml", - "version": "v3.3.4", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -4699,7 +4701,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-06-15T12:58:50+00:00" + "time": "2017-06-15 12:58:50" }, { "name": "theseer/tokenizer", @@ -4739,7 +4741,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2017-04-07 12:08:54" }, { "name": "webmozart/assert", @@ -4789,7 +4791,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2016-11-23 20:04:58" }, { "name": "yiisoft/yii2-debug", @@ -4836,7 +4838,7 @@ "debugger", "yii2" ], - "time": "2017-02-21T10:30:50+00:00" + "time": "2017-02-21 10:30:50" }, { "name": "yiisoft/yii2-faker", @@ -4883,7 +4885,7 @@ "faker", "yii2" ], - "time": "2015-03-01T06:22:44+00:00" + "time": "2015-03-01 06:22:44" }, { "name": "yiisoft/yii2-gii", @@ -4936,7 +4938,7 @@ "gii", "yii2" ], - "time": "2016-03-18T14:09:46+00:00" + "time": "2016-03-18 14:09:46" } ], "aliases": [], diff --git a/frontend/controllers/PageController.php b/frontend/controllers/PageController.php index b6614a5..be80ab6 100644 --- a/frontend/controllers/PageController.php +++ b/frontend/controllers/PageController.php @@ -43,6 +43,7 @@ [ 'model' => $model, 'pages' => $pages, + 'images' => $model->getImages(), ] ); } diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 9842a9c..9abe702 100644 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -5,6 +5,7 @@ use common\models\Order; use common\models\Settings; use Yii; + use yii\swiftmailer\Mailer; use yii\web\BadRequestHttpException; use yii\web\Controller; use yii\filters\VerbFilter; @@ -102,11 +103,34 @@ public function actionFeedback() { Yii::$app->response->format = Response::FORMAT_JSON; + + /** + * @var Mailer $mailer + */ + $mailer = \Yii::$app->get('smtpmailer'); + $settings = Settings::getInstance(); + if (empty( Yii::$app->request->post() )) { throw new BadRequestHttpException(); } else { $model = new Order(); if ($model->load(Yii::$app->request->post()) && $model->save()) { + + try { + $mailer->compose( + 'feedback', + [ + 'model' => $model, + ] + ) + ->setFrom('artbox@domain.com') + ->setTo($settings->email) + ->setSubject(\Yii::t('app', 'Feedback')) + ->send(); + } catch (\Error $error) { + // Do something on error + } + return [ 'success' => true, 'message' => 'Success message', diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index d15b282..0b5be07 100644 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -9,13 +9,15 @@ use artbox\core\helpers\ImageHelper; use artbox\core\models\Feedback; use artbox\core\models\Page; + use artbox\core\models\PageCategory; use artbox\core\models\User; use common\models\Settings; use frontend\assets\AppAsset; - use noam148\imagemanager\models\ImageManager; + use artbox\core\components\imagemanager\models\ImageManager; use yii\bootstrap\ActiveForm; use yii\bootstrap\Nav; use yii\bootstrap\Html; + use yii\db\ActiveQuery; use yii\helpers\Json; use yii\helpers\Url; use yii\web\View; @@ -30,12 +32,22 @@ $default_controller = Yii::$app->defaultRoute; $isHome = ( ( $controller->id === $default_controller ) && ( $controller->action->id === $controller->defaultAction ) ) ? true : false; /** - * @var Page[] $pages + * @var PageCategory[] $pageCategories */ - $pages = Page::find() - ->where([ 'in_menu' => true ]) - ->with('lang.alias') - ->all(); + $pageCategories = PageCategory::find() + ->with( + [ + 'lang', + 'pages' => function (ActiveQuery $query) { + $query->with('lang.alias') + ->where(['in_menu' => true]) + ->orderBy([ 'sort' => SORT_ASC ]); + }, + ] + ) + ->where([ 'status' => true ]) + ->orderBy([ 'sort' => SORT_ASC ]) + ->all(); $logo = null; if ($settings->logo) { $logo_img = ImageManager::findOne($settings->logo); @@ -260,41 +272,38 @@ _________________________________________________________ -->