├── .bowerrc ├── .gitignore ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── backend ├── assets │ ├── AppAsset.php │ ├── AppAssetIe9.php │ ├── MediaAsset.php │ ├── MediaBrowserAsset.php │ ├── MediaModalAsset.php │ ├── MenuAsset.php │ └── WidgetAsset.php ├── config │ ├── .gitignore │ ├── bootstrap.php │ ├── main.php │ └── params.php ├── controllers │ ├── EditorController.php │ ├── MediaBrowserController.php │ ├── MediaCommentController.php │ ├── MediaController.php │ ├── MenuController.php │ ├── ModuleController.php │ ├── PostCommentController.php │ ├── PostController.php │ ├── PostTypeController.php │ ├── SettingController.php │ ├── SiteController.php │ ├── TaxonomyController.php │ ├── TermController.php │ ├── TermRelationshipController.php │ ├── ThemeController.php │ ├── UserController.php │ └── WidgetController.php ├── models │ └── .gitkeep ├── runtime │ └── .gitignore ├── views │ ├── layouts │ │ ├── blank.php │ │ ├── main-footer.php │ │ ├── main-header.php │ │ ├── main-sidebar.php │ │ └── main.php │ ├── media-browser │ │ ├── _template-details.php │ │ ├── _template-download.php │ │ ├── _template-form.php │ │ ├── _template-upload.php │ │ └── index.php │ ├── media-comment │ │ ├── _form-reply.php │ │ ├── _form.php │ │ ├── _search.php │ │ ├── index.php │ │ ├── reply.php │ │ └── update.php │ ├── media │ │ ├── _form.php │ │ ├── _search.php │ │ ├── _template-create.php │ │ ├── create.php │ │ ├── index.php │ │ └── update.php │ ├── menu │ │ ├── _create.php │ │ ├── _link.php │ │ ├── _post-types.php │ │ ├── _render-item.php │ │ ├── _render.php │ │ ├── _select.php │ │ ├── _taxonomies.php │ │ └── index.php │ ├── module │ │ ├── _config.php │ │ ├── _form.php │ │ ├── _search.php │ │ ├── create.php │ │ ├── index.php │ │ ├── update.php │ │ └── view.php │ ├── post-comment │ │ ├── _form-reply.php │ │ ├── _form.php │ │ ├── _search.php │ │ ├── index.php │ │ ├── reply.php │ │ └── update.php │ ├── post-type │ │ ├── _form.php │ │ ├── _post-type-taxonomy.php │ │ ├── _search.php │ │ ├── create.php │ │ ├── index.php │ │ ├── update.php │ │ └── view.php │ ├── post │ │ ├── _form-comment.php │ │ ├── _form-meta.php │ │ ├── _form-publish.php │ │ ├── _form-term-js.php │ │ ├── _form-term.php │ │ ├── _form.php │ │ ├── _search.php │ │ ├── create.php │ │ ├── index.php │ │ └── update.php │ ├── setting │ │ ├── _form.php │ │ ├── _search.php │ │ ├── create.php │ │ ├── discussion.php │ │ ├── general.php │ │ ├── index.php │ │ ├── media.php │ │ ├── reading.php │ │ ├── update.php │ │ └── view.php │ ├── site │ │ ├── error.php │ │ ├── index.php │ │ ├── login.php │ │ ├── request-password-reset-token.php │ │ ├── reset-password.php │ │ ├── signup.php │ │ └── terms.php │ ├── taxonomy │ │ ├── _form.php │ │ ├── _search.php │ │ ├── create.php │ │ ├── index.php │ │ ├── update.php │ │ └── view.php │ ├── term │ │ ├── _form.php │ │ ├── _search.php │ │ └── index.php │ ├── theme │ │ ├── _navigation.php │ │ ├── _theme-detail.php │ │ ├── _theme-thumbnail.php │ │ ├── detail.php │ │ ├── index.php │ │ └── upload.php │ ├── user │ │ ├── _form.php │ │ ├── _profile.php │ │ ├── _reset-password.php │ │ ├── _search.php │ │ ├── create.php │ │ ├── index.php │ │ ├── profile.php │ │ ├── reset-password.php │ │ ├── update.php │ │ └── view.php │ └── widget │ │ ├── _active.php │ │ ├── _available.php │ │ ├── _form.php │ │ ├── _space.php │ │ ├── create.php │ │ └── index.php └── widgets │ ├── MediaModal.php │ └── RenderMenu.php ├── common ├── components │ ├── BackendBootstrap.php │ ├── BaseWidget.php │ ├── FrontendBootstrap.php │ ├── Json.php │ ├── MediaUploadHandler.php │ └── TimeZoneHelper.php ├── config │ ├── .gitignore │ ├── bootstrap.php │ ├── main.php │ └── params.php ├── mail │ ├── layouts │ │ ├── html.php │ │ └── text.php │ ├── passwordResetToken-html.php │ └── passwordResetToken-text.php ├── models │ ├── BaseComment.php │ ├── LoginForm.php │ ├── Media.php │ ├── MediaComment.php │ ├── MediaMeta.php │ ├── Menu.php │ ├── MenuItem.php │ ├── Module.php │ ├── Option.php │ ├── PasswordResetRequestForm.php │ ├── Post.php │ ├── PostComment.php │ ├── PostMeta.php │ ├── PostType.php │ ├── PostTypeTaxonomy.php │ ├── ResetPasswordForm.php │ ├── SignupForm.php │ ├── Taxonomy.php │ ├── Term.php │ ├── TermRelationship.php │ ├── User.php │ ├── Widget.php │ └── search │ │ ├── Media.php │ │ ├── MediaComment.php │ │ ├── Module.php │ │ ├── Option.php │ │ ├── Post.php │ │ ├── PostComment.php │ │ ├── PostType.php │ │ ├── Taxonomy.php │ │ ├── Term.php │ │ └── User.php └── tmp │ └── .gitignore ├── composer.json ├── composer.lock ├── console ├── config │ ├── .gitignore │ ├── bootstrap.php │ ├── main.php │ └── params.php ├── controllers │ └── .gitkeep ├── migrations │ ├── m000000_000001_option.php │ ├── m000000_000002_user.php │ ├── m000000_000003_auth_rule.php │ ├── m000000_000004_auth_item.php │ ├── m000000_000005_auth_item_child.php │ ├── m000000_000006_auth_assignment.php │ ├── m000000_000007_post_type.php │ ├── m000000_000008_taxonomy.php │ ├── m000000_000009_post_type_taxonomy.php │ ├── m000000_000010_term.php │ ├── m000000_000011_post.php │ ├── m000000_000012_term_relationship.php │ ├── m000000_000013_post_meta.php │ ├── m000000_000014_post_comment.php │ ├── m000000_000015_media.php │ ├── m000000_000016_media_meta.php │ ├── m000000_000017_media_comment.php │ ├── m000000_000018_menu.php │ ├── m000000_000019_menu_item.php │ ├── m000000_000020_module.php │ └── m000000_000021_widget.php ├── models │ └── .gitkeep └── runtime │ └── .gitignore ├── environments ├── dev │ ├── backend │ │ └── config │ │ │ ├── main-local.php │ │ │ └── params-local.php │ ├── common │ │ └── config │ │ │ ├── main-local.php │ │ │ └── params-local.php │ ├── console │ │ └── config │ │ │ ├── main-local.php │ │ │ └── params-local.php │ ├── frontend │ │ └── config │ │ │ ├── main-local.php │ │ │ └── params-local.php │ ├── public │ │ ├── admin │ │ │ ├── index-test.php │ │ │ └── index.php │ │ ├── index-test.php │ │ └── index.php │ └── yii ├── index.php └── prod │ ├── backend │ └── config │ │ ├── main-local.php │ │ └── params-local.php │ ├── common │ └── config │ │ ├── main-local.php │ │ └── params-local.php │ ├── console │ └── config │ │ ├── main-local.php │ │ └── params-local.php │ ├── frontend │ └── config │ │ ├── main-local.php │ │ └── params-local.php │ ├── public │ ├── admin │ │ └── index.php │ └── index.php │ └── yii ├── frontend ├── assets │ ├── AppAsset.php │ └── CommentAsset.php ├── config │ ├── .gitignore │ ├── bootstrap.php │ ├── main.php │ └── params.php ├── controllers │ ├── MediaController.php │ ├── PostController.php │ ├── SiteController.php │ ├── TermController.php │ └── UserController.php ├── models │ └── ContactForm.php ├── runtime │ └── .gitignore ├── views │ ├── layouts │ │ ├── footer.php │ │ ├── main.php │ │ ├── search-form.php │ │ └── sidebar.php │ ├── media-comment │ │ ├── _form.php │ │ └── comments.php │ ├── media │ │ ├── protected.php │ │ └── view.php │ ├── post-comment │ │ ├── _form.php │ │ └── comments.php │ ├── post │ │ ├── index.php │ │ ├── protected.php │ │ └── view.php │ ├── site │ │ ├── contact.php │ │ ├── error.php │ │ ├── index.php │ │ └── search.php │ ├── term │ │ └── view.php │ └── user │ │ └── view.php └── widgets │ ├── Alert.php │ ├── RenderWidget.php │ └── comment │ ├── BaseComment.php │ ├── MediaComment.php │ └── PostComment.php ├── init ├── init.bat ├── modules ├── feed │ ├── config │ │ └── main.php │ └── frontend │ │ ├── Module.php │ │ ├── controllers │ │ └── DefaultController.php │ │ └── views │ │ └── default │ │ └── index.php ├── sitemap │ ├── backend │ │ ├── Module.php │ │ ├── controllers │ │ │ └── DefaultController.php │ │ └── views │ │ │ └── default │ │ │ ├── _basic.php │ │ │ ├── _form.php │ │ │ ├── _home.php │ │ │ ├── _media.php │ │ │ ├── _post-types.php │ │ │ ├── _taxonomies.php │ │ │ └── index.php │ ├── config │ │ ├── main.php │ │ └── params.php │ └── frontend │ │ ├── Module.php │ │ ├── controllers │ │ └── DefaultController.php │ │ └── views │ │ └── default │ │ ├── home.php │ │ ├── index.php │ │ ├── media.php │ │ ├── post-type.php │ │ ├── style.php │ │ └── taxonomy.php └── toolbar │ ├── config │ └── main.php │ └── frontend │ ├── Module.php │ └── assets │ ├── toolbar.css │ └── toolbar.min.css ├── public ├── .gitignore ├── admin │ ├── .gitignore │ ├── assets │ │ └── .gitignore │ ├── css │ │ ├── media.browser.css │ │ ├── media.modal.css │ │ ├── menu.css │ │ ├── min │ │ │ ├── media.browser.css │ │ │ ├── media.modal.css │ │ │ ├── menu.css │ │ │ └── site.css │ │ └── site.css │ ├── editor │ │ └── skins │ │ │ └── writesdown │ │ │ ├── content.inline.min.css │ │ │ ├── content.min.css │ │ │ ├── fonts │ │ │ ├── tinymce-small.eot │ │ │ ├── tinymce-small.svg │ │ │ ├── tinymce-small.ttf │ │ │ ├── tinymce-small.woff │ │ │ ├── tinymce.eot │ │ │ ├── tinymce.svg │ │ │ ├── tinymce.ttf │ │ │ └── tinymce.woff │ │ │ ├── img │ │ │ ├── anchor.gif │ │ │ ├── loader.gif │ │ │ ├── object.gif │ │ │ └── trans.gif │ │ │ ├── skin.ie7.min.css │ │ │ └── skin.min.css │ ├── favicon.ico │ ├── img │ │ ├── logo-mini.png │ │ ├── logo.png │ │ ├── mime │ │ │ ├── archive.png │ │ │ ├── audio.png │ │ │ ├── code.png │ │ │ ├── default.png │ │ │ ├── document.png │ │ │ ├── interactive.png │ │ │ ├── pdf.png │ │ │ ├── spreadsheet.png │ │ │ ├── text.png │ │ │ └── video.png │ │ └── themes.png │ ├── js │ │ ├── media.browser.js │ │ ├── media.js │ │ ├── media.modal.js │ │ ├── menu.js │ │ ├── min │ │ │ ├── media.browser.js │ │ │ ├── media.js │ │ │ ├── media.modal.js │ │ │ ├── menu.js │ │ │ ├── site.js │ │ │ └── widget.js │ │ ├── site.js │ │ └── widget.js │ ├── robots.txt │ └── themes │ │ └── writesdown.png ├── assets │ └── .gitignore ├── css │ ├── min │ │ └── site.css │ └── site.css ├── favicon.ico ├── img │ └── logo-mini.png ├── js │ ├── comment.js │ └── min │ │ └── comment.js ├── robots.txt └── uploads │ └── .gitignore ├── requirements.php ├── tests ├── README.md ├── codeception.yml └── codeception │ ├── _output │ └── .gitignore │ ├── backend │ ├── .gitignore │ ├── _bootstrap.php │ ├── _output │ │ └── .gitignore │ ├── _pages │ │ ├── _media │ │ │ ├── IndexPage.php │ │ │ └── UpdatePage.php │ │ ├── _mediacomment │ │ │ ├── IndexPage.php │ │ │ ├── ReplyPage.php │ │ │ └── UpdatePage.php │ │ ├── _menu │ │ │ └── IndexPage.php │ │ ├── _module │ │ │ ├── IndexPage.php │ │ │ └── UpdatePage.php │ │ ├── _post │ │ │ ├── CreatePage.php │ │ │ ├── IndexPage.php │ │ │ └── UpdatePage.php │ │ ├── _postcomment │ │ │ ├── IndexPage.php │ │ │ ├── ReplyPage.php │ │ │ └── UpdatePage.php │ │ ├── _posttype │ │ │ ├── CreatePage.php │ │ │ ├── IndexPage.php │ │ │ └── UpdatePage.php │ │ ├── _site │ │ │ ├── LoginPage.php │ │ │ ├── RequestPasswordResetPage.php │ │ │ ├── ResetPasswordPage.php │ │ │ └── SignupPage.php │ │ ├── _taxonomy │ │ │ ├── CreatePage.php │ │ │ ├── IndexPage.php │ │ │ ├── UpdatePage.php │ │ │ ├── UpdateTermPage.php │ │ │ └── ViewPage.php │ │ └── _user │ │ │ ├── CreatePage.php │ │ │ ├── IndexPage.php │ │ │ ├── ProfilePage.php │ │ │ ├── ResetPasswordPage.php │ │ │ └── UpdatePage.php │ ├── acceptance.suite.yml │ ├── acceptance │ │ ├── MediaCest.php │ │ ├── MediaCommentCest.php │ │ ├── MenuCest.php │ │ ├── ModuleCest.php │ │ ├── PostCest.php │ │ ├── PostCommentCest.php │ │ ├── PostTypeCest.php │ │ ├── SettingCest.php │ │ ├── SiteCest.php │ │ ├── TaxonomyCest.php │ │ ├── ThemeCest.php │ │ ├── UserCest.php │ │ ├── WidgetCest.php │ │ └── _bootstrap.php │ ├── codeception.yml │ ├── functional.suite.yml │ ├── functional │ │ ├── MediaCest.php │ │ ├── MediaCommentCest.php │ │ ├── MenuCest.php │ │ ├── ModuleCest.php │ │ ├── PostCest.php │ │ ├── PostCommentCest.php │ │ ├── PostTypeCest.php │ │ ├── SettingCest.php │ │ ├── SiteCest.php │ │ ├── TaxonomyCest.php │ │ ├── ThemeCest.php │ │ ├── UserCest.php │ │ ├── WidgetCest.php │ │ └── _bootstrap.php │ ├── unit.suite.yml │ └── unit │ │ ├── DbTestCase.php │ │ ├── TestCase.php │ │ ├── _bootstrap.php │ │ └── fixtures │ │ └── data │ │ └── .gitkeep │ ├── bin │ ├── _bootstrap.php │ ├── yii │ └── yii.bat │ ├── common │ ├── .gitignore │ ├── _bootstrap.php │ ├── _output │ │ └── .gitignore │ ├── _support │ │ └── FixtureHelper.php │ ├── codeception.yml │ ├── fixtures │ │ ├── AuthAssignmentFixture.php │ │ ├── AuthItemChildFixture.php │ │ ├── AuthItemFixture.php │ │ ├── AuthRuleFixture.php │ │ ├── MediaCommentFixture.php │ │ ├── MediaFixture.php │ │ ├── MediaMetaFixture.php │ │ ├── MenuFixture.php │ │ ├── MenuItemFixture.php │ │ ├── ModuleFixture.php │ │ ├── OptionFixture.php │ │ ├── PostCommentFixture.php │ │ ├── PostFixture.php │ │ ├── PostMetaFixture.php │ │ ├── PostTypeFixture.php │ │ ├── PostTypeTaxonomyFixture.php │ │ ├── TaxonomyFixture.php │ │ ├── TermFixture.php │ │ ├── TermRelationshipFixture.php │ │ ├── UserFixture.php │ │ ├── WidgetFixture.php │ │ └── data │ │ │ ├── init_auth_assignment.php │ │ │ ├── init_auth_item.php │ │ │ ├── init_auth_item_child.php │ │ │ ├── init_media.php │ │ │ ├── init_media_comment.php │ │ │ ├── init_media_meta.php │ │ │ ├── init_menu.php │ │ │ ├── init_menu_item.php │ │ │ ├── init_module.php │ │ │ ├── init_option.php │ │ │ ├── init_post.php │ │ │ ├── init_post_comment.php │ │ │ ├── init_post_type.php │ │ │ ├── init_post_type_taxonomy.php │ │ │ ├── init_taxonomy.php │ │ │ ├── init_term.php │ │ │ ├── init_term_relationship.php │ │ │ ├── init_user.php │ │ │ └── test-media.txt │ ├── templates │ │ └── fixtures │ │ │ ├── media_comment.php │ │ │ ├── media_meta.php │ │ │ ├── menu.php │ │ │ ├── menu_item.php │ │ │ ├── post.php │ │ │ ├── post_comment.php │ │ │ ├── post_meta.php │ │ │ ├── post_type.php │ │ │ ├── taxonomy.php │ │ │ ├── term.php │ │ │ └── user.php │ ├── unit.suite.yml │ └── unit │ │ ├── DbTestCase.php │ │ ├── TestCase.php │ │ ├── _bootstrap.php │ │ └── fixtures │ │ └── data │ │ └── .gitkeep │ ├── config │ ├── acceptance.php │ ├── backend │ │ ├── acceptance.php │ │ ├── config.php │ │ ├── functional.php │ │ └── unit.php │ ├── common │ │ └── unit.php │ ├── config.php │ ├── console │ │ └── unit.php │ ├── frontend │ │ ├── acceptance.php │ │ ├── config.php │ │ ├── functional.php │ │ └── unit.php │ ├── functional.php │ └── unit.php │ ├── console │ ├── .gitignore │ ├── _bootstrap.php │ ├── _output │ │ └── .gitignore │ ├── codeception.yml │ ├── unit.suite.yml │ └── unit │ │ ├── DbTestCase.php │ │ ├── TestCase.php │ │ ├── _bootstrap.php │ │ └── fixtures │ │ └── data │ │ └── .gitkeep │ └── frontend │ ├── .gitignore │ ├── _bootstrap.php │ ├── _output │ └── .gitignore │ ├── _pages │ ├── ContactPage.php │ ├── MediaViewPage.php │ └── PostViewPage.php │ ├── acceptance.suite.yml │ ├── acceptance │ ├── MediaCest.php │ ├── PostCest.php │ ├── SiteCest.php │ ├── TermCest.php │ ├── UserCest.php │ └── _bootstrap.php │ ├── codeception.yml │ ├── functional.suite.yml │ ├── functional │ ├── MediaCest.php │ ├── PostCest.php │ ├── SiteCest.php │ ├── TermCest.php │ ├── UserCest.php │ └── _bootstrap.php │ ├── unit.suite.yml │ └── unit │ ├── DbTestCase.php │ ├── TestCase.php │ ├── _bootstrap.php │ └── fixtures │ └── data │ └── .gitkeep ├── themes └── writesdown │ ├── assets │ ├── css │ │ ├── site.css │ │ └── site.min.css │ └── img │ │ ├── favicon.ico │ │ └── logo.png │ ├── classes │ ├── assets │ │ └── ThemeAsset.php │ ├── meta │ │ ├── Meta.php │ │ └── views │ │ │ └── _form.php │ └── widgets │ │ └── Nav.php │ ├── config │ ├── main.php │ └── params.php │ ├── layouts │ ├── footer.php │ ├── header.php │ ├── main.php │ ├── search-form.php │ └── sidebar.php │ ├── media-comment │ ├── _form.php │ └── comments.php │ ├── media │ ├── protected.php │ ├── view-image.php │ └── view.php │ ├── post-comment │ ├── _form.php │ └── comments.php │ ├── post │ ├── index.php │ ├── protected.php │ └── view.php │ ├── screenshot.png │ ├── site │ ├── contact.php │ ├── error.php │ ├── index.php │ └── search.php │ ├── term │ ├── view-category.php │ ├── view-tag.php │ └── view.php │ └── user │ └── view.php ├── widgets ├── meta │ ├── MetaWidget.php │ └── config │ │ └── main.php ├── search │ ├── SearchWidget.php │ ├── config │ │ └── main.php │ └── views │ │ └── search-form.php └── text │ ├── TextWidget.php │ ├── config │ └── main.php │ └── views │ └── option.php └── yii.bat /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory" : "vendor/bower" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # yii console command 2 | /yii 3 | 4 | # phpstorm project files 5 | .idea 6 | 7 | # netbeans project files 8 | nbproject 9 | 10 | # zend studio for eclipse project files 11 | .buildpath 12 | .project 13 | .settings 14 | 15 | # windows thumbnail cache 16 | Thumbs.db 17 | 18 | # composer vendor dir 19 | /vendor 20 | 21 | # composer itself is not needed 22 | composer.phar 23 | 24 | # Mac DS_Store Files 25 | .DS_Store 26 | 27 | # phpunit itself is not needed 28 | phpunit.phar 29 | # local phpunit config 30 | /phpunit.xml 31 | 32 | # webserver error and access log 33 | /*.log 34 | -------------------------------------------------------------------------------- /backend/assets/AppAsset.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.0 17 | */ 18 | class AppAsset extends AssetBundle 19 | { 20 | public $basePath = '@webroot'; 21 | public $baseUrl = '@web'; 22 | public $depends = [ 23 | 'codezeen\yii2\adminlte\AdminLteAsset', 24 | 'backend\assets\AppAssetIe9', 25 | ]; 26 | 27 | public function init() 28 | { 29 | if (YII_DEBUG) { 30 | $this->css = ['css/site.css']; 31 | $this->js = ['js/site.js']; 32 | } else { 33 | $this->css = ['css/min/site.css']; 34 | $this->js = ['js/min/site.js']; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /backend/assets/AppAssetIe9.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.0 18 | */ 19 | class AppAssetIe9 extends AssetBundle 20 | { 21 | public $js = [ 22 | '//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js', 23 | '//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js', 24 | ]; 25 | public $jsOptions = [ 26 | 'condition' => 'lt IE 9', 27 | 'position' => View::POS_HEAD, 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /backend/assets/MediaAsset.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.0 17 | */ 18 | class MediaAsset extends AssetBundle 19 | { 20 | public $basePath = '@webroot'; 21 | public $baseUrl = '@web'; 22 | public $depends = [ 23 | 'backend\assets\AppAsset', 24 | 'dosamigos\fileupload\FileUploadUIAsset', 25 | ]; 26 | 27 | public function init() 28 | { 29 | YII_DEBUG ? $this->js = ['js/media.js'] : $this->js = ['js/min/media.js']; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /backend/assets/MediaBrowserAsset.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.0 17 | */ 18 | class MediaBrowserAsset extends AssetBundle 19 | { 20 | public $basePath = '@webroot'; 21 | public $baseUrl = '@web'; 22 | public $depends = [ 23 | 'backend\assets\AppAsset', 24 | 'yii\jui\JuiAsset', 25 | 'dosamigos\fileupload\FileUploadUIAsset', 26 | ]; 27 | 28 | public function init() 29 | { 30 | if (YII_DEBUG) { 31 | $this->css = ['css/media.browser.css']; 32 | $this->js = ['js/media.browser.js']; 33 | } else { 34 | $this->css = ['css/min/media.browser.css']; 35 | $this->js = ['js/min/media.browser.js']; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /backend/assets/MediaModalAsset.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.3.0 17 | */ 18 | class MediaModalAsset extends AssetBundle 19 | { 20 | public $basePath = '@webroot'; 21 | public $baseUrl = '@web'; 22 | public $depends = [ 23 | 'backend\assets\AppAsset', 24 | ]; 25 | 26 | public function init() 27 | { 28 | if (YII_DEBUG) { 29 | $this->css = ['css/media.modal.css']; 30 | $this->js = ['js/media.modal.js']; 31 | } else { 32 | $this->css = ['css/min/media.modal.css']; 33 | $this->js = ['js/min/media.modal.js']; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /backend/assets/MenuAsset.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.0 17 | */ 18 | class MenuAsset extends AssetBundle 19 | { 20 | public $basePath = '@webroot'; 21 | public $baseUrl = '@web'; 22 | public $depends = [ 23 | 'backend\assets\AppAsset', 24 | ]; 25 | 26 | public function init() 27 | { 28 | if (YII_DEBUG) { 29 | $this->css = ['css/menu.css']; 30 | $this->js = ['js/menu.js']; 31 | } else { 32 | $this->css = ['css/min/menu.css']; 33 | $this->js = ['js/min/menu.js']; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /backend/assets/WidgetAsset.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.0 17 | */ 18 | class WidgetAsset extends AssetBundle 19 | { 20 | public $basePath = '@webroot'; 21 | public $baseUrl = '@web'; 22 | public $depends = [ 23 | 'yii\jui\JuiAsset', 24 | 'backend\assets\AppAsset', 25 | ]; 26 | 27 | public function init() 28 | { 29 | YII_DEBUG ? $this->js = ['js/widget.js'] : $this->js = ['js/min/widget.js']; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /backend/config/.gitignore: -------------------------------------------------------------------------------- 1 | main-local.php 2 | params-local.php 3 | -------------------------------------------------------------------------------- /backend/config/bootstrap.php: -------------------------------------------------------------------------------- 1 | 'skin-blue sidebar-mini', 4 | ]; 5 | -------------------------------------------------------------------------------- /backend/controllers/EditorController.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.3.0 18 | */ 19 | class EditorController extends Controller 20 | { 21 | /** 22 | * @inheritdoc 23 | */ 24 | public function actions() 25 | { 26 | return [ 27 | 'compressor' => [ 28 | 'class' => TinyMceCompressorAction::className(), 29 | ], 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend/models/.gitkeep: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /backend/runtime/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /backend/views/layouts/blank.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use backend\assets\AppAsset; 10 | use yii\helpers\ArrayHelper; 11 | use yii\helpers\Html; 12 | 13 | /* @var $this yii\web\View */ 14 | /* @var $content string */ 15 | 16 | // Favicon 17 | $this->registerLinkTag(['rel' => 'icon', 'href' => Yii::getAlias('@web/favicon.ico'), 'type' => 'image/x-icon']); 18 | 19 | AppAsset::register($this); 20 | ?> 21 | beginPage() ?> 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | WritesDown » <?= Html::encode($this->title) ?> 30 | head() ?> 31 | 32 | 33 | beginBody() ?> 34 | 35 | endBody() ?> 36 | 37 | 38 | endPage() ?> 39 | -------------------------------------------------------------------------------- /backend/views/layouts/main-footer.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | ?> 11 | 20 | -------------------------------------------------------------------------------- /backend/views/layouts/main.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use codezeen\yii2\adminlte\widgets\Alert; 10 | use yii\helpers\ArrayHelper; 11 | use yii\helpers\Html; 12 | use yii\widgets\Breadcrumbs; 13 | 14 | /* @var $this yii\web\View */ 15 | /* @var $content string */ 16 | ?> 17 | beginContent('@app/views/layouts/blank.php') ?> 18 |
19 | render('main-header') ?> 20 | render('main-sidebar') ?> 21 |
22 |
23 |

title ?>

24 | 25 | [ 27 | 'label' => Html::a( 28 | ' ' . Yii::t('writesdown', 'Home'), 29 | Yii::$app->homeUrl 30 | ), 31 | ], 32 | 'encodeLabels' => false, 33 | 'links' => ArrayHelper::getValue($this->params, 'breadcrumbs', []), 34 | ]) ?> 35 |
36 |
37 | 38 | 39 |
40 |
41 | render('main-footer') ?> 42 |
43 | endContent() ?> 44 | -------------------------------------------------------------------------------- /backend/views/media-browser/_template-details.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | ?> 9 | 26 | -------------------------------------------------------------------------------- /backend/views/media-browser/_template-download.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | ?> 9 | 24 | -------------------------------------------------------------------------------- /backend/views/media-browser/_template-upload.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | ?> 9 | 20 | -------------------------------------------------------------------------------- /backend/views/media-comment/_form-reply.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use codezeen\yii2\tinymce\TinyMce; 10 | use yii\helpers\Html; 11 | use yii\helpers\Url; 12 | 13 | /* @var $this yii\web\View */ 14 | /* @var $form yii\widgets\ActiveForm */ 15 | /* @var $model common\models\MediaComment */ 16 | ?> 17 | 18 |
19 | field($model, 'content', ["template" => "{input}\n{error}"])->widget( 20 | TinyMce::className(), 21 | [ 22 | 'compressorRoute' => 'editor/compressor', 23 | 'settings' => [ 24 | 'menubar' => false, 25 | 'skin_url' => Url::base(true) . '/editor/skins/writesdown', 26 | 'toolbar_items_size' => 'medium', 27 | 'toolbar' => 'bold | italic | strikethrough | underline | link | image | bullist | numlist', 28 | ], 29 | 'options' => [ 30 | 'id' => 'mediacomment-content', 31 | 'style' => 'height:200px;', 32 | ], 33 | ] 34 | ) ?> 35 | 36 |
37 | 'btn-flat btn btn-primary']) ?> 38 | 39 |
40 |
41 | -------------------------------------------------------------------------------- /backend/views/menu/_create.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Html; 10 | use yii\helpers\Url; 11 | use yii\widgets\ActiveForm; 12 | 13 | /* @var $this yii\web\View */ 14 | /* @var $form yii\widgets\ActiveForm */ 15 | /* @var $model common\models\Menu */ 16 | ?> 17 | 'create-menu-form', 19 | 'action' => Url::to(['create']), 20 | ]) ?> 21 | 22 |
23 | field($model, 'title', ['template' => '{input}'])->textInput([ 24 | 'placeholder' => $model->getAttributeLabel('title'), 25 | ]) ?> 26 | 27 |
28 | 'btn btn-flat btn-primary']) ?> 29 | 30 |
31 |
32 | 33 | -------------------------------------------------------------------------------- /backend/views/module/_config.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this \yii\web\View */ 10 | /* @var $model common\models\Module */ 11 | /* @var $form \yii\widgets\ActiveForm */ 12 | /* @var $config array */ 13 | /* @var $type string */ 14 | 15 | /** 16 | * Render widget config. 17 | * 18 | * @param $form \yii\widgets\ActiveForm 19 | * @param $model \common\models\Widget 20 | * @param $config array 21 | * @param $type string 22 | * @param $oldKey null|array 23 | */ 24 | $renderConfig = function ($form, $model, $config, $type, $oldKey = null) use (&$renderConfig) { 25 | echo ''; 42 | }; 43 | 44 | $renderConfig($form, $model, $config, $type); 45 | -------------------------------------------------------------------------------- /backend/views/module/update.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\Module */ 11 | 12 | $this->title = Yii::t('writesdown', 'Update Module: {name}', ['name' => $model->name]); 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Modules'), 'url' => ['index']]; 14 | $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; 15 | $this->params['breadcrumbs'][] = Yii::t('writesdown', 'Update'); 16 | ?> 17 | 18 |
19 | render('_form', [ 20 | 'model' => $model, 21 | ]) ?> 22 |
23 | -------------------------------------------------------------------------------- /backend/views/post-comment/_form-reply.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use codezeen\yii2\tinymce\TinyMce; 10 | use yii\helpers\Html; 11 | use yii\helpers\Url; 12 | 13 | /* @var $this yii\web\View */ 14 | /* @var $form yii\widgets\ActiveForm */ 15 | /* @var $model common\models\PostComment */ 16 | ?> 17 |
18 | field($model, 'content', ["template" => "{input}\n{error}"])->widget( 19 | TinyMce::className(), 20 | [ 21 | 'compressorRoute' => 'editor/compressor', 22 | 'settings' => [ 23 | 'menubar' => false, 24 | 'skin_url' => Url::base(true) . '/editor/skins/writesdown', 25 | 'toolbar_items_size' => 'medium', 26 | 'toolbar' => "bold | italic | strikethrough | underline | link | image | bullist | numlist", 27 | ], 28 | 'options' => [ 29 | 'id' => 'postcomment-content', 30 | 'style' => 'height:200px;', 31 | ], 32 | ] 33 | ) ?> 34 | 35 |
36 | 'btn-flat btn btn-primary']) ?> 37 | 38 |
39 |
40 | -------------------------------------------------------------------------------- /backend/views/post-type/create.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\PostType */ 11 | /* @var $taxonomy common\models\Taxonomy */ 12 | /* @var $taxonomies [] */ 13 | 14 | $this->title = Yii::t('writesdown', 'Add New Post Type'); 15 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Post Types'), 'url' => ['index']]; 16 | $this->params['breadcrumbs'][] = $this->title; 17 | ?> 18 | 19 |
20 |
21 | render('_form', [ 22 | 'model' => $model, 23 | ]) ?> 24 |
25 |
26 | render('_post-type-taxonomy', [ 27 | 'model' => $model, 28 | 'taxonomy' => $taxonomy, 29 | 'taxonomies' => $taxonomies, 30 | ]) ?> 31 |
32 |
33 | -------------------------------------------------------------------------------- /backend/views/post-type/update.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $taxonomies [] */ 11 | /* @var $model common\models\PostType */ 12 | /* @var $taxonomy common\models\Taxonomy */ 13 | 14 | $this->title = Yii::t('writesdown', 'Update Post Type: {name} ', ['name' => $model->singular_name]); 15 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Post Types'), 'url' => ['index']]; 16 | $this->params['breadcrumbs'][] = ['label' => $model->singular_name, 'url' => ['view', 'id' => $model->id]]; 17 | $this->params['breadcrumbs'][] = Yii::t('writesdown', 'Update'); 18 | ?> 19 | 20 |
21 |
22 | render('_form', [ 23 | 'model' => $model, 24 | ]) ?> 25 |
26 |
27 | render('_post-type-taxonomy', [ 28 | 'model' => $model, 29 | 'taxonomy' => $taxonomy, 30 | 'taxonomies' => $taxonomies, 31 | ]) ?> 32 |
33 |
34 | -------------------------------------------------------------------------------- /backend/views/post/_form-meta.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\ArrayHelper; 10 | 11 | /* @var $model common\models\Post */ 12 | /* @var $postType common\models\PostType */ 13 | /* @var $form yii\widgets\ActiveForm */ 14 | 15 | $metaBox = isset(Yii::$app->params['postType'][$postType->name]['meta']) 16 | ? Yii::$app->params['postType'][$postType->name]['meta'] 17 | : []; 18 | 19 | foreach ($metaBox as $config) { 20 | $config = ArrayHelper::merge($config, [ 21 | 'model' => $model, 22 | 'form' => $form, 23 | ]); 24 | try { 25 | Yii::createObject($config); 26 | } catch (Exception $e) { 27 | // Hide errors 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /backend/views/setting/create.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\Option */ 11 | 12 | $this->title = Yii::t('writesdown', 'Add New Setting'); 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Settings'), 'url' => ['index']]; 14 | $this->params['breadcrumbs'][] = $this->title; 15 | ?> 16 |
17 | render('_form', [ 18 | 'model' => $model, 19 | ]) ?> 20 |
21 | -------------------------------------------------------------------------------- /backend/views/setting/update.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\Option */ 11 | 12 | $this->title = Yii::t('writesdown', 'Update Setting: {name}', ['name' => $model->name]); 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Setting'), 'url' => ['index']]; 14 | $this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]]; 15 | $this->params['breadcrumbs'][] = Yii::t('writesdown', 'Update'); 16 | ?> 17 |
18 | render('_form', [ 19 | 'model' => $model, 20 | ]) ?> 21 |
22 | -------------------------------------------------------------------------------- /backend/views/setting/view.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Html; 10 | use yii\widgets\DetailView; 11 | 12 | /* @var $this yii\web\View */ 13 | /* @var $model common\models\Option */ 14 | 15 | $this->title = Yii::t('writesdown', 'View Setting: {name}', ['name' => $model->name]); 16 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Settings'), 'url' => ['index']]; 17 | $this->params['breadcrumbs'][] = $model->id; 18 | ?> 19 |
20 |

21 | $model->id], 24 | ['class' => 'btn-flat btn btn-primary'] 25 | ) ?> 26 | 27 | $model->id], [ 28 | 'class' => 'btn btn-flat btn-danger', 29 | 'data' => [ 30 | 'confirm' => Yii::t('writesdown', 'Are you sure you want to delete this item?'), 31 | 'method' => 'post', 32 | ], 33 | ]) ?> 34 | 35 |

36 | $model, 38 | 'attributes' => [ 39 | 'id', 40 | 'name', 41 | 'value:ntext', 42 | 'label', 43 | 'group', 44 | ], 45 | ]) ?> 46 | 47 |
48 | -------------------------------------------------------------------------------- /backend/views/site/error.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Html; 10 | 11 | /* @var $this yii\web\View */ 12 | /* @var $name string */ 13 | /* @var $message string */ 14 | /* @var $exception Exception */ 15 | 16 | $this->title = $name; 17 | $this->params['breadcrumbs'][] = $this->title; 18 | ?> 19 |
20 |
21 |

The above error occurred while the Web server was processing your request.

22 |

Please contact us if you think this is a server error. Thank you.

23 |
24 | -------------------------------------------------------------------------------- /backend/views/taxonomy/create.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\Taxonomy */ 11 | 12 | $this->title = Yii::t('writesdown', 'Add New Taxonomy'); 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Taxonomies'), 'url' => ['index']]; 14 | $this->params['breadcrumbs'][] = $this->title; 15 | ?> 16 |
17 | render('_form', [ 18 | 'model' => $model, 19 | ]) ?> 20 |
21 | -------------------------------------------------------------------------------- /backend/views/taxonomy/update.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\Taxonomy */ 11 | 12 | $this->title = Yii::t('writesdown', 'Update Taxonomy: {name}', ['name' => $model->singular_name]); 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Taxonomies'), 'url' => ['index']]; 14 | $this->params['breadcrumbs'][] = ['label' => $model->singular_name, 'url' => ['view', 'id' => $model->id]]; 15 | $this->params['breadcrumbs'][] = Yii::t('writesdown', 'Update'); 16 | ?> 17 |
18 | render('_form', [ 19 | 'model' => $model, 20 | ]) ?> 21 |
22 | -------------------------------------------------------------------------------- /backend/views/taxonomy/view.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\widgets\Pjax; 10 | 11 | /* @var $this yii\web\View */ 12 | /* @var $model common\models\Taxonomy */ 13 | /* @var $searchModel common\models\Taxonomy */ 14 | /* @var $dataProvider yii\data\ActiveDataProvider */ 15 | /* @var $term common\models\Term */ 16 | 17 | $this->title = Yii::t('writesdown', 'View Taxonomy: {name}', ['name' => $model->singular_name]); 18 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Taxonomies'), 'url' => ['index']]; 19 | $this->params['breadcrumbs'][] = $this->title; 20 | ?> 21 |
22 | 23 | 24 |
25 |
26 | render('/term/_form', ['model' => $term, 'taxonomy' => $model]) ?> 27 |
28 |
29 | render('/term/index', [ 30 | 'searchModel' => $searchModel, 31 | 'dataProvider' => $dataProvider, 32 | 'taxonomy' => $model, 33 | ]) ?> 34 |
35 |
36 | 37 | 38 |
39 | -------------------------------------------------------------------------------- /backend/views/theme/_navigation.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\bootstrap\Nav; 10 | 11 | echo Nav::widget([ 12 | 'items' => [ 13 | [ 14 | 'label' => ' ' . Yii::t('writesdown', 'Available Themes') . '', 15 | 'url' => ['index'], 16 | ], 17 | [ 18 | 'label' => ' ' . Yii::t('writesdown', 'Add New Theme') . '', 19 | 'url' => ['upload'], 20 | ], 21 | ], 22 | 'encodeLabels' => false, 23 | 'options' => ['class' => 'nav-tabs nav-theme', 'id' => 'nav-theme'], 24 | ]); 25 | -------------------------------------------------------------------------------- /backend/views/theme/detail.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $theme [] */ 11 | /* @var $installed string */ 12 | 13 | $this->title = Yii::t('writesdown', 'Detail Theme'); 14 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Themes'), 'url' => ['index']]; 15 | $this->params['breadcrumbs'][] = $theme['info']['Name']; 16 | $this->params['breadcrumbs'][] = $this->title; 17 | 18 | echo $this->render('_theme-detail', [ 19 | 'theme' => $theme, 20 | 'installed' => $installed, 21 | ]); 22 | -------------------------------------------------------------------------------- /backend/views/theme/upload.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Html; 10 | use yii\widgets\ActiveForm; 11 | 12 | /* @var $this yii\web\View */ 13 | /* @var $model yii\base\DynamicModel */ 14 | /* @var $errors array */ 15 | 16 | $this->title = Yii::t('writesdown', 'Upload New Theme'); 17 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Themes'), 'url' => ['index']]; 18 | $this->params['breadcrumbs'][] = $this->title; 19 | ?> 20 |
21 | 43 |
44 | -------------------------------------------------------------------------------- /backend/views/user/_reset-password.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Html; 10 | use yii\widgets\ActiveForm; 11 | 12 | /* @var $this yii\web\View */ 13 | /* @var $model common\models\User */ 14 | /* @var $form yii\widgets\ActiveForm */ 15 | ?> 16 |
17 | 'user-reset-password-form']) ?> 18 | 19 | field($model, 'password_old')->passwordInput([ 20 | 'maxlength' => 255, 21 | 'placeholder' => $model->getAttributeLabel('password_old'), 22 | ]) ?> 23 | 24 | field($model, 'password')->passwordInput([ 25 | 'maxlength' => 255, 26 | 'placeholder' => $model->getAttributeLabel('password'), 27 | ]) ?> 28 | 29 | field($model, 'password_repeat')->passwordInput([ 30 | 'maxlength' => 255, 31 | 'placeholder' => $model->getAttributeLabel('password_repeat'), 32 | ]) ?> 33 | 34 |
35 | 'btn-flat btn btn-primary']) ?> 36 | 37 |
38 | 39 | 40 |
41 | -------------------------------------------------------------------------------- /backend/views/user/create.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\User */ 11 | 12 | $this->title = Yii::t('writesdown', 'Add New User'); 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Users'), 'url' => ['index']]; 14 | $this->params['breadcrumbs'][] = $this->title; 15 | ?> 16 |
17 | render('_form', [ 18 | 'model' => $model, 19 | ]) ?> 20 |
21 | -------------------------------------------------------------------------------- /backend/views/user/profile.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\User */ 11 | 12 | $this->title = Yii::t('writesdown', 'My Profile'); 13 | 14 | $this->params['breadcrumbs'][] = Yii::t('writesdown', 'Profile'); 15 | ?> 16 |
17 | render('_profile', [ 18 | 'model' => $model, 19 | ]) ?> 20 |
21 | -------------------------------------------------------------------------------- /backend/views/user/reset-password.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\User */ 11 | 12 | $this->title = Yii::t('writesdown', 'Reset Password'); 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Profile'), 'url' => ['profile']]; 14 | $this->params['breadcrumbs'][] = $this->title; 15 | ?> 16 |
17 |

18 | render('_reset-password', [ 19 | 'model' => $model, 20 | ]) ?> 21 |
22 | -------------------------------------------------------------------------------- /backend/views/user/update.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $model common\models\User */ 11 | 12 | $this->title = Yii::t('writesdown', 'Update User: {username}', ['username' => $model->username]); 13 | $this->params['breadcrumbs'][] = ['label' => Yii::t('writesdown', 'Users'), 'url' => ['index']]; 14 | $this->params['breadcrumbs'][] = ['label' => $model->username, 'url' => ['view', 'id' => $model->id]]; 15 | $this->params['breadcrumbs'][] = Yii::t('writesdown', 'Update'); 16 | ?> 17 |
18 | render('_form', [ 19 | 'model' => $model, 20 | ]) ?> 21 |
22 | -------------------------------------------------------------------------------- /backend/views/widget/_form.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this \yii\web\View */ 10 | /* @var $form \yii\bootstrap\ActiveForm */ 11 | /* @var $widget \common\models\Widget */ 12 | 13 | /** 14 | * Render widget config. 15 | * 16 | * @param $form \yii\widgets\ActiveForm 17 | * @param $model \common\models\Widget 18 | * @param $config array 19 | * @param $oldKey null|array 20 | */ 21 | $renderConfig = function ($form, $model, $config, $oldKey = null) use (&$renderConfig) { 22 | echo ''; 39 | }; 40 | 41 | $renderConfig($form, $widget, $widget->getConfig()); 42 | -------------------------------------------------------------------------------- /common/components/BaseWidget.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.2.0 17 | */ 18 | abstract class BaseWidget extends Object 19 | { 20 | /** 21 | * @var integer Id of active widget that can be used for id of HTML element. 22 | */ 23 | public $id; 24 | /** 25 | * @var string 26 | */ 27 | public $title = ''; 28 | 29 | /** 30 | * @var string 31 | */ 32 | public $beforeTitle = ''; 33 | 34 | /** 35 | * @var string 36 | */ 37 | public $afterTitle = ''; 38 | 39 | /** 40 | * @var string 41 | */ 42 | public $beforeWidget = ''; 43 | 44 | /** 45 | * @var string 46 | */ 47 | public $afterWidget = ''; 48 | 49 | /** 50 | * @inheritdoc 51 | */ 52 | public function init() 53 | { 54 | $this->run(); 55 | } 56 | 57 | /** 58 | * Executes the widget. 59 | */ 60 | public function run() 61 | { 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /common/components/TimeZoneHelper.php: -------------------------------------------------------------------------------- 1 | 14 | * @since 0.1.0 15 | */ 16 | class TimeZoneHelper 17 | { 18 | /** 19 | * List of timezone as array. 20 | * 21 | * @return array 22 | */ 23 | public static function listTimeZone() 24 | { 25 | $timezone = []; 26 | $timestamp = time(); 27 | 28 | foreach (timezone_identifiers_list() as $zone) { 29 | date_default_timezone_set($zone); 30 | $timezone[$zone] = $zone . ' UTC/GMT ' . date('P', $timestamp); 31 | } 32 | 33 | return $timezone; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /common/config/.gitignore: -------------------------------------------------------------------------------- 1 | main-local.php 2 | params-local.php 3 | -------------------------------------------------------------------------------- /common/config/bootstrap.php: -------------------------------------------------------------------------------- 1 | dirname(dirname(__DIR__)) . '/vendor', 4 | 'components' => [ 5 | 'cache' => [ 6 | 'class' => 'yii\caching\FileCache', 7 | ], 8 | ], 9 | ]; 10 | -------------------------------------------------------------------------------- /common/config/params.php: -------------------------------------------------------------------------------- 1 | 3600, 4 | ]; 5 | -------------------------------------------------------------------------------- /common/mail/layouts/html.php: -------------------------------------------------------------------------------- 1 | 8 | beginPage() ?> 9 | 10 | 11 | 12 | 13 | <?= Html::encode($this->title) ?> 14 | head() ?> 15 | 16 | 17 | beginBody() ?> 18 | 19 | endBody() ?> 20 | 21 | 22 | endPage() ?> 23 | -------------------------------------------------------------------------------- /common/mail/layouts/text.php: -------------------------------------------------------------------------------- 1 | 6 | beginPage() ?> 7 | beginBody() ?> 8 | 9 | endBody() ?> 10 | endPage() ?> 11 | -------------------------------------------------------------------------------- /common/mail/passwordResetToken-html.php: -------------------------------------------------------------------------------- 1 | urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]); 8 | ?> 9 |
10 |

Hello username) ?>,

11 | 12 |

Follow the link below to reset your password:

13 | 14 |

15 |
16 | -------------------------------------------------------------------------------- /common/mail/passwordResetToken-text.php: -------------------------------------------------------------------------------- 1 | urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]); 7 | ?> 8 | Hello username ?>, 9 | 10 | Follow the link below to reset your password: 11 | 12 | 13 | -------------------------------------------------------------------------------- /common/tmp/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /console/config/.gitignore: -------------------------------------------------------------------------------- 1 | main-local.php 2 | params-local.php 3 | -------------------------------------------------------------------------------- /console/config/bootstrap.php: -------------------------------------------------------------------------------- 1 | 'app-console', 11 | 'basePath' => dirname(__DIR__), 12 | 'bootstrap' => ['log'], 13 | 'controllerNamespace' => 'console\controllers', 14 | 'components' => [ 15 | 'log' => [ 16 | 'targets' => [ 17 | [ 18 | 'class' => 'yii\log\FileTarget', 19 | 'levels' => ['error', 'warning'], 20 | ], 21 | ], 22 | ], 23 | ], 24 | 'params' => $params, 25 | ]; 26 | -------------------------------------------------------------------------------- /console/config/params.php: -------------------------------------------------------------------------------- 1 | 'admin@example.com', 4 | ]; 5 | -------------------------------------------------------------------------------- /console/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/console/controllers/.gitkeep -------------------------------------------------------------------------------- /console/migrations/m000000_000003_auth_rule.php: -------------------------------------------------------------------------------- 1 | 10 | * @since 0.1.0 11 | */ 12 | class m000000_000003_auth_rule extends \yii\db\Migration 13 | { 14 | /** 15 | * @inheritdoc 16 | */ 17 | public function up() 18 | { 19 | $tableOptions = null; 20 | 21 | if ($this->db->driverName === 'mysql') { 22 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; 23 | } 24 | 25 | $this->createTable('{{%auth_rule}}', [ 26 | 'name' => Schema::TYPE_STRING . '(64) NOT NULL', 27 | 'data' => Schema::TYPE_TEXT, 28 | 'created_at' => Schema::TYPE_INTEGER . '(11)', 29 | 'updated_at' => Schema::TYPE_INTEGER . '(11)', 30 | 'PRIMARY KEY ([[name]])', 31 | ], $tableOptions); 32 | } 33 | 34 | /** 35 | * @inheritdoc 36 | */ 37 | public function down() 38 | { 39 | $this->dropTable('{{%auth_rule}}'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /console/migrations/m000000_000012_term_relationship.php: -------------------------------------------------------------------------------- 1 | 9 | * @since 0.1.0 10 | */ 11 | class m000000_000012_term_relationship extends \yii\db\Migration 12 | { 13 | /** 14 | * @inheritdoc 15 | */ 16 | public function up() 17 | { 18 | $tableOptions = null; 19 | 20 | if ($this->db->driverName === 'mysql') { 21 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; 22 | } 23 | 24 | $this->createTable('{{%term_relationship}}', [ 25 | 'post_id' => Schema::TYPE_INTEGER . '(11) NOT NULL', 26 | 'term_id' => Schema::TYPE_INTEGER . '(11) NOT NULL', 27 | 'PRIMARY KEY ([[post_id]], [[term_id]])', 28 | 'FOREIGN KEY ([[post_id]]) REFERENCES {{%post}} ([[id]]) ON DELETE CASCADE ON UPDATE CASCADE', 29 | 'FOREIGN KEY ([[term_id]]) REFERENCES {{%term}} ([[id]]) ON DELETE CASCADE ON UPDATE CASCADE', 30 | ], $tableOptions); 31 | 32 | /** 33 | * First post has post-category and post-tag 34 | */ 35 | $this->batchInsert('{{%term_relationship}}', ['post_id', 'term_id'], [ 36 | [1, 1], 37 | [1, 2], 38 | ]); 39 | } 40 | 41 | /** 42 | * @inheritdoc 43 | */ 44 | public function down() 45 | { 46 | $this->dropTable('{{%term_relationship}}'); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /console/migrations/m000000_000013_post_meta.php: -------------------------------------------------------------------------------- 1 | 9 | * @since 0.1.0 10 | */ 11 | class m000000_000013_post_meta extends \yii\db\Migration 12 | { 13 | /** 14 | * @inheritdoc 15 | */ 16 | public function up() 17 | { 18 | $tableOptions = null; 19 | 20 | if ($this->db->driverName === 'mysql') { 21 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; 22 | } 23 | 24 | $this->createTable('{{%post_meta}}', [ 25 | 'id' => Schema::TYPE_PK, 26 | 'post_id' => Schema::TYPE_INTEGER . '(11) NOT NULL', 27 | 'name' => Schema::TYPE_STRING . '(255) NOT NULL', 28 | 'value' => Schema::TYPE_TEXT . ' NOT NULL', 29 | 'FOREIGN KEY ([[post_id]]) REFERENCES {{%post}} ([[id]]) ON DELETE CASCADE ON UPDATE CASCADE', 30 | ], $tableOptions); 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | */ 36 | public function down() 37 | { 38 | $this->dropTable('{{%post_meta}}'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /console/migrations/m000000_000016_media_meta.php: -------------------------------------------------------------------------------- 1 | 9 | * @since 0.1.0 10 | */ 11 | class m000000_000016_media_meta extends \yii\db\Migration 12 | { 13 | /** 14 | * @inheritdoc 15 | */ 16 | public function up() 17 | { 18 | $tableOptions = null; 19 | 20 | if ($this->db->driverName === 'mysql') { 21 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; 22 | } 23 | 24 | $this->createTable('{{%media_meta}}', [ 25 | 'id' => Schema::TYPE_PK, 26 | 'media_id' => Schema::TYPE_INTEGER . '(11) NOT NULL', 27 | 'name' => Schema::TYPE_STRING . '(255) NOT NULL', 28 | 'value' => Schema::TYPE_TEXT . ' NOT NULL', 29 | 'FOREIGN KEY ([[media_id]]) REFERENCES {{%media}} ([[id]]) ON DELETE CASCADE ON UPDATE CASCADE', 30 | ], $tableOptions); 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | */ 36 | public function down() 37 | { 38 | $this->dropTable('{{%media_meta}}'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /console/migrations/m000000_000018_menu.php: -------------------------------------------------------------------------------- 1 | 9 | * @since 0.1.0 10 | */ 11 | class m000000_000018_menu extends \yii\db\Migration 12 | { 13 | /** 14 | * @inheritdoc 15 | */ 16 | public function up() 17 | { 18 | $tableOptions = null; 19 | 20 | if ($this->db->driverName === 'mysql') { 21 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; 22 | } 23 | 24 | $this->createTable('{{%menu}}', [ 25 | 'id' => Schema::TYPE_PK, 26 | 'title' => Schema::TYPE_STRING . '(255) NOT NULL', 27 | 'location' => Schema::TYPE_STRING . '(50)', 28 | ], $tableOptions); 29 | } 30 | 31 | /** 32 | * @inheritdoc 33 | */ 34 | public function down() 35 | { 36 | $this->dropTable('{{%menu}}'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /console/migrations/m000000_000019_menu_item.php: -------------------------------------------------------------------------------- 1 | 9 | * @since 0.1.0 10 | */ 11 | class m000000_000019_menu_item extends \yii\db\Migration 12 | { 13 | /** 14 | * @inheritdoc 15 | */ 16 | public function up() 17 | { 18 | $tableOptions = null; 19 | 20 | if ($this->db->driverName === 'mysql') { 21 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; 22 | } 23 | 24 | $this->createTable('{{%menu_item}}', [ 25 | 'id' => Schema::TYPE_PK, 26 | 'menu_id' => Schema::TYPE_INTEGER . '(11) NOT NULL', 27 | 'label' => Schema::TYPE_STRING . '(255) NOT NULL', 28 | 'url' => Schema::TYPE_TEXT . ' NOT NULL', 29 | 'description' => Schema::TYPE_TEXT, 30 | 'order' => Schema::TYPE_INTEGER . '(11) NOT NULL DEFAULT 0', 31 | 'parent' => Schema::TYPE_INTEGER . '(11) NOT NULL DEFAULT 0', 32 | 'options' => Schema::TYPE_TEXT, 33 | 'FOREIGN KEY ([[menu_id]]) REFERENCES {{%menu}} ([[id]]) ON DELETE CASCADE ON UPDATE CASCADE', 34 | ], $tableOptions); 35 | } 36 | 37 | /** 38 | * @inheritdoc 39 | */ 40 | public function down() 41 | { 42 | $this->dropTable('{{%menu_item}}'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /console/migrations/m000000_000021_widget.php: -------------------------------------------------------------------------------- 1 | 9 | * @since 0.2.0 10 | */ 11 | class m000000_000021_widget extends \yii\db\Migration 12 | { 13 | /** 14 | * @inheritdoc 15 | */ 16 | public function up() 17 | { 18 | $tableOptions = null; 19 | 20 | if ($this->db->driverName === 'mysql') { 21 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; 22 | } 23 | 24 | $this->createTable('{{%widget}}', [ 25 | 'id' => Schema::TYPE_PK, 26 | 'title' => Schema::TYPE_STRING . '(255) NOT NULL', 27 | 'config' => Schema::TYPE_TEXT . ' NOT NULL', 28 | 'location' => Schema::TYPE_STRING . '(128) NOT NULL', 29 | 'order' => Schema::TYPE_INTEGER . '(11) NOT NULL DEFAULT 0', 30 | 'directory' => Schema::TYPE_STRING . '(128) NOT NULL', 31 | 'date' => Schema::TYPE_DATETIME . ' NOT NULL', 32 | 'modified' => Schema::TYPE_DATETIME . ' NOT NULL', 33 | ], $tableOptions); 34 | } 35 | 36 | /** 37 | * @inheritdoc 38 | */ 39 | public function down() 40 | { 41 | $this->dropTable('{{%widget}}'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /console/models/.gitkeep: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /console/runtime/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /environments/dev/backend/config/main-local.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'request' => [ 6 | // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 7 | 'cookieValidationKey' => '', 8 | ], 9 | ], 10 | ]; 11 | 12 | if (!YII_ENV_TEST) { 13 | // configuration adjustments for 'dev' environment 14 | $config['bootstrap'][] = 'debug'; 15 | $config['modules']['debug'] = [ 16 | 'class' => 'yii\debug\Module', 17 | ]; 18 | 19 | $config['bootstrap'][] = 'gii'; 20 | $config['modules']['gii'] = [ 21 | 'class' => 'yii\gii\Module', 22 | ]; 23 | } 24 | 25 | return $config; 26 | -------------------------------------------------------------------------------- /environments/dev/backend/config/params-local.php: -------------------------------------------------------------------------------- 1 | [ 4 | 'db' => [ 5 | 'class' => 'yii\db\Connection', 6 | 'dsn' => 'mysql:host=localhost;dbname=writesdown', 7 | 'username' => 'root', 8 | 'password' => '', 9 | 'charset' => 'utf8', 10 | 'tablePrefix' => 'wd_', 11 | ], 12 | 'mailer' => [ 13 | 'class' => 'yii\swiftmailer\Mailer', 14 | 'viewPath' => '@common/mail', 15 | // send all mails to a file by default. You have to set 16 | // 'useFileTransport' to false and configure a transport 17 | // for the mailer to send real emails. 18 | 'useFileTransport' => true, 19 | ], 20 | ], 21 | ]; 22 | -------------------------------------------------------------------------------- /environments/dev/common/config/params-local.php: -------------------------------------------------------------------------------- 1 | ['gii'], 4 | 'modules' => [ 5 | 'gii' => 'yii\gii\Module', 6 | ], 7 | ]; 8 | -------------------------------------------------------------------------------- /environments/dev/console/config/params-local.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'request' => [ 6 | // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 7 | 'cookieValidationKey' => '', 8 | ], 9 | ], 10 | ]; 11 | 12 | if (!YII_ENV_TEST) { 13 | // configuration adjustments for 'dev' environment 14 | $config['bootstrap'][] = 'debug'; 15 | $config['modules']['debug'] = [ 16 | 'class' => 'yii\debug\Module', 17 | ]; 18 | $config['bootstrap'][] = 'gii'; 19 | $config['modules']['gii'] = [ 20 | 'class' => 'yii\gii\Module', 21 | ]; 22 | } 23 | 24 | return $config; 25 | -------------------------------------------------------------------------------- /environments/dev/frontend/config/params-local.php: -------------------------------------------------------------------------------- 1 | run(); 20 | -------------------------------------------------------------------------------- /environments/dev/public/admin/index.php: -------------------------------------------------------------------------------- 1 | run(); 19 | -------------------------------------------------------------------------------- /environments/dev/public/index-test.php: -------------------------------------------------------------------------------- 1 | run(); 19 | -------------------------------------------------------------------------------- /environments/dev/public/index.php: -------------------------------------------------------------------------------- 1 | run(); 19 | -------------------------------------------------------------------------------- /environments/dev/yii: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 28 | exit($exitCode); 29 | -------------------------------------------------------------------------------- /environments/prod/backend/config/main-local.php: -------------------------------------------------------------------------------- 1 | [ 4 | 'request' => [ 5 | // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 6 | 'cookieValidationKey' => '', 7 | ], 8 | ], 9 | ]; 10 | -------------------------------------------------------------------------------- /environments/prod/backend/config/params-local.php: -------------------------------------------------------------------------------- 1 | [ 4 | 'db' => [ 5 | 'class' => 'yii\db\Connection', 6 | 'dsn' => 'mysql:host=localhost;dbname=writesdown', 7 | 'username' => 'root', 8 | 'password' => '', 9 | 'charset' => 'utf8', 10 | 'tablePrefix' => 'wd_', 11 | ], 12 | 'mailer' => [ 13 | 'class' => 'yii\swiftmailer\Mailer', 14 | 'viewPath' => '@common/mail', 15 | ], 16 | ], 17 | ]; 18 | -------------------------------------------------------------------------------- /environments/prod/common/config/params-local.php: -------------------------------------------------------------------------------- 1 | [ 4 | 'request' => [ 5 | // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 6 | 'cookieValidationKey' => '', 7 | ], 8 | ], 9 | ]; 10 | -------------------------------------------------------------------------------- /environments/prod/frontend/config/params-local.php: -------------------------------------------------------------------------------- 1 | run(); 19 | -------------------------------------------------------------------------------- /environments/prod/public/index.php: -------------------------------------------------------------------------------- 1 | run(); 19 | -------------------------------------------------------------------------------- /environments/prod/yii: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 28 | exit($exitCode); 29 | -------------------------------------------------------------------------------- /frontend/assets/AppAsset.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.0 17 | */ 18 | class AppAsset extends AssetBundle 19 | { 20 | public $basePath = '@webroot'; 21 | public $baseUrl = '@web'; 22 | public $depends = [ 23 | 'yii\web\YiiAsset', 24 | 'yii\bootstrap\BootstrapAsset', 25 | ]; 26 | 27 | public function init() 28 | { 29 | if (YII_DEBUG) { 30 | $this->css = ['css/site.css']; 31 | } else { 32 | $this->css = ['css/min/site.css']; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /frontend/assets/CommentAsset.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.0 17 | */ 18 | class CommentAsset extends AssetBundle 19 | { 20 | public $basePath = '@webroot'; 21 | public $baseUrl = '@web'; 22 | public $depends = [ 23 | 'yii\web\YiiAsset', 24 | ]; 25 | 26 | public function init() 27 | { 28 | if (YII_DEBUG) { 29 | $this->js = ['js/comment.js']; 30 | } else { 31 | $this->js = ['js/min/comment.js']; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /frontend/config/.gitignore: -------------------------------------------------------------------------------- 1 | main-local.php 2 | params-local.php 3 | -------------------------------------------------------------------------------- /frontend/config/bootstrap.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use common\models\Option; 10 | use yii\helpers\Html; 11 | 12 | ?> 13 | 22 | -------------------------------------------------------------------------------- /frontend/views/layouts/search-form.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Html; 10 | use yii\helpers\Url; 11 | use yii\widgets\ActiveForm; 12 | 13 | ?> 14 | Url::to(['/site/search']), 16 | 'method' => 'get', 17 | 'options' => ['class' => 'form-search'], 18 | ]); ?> 19 | 20 |
21 | request->get('s'), [ 22 | 'class' => 'form-control', 23 | 'placeholder' => 'Search...', 24 | ]) ?> 25 | 26 | 27 | 'btn btn-default', 29 | 'type' => 'submit', 30 | ]) ?> 31 | 32 | 33 |
34 | 35 | -------------------------------------------------------------------------------- /frontend/views/layouts/sidebar.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use common\models\Taxonomy; 10 | use yii\bootstrap\Nav; 11 | 12 | /* @var $this yii\web\View */ 13 | /* @var $taxonomies common\models\Taxonomy[] */ 14 | 15 | $taxonomies = Taxonomy::find()->all(); 16 | $items = []; 17 | ?> 18 | 45 | -------------------------------------------------------------------------------- /frontend/views/site/error.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Html; 10 | 11 | /* @var $this yii\web\View */ 12 | /* @var $name string */ 13 | /* @var $message string */ 14 | /* @var $exception Exception */ 15 | 16 | $this->title = $name; 17 | $this->params['breadcrumbs'][] = $this->title; 18 | $this->registerMetaTag([ 19 | 'name' => 'robots', 20 | 'content' => 'noindex, nofollow', 21 | ]); 22 | ?> 23 |
24 |

title) ?>

25 | 26 |
27 |

The above error occurred while the Web server was processing your request.

28 |

Please contact us if you think this is a server error. Thank you.

29 |
30 | -------------------------------------------------------------------------------- /init.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Yii command line init script for Windows. 5 | rem 6 | rem @author Qiang Xue 7 | rem @link http://www.yiiframework.com/ 8 | rem @copyright Copyright (c) 2008 Yii Software LLC 9 | rem @license http://www.yiiframework.com/license/ 10 | rem ------------------------------------------------------------- 11 | 12 | @setlocal 13 | 14 | set YII_PATH=%~dp0 15 | 16 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 17 | 18 | "%PHP_COMMAND%" "%YII_PATH%init" %* 19 | 20 | @endlocal 21 | -------------------------------------------------------------------------------- /modules/feed/config/main.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | 'name' => 'feed', 11 | 'title' => 'RSS Feed', 12 | 'config' => [ 13 | 'frontend' => [ 14 | 'class' => 'modules\feed\frontend\Module', 15 | ], 16 | ], 17 | ]; 18 | -------------------------------------------------------------------------------- /modules/feed/frontend/Module.php: -------------------------------------------------------------------------------- 1 | 14 | * @since 0.2.0 15 | */ 16 | class Module extends \yii\base\Module 17 | { 18 | /** 19 | * @var string 20 | */ 21 | public $controllerNamespace = 'modules\feed\frontend\controllers'; 22 | 23 | /** 24 | * @inheritdoc 25 | */ 26 | public function init() 27 | { 28 | parent::init(); 29 | 30 | // custom initialization code goes here 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /modules/sitemap/backend/Module.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.2.0 17 | */ 18 | class Module extends \yii\base\Module 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $controllerNamespace = 'modules\sitemap\backend\controllers'; 24 | 25 | /** 26 | * @inheritdoc 27 | */ 28 | public function init() 29 | { 30 | parent::init(); 31 | 32 | if (!isset(Yii::$app->i18n->translations['sitemap'])) { 33 | Yii::$app->i18n->translations['sitemap'] = [ 34 | 'class' => 'yii\i18n\PhpMessageSource', 35 | 'sourceLanguage' => Yii::$app->language, 36 | 'basePath' => __DIR__ . '/../messages', 37 | ]; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /modules/sitemap/backend/views/default/index.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /* @var $this yii\web\View */ 10 | /* @var $optionName string */ 11 | /* @var $option [] */ 12 | /* @var $postTypes common\models\PostType[] */ 13 | /* @var $taxonomies common\models\Taxonomy[] */ 14 | 15 | $this->title = Yii::t('sitemap', 'XML Sitemap by WritesDown'); 16 | $this->params['breadcrumbs'][] = $this->title; 17 | ?> 18 |
19 | render('_form', [ 20 | 'option' => $option, 21 | 'postTypes' => $postTypes, 22 | 'taxonomies' => $taxonomies, 23 | ]) ?> 24 |
25 | -------------------------------------------------------------------------------- /modules/sitemap/config/main.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | 'name' => 'sitemap', 11 | 'title' => 'Sitemap', 12 | 'description' => 'Module for sitemap', 13 | 'config' => [ 14 | 'backend' => [ 15 | 'class' => 'modules\sitemap\backend\Module', 16 | ], 17 | 'frontend' => [ 18 | 'class' => 'modules\sitemap\frontend\Module', 19 | ], 20 | ], 21 | 'frontend_bootstrap' => 1, 22 | ]; 23 | -------------------------------------------------------------------------------- /modules/sitemap/config/params.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | 'backend' => [ 11 | 'adminMenu' => [ 12 | 70 => [ 13 | 'label' => Yii::t('writesdown', 'Sitemap'), 14 | 'url' => ['/sitemap/default/index'], 15 | 'icon' => 'fa fa-sitemap', 16 | ], 17 | ], 18 | ], 19 | ]; 20 | -------------------------------------------------------------------------------- /modules/sitemap/frontend/views/default/home.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Url; 10 | 11 | /* @var $item array */ 12 | ?> 13 | ' ?> 14 | ' ?> 15 | 18 | 19 | ]]> 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /modules/sitemap/frontend/views/default/index.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Url; 10 | 11 | /* @var $items array */ 12 | ?> 13 | ' ?> 14 | ' ?> 15 | 16 | 17 | urlManager->hostInfo 18 | . Url::to(['view', 'type' => 'h', 'slug' => 'home', 'page' => 1]) ?>]]> 19 | 20 | 21 | timeZone)); 23 | echo $lastmod->format('r') 24 | ?> 25 | 26 | 27 | 28 | ' ?> 29 | ' ?> 30 | ' . $item['lastmod'] . '' ?> 31 | ' ?> 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/sitemap/frontend/views/default/media.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Url; 10 | 11 | /* @var $items array */ 12 | ?> 13 | ' ?> 14 | ' ?> 15 | 18 | 19 | 20 | ]]> 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /modules/sitemap/frontend/views/default/taxonomy.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Url; 10 | 11 | /* @var $items array */ 12 | ?> 13 | ' ?> 14 | ' ?> 15 | 18 | 19 | 20 | ]]> 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /modules/toolbar/config/main.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | 'name' => 'toolbar', 11 | 'title' => 'Toolbar', 12 | 'config' => [ 13 | 'frontend' => [ 14 | 'class' => 'modules\toolbar\frontend\Module', 15 | ], 16 | ], 17 | 'frontend_bootstrap' => 1, 18 | ]; 19 | -------------------------------------------------------------------------------- /modules/toolbar/frontend/assets/toolbar.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-top: 40px; 3 | } 4 | #wd-frontend-toolbar { 5 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 6 | min-height: 28px; 7 | } 8 | #wd-frontend-toolbar .dropdown-menu { 9 | border-radius: 0; 10 | } 11 | #wd-frontend-toolbar .dropdown-menu:empty { 12 | display: none; 13 | } 14 | #wd-frontend-toolbar .navbar-nav > li > a { 15 | padding-bottom: 10px; 16 | padding-top: 10px; 17 | } 18 | #wd-frontend-toolbar .navbar-brand { 19 | height: 40px; 20 | line-height: 40px; 21 | padding: 9px 15px; 22 | } 23 | #wd-frontend-toolbar .navbar-toggle { 24 | padding: 4px; 25 | border-radius: 0; 26 | } -------------------------------------------------------------------------------- /modules/toolbar/frontend/assets/toolbar.min.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-top: 40px 3 | } 4 | #wd-frontend-toolbar { 5 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 6 | min-height: 28px 7 | } 8 | #wd-frontend-toolbar .dropdown-menu { 9 | border-radius: 0 10 | } 11 | #wd-frontend-toolbar .dropdown-menu:empty { 12 | display: none 13 | } 14 | #wd-frontend-toolbar .navbar-nav > li > a { 15 | padding-bottom: 10px; 16 | padding-top: 10px 17 | } 18 | #wd-frontend-toolbar .navbar-brand { 19 | height: 40px; 20 | line-height: 40px; 21 | padding: 9px 15px 22 | } 23 | #wd-frontend-toolbar .navbar-toggle { 24 | padding: 4px; 25 | border-radius: 0 26 | } -------------------------------------------------------------------------------- /public/.gitignore: -------------------------------------------------------------------------------- 1 | /index.php 2 | /index-test.php 3 | -------------------------------------------------------------------------------- /public/admin/.gitignore: -------------------------------------------------------------------------------- 1 | /index.php 2 | /index-test.php 3 | -------------------------------------------------------------------------------- /public/admin/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/admin/css/media.modal.css: -------------------------------------------------------------------------------- 1 | #media-browser-modal .modal-header { 2 | height: 57px; 3 | overflow: hidden; 4 | padding: 15px; 5 | border-bottom: 1px solid #e5e5e5; 6 | } 7 | #media-browser-modal .modal-dialog { 8 | width: 90%; 9 | position: fixed; 10 | top: 10px; 11 | left: 10px; 12 | right: 10px; 13 | bottom: 10px; 14 | } 15 | #media-browser-modal .modal-dialog .modal-content { 16 | position: absolute; 17 | top: 0; 18 | left: 0; 19 | right: 0; 20 | bottom: 0; 21 | min-height: 300px; 22 | -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .7); 23 | box-shadow: 0 5px 15px rgba(0, 0, 0, .7); 24 | background: #fcfcfc; 25 | -webkit-font-smoothing: subpixel-antialiased; 26 | padding: 0; 27 | } 28 | #media-browser-modal .modal-dialog .modal-body { 29 | bottom: 0; 30 | left: 0; 31 | padding: 0; 32 | position: absolute; 33 | right: 0; 34 | top: 57px; 35 | } 36 | #media-browser-modal .modal-dialog .modal-body iframe { 37 | width: 100%; 38 | border: none; 39 | height: 100%; 40 | } 41 | @media only screen and (max-width: 640px), screen and (max-height: 400px) { 42 | #media-browser-modal .modal-dialog { 43 | width: 100%; 44 | position: fixed; 45 | top: 0; 46 | left: 0; 47 | right: 0; 48 | bottom: 0; 49 | margin: 0; 50 | } 51 | } -------------------------------------------------------------------------------- /public/admin/css/min/media.modal.css: -------------------------------------------------------------------------------- 1 | #media-browser-modal .modal-header{height:57px;overflow:hidden;padding:15px;border-bottom:1px solid #e5e5e5}#media-browser-modal .modal-dialog{width:90%;position:fixed;top:10px;left:10px;right:10px;bottom:10px}#media-browser-modal .modal-dialog .modal-content{position:absolute;top:0;left:0;right:0;bottom:0;min-height:300px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,.7);box-shadow:0 5px 15px rgba(0,0,0,.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased;padding:0}#media-browser-modal .modal-dialog .modal-body{bottom:0;left:0;padding:0;position:absolute;right:0;top:57px}#media-browser-modal .modal-dialog .modal-body iframe{width:100%;border:0;height:100%}@media only screen and (max-width:640px),screen and (max-height:400px){#media-browser-modal .modal-dialog{width:100%;position:fixed;top:0;left:0;right:0;bottom:0;margin:0}} -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/fonts/tinymce-small.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/fonts/tinymce-small.eot -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/fonts/tinymce.eot -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/fonts/tinymce.ttf -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/fonts/tinymce.woff -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/img/anchor.gif -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/img/loader.gif -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/img/object.gif -------------------------------------------------------------------------------- /public/admin/editor/skins/writesdown/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/editor/skins/writesdown/img/trans.gif -------------------------------------------------------------------------------- /public/admin/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/favicon.ico -------------------------------------------------------------------------------- /public/admin/img/logo-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/logo-mini.png -------------------------------------------------------------------------------- /public/admin/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/logo.png -------------------------------------------------------------------------------- /public/admin/img/mime/archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/archive.png -------------------------------------------------------------------------------- /public/admin/img/mime/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/audio.png -------------------------------------------------------------------------------- /public/admin/img/mime/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/code.png -------------------------------------------------------------------------------- /public/admin/img/mime/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/default.png -------------------------------------------------------------------------------- /public/admin/img/mime/document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/document.png -------------------------------------------------------------------------------- /public/admin/img/mime/interactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/interactive.png -------------------------------------------------------------------------------- /public/admin/img/mime/pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/pdf.png -------------------------------------------------------------------------------- /public/admin/img/mime/spreadsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/spreadsheet.png -------------------------------------------------------------------------------- /public/admin/img/mime/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/text.png -------------------------------------------------------------------------------- /public/admin/img/mime/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/mime/video.png -------------------------------------------------------------------------------- /public/admin/img/themes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/img/themes.png -------------------------------------------------------------------------------- /public/admin/js/min/media.js: -------------------------------------------------------------------------------- 1 | (function($){var mediaUpload=$("#media-upload"),dropzone=$(".dropzone");mediaUpload.fileupload({url:mediaUpload.data("url"),dropZone:dropzone,autoUpload:true,filesContainer:".media-container"}).fileupload("option","redirect",window.location.href.replace(/\/[^\/]*$/,"/cors/result.html?%s")).addClass("fileupload-processing");$(document).bind("dragover",function(e){var foundDropzone,timeout=window.dropZoneTimeout,found=false,node=e.target;if(!timeout){dropzone.addClass("in");}else{clearTimeout(timeout);}do{if($(node).hasClass("dropzone")){found=true;foundDropzone=$(node);break;}node=node.parentNode;}while(node!==null);dropzone.removeClass("in hover");if(found){foundDropzone.addClass("hover");}window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null;dropzone.removeClass("in hover");},100);});}(jQuery)); -------------------------------------------------------------------------------- /public/admin/robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Disallow: / 3 | -------------------------------------------------------------------------------- /public/admin/themes/writesdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/admin/themes/writesdown.png -------------------------------------------------------------------------------- /public/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/favicon.ico -------------------------------------------------------------------------------- /public/img/logo-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/public/img/logo-mini.png -------------------------------------------------------------------------------- /public/js/comment.js: -------------------------------------------------------------------------------- 1 | (function($){ 2 | "use strict"; 3 | $(document).on("click", ".comment-reply-link", function(e){ 4 | e.preventDefault(); 5 | var cf = $('#respond'), 6 | cp = $('.comment-parent-field'), 7 | cr = $('#cancel-reply'); 8 | cf.find(cp).val($(this).data('id')); 9 | cr.show(); 10 | $(this).closest('.comment').append(cf); 11 | }); 12 | $(document).on("click","#cancel-reply", function(e){ 13 | e.preventDefault(); 14 | var cf = $('#respond'), 15 | cp = $('.comment-parent-field'), 16 | cv = $('#comment-view'); 17 | cf.find(cp).val(0); 18 | $(this).hide(); 19 | cv.append(cf); 20 | }) 21 | }(jQuery)); -------------------------------------------------------------------------------- /public/js/min/comment.js: -------------------------------------------------------------------------------- 1 | (function($){$(document).on("click",".comment-reply-link",function(e){e.preventDefault();var cf=$("#respond"),cp=$(".comment-parent-field"),cr=$("#cancel-reply");cf.find(cp).val($(this).data("id"));cr.show();$(this).closest(".comment").append(cf);});$(document).on("click","#cancel-reply",function(e){e.preventDefault();var cf=$("#respond"),cp=$(".comment-parent-field"),cv=$("#comment-view");cf.find(cp).val(0);$(this).hide();cv.append(cf);});}(jQuery)); -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | Disallow: /admin 4 | 5 | Sitemap: /sitemap.xml -------------------------------------------------------------------------------- /public/uploads/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/codeception.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - codeception/common 3 | - codeception/console 4 | - codeception/backend 5 | - codeception/frontend 6 | 7 | paths: 8 | log: codeception/_output 9 | 10 | settings: 11 | colors: true 12 | -------------------------------------------------------------------------------- /tests/codeception/_output/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/codeception/backend/.gitignore: -------------------------------------------------------------------------------- 1 | # these files are auto generated by codeception build 2 | /unit/UnitTester.php 3 | /functional/FunctionalTester.php 4 | /acceptance/AcceptanceTester.php 5 | -------------------------------------------------------------------------------- /tests/codeception/backend/_bootstrap.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class IndexPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/media/index']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | $this->actor->click('button[data-target="#media-search"]'); 32 | 33 | // Wait to toggle 34 | if (method_exists($this->actor, 'wait')) { 35 | $this->actor->wait(3); 36 | } 37 | 38 | foreach ($data as $field => $value) { 39 | $this->actor->fillField('#media-search input[name="Media[' . $field . ']"]', $value); 40 | } 41 | 42 | $this->actor->click('Search', '#media-search'); 43 | 44 | // Wait to submit 45 | if (method_exists($this->actor, 'wait')) { 46 | $this->actor->wait(3); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_media/UpdatePage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class UpdatePage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/media/update', 'id' => 1]; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $fieldType = $field == 'excerpt' || $field == 'content' ? 'textarea' : 'input'; 33 | $this->actor->fillField($fieldType . '[name="Media[' . $field . ']"]', $value); 34 | } 35 | $this->actor->click('Update', '#media-update-form'); 36 | 37 | // Wait to submit 38 | if (method_exists($this->actor, 'wait')) { 39 | $this->actor->wantTo(3); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_mediacomment/ReplyPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class ReplyPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/media-comment/reply', 'id' => 1]; 25 | 26 | /** 27 | * @param string $content 28 | */ 29 | public function submit($content) 30 | { 31 | // Run js for TinyMCE 32 | if (method_exists($this->actor, 'executeJS')) { 33 | $this->actor->executeJS('$("#mediacomment-content").val("' . $content . '")'); 34 | } else { 35 | $this->actor->fillField('textarea[name="MediaComment[content]"]', $content); 36 | } 37 | 38 | $this->actor->click('Reply', '#media-comment-reply-form'); 39 | 40 | // Wit for submit 41 | if (method_exists($this->actor, 'wait')) { 42 | $this->actor->wait(3); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_module/IndexPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class IndexPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/module/index']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | $this->actor->click('button[data-target="#module-search"]'); 32 | 33 | // Wait to toggle 34 | if (method_exists($this->actor, 'wait')) { 35 | $this->actor->wait(3); 36 | } 37 | 38 | foreach ($data as $field => $value) { 39 | $this->actor->fillField('#module-search input[name="Module[' . $field . ']"]', $value); 40 | } 41 | 42 | $this->actor->click('Search', '#module-search'); 43 | 44 | // Wait to submit 45 | if (method_exists($this->actor, 'wait')) { 46 | $this->actor->wait(3); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_module/UpdatePage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class UpdatePage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/module/update', 'id' => 2]; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $this->actor->fillField('input[name="Module[' . $field . ']"]', $value); 33 | } 34 | 35 | $this->actor->click('Update', '#module-update-form'); 36 | 37 | // Wait to submit 38 | if (method_exists($this->actor, 'wait')) { 39 | $this->actor->wait(3); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_post/IndexPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class IndexPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/post/index', 'type' => '1']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | $this->actor->click('button[data-target="#post-search"]'); 32 | 33 | // Wait to toggle 34 | if (method_exists($this->actor, 'wait')) { 35 | $this->actor->wait(3); 36 | } 37 | 38 | foreach ($data as $field => $value) { 39 | $this->actor->fillField('#post-search input[name="Post[' . $field . ']"]', $value); 40 | } 41 | 42 | $this->actor->click('Search', '#post-search'); 43 | 44 | // Wait to submit 45 | if (method_exists($this->actor, 'wait')) { 46 | $this->actor->wait(3); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_postcomment/ReplyPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class ReplyPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/post-comment/reply', 'id' => 1]; 25 | 26 | /** 27 | * @param string $content 28 | */ 29 | public function submit($content = null) 30 | { 31 | // Run js for TinyMCE 32 | if (method_exists($this->actor, 'executeJS')) { 33 | $this->actor->executeJS('$("#postcomment-content").val("' . $content . '")'); 34 | } else { 35 | $this->actor->fillField('textarea[name="PostComment[content]"]', $content); 36 | } 37 | 38 | $this->actor->click('Reply', '#post-comment-reply-form'); 39 | 40 | // Wait to submit 41 | if (method_exists($this->actor, 'wait')) { 42 | $this->actor->wait(3); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_posttype/IndexPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class IndexPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/post-type/index']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | $this->actor->click('button[data-target="#post-type-search"]'); 32 | 33 | // Wait to toggle 34 | if (method_exists($this->actor, 'wait')) { 35 | $this->actor->wait(3); 36 | } 37 | 38 | foreach ($data as $field => $value) { 39 | $this->actor->fillField('#post-type-search input[name="PostType[' . $field . ']"]', $value); 40 | } 41 | 42 | $this->actor->click('Search', '#post-type-search'); 43 | 44 | // Wait to submit 45 | if (method_exists($this->actor, 'wait')) { 46 | $this->actor->wait(3); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_site/LoginPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class LoginPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/site/login']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $this->actor->fillField('input[name="LoginForm[' . $field . ']"]', $value); 33 | } 34 | 35 | $this->actor->click('Sign In', '#login-form'); 36 | 37 | // Wait 38 | if (method_exists($this->actor, 'wait')) { 39 | $this->actor->wait(3); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_site/RequestPasswordResetPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class RequestPasswordResetPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/site/request-password-reset']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $this->actor->fillField('input[name="PasswordResetRequestForm[' . $field . ']"]', $value); 33 | } 34 | 35 | $this->actor->click('Send', '#request-password-token-form'); 36 | 37 | // Wait 38 | if (method_exists($this->actor, 'wait')) { 39 | $this->actor->wait(3); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_site/ResetPasswordPage.php: -------------------------------------------------------------------------------- 1 | 18 | * @since 0.1.2 19 | */ 20 | class ResetPasswordPage extends BasePage 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function __construct($I) 26 | { 27 | $this->route = ['/site/reset-password', 'token' => User::findOne('6')->password_reset_token]; 28 | parent::__construct($I); 29 | } 30 | 31 | /** 32 | * @param array $data 33 | */ 34 | public function submit(array $data) 35 | { 36 | foreach ($data as $field => $value) { 37 | $this->actor->fillField('input[name="ResetPasswordForm[' . $field . ']"]', $value); 38 | } 39 | 40 | $this->actor->click('Save', '#reset-password-form'); 41 | 42 | // Wait 43 | if (method_exists($this->actor, 'wait')) { 44 | $this->actor->wait(3); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_site/SignupPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class SignupPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/site/signup']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $this->actor->fillField('input[name="SignupForm[' . $field . ']"]', $value); 33 | } 34 | 35 | $this->actor->checkOption('#signupform-term_condition'); 36 | $this->actor->click('Signup', '#signup-form'); 37 | 38 | // Wait 39 | if (method_exists($this->actor, 'wait')) { 40 | $this->actor->wait(3); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_taxonomy/CreatePage.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class CreatePage extends BasePage 19 | { 20 | /** 21 | * @var array 22 | */ 23 | public $route = ['/taxonomy/create']; 24 | 25 | /** 26 | * @param array $data 27 | */ 28 | public function submit(array $data) 29 | { 30 | foreach ($data as $field => $value) { 31 | $this->actor->fillField('input[name="Taxonomy[' . $field . ']"]', $value); 32 | } 33 | 34 | $this->actor->click('Save', '#taxonomy-form'); 35 | 36 | // Wait 37 | if (method_exists($this->actor, 'wait')) { 38 | $this->actor->wait(3); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_taxonomy/IndexPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class IndexPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/taxonomy/index']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | $this->actor->click('button[data-target="#taxonomy-search"]'); 32 | 33 | if (method_exists($this->actor, 'wait')) { 34 | $this->actor->wait(3); 35 | } 36 | 37 | foreach ($data as $field => $value) { 38 | $this->actor->fillField('#taxonomy-search input[name="Taxonomy[' . $field . ']"]', $value); 39 | } 40 | 41 | $this->actor->click('Search', '#taxonomy-search'); 42 | 43 | if (method_exists($this->actor, 'wait')) { 44 | $this->actor->wait(3); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_taxonomy/UpdatePage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class UpdatePage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/taxonomy/update', 'id' => 2]; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $this->actor->fillField('input[name="Taxonomy[' . $field . ']"]', $value); 33 | } 34 | 35 | $this->actor->checkOption('#taxonomy-hierarchical'); 36 | $this->actor->checkOption('#taxonomy-menu_builder'); 37 | $this->actor->click('Update', '#taxonomy-form'); 38 | 39 | if (method_exists($this->actor, 'wait')) { 40 | $this->actor->wait(3); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_taxonomy/UpdateTermPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class UpdateTermPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/taxonomy/update-term', 'id' => 2, 'term' => 2]; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $inputType = $field == 'description' ? 'textarea' : 'input'; 33 | $this->actor->fillField('#term-form ' . $inputType . '[name="Term[' . $field . ']"]', $value); 34 | } 35 | 36 | $this->actor->click('Update', '#term-form'); 37 | 38 | if (method_exists($this->actor, 'wait')) { 39 | $this->actor->wait(3); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_user/CreatePage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class CreatePage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/user/create']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $this->actor->fillField('input[name="User[' . $field . ']"]', $value); 33 | } 34 | 35 | $this->actor->selectOption('#user-role', 'author'); 36 | $this->actor->click('Save', '#user-form'); 37 | 38 | // Wait 39 | if (method_exists($this->actor, 'wait')) { 40 | $this->actor->wait(3); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_user/IndexPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class IndexPage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/user/index']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | $this->actor->click('button[data-target="#user-search"]'); 32 | 33 | // Wait to toggle 34 | if (method_exists($this->actor, 'wait')) { 35 | $this->actor->wait(3); 36 | } 37 | 38 | foreach ($data as $field => $value) { 39 | $this->actor->fillField('#user-search input[name="User[' . $field . ']"]', $value); 40 | } 41 | 42 | $this->actor->click('Search', '#user-search'); 43 | 44 | // Wait for submitting 45 | if (method_exists($this->actor, 'wait')) { 46 | $this->actor->wait(3); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_user/ProfilePage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class ProfilePage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/user/profile']; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $this->actor->fillField('input[name="User[' . $field . ']"]', $value); 33 | } 34 | 35 | $this->actor->click('Update', '#user-profile-form'); 36 | 37 | if (method_exists($this->actor, 'wait')) { 38 | $this->actor->wait(3); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_user/ResetPasswordPage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class ResetPasswordPage extends BasePage 20 | { 21 | public $route = ['/user/reset-password']; 22 | 23 | public function submit(array $data) 24 | { 25 | foreach ($data as $field => $value) { 26 | $this->actor->fillField('input[name="User[' . $field . ']"]', $value); 27 | } 28 | 29 | $this->actor->click('Save my new password', '#user-reset-password-form'); 30 | 31 | if (method_exists($this->actor, 'wait')) { 32 | $this->actor->wait(3); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tests/codeception/backend/_pages/_user/UpdatePage.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class UpdatePage extends BasePage 20 | { 21 | /** 22 | * @var array 23 | */ 24 | public $route = ['/user/update', 'id' => 3]; 25 | 26 | /** 27 | * @param array $data 28 | */ 29 | public function submit(array $data) 30 | { 31 | foreach ($data as $field => $value) { 32 | $this->actor->fillField('input[name="User[' . $field . ']"]', $value); 33 | } 34 | 35 | $this->actor->selectOption('#user-role', 'subscriber'); 36 | $this->actor->click('Update', '#user-form'); 37 | 38 | if (method_exists($this->actor, 'wait')) { 39 | $this->actor->wait(3); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/codeception/backend/acceptance.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | 3 | # suite for acceptance tests. 4 | # perform tests in browser using the Selenium-like tools. 5 | # powered by Mink (http://mink.behat.org). 6 | # (tip: that's what your customer will see). 7 | # (tip: test your ajax and javascript by one of Mink drivers). 8 | 9 | # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 10 | 11 | class_name: AcceptanceTester 12 | modules: 13 | enabled: 14 | - PhpBrowser 15 | - tests\codeception\common\_support\FixtureHelper 16 | # you can use WebDriver instead of PhpBrowser to test javascript and ajax. 17 | # This will require you to install selenium. See http://codeception.com/docs/04-AcceptanceTests#Selenium 18 | # "restart" option is used by the WebDriver to start each time per test-file new session and cookies, 19 | # it is useful if you want to login in your app in each test. 20 | # - WebDriver 21 | config: 22 | PhpBrowser: 23 | # PLEASE ADJUST IT TO THE ACTUAL ENTRY POINT WITHOUT PATH INFO 24 | url: http://localhost:8080 25 | # WebDriver: 26 | # url: http://localhost:8080 27 | # browser: firefox 28 | # restart: true 29 | -------------------------------------------------------------------------------- /tests/codeception/backend/acceptance/_bootstrap.php: -------------------------------------------------------------------------------- 1 | run(); 23 | exit($exitCode); 24 | -------------------------------------------------------------------------------- /tests/codeception/bin/yii.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Yii command line bootstrap script for Windows. 5 | rem 6 | rem @author Qiang Xue 7 | rem @link http://www.yiiframework.com/ 8 | rem @copyright Copyright (c) 2008 Yii Software LLC 9 | rem @license http://www.yiiframework.com/license/ 10 | rem ------------------------------------------------------------- 11 | 12 | @setlocal 13 | 14 | set YII_PATH=%~dp0 15 | 16 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 17 | 18 | "%PHP_COMMAND%" "%YII_PATH%yii" %* 19 | 20 | @endlocal 21 | -------------------------------------------------------------------------------- /tests/codeception/common/.gitignore: -------------------------------------------------------------------------------- 1 | # these files are auto generated by codeception build 2 | /unit/UnitTester.php 3 | /functional/FunctionalTester.php 4 | /acceptance/AcceptanceTester.php 5 | -------------------------------------------------------------------------------- /tests/codeception/common/_bootstrap.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class AuthAssignmentFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $tableName = '{{%auth_assignment}}'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_auth_assignment.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/AuthItemChildFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class AuthItemChildFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $tableName = '{{%auth_item_child}}'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_auth_item_child.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/AuthItemFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class AuthItemFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $tableName = '{{%auth_item}}'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_auth_item.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/AuthRuleFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class AuthRuleFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $tableName = '{{%auth_rule}}'; 24 | } 25 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/MediaCommentFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class MediaCommentFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\MediaComment'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_media_comment.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/MediaFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class MediaFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\Media'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_media.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/MediaMetaFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class MediaMetaFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\MediaMeta'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_media_meta.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/MenuFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class MenuFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\Menu'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_menu.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/MenuItemFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class MenuItemFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\MenuItem'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_menu_item.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/ModuleFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class ModuleFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\Module'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_module.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/OptionFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class OptionFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\Option'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_option.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/PostCommentFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class PostCommentFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\PostComment'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_post_comment.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/PostFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class PostFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\Post'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_post.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/PostMetaFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class PostMetaFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\PostMeta'; 24 | } 25 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/PostTypeFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class PostTypeFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\PostType'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_post_type.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/PostTypeTaxonomyFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class PostTypeTaxonomyFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\PostTypeTaxonomy'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_post_type_taxonomy.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/TaxonomyFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class TaxonomyFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\Taxonomy'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_taxonomy.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/TermFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class TermFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\Term'; 24 | /** 25 | * @var string 26 | */ 27 | public $dataFile = '@tests/codeception/common/fixtures/data/init_term.php'; 28 | } 29 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/TermRelationshipFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class TermRelationshipFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\TermRelationship'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_term_relationship.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/UserFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class UserFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\User'; 24 | 25 | /** 26 | * @var string 27 | */ 28 | public $dataFile = '@tests/codeception/common/fixtures/data/init_user.php'; 29 | } 30 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/WidgetFixture.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.2 17 | */ 18 | class WidgetFixture extends ActiveFixture 19 | { 20 | /** 21 | * @var string 22 | */ 23 | public $modelClass = 'common\models\Widget'; 24 | } 25 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_auth_assignment.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | ['item_name' => 'superadmin', 'user_id' => '1', 'created_at' => time()], 11 | ['item_name' => 'administrator', 'user_id' => '2', 'created_at' => time()], 12 | ['item_name' => 'editor', 'user_id' => '3', 'created_at' => time()], 13 | ['item_name' => 'author', 'user_id' => '4', 'created_at' => time()], 14 | ['item_name' => 'contributor', 'user_id' => '5', 'created_at' => time()], 15 | ['item_name' => 'subscriber', 'user_id' => '6', 'created_at' => time()], 16 | ]; 17 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_auth_item.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | ['name' => 'administrator', 'type' => '1', 'description' => 'Administrator'], 11 | ['name' => 'author', 'type' => '1', 'description' => 'Author'], 12 | ['name' => 'contributor', 'type' => '1', 'description' => 'Contributor'], 13 | ['name' => 'editor', 'type' => '1', 'description' => 'Editor'], 14 | ['name' => 'subscriber', 'type' => '1', 'description' => 'Subscriber'], 15 | ['name' => 'superadmin', 'type' => '1', 'description' => 'Super Administrator'], 16 | ]; 17 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_auth_item_child.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | ['parent' => 'superadmin', 'child' => 'administrator'], 11 | ['parent' => 'editor', 'child' => 'author'], 12 | ['parent' => 'author', 'child' => 'contributor'], 13 | ['parent' => 'administrator', 'child' => 'editor'], 14 | ['parent' => 'contributor', 'child' => 'subscriber'], 15 | ]; 16 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_media_comment.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | [ 11 | 'media_id' => '1', 12 | 'author' => 'Mr. WritesDown', 13 | 'email' => 'wd@writesdown.com', 14 | 'url' => 'http://www.writesdown.com', 15 | 'ip' => '::1', 16 | 'date' => '2015-12-06 03:56:38', 17 | 'content' => 'SAMPLE MEDIA COMMENT: Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris.', 18 | 'status' => 'approved', 19 | 'agent' => 'Mozilla/5.0 (Windows NT 6.2; rv:42.0) Gecko/20100101 Firefox/42.0', 20 | 'parent' => '0', 21 | ], 22 | ]; 23 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_media_meta.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | [ 11 | 'media_id' => '1', 12 | 'name' => 'metadata', 13 | 'value' => '{"filename":"test-media.txt","file_size":10,"versions":{"full":{"url":"2015/12/test-media.txt"}},"icon_url":"img/mime/text.png"}', 14 | ], 15 | ]; 16 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_menu.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | ['title' => 'Menu Primary', 'location' => 'primary'], 11 | ['title' => 'Menu Secondary', 'location' => 'secondary'], 12 | ]; 13 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_menu_item.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | [ 11 | 'menu_id' => '1', 12 | 'label' => 'Menu Item Primary', 13 | 'url' => 'http://www.writesdown.com/', 14 | 'order' => '0', 15 | 'parent' => '0', 16 | ], 17 | [ 18 | 'menu_id' => '1', 19 | 'label' => 'Menu Item Secondary', 20 | 'url' => 'http://www.google.com/', 21 | 'order' => '0', 22 | 'parent' => '0', 23 | ], 24 | ]; 25 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_post_comment.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | [ 11 | 'post_id' => '1', 12 | 'author' => 'Mr. WritesDown', 13 | 'email' => 'wd@writesdown.com', 14 | 'url' => 'http://www.writesdown.com', 15 | 'ip' => '::1', 16 | 'date' => '2015-12-06 03:56:38', 17 | 'content' => 'SAMPLE POST COMMENT: Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris.', 18 | 'status' => 'approved', 19 | 'agent' => 'Mozilla/5.0 (Windows NT 6.2; rv:42.0) Gecko/20100101 Firefox/42.0', 20 | 'parent' => '0', 21 | ], 22 | ]; 23 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_post_type.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | [ 11 | 'name' => 'post', 12 | 'slug' => 'post', 13 | 'icon' => 'fa fa-thumb-tack', 14 | 'singular_name' => 'Post', 15 | 'plural_name' => 'Posts', 16 | 'menu_builder' => '0', 17 | 'permission' => 'contributor', 18 | ], 19 | [ 20 | 'name' => 'page', 21 | 'slug' => 'pages', 22 | 'icon' => 'fa fa-file-o', 23 | 'singular_name' => 'Page', 24 | 'plural_name' => 'Pages', 25 | 'menu_builder' => '1', 26 | 'permission' => 'editor', 27 | ], 28 | ]; 29 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_post_type_taxonomy.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | ['post_type_id' => '1', 'taxonomy_id' => '1'], 11 | ['post_type_id' => '1', 'taxonomy_id' => '2'], 12 | ]; 13 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_taxonomy.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | [ 11 | 'name' => 'category', 12 | 'slug' => 'category', 13 | 'hierarchical' => '1', 14 | 'singular_name' => 'Category', 15 | 'plural_name' => 'Categories', 16 | 'menu_builder' => '1', 17 | ], 18 | [ 19 | 'name' => 'tag', 20 | 'slug' => 'tag', 21 | 'hierarchical' => '0', 22 | 'singular_name' => 'Tag', 23 | 'plural_name' => 'Tags', 24 | 'menu_builder' => '0', 25 | ], 26 | ]; 27 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_term.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | [ 11 | 'taxonomy_id' => '1', 12 | 'name' => 'Sample Category', 13 | 'slug' => 'sample-category', 14 | 'description' => 'This is sample category description', 15 | 'parent' => '0', 16 | 'count' => '1', 17 | ], 18 | [ 19 | 'taxonomy_id' => '2', 20 | 'name' => 'Sample Tag', 21 | 'slug' => 'sample-tag', 22 | 'description' => 'This is sample tag description', 23 | 'parent' => '0', 24 | 'count' => '1', 25 | ], 26 | ]; 27 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/init_term_relationship.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | ['post_id' => '1', 'term_id' => '1'], 11 | ['post_id' => '1', 'term_id' => '2'], 12 | ]; 13 | -------------------------------------------------------------------------------- /tests/codeception/common/fixtures/data/test-media.txt: -------------------------------------------------------------------------------- 1 | TEST MEDIA 12345 QWERTY` -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/media_comment.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'media_id' => '1', 16 | 'author' => $faker->name, 17 | 'email' => $faker->email, 18 | 'url' => $faker->url, 19 | 'ip' => $faker->ipv4, 20 | 'date' => $faker->date('Y-m-d H:i:s'), 21 | 'content' => $faker->text, 22 | 'status' => 'approved', 23 | 'agent' => $faker->userAgent, 24 | 'parent' => '0', 25 | ]; 26 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/media_meta.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'media_id' => '1', 16 | 'name' => $faker->slug(1), 17 | 'value' => $faker->text, 18 | ]; 19 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/menu.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'title' => $faker->name, 16 | 'location' => $faker->slug(1), 17 | ]; 18 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/menu_item.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'menu_id' => '1', 16 | 'label' => $faker->name, 17 | 'url' => $faker->url, 18 | 'order' => '0', 19 | 'parent' => '0', 20 | ]; 21 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/post.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'author' => $faker->numberBetween(1, 6), 16 | 'type' => $faker->numberBetween(1, 2), 17 | 'title' => $faker->title, 18 | 'excerpt' => $faker->text, 19 | 'content' => $faker->text, 20 | 'date' => $faker->date('Y-m-d H:i:s'), 21 | 'modified' => $faker->date('Y-m-d H:i:s'), 22 | 'status' => 'publish', 23 | 'slug' => $faker->slug, 24 | 'comment_status' => 'open', 25 | 'comment_count' => '0', 26 | ]; 27 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/post_comment.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'post_id' => '1', 16 | 'author' => $faker->name, 17 | 'email' => $faker->email, 18 | 'url' => $faker->url, 19 | 'ip' => $faker->ipv4, 20 | 'date' => $faker->date('Y-m-d H:i:s'), 21 | 'content' => $faker->text, 22 | 'status' => 'approved', 23 | 'agent' => $faker->userAgent, 24 | 'parent' => '0', 25 | ]; 26 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/post_meta.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'post_id' => '1', 16 | 'name' => $faker->name, 17 | 'value' => $faker->text, 18 | ]; 19 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/post_type.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'name' => $faker->name, 16 | 'slug' => $faker->slug, 17 | 'icon' => 'fa fa-file-o', 18 | 'singular_name' => $faker->name, 19 | 'plural_name' => $faker->name, 20 | 'menu_builder' => $faker->numberBetween(0, 1), 21 | 'permission' => 'contributor', 22 | ]; 23 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/taxonomy.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'name' => $faker->name, 16 | 'slug' => $faker->slug, 17 | 'hierarchical' => $faker->numberBetween(0, 1), 18 | 'singular_name' => $faker->name, 19 | 'plural_name' => $faker->name, 20 | 'menu_builder' => $faker->numberBetween(0, 1), 21 | ]; 22 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/term.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | return [ 15 | 'taxonomy_id' => $faker->numberBetween(1, 2), 16 | 'name' => $faker->name, 17 | 'slug' => $faker->slug, 18 | 'description' => $faker->text, 19 | 'parent' => '0', 20 | 'count' => '0', 21 | ]; 22 | -------------------------------------------------------------------------------- /tests/codeception/common/templates/fixtures/user.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | /** 10 | * @var $faker \Faker\Generator 11 | * @var $index integer 12 | */ 13 | 14 | $security = Yii::$app->getSecurity(); 15 | 16 | return [ 17 | 'username' => $faker->userName, 18 | 'email' => $faker->email, 19 | 'full_name' => $faker->name, 20 | 'display_name' => $faker->name, 21 | 'password_hash' => $security->generatePasswordHash('password_' . $index), 22 | 'password_reset_token' => $security->generateRandomString() . '_' . time(), 23 | 'auth_key' => $security->generateRandomString(), 24 | 'created_at' => time(), 25 | 'updated_at' => time(), 26 | 'login_at' => time(), 27 | ]; 28 | -------------------------------------------------------------------------------- /tests/codeception/common/unit.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | 3 | # suite for unit (internal) tests. 4 | # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 5 | 6 | class_name: UnitTester 7 | -------------------------------------------------------------------------------- /tests/codeception/common/unit/DbTestCase.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'widget' => [ 9 | [ 10 | 'title' => 'Sidebar', 11 | 'description' => 'Main sidebar that appears on the right.', 12 | 'location' => 'sidebar', 13 | ], 14 | ], 15 | 'menu' => [ 16 | 'location' => [ 17 | 'primary' => 'Primary', 18 | 'secondary' => 'Secondary', 19 | ], 20 | ], 21 | ], 22 | ]; 23 | -------------------------------------------------------------------------------- /tests/codeception/config/backend/functional.php: -------------------------------------------------------------------------------- 1 | 'app-common', 'basePath' => dirname(__DIR__)] 12 | ); 13 | -------------------------------------------------------------------------------- /tests/codeception/config/config.php: -------------------------------------------------------------------------------- 1 | 'en-US', 8 | 'controllerMap' => [ 9 | 'fixture' => [ 10 | 'class' => 'yii\faker\FixtureController', 11 | 'fixtureDataPath' => '@tests/codeception/common/fixtures/data', 12 | 'templatePath' => '@tests/codeception/common/templates/fixtures', 13 | 'namespace' => 'tests\codeception\common\fixtures', 14 | ], 15 | ], 16 | 'components' => [ 17 | 'db' => [ 18 | 'dsn' => 'mysql:host=localhost;dbname=writesdown_tests', 19 | ], 20 | 'mailer' => [ 21 | 'useFileTransport' => true, 22 | ], 23 | 'urlManager' => [ 24 | 'showScriptName' => true, 25 | ], 26 | ], 27 | ]; 28 | -------------------------------------------------------------------------------- /tests/codeception/config/console/unit.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'request' => [ 9 | // it's not recommended to run functional tests with CSRF validation enabled 10 | 'enableCsrfValidation' => false, 11 | // but if you absolutely need it set cookie domain to localhost 12 | /* 13 | 'csrfCookie' => [ 14 | 'domain' => 'localhost', 15 | ], 16 | */ 17 | ], 18 | ], 19 | ]; 20 | -------------------------------------------------------------------------------- /tests/codeception/config/unit.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.2 18 | */ 19 | class ContactPage extends BasePage 20 | { 21 | public $route = ['/site/contact']; 22 | 23 | /** 24 | * @param array $data 25 | */ 26 | public function submit(array $data) 27 | { 28 | foreach ($data as $field => $value) { 29 | $inputType = $field === 'body' ? 'textarea' : 'input'; 30 | $this->actor->fillField($inputType . '[name="ContactForm[' . $field . ']"]', $value); 31 | } 32 | 33 | $this->actor->click('contact-button'); 34 | 35 | if (method_exists($this->actor, 'wait')) { 36 | $this->actor->wait(3); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/codeception/frontend/acceptance.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | 3 | # suite for acceptance tests. 4 | # perform tests in browser using the Selenium-like tools. 5 | # powered by Mink (http://mink.behat.org). 6 | # (tip: that's what your customer will see). 7 | # (tip: test your ajax and javascript by one of Mink drivers). 8 | 9 | # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 10 | 11 | class_name: AcceptanceTester 12 | modules: 13 | enabled: 14 | - PhpBrowser 15 | - tests\codeception\common\_support\FixtureHelper 16 | # you can use WebDriver instead of PhpBrowser to test javascript and ajax. 17 | # This will require you to install selenium. See http://codeception.com/docs/04-AcceptanceTests#Selenium 18 | # "restart" option is used by the WebDriver to start each time per test-file new session and cookies, 19 | # it is useful if you want to login in your app in each test. 20 | # - WebDriver 21 | config: 22 | PhpBrowser: 23 | # PLEASE ADJUST IT TO THE ACTUAL ENTRY POINT WITHOUT PATH INFO 24 | url: http://localhost:8080 25 | # WebDriver: 26 | # url: http://localhost:8080 27 | # browser: firefox 28 | # restart: true 29 | -------------------------------------------------------------------------------- /tests/codeception/frontend/acceptance/_bootstrap.php: -------------------------------------------------------------------------------- 1 | 16 | * @since 0.1.0 17 | */ 18 | class ThemeAsset extends AssetBundle 19 | { 20 | public $sourcePath = '@themes/writesdown/assets'; 21 | public $depends = [ 22 | 'yii\web\YiiAsset', 23 | 'yii\bootstrap\BootstrapAsset', 24 | 'yii\bootstrap\BootstrapPluginAsset', 25 | 'rmrevin\yii\fontawesome\AssetBundle', 26 | ]; 27 | 28 | public function init() 29 | { 30 | if (YII_DEBUG) { 31 | $this->css = ['css/site.css']; 32 | } else { 33 | $this->css = ['css/site.min.css']; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /themes/writesdown/classes/meta/Meta.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.0 18 | */ 19 | class Meta extends Object 20 | { 21 | /** 22 | * @var \common\models\Post 23 | */ 24 | public $model; 25 | 26 | /** 27 | * @var \yii\widgets\ActiveForm 28 | */ 29 | public $form; 30 | 31 | /** 32 | * @inheritdoc 33 | */ 34 | public function init() 35 | { 36 | $this->renderBox(); 37 | } 38 | 39 | public function renderBox() 40 | { 41 | echo Yii::$app->view->renderFile(__DIR__ . '/views/_form.php', [ 42 | 'model' => $this->model, 43 | 'form' => $this->form 44 | ]); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /themes/writesdown/classes/widgets/Nav.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | namespace themes\writesdown\classes\widgets; 10 | 11 | use Yii; 12 | 13 | /** 14 | * Class Nav 15 | * 16 | * @author Agiel K. Saputra <13nightevil@gmail.com> 17 | * @since 0.1.0 18 | */ 19 | class Nav extends \yii\bootstrap\Nav 20 | { 21 | /** 22 | * @inheritdoc 23 | */ 24 | protected function isItemActive($item) 25 | { 26 | if (isset($item['url']) && $item['url'] === Yii::$app->request->absoluteUrl) { 27 | return true; 28 | } 29 | 30 | return false; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /themes/writesdown/config/main.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | 'info' => [ 11 | 'Name' => 'WritesDown Theme Default', 12 | 'URI' => 'http://www.writesdown.com', 13 | 'Author' => 'Agiel K. Saputra', 14 | 'Author URI' => 'http://www.writesdown.com', 15 | 'Description' => 'Default theme for WriteDown', 16 | 'Version' => '1.0', 17 | 'License' => 'http://www.writesdown.com/license', 18 | 'License URI' => 'http://www.writesdown.com/license', 19 | 'Tags' => 'grey, simple, clean, bootstrap', 20 | 'Text Domain' => 'wdthemedefault', 21 | ], 22 | ]; 23 | -------------------------------------------------------------------------------- /themes/writesdown/layouts/search-form.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Html; 10 | use yii\helpers\Url; 11 | use yii\widgets\ActiveForm; 12 | 13 | ?> 14 | Url::to(['/site/search']), 16 | 'method' => 'get', 17 | 'options' => ['class' => 'form-search'], 18 | ]) ?> 19 | 20 |
21 | 'form-control', 'placeholder' => 'Search...']) ?> 22 | 23 | 24 | ', 26 | ['class' => ' btn btn-default'] 27 | ) ?> 28 | 29 | 30 |
31 | 32 | -------------------------------------------------------------------------------- /themes/writesdown/layouts/sidebar.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use frontend\widgets\RenderWidget; 10 | 11 | /* @var $this yii\web\View */ 12 | /* @var $taxonomies common\models\Taxonomy[] */ 13 | ?> 14 |
15 | 27 |
28 | -------------------------------------------------------------------------------- /themes/writesdown/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/writesdown/app-cms/d5e2d7bca7b42dc45851d9b8d4229ab636920bf3/themes/writesdown/screenshot.png -------------------------------------------------------------------------------- /widgets/meta/config/main.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | 'title' => 'Meta', 11 | 'config' => [ 12 | 'class' => 'widgets\meta\MetaWidget', 13 | 'title' => 'Site Meta', 14 | ], 15 | ]; 16 | -------------------------------------------------------------------------------- /widgets/search/config/main.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | 'title' => 'Search', 11 | 'config' => [ 12 | 'class' => 'widgets\search\SearchWidget', 13 | 'title' => '', 14 | ], 15 | ]; 16 | -------------------------------------------------------------------------------- /widgets/search/views/search-form.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | use yii\helpers\Html; 10 | use yii\helpers\Url; 11 | use yii\widgets\ActiveForm; 12 | 13 | ?> 14 | Url::to(['/site/search']), 16 | 'method' => 'get', 17 | 'options' => [ 18 | 'class' => 'search-form', 19 | ], 20 | ]) ?> 21 | 22 | request->get('s'), [ 23 | 'class' => 'search-form-field', 24 | 'placeholder' => 'Search for...', 25 | ]) ?> 26 | 27 | 'search-form-btn']) ?> 28 | 29 | 30 | -------------------------------------------------------------------------------- /widgets/text/TextWidget.php: -------------------------------------------------------------------------------- 1 | 17 | * @since 0.1.1 18 | */ 19 | class TextWidget extends BaseWidget 20 | { 21 | /** 22 | * @var string 23 | */ 24 | public $text = ''; 25 | 26 | /** 27 | * @inheritdoc 28 | */ 29 | public function run() 30 | { 31 | echo $this->beforeWidget; 32 | 33 | if ($this->title) { 34 | echo $this->beforeTitle . $this->title . $this->afterTitle; 35 | } 36 | 37 | echo Html::tag('div', $this->text, [ 38 | 'class' => 'widget-text', 39 | ]); 40 | echo $this->afterWidget; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /widgets/text/config/main.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright (c) 2015 WritesDown 6 | * @license http://www.writesdown.com/license/ 7 | */ 8 | 9 | return [ 10 | 'title' => 'Text', 11 | 'config' => [ 12 | 'class' => 'widgets\text\TextWidget', 13 | 'title' => '', 14 | 'text' => '', 15 | ], 16 | 'description' => 'Simple widget to show text or HTML.', 17 | 'page' => __DIR__ . '/../views/option.php', 18 | ]; 19 | -------------------------------------------------------------------------------- /widgets/text/views/option.php: -------------------------------------------------------------------------------- 1 | 15 | getConfig() ?> 16 | 17 | 18 |
19 | id, ['class' => 'form-label']) ?> 20 | 21 | 'form-control input-sm'] 25 | ) ?> 26 | 27 |
28 |
29 | id, ['class' => 'form-label']) ?> 30 | 31 | 'text-' . $widget->id, 33 | 'class' => 'form-control', 34 | 'rows' => '5', 35 | ]) ?> 36 | 37 |
38 | -------------------------------------------------------------------------------- /yii.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Yii command line bootstrap script for Windows. 5 | rem 6 | rem @author Qiang Xue 7 | rem @link http://www.yiiframework.com/ 8 | rem @copyright Copyright (c) 2008 Yii Software LLC 9 | rem @license http://www.yiiframework.com/license/ 10 | rem ------------------------------------------------------------- 11 | 12 | @setlocal 13 | 14 | set YII_PATH=%~dp0 15 | 16 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 17 | 18 | "%PHP_COMMAND%" "%YII_PATH%yii" %* 19 | 20 | @endlocal 21 | --------------------------------------------------------------------------------