diff --git a/.babelrc b/.babelrc
old mode 100644
new mode 100755
diff --git a/.editorconfig b/.editorconfig
old mode 100644
new mode 100755
diff --git a/.gitattributes b/.gitattributes
old mode 100644
new mode 100755
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
old mode 100644
new mode 100755
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
old mode 100644
new mode 100755
diff --git a/.github/ISSUE_TEMPLATE/0_IMMEDIATE_SUPPORT.md b/.github/ISSUE_TEMPLATE/0_IMMEDIATE_SUPPORT.md
old mode 100644
new mode 100755
diff --git a/.github/ISSUE_TEMPLATE/1_BUG_REPORT.md b/.github/ISSUE_TEMPLATE/1_BUG_REPORT.md
old mode 100644
new mode 100755
diff --git a/.github/ISSUE_TEMPLATE/2_MARKETPLACE_SUPPORT.md b/.github/ISSUE_TEMPLATE/2_MARKETPLACE_SUPPORT.md
old mode 100644
new mode 100755
diff --git a/.github/ISSUE_TEMPLATE/3_GENERAL_SUPPORT.md b/.github/ISSUE_TEMPLATE/3_GENERAL_SUPPORT.md
old mode 100644
new mode 100755
diff --git a/.github/ISSUE_TEMPLATE/4_FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/4_FEATURE_REQUEST.md
old mode 100644
new mode 100755
diff --git a/.github/ISSUE_TEMPLATE/5_DOCUMENTATION.md b/.github/ISSUE_TEMPLATE/5_DOCUMENTATION.md
old mode 100644
new mode 100755
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
old mode 100644
new mode 100755
diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml
old mode 100644
new mode 100755
diff --git a/.github/workflows/code-quality-pr.yaml b/.github/workflows/code-quality-pr.yaml
old mode 100644
new mode 100755
diff --git a/.github/workflows/code-quality-push.yaml b/.github/workflows/code-quality-push.yaml
old mode 100644
new mode 100755
diff --git a/.github/workflows/commander.yml b/.github/workflows/commander.yml
old mode 100644
new mode 100755
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
old mode 100644
new mode 100755
diff --git a/.github/workflows/utilities/library-switcher b/.github/workflows/utilities/library-switcher
old mode 100644
new mode 100755
diff --git a/.github/workflows/utilities/phpcs-pr b/.github/workflows/utilities/phpcs-pr
old mode 100644
new mode 100755
diff --git a/.github/workflows/utilities/phpcs-push b/.github/workflows/utilities/phpcs-push
old mode 100644
new mode 100755
diff --git a/.gitignore b/.gitignore
old mode 100644
new mode 100755
diff --git a/.htaccess b/.htaccess
old mode 100644
new mode 100755
index addd1a9..e4876b6
--- a/.htaccess
+++ b/.htaccess
@@ -3,9 +3,17 @@
= e(trans('backend::lang.form.return_to_list')) ?>
+ \ No newline at end of file diff --git a/plugins/atash/news/controllers/helpoptionscontroller/index.htm b/plugins/atash/news/controllers/helpoptionscontroller/index.htm new file mode 100755 index 0000000..ea43a36 --- /dev/null +++ b/plugins/atash/news/controllers/helpoptionscontroller/index.htm @@ -0,0 +1 @@ += $this->listRender() ?> diff --git a/plugins/atash/news/controllers/helpoptionscontroller/preview.htm b/plugins/atash/news/controllers/helpoptionscontroller/preview.htm new file mode 100755 index 0000000..81e121e --- /dev/null +++ b/plugins/atash/news/controllers/helpoptionscontroller/preview.htm @@ -0,0 +1,22 @@ + ++ + = e(trans('backend::lang.form.return_to_list')) ?> + +
\ No newline at end of file diff --git a/plugins/atash/news/controllers/helpoptionscontroller/reorder.htm b/plugins/atash/news/controllers/helpoptionscontroller/reorder.htm new file mode 100755 index 0000000..79bad7c --- /dev/null +++ b/plugins/atash/news/controllers/helpoptionscontroller/reorder.htm @@ -0,0 +1,8 @@ + += e(trans('backend::lang.form.return_to_list')) ?>
+ \ No newline at end of file diff --git a/plugins/atash/news/controllers/newscontroller/_list_toolbar.htm b/plugins/atash/news/controllers/newscontroller/_list_toolbar.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/newscontroller/_reorder_toolbar.htm b/plugins/atash/news/controllers/newscontroller/_reorder_toolbar.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/newscontroller/config_form.yaml b/plugins/atash/news/controllers/newscontroller/config_form.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/newscontroller/config_list.yaml b/plugins/atash/news/controllers/newscontroller/config_list.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/newscontroller/config_reorder.yaml b/plugins/atash/news/controllers/newscontroller/config_reorder.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/newscontroller/create.htm b/plugins/atash/news/controllers/newscontroller/create.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/newscontroller/index.htm b/plugins/atash/news/controllers/newscontroller/index.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/newscontroller/preview.htm b/plugins/atash/news/controllers/newscontroller/preview.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/newscontroller/reorder.htm b/plugins/atash/news/controllers/newscontroller/reorder.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/newscontroller/update.htm b/plugins/atash/news/controllers/newscontroller/update.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/news/controllers/questionsanswers/_list_toolbar.htm b/plugins/atash/news/controllers/questionsanswers/_list_toolbar.htm new file mode 100755 index 0000000..e550a6c --- /dev/null +++ b/plugins/atash/news/controllers/questionsanswers/_list_toolbar.htm @@ -0,0 +1,19 @@ += e(trans('backend::lang.form.return_to_list')) ?>
+ \ No newline at end of file diff --git a/plugins/atash/news/controllers/questionsanswers/index.htm b/plugins/atash/news/controllers/questionsanswers/index.htm new file mode 100755 index 0000000..ea43a36 --- /dev/null +++ b/plugins/atash/news/controllers/questionsanswers/index.htm @@ -0,0 +1 @@ += $this->listRender() ?> diff --git a/plugins/atash/news/controllers/questionsanswers/preview.htm b/plugins/atash/news/controllers/questionsanswers/preview.htm new file mode 100755 index 0000000..b9d18fd --- /dev/null +++ b/plugins/atash/news/controllers/questionsanswers/preview.htm @@ -0,0 +1,22 @@ + ++ + = e(trans('backend::lang.form.return_to_list')) ?> + +
\ No newline at end of file diff --git a/plugins/atash/news/controllers/questionsanswers/reorder.htm b/plugins/atash/news/controllers/questionsanswers/reorder.htm new file mode 100755 index 0000000..282ca4b --- /dev/null +++ b/plugins/atash/news/controllers/questionsanswers/reorder.htm @@ -0,0 +1,8 @@ + += e(trans('backend::lang.form.return_to_list')) ?>
+ \ No newline at end of file diff --git a/plugins/atash/news/lang/en/lang.php b/plugins/atash/news/lang/en/lang.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/models/Banknews.php b/plugins/atash/news/models/Banknews.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/models/HelpOptions.php b/plugins/atash/news/models/HelpOptions.php new file mode 100755 index 0000000..2a730cf --- /dev/null +++ b/plugins/atash/news/models/HelpOptions.php @@ -0,0 +1,31 @@ + \Atash\News\Models\QuestionsAnswers::class + ]; + + /** + * @var array Validation rules + */ + public $rules = [ + ]; + + public $implement = ['RainLab.Translate.Behaviors.TranslatableModel']; + + public $translatable = ['name']; +} diff --git a/plugins/atash/news/models/News.php b/plugins/atash/news/models/News.php old mode 100644 new mode 100755 index 0218f77..dacf0a1 --- a/plugins/atash/news/models/News.php +++ b/plugins/atash/news/models/News.php @@ -27,6 +27,24 @@ class News extends Model public $rules = [ ]; + public function setUrl($pageName, $controller, $params = []) + { + $params = array_merge([ + 'id' => $this->id, + ], $params); + + + + // Expose published year, month and day as URL parameters. + if ($this->published) { + $params['year'] = $this->published_at->format('Y'); + $params['month'] = $this->published_at->format('m'); + $params['day'] = $this->published_at->format('d'); + } + + return $this->url = $controller->pageUrl($pageName, $params); + } + public $implement = ['RainLab.Translate.Behaviors.TranslatableModel']; public $translatable = ['name','text']; diff --git a/plugins/atash/news/models/QuestionsAnswers.php b/plugins/atash/news/models/QuestionsAnswers.php new file mode 100755 index 0000000..d2bc1f9 --- /dev/null +++ b/plugins/atash/news/models/QuestionsAnswers.php @@ -0,0 +1,33 @@ + \Atash\News\Models\HelpOptions::class + ]; + + public $implement = ['RainLab.Translate.Behaviors.TranslatableModel']; + + public $translatable = ['question','answer']; +} diff --git a/plugins/atash/news/models/banknews/columns.yaml b/plugins/atash/news/models/banknews/columns.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/news/models/banknews/fields.yaml b/plugins/atash/news/models/banknews/fields.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/news/models/helpoptions/columns.yaml b/plugins/atash/news/models/helpoptions/columns.yaml new file mode 100755 index 0000000..4d2e4f3 --- /dev/null +++ b/plugins/atash/news/models/helpoptions/columns.yaml @@ -0,0 +1,13 @@ +columns: + id: + label: id + type: number + name: + label: name + type: text + created_at: + label: created_at + type: datetime + updated_at: + label: updated_at + type: datetime diff --git a/plugins/atash/news/models/helpoptions/fields.yaml b/plugins/atash/news/models/helpoptions/fields.yaml new file mode 100755 index 0000000..29b9ff6 --- /dev/null +++ b/plugins/atash/news/models/helpoptions/fields.yaml @@ -0,0 +1,5 @@ +fields: + name: + label: имя + span: auto + type: text diff --git a/plugins/atash/news/models/news/columns.yaml b/plugins/atash/news/models/news/columns.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/news/models/news/fields.yaml b/plugins/atash/news/models/news/fields.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/news/models/questionsanswers/columns.yaml b/plugins/atash/news/models/questionsanswers/columns.yaml new file mode 100755 index 0000000..ea97d34 --- /dev/null +++ b/plugins/atash/news/models/questionsanswers/columns.yaml @@ -0,0 +1,16 @@ +columns: + id: + label: id + type: number + question: + label: question + type: text + answer: + label: answer + type: text + created_at: + label: created_at + type: datetime + updated_at: + label: updated_at + type: datetime diff --git a/plugins/atash/news/models/questionsanswers/fields.yaml b/plugins/atash/news/models/questionsanswers/fields.yaml new file mode 100755 index 0000000..a2542be --- /dev/null +++ b/plugins/atash/news/models/questionsanswers/fields.yaml @@ -0,0 +1,16 @@ +fields: + question: + label: вопрос + span: full + type: text + answer: + label: Answer + span: full + size: small + type: richeditor + help_options: + label: Relation + nameFrom: name + descriptionFrom: description + span: auto + type: relation diff --git a/plugins/atash/news/plugin.yaml b/plugins/atash/news/plugin.yaml old mode 100644 new mode 100755 index 92ec6fd..6faaab2 --- a/plugins/atash/news/plugin.yaml +++ b/plugins/atash/news/plugin.yaml @@ -18,6 +18,14 @@ navigation: icon: icon-sitemap permissions: - news + side-menu-item2: + label: 'Варианты помощь' + url: atash/news/helpoptionscontroller + icon: icon-comments + side-menu-item3: + label: 'Вопросы ответы' + url: atash/news/questionsanswers + icon: icon-group permissions: bank_news: tab: Other diff --git a/plugins/atash/news/updates/builder_table_create_atash_news_help_options.php b/plugins/atash/news/updates/builder_table_create_atash_news_help_options.php new file mode 100755 index 0000000..7010710 --- /dev/null +++ b/plugins/atash/news/updates/builder_table_create_atash_news_help_options.php @@ -0,0 +1,22 @@ +engine = 'InnoDB'; + $table->increments('id')->unsigned(); + $table->string('name'); + }); + } + + public function down() + { + Schema::dropIfExists('atash_news_help_options'); + } +} diff --git a/plugins/atash/news/updates/builder_table_create_atash_news_news.php b/plugins/atash/news/updates/builder_table_create_atash_news_news.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/updates/builder_table_create_atash_news_questions_answers.php b/plugins/atash/news/updates/builder_table_create_atash_news_questions_answers.php new file mode 100755 index 0000000..6c68457 --- /dev/null +++ b/plugins/atash/news/updates/builder_table_create_atash_news_questions_answers.php @@ -0,0 +1,25 @@ +engine = 'InnoDB'; + $table->increments('id')->unsigned(); + $table->text('question'); + $table->text('answer'); + $table->timestamp('created_at')->nullable(); + $table->timestamp('updated_at')->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('atash_news_questions_answers'); + } +} diff --git a/plugins/atash/news/updates/builder_table_delete_atash_news_news.php b/plugins/atash/news/updates/builder_table_delete_atash_news_news.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/updates/builder_table_delete_atash_news_news_2.php b/plugins/atash/news/updates/builder_table_delete_atash_news_news_2.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/updates/builder_table_update_atash_news_banknews.php b/plugins/atash/news/updates/builder_table_update_atash_news_banknews.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/updates/builder_table_update_atash_news_help_options.php b/plugins/atash/news/updates/builder_table_update_atash_news_help_options.php new file mode 100755 index 0000000..a55e021 --- /dev/null +++ b/plugins/atash/news/updates/builder_table_update_atash_news_help_options.php @@ -0,0 +1,25 @@ +timestamp('created_at')->nullable(); + $table->timestamp('updated_at')->nullable(); + }); + } + + public function down() + { + Schema::table('atash_news_help_options', function($table) + { + $table->dropColumn('created_at'); + $table->dropColumn('updated_at'); + }); + } +} diff --git a/plugins/atash/news/updates/builder_table_update_atash_news_news.php b/plugins/atash/news/updates/builder_table_update_atash_news_news.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/updates/builder_table_update_atash_news_news_2.php b/plugins/atash/news/updates/builder_table_update_atash_news_news_2.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/updates/builder_table_update_atash_news_news_3.php b/plugins/atash/news/updates/builder_table_update_atash_news_news_3.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/updates/builder_table_update_atash_news_news_4.php b/plugins/atash/news/updates/builder_table_update_atash_news_news_4.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/updates/builder_table_update_atash_news_news_5.php b/plugins/atash/news/updates/builder_table_update_atash_news_news_5.php old mode 100644 new mode 100755 diff --git a/plugins/atash/news/updates/builder_table_update_atash_news_questions_answers.php b/plugins/atash/news/updates/builder_table_update_atash_news_questions_answers.php new file mode 100755 index 0000000..cd437be --- /dev/null +++ b/plugins/atash/news/updates/builder_table_update_atash_news_questions_answers.php @@ -0,0 +1,23 @@ +integer('help_options_id'); + }); + } + + public function down() + { + Schema::table('atash_news_questions_answers', function($table) + { + $table->dropColumn('help_options_id'); + }); + } +} diff --git a/plugins/atash/news/updates/version.yaml b/plugins/atash/news/updates/version.yaml old mode 100644 new mode 100755 index 7bdb2ef..fa6de2a --- a/plugins/atash/news/updates/version.yaml +++ b/plugins/atash/news/updates/version.yaml @@ -24,3 +24,15 @@ 1.0.9: - 'Updated table atash_news_news' - builder_table_update_atash_news_news_5.php +1.0.10: + - 'Created table atash_news_help_options' + - builder_table_create_atash_news_help_options.php +1.0.11: + - 'Updated table atash_news_help_options' + - builder_table_update_atash_news_help_options.php +1.0.12: + - 'Created table atash_news_questions_answers' + - builder_table_create_atash_news_questions_answers.php +1.0.13: + - 'Updated table atash_news_questions_answers' + - builder_table_update_atash_news_questions_answers.php diff --git a/plugins/atash/slider/Plugin.php b/plugins/atash/slider/Plugin.php old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/ImageController.php b/plugins/atash/slider/controllers/ImageController.php old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/_list_toolbar.htm b/plugins/atash/slider/controllers/imagecontroller/_list_toolbar.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/_reorder_toolbar.htm b/plugins/atash/slider/controllers/imagecontroller/_reorder_toolbar.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/config_form.yaml b/plugins/atash/slider/controllers/imagecontroller/config_form.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/config_list.yaml b/plugins/atash/slider/controllers/imagecontroller/config_list.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/config_reorder.yaml b/plugins/atash/slider/controllers/imagecontroller/config_reorder.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/create.htm b/plugins/atash/slider/controllers/imagecontroller/create.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/index.htm b/plugins/atash/slider/controllers/imagecontroller/index.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/preview.htm b/plugins/atash/slider/controllers/imagecontroller/preview.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/reorder.htm b/plugins/atash/slider/controllers/imagecontroller/reorder.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/controllers/imagecontroller/update.htm b/plugins/atash/slider/controllers/imagecontroller/update.htm old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/lang/en/lang.php b/plugins/atash/slider/lang/en/lang.php old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/models/Slider.php b/plugins/atash/slider/models/Slider.php index f44d641..6c3a3a9 100644 --- a/plugins/atash/slider/models/Slider.php +++ b/plugins/atash/slider/models/Slider.php @@ -29,6 +29,7 @@ class Slider extends Model public $attachOne = [ 'image' => 'System\Models\File', - 'image_ru' => 'System\Models\File' + 'image_ru' => 'System\Models\File', + 'image_en' => 'System\Models\File' ]; } diff --git a/plugins/atash/slider/models/slider/columns.yaml b/plugins/atash/slider/models/slider/columns.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/models/slider/fields.yaml b/plugins/atash/slider/models/slider/fields.yaml index 380a601..7953536 100644 --- a/plugins/atash/slider/models/slider/fields.yaml +++ b/plugins/atash/slider/models/slider/fields.yaml @@ -25,3 +25,12 @@ fields: extension: auto span: left type: fileupload + image_en: + label: image_en + mode: image + useCaption: true + thumbOptions: + mode: crop + extension: auto + span: left + type: fileupload diff --git a/plugins/atash/slider/plugin.yaml b/plugins/atash/slider/plugin.yaml old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/updates/builder_table_create_atash_slider_slider.php b/plugins/atash/slider/updates/builder_table_create_atash_slider_slider.php old mode 100644 new mode 100755 diff --git a/plugins/atash/slider/updates/version.yaml b/plugins/atash/slider/updates/version.yaml old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/Plugin.php b/plugins/gromit/mysqlbackup/Plugin.php old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/composer.json b/plugins/gromit/mysqlbackup/composer.json old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/console/RunBackup.php b/plugins/gromit/mysqlbackup/console/RunBackup.php old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/controllers/MysqlBackups.php b/plugins/gromit/mysqlbackup/controllers/MysqlBackups.php old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/controllers/mysqlbackups/_list_toolbar.htm b/plugins/gromit/mysqlbackup/controllers/mysqlbackups/_list_toolbar.htm old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/controllers/mysqlbackups/config_list.yaml b/plugins/gromit/mysqlbackup/controllers/mysqlbackups/config_list.yaml old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/controllers/mysqlbackups/index.htm b/plugins/gromit/mysqlbackup/controllers/mysqlbackups/index.htm old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/controllers/mysqlbackups/partials/_comment.htm b/plugins/gromit/mysqlbackup/controllers/mysqlbackups/partials/_comment.htm old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/controllers/mysqlbackups/partials/_filename.htm b/plugins/gromit/mysqlbackup/controllers/mysqlbackups/partials/_filename.htm old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/controllers/mysqlbackups/partials/_settings_description.htm b/plugins/gromit/mysqlbackup/controllers/mysqlbackups/partials/_settings_description.htm old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/helpers/FileHelper.php b/plugins/gromit/mysqlbackup/helpers/FileHelper.php old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/lang/en/lang.php b/plugins/gromit/mysqlbackup/lang/en/lang.php old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/lang/ru/lang.php b/plugins/gromit/mysqlbackup/lang/ru/lang.php old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/models/MysqlBackup.php b/plugins/gromit/mysqlbackup/models/MysqlBackup.php old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/models/MysqlBackupSettings.php b/plugins/gromit/mysqlbackup/models/MysqlBackupSettings.php old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/models/mysqlbackup/columns.yaml b/plugins/gromit/mysqlbackup/models/mysqlbackup/columns.yaml old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/models/mysqlbackupsettings/fields.yaml b/plugins/gromit/mysqlbackup/models/mysqlbackupsettings/fields.yaml old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/updates/create_mysql_backups_table.php b/plugins/gromit/mysqlbackup/updates/create_mysql_backups_table.php old mode 100644 new mode 100755 diff --git a/plugins/gromit/mysqlbackup/updates/version.yaml b/plugins/gromit/mysqlbackup/updates/version.yaml old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/LICENCE.md b/plugins/indikator/devtools/LICENCE.md old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/Plugin.php b/plugins/indikator/devtools/Plugin.php old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/README.md b/plugins/indikator/devtools/README.md old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/assets/images/devtools-icon.svg b/plugins/indikator/devtools/assets/images/devtools-icon.svg old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/assets/october.cmspage.js b/plugins/indikator/devtools/assets/october.cmspage.js old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/classes/Asset.php b/plugins/indikator/devtools/classes/Asset.php old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/classes/asset/fields.yaml b/plugins/indikator/devtools/classes/asset/fields.yaml old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/composer.json b/plugins/indikator/devtools/composer.json old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/controllers/Editor.php b/plugins/indikator/devtools/controllers/Editor.php old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/controllers/editor/_concurrency_resolve_form.htm b/plugins/indikator/devtools/controllers/editor/_concurrency_resolve_form.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/controllers/editor/_content_toolbar.htm b/plugins/indikator/devtools/controllers/editor/_content_toolbar.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/controllers/editor/_form_page.htm b/plugins/indikator/devtools/controllers/editor/_form_page.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/controllers/editor/_sidepanel.htm b/plugins/indikator/devtools/controllers/editor/_sidepanel.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/controllers/editor/index.htm b/plugins/indikator/devtools/controllers/editor/index.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/formwidgets/Help.php b/plugins/indikator/devtools/formwidgets/Help.php old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/formwidgets/help/partials/_help.htm b/plugins/indikator/devtools/formwidgets/help/partials/_help.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/lang/en/lang.php b/plugins/indikator/devtools/lang/en/lang.php old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/lang/hu/lang.php b/plugins/indikator/devtools/lang/hu/lang.php old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/models/Settings.php b/plugins/indikator/devtools/models/Settings.php old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/models/settings/fields.yaml b/plugins/indikator/devtools/models/settings/fields.yaml old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/routes.php b/plugins/indikator/devtools/routes.php old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/updates/version.yaml b/plugins/indikator/devtools/updates/version.yaml old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/AssetList.php b/plugins/indikator/devtools/widgets/AssetList.php old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/assets/css/assetlist.css b/plugins/indikator/devtools/widgets/assetlist/assets/css/assetlist.css old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/assets/js/assetlist.js b/plugins/indikator/devtools/widgets/assetlist/assets/js/assetlist.js old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/assets/less/assetlist.less b/plugins/indikator/devtools/widgets/assetlist/assets/less/assetlist.less old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/partials/_body.htm b/plugins/indikator/devtools/widgets/assetlist/partials/_body.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/partials/_files.htm b/plugins/indikator/devtools/widgets/assetlist/partials/_files.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/partials/_items.htm b/plugins/indikator/devtools/widgets/assetlist/partials/_items.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/partials/_move_form.htm b/plugins/indikator/devtools/widgets/assetlist/partials/_move_form.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/partials/_new_dir_form.htm b/plugins/indikator/devtools/widgets/assetlist/partials/_new_dir_form.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/partials/_rename_form.htm b/plugins/indikator/devtools/widgets/assetlist/partials/_rename_form.htm old mode 100644 new mode 100755 diff --git a/plugins/indikator/devtools/widgets/assetlist/partials/_toolbar.htm b/plugins/indikator/devtools/widgets/assetlist/partials/_toolbar.htm old mode 100644 new mode 100755 diff --git a/plugins/koderhut/rssfeedster/Plugin.php b/plugins/koderhut/rssfeedster/Plugin.php new file mode 100755 index 0000000..c4510ba --- /dev/null +++ b/plugins/koderhut/rssfeedster/Plugin.php @@ -0,0 +1,164 @@ + + */ + +namespace KoderHut\RssFeedster; + +use Illuminate\Support\Facades\App; +use Route, + Url; + +use Cms\Classes\Controller; + +use System\Classes\PluginBase, + System\Classes\PluginManager; + +use KoderHut\RssFeedster\Classes\Feedster, + KoderHut\RssFeedster\Classes\DataSource\NewsSource, + KoderHut\RssFeedster\Classes\View\XmlRenderer, + KoderHut\RssFeedster\Models\Settings, + KoderHut\RssFeedster\Classes\Support\Adapters\NewsXmlAdapter, + KoderHut\RssFeedster\Classes\Contracts\IAdapter; + + +/** + * RssFeed Plugin Information File + */ +class Plugin + extends PluginBase +{ + /** + * Namespace const + */ + const KODERHUT_RSSFEEDSTER_NS = 'KoderHut\RssFeedster'; + + /** + * Define the plug-in dependencies + * + * @var array Plugin dependencies + */ + // public $require = ['Indikator.News']; + + /** + * Returns information about this plugin. + * + * @return array + */ + public function pluginDetails() + { + return [ + 'name' => 'koderhut.rssfeedster::lang.plugin.name', + 'description' => 'koderhut.rssfeedster::lang.plugin.description', + 'author' => 'Denis-Florin Rendler (KoderHut)', + 'icon' => 'icon-rss', + 'homepage' => 'https://github.com/rendler-denis/rssfeedster', + ]; + } + + /** + * Set up the route for the RSS builder + */ + public function boot() + { + $rssUrl = Settings::get('feed_url'); + + Route::get('/{locale?}'.$rssUrl, 'KoderHut\RssFeedster\Controllers\Rss@buildRssFeed'); + + $this->app->bind('KoderHut\RssFeedster\Feed', function($app) + { + return new Feedster(); + }); + } + + /** + * Register our data source and renderer + */ + public function register() + { + /** + * Set up the data source for the feed + */ + $this->app->bind('KoderHut\RssFeedster\DataSource', function($app) + { + $config['page'] = Settings::get('post_page'); + $config['comments_anchor'] = Settings::get('comments_anchor'); + $config['controller'] = new Controller(); + + return new NewsSource($config); + }); + + /** + * Set up the adapter interface between the XML renderer and + * the blog posts data + */ + $this->app->bind(IAdapter::DI_NAMESPACE, function () { + return new NewsXmlAdapter(); + }); + + /** + * Set up the feed renderer + */ + $this->app->bind('KoderHut\RssFeedster\Renderer', function($app) + { + $config = [ + 'description' => Settings::get('feed_description'), + 'title' => Settings::get('feed_title'), + 'category' => Settings::get('feed_category'), + 'copyright' => Settings::get('feed_copyright'), + 'language' => App::getLocale(), + 'link' => Url::action('KoderHut\RssFeedster\Controllers\Rss@buildRssFeed'), + ]; + $pluginPath = PluginManager::instance()->getPluginPath(Plugin::KODERHUT_RSSFEEDSTER_NS); + $xmlTemplate = $pluginPath . DIRECTORY_SEPARATOR . 'resources' + . DIRECTORY_SEPARATOR . 'feed-template.xml'; + + return + new XmlRenderer( + $config, + file_get_contents($xmlTemplate), + $this->app->make(IAdapter::DI_NAMESPACE) + ); + }); + + return; + } + + /** + * Register the plug-in settings + * + * @return array + */ + public function registerSettings() + { + return [ + 'settings' => [ + 'label' => 'koderhut.rssfeedster::lang.plugin.name', + 'description' => 'koderhut.rssfeedster::lang.settings.base.description', + 'icon' => 'icon-rss', + 'class' => 'KoderHut\RssFeedster\Models\Settings', + 'order' => 500, + 'keywords' => 'rss feed', + 'category' => 'KoderHut', + 'permissions' => ['koderhut.rssfeedster.access_config'], + ] + ]; + } + + /** + * Register plug-in permissions + * + * @return array + */ + public function registerPermissions() + { + return [ + 'koderhut.rssfeedster.access_config' => [ + 'label' => 'koderhut.rssfeedster::lang.messages.permissions.access_config_label', + 'tab' => 'koderhut.rssfeedster::lang.plugin.name' + ], + ]; + } +} diff --git a/plugins/koderhut/rssfeedster/README.md b/plugins/koderhut/rssfeedster/README.md new file mode 100755 index 0000000..6b79f12 --- /dev/null +++ b/plugins/koderhut/rssfeedster/README.md @@ -0,0 +1,22 @@ +## RssFeedster + +> Note: This plug-in extends and depends on the [RainLab's Blog](https://octobercms.com/plugin/rainlab-blog) plug-in to generate the feed. + +An on-the-fly, W3C validated, customisable RSS feed builder plug-in. +The generated RSS feed was built according to the W3C standards. It includes all the required tags as well as a few optional ones, like copyright, feed category, feed language. These optional tags can help feed aggregators to better promote your feed. + +The feed is built on request, so it always generates an up-to-date feed. +The plug-in is very customisable by both end-user as well as extendable by other developers. + +## Features +- customisable URL +- feed built on request +- includes optional RSS fields for better integration with feed aggregators +- data source and renderer easily extendable by developers. + +## License + +The License is MIT with the exception that you are NOT allowed to sell the plug-in under ANY circumstance. +You can install, debug and fix the code for your clients and charge for those services but you are NOT allowed to charge for the plug-in itself. + +If you are in doubt about the license you can contact me at connect [ at ] rendler.me \ No newline at end of file diff --git a/plugins/koderhut/rssfeedster/classes/Feedster.php b/plugins/koderhut/rssfeedster/classes/Feedster.php new file mode 100755 index 0000000..9f13ff0 --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/Feedster.php @@ -0,0 +1,150 @@ + + */ + +namespace KoderHut\RssFeedster\Classes; + +use October\Rain\Exception\ApplicationException; + +use KoderHut\RssFeedster\Classes\Contracts\IDataSource, + KoderHut\RssFeedster\Classes\Contracts\IRenderer, + KoderHut\RssFeedster\Models\Settings, + KoderHut\RssFeedster\Classes\Support\Facades\Renderer, + KoderHut\RssFeedster\Classes\Support\Facades\DataSource; + +/** + * Class Feedster + * Service class in charge of collecting the feed data + * and rendering it + * + * @package KoderHut\RssFeedster\Classes + */ +class Feedster +{ + /** + * The feed generator name + */ + const FEED_GENERATOR_NAME = 'KoderHut.eu - RSSFeedster for OctoberCMS'; + + /** + * Feed title + * + * @var string + */ + protected $feedTitle = ''; + + /** + * Maximum number of rows to retrieve and render + * + * @var int + */ + protected $dataRowsLimit = 1; + + /** + * Either to display the full content + * + * @var bool + */ + protected $fullContent = false; + + /** + * Data source for retrieving the feed data + * + * @var IDataSource + */ + protected $source = null; + + /** + * Feed renderer + * + * @var IRenderer + */ + protected $renderer = null; + + /** + * Constructor + * + * @throws ApplicationException + */ + public function __construct(IDataSource $source = null, IRenderer $renderer = null, Settings $config = null) + { + $config = $config instanceof Settings ? $config : Settings::instance(); + + $this->validateSettings($config); + + $this->feedTitle = $config->feed_title; + $this->dataRowsLimit = $config->post_max_number; + $this->fullContent = $config->post_full_content; + + $this->source = $source ?: DataSource::getFacadeRoot(); + $this->renderer = $renderer ?: Renderer::getFacadeRoot(); + } + + /** + * Validate required settings + * + * @param Settings $settings + * + * @return bool + * + * @throws ApplicationException + */ + protected function validateSettings(Settings $settings) + { + if (empty($settings->feed_title)) { + throw new ApplicationException('Feed Title is required!'); + } + + if ($settings->post_max_number <= 0) { + $this->dataRowsLimit = 1000; + } + + return true; + } + + /** + * Set a data source for building the feed + * + * @param IDataSource $source + */ + public function setSource(IDataSource $source) + { + $this->source = $source; + } + + /** + * Set a renderer for the feed + * + * @param Renderer $renderer + */ + public function setRenderer(IRenderer $renderer) + { + $this->renderer = $renderer; + } + + /** + * Return the rendered feed data + * + * @return mixed + */ + public function getFeed() + { + $feedData = $this->source->getData($this->dataRowsLimit); + $renderedData = $this->renderer->renderData($feedData); + + return $renderedData; + } + + /** + * Return the content-type for this renderer + * + * @return string + */ + public function getContentType() + { + return $this->renderer->getContentType(); + } +} diff --git a/plugins/koderhut/rssfeedster/classes/contracts/IAdapter.php b/plugins/koderhut/rssfeedster/classes/contracts/IAdapter.php new file mode 100755 index 0000000..66614cd --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/contracts/IAdapter.php @@ -0,0 +1,31 @@ + + */ + +namespace KoderHut\RssFeedster\Classes\Contracts; + +/** + * Interface IAdapter + * + * @package KoderHut\RssFeedster\Classes\Contracts + */ +interface IAdapter +{ + /** + * Namespace const used for DI + */ + const DI_NAMESPACE = 'KoderHut\RssFeedster\Adapter'; + + /** + * Method used to connect a data source to a renderer + * + * @param mixed $item + * @param mixed $dataItem + * + * @return mixed + */ + public function getDataValue($item, $dataItem); +} \ No newline at end of file diff --git a/plugins/koderhut/rssfeedster/classes/contracts/IDataSource.php b/plugins/koderhut/rssfeedster/classes/contracts/IDataSource.php new file mode 100755 index 0000000..ba79be0 --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/contracts/IDataSource.php @@ -0,0 +1,32 @@ + + */ + +namespace KoderHut\RssFeedster\Classes\Contracts; + +/** + * Interface IDataSource + * + * Data source interface + * + * @package KoderHut\RssFeedster\Classes\Contracts + */ +interface IDataSource +{ + /** + * Load the data from source + * + * @return mixed + */ + public function loadData(); + + /** + * Load, if not laready loaded, and return the data + * + * @return mixed + */ + public function getData(); +} \ No newline at end of file diff --git a/plugins/koderhut/rssfeedster/classes/contracts/IRenderer.php b/plugins/koderhut/rssfeedster/classes/contracts/IRenderer.php new file mode 100755 index 0000000..856c3f2 --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/contracts/IRenderer.php @@ -0,0 +1,34 @@ + + */ + +namespace KoderHut\RssFeedster\Classes\Contracts; + +/** + * Interface IRenderer + * + * Renderer interface + * + * @package KoderHut\RssFeedster\Classes\Interfaces + */ +interface IRenderer +{ + /** + * Render the data + * + * @param $data + * + * @return mixed + */ + public function renderData($data); + + /** + * Return the content-type for this renderer + * + * @return string + */ + public function getContentType(); +} \ No newline at end of file diff --git a/plugins/koderhut/rssfeedster/classes/datasource/NewsSource.php b/plugins/koderhut/rssfeedster/classes/datasource/NewsSource.php new file mode 100755 index 0000000..75340f9 --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/datasource/NewsSource.php @@ -0,0 +1,106 @@ +page = $params['page']; + $this->controller = $params['controller']; + $this->commentsAnchor = $params['comments_anchor']; + } + /** + * Load the news + * + * @param int $maxItems + * + * @return mixed + */ + public function loadData($maxItems = self::MAX_NO_ITEMS) + { + $posts = null; + + if (!empty($this->data)) { + return $this->data; + } + $model = new Posts(); + $locale = request('locale'); + + $posts = $model->listFrontEnd([ + 'sort' => 'date desc', + 'perPage' => $maxItems, + 'locale' => in_array($locale,['ru','en','tk'])? $locale : 'en' + ]); + + + foreach ($posts as $post) { + $post->setUrl($this->page, $this->controller); +// $post->comments_url = "{$post->url}/#{$this->commentsAnchor}"; + $post->feed_content = true === $this->displayFullContent ? $post->content : $post->introductory; + } + + return $this->data = $posts; + } + + /** + * Retrieve posts from cache or load them and then return them + * + * @param int $maxItems + * + * @return mixed + */ + public function getData($maxItems = self::MAX_NO_ITEMS) + { + + if (null !== $this->data && !empty($this->data)) { + return $this->data; + } + + $this->data = $this->loadData($maxItems); + + return $this->data; + } + + /** + * Set if we display the full post content or a summary + * + * @param bool $fullContent + */ + public function setDisplayFullContent($fullContent = true) + { + $this->displayFullContent = $fullContent; + } +} diff --git a/plugins/koderhut/rssfeedster/classes/datasource/PostsSource.php b/plugins/koderhut/rssfeedster/classes/datasource/PostsSource.php new file mode 100755 index 0000000..5120d25 --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/datasource/PostsSource.php @@ -0,0 +1,117 @@ + + */ + +namespace KoderHut\RssFeedster\Classes\DataSource; + +use KoderHut\RssFeedster\Classes\Contracts\IDataSource; + +use Atash\News\Models\Banknews as Post; + +/** + * Class PostsSource + * + * Feed data source retrieving blog posts. + * Requires: RainLab.Blog plug-in + * + * @package KoderHut\RssFeedster\Classes\DataSource + */ +class PostsSource + implements IDataSource +{ + /** + * Maximum number of items to display in the feed + */ + const MAX_NO_ITEMS = 10; + + /** + * Cache for the data + * + * @var array|mixed + */ + protected $data = []; + + /** + * Disaply the full content of the post + * + * @var bool + */ + protected $displayFullContent = false; + + /** + * Constructor + * + * @param array $params + */ + public function __construct($params = null) + { + if (null === $params) { + return $this; + } + + $this->page = $params['page']; + $this->controller = $params['controller']; + $this->commentsAnchor = $params['comments_anchor']; + } + + /** + * Load the blog posts + * + * @param int $maxItems + * + * @return mixed + */ + public function loadData($maxItems = self::MAX_NO_ITEMS) + { + $posts = null; + + if (!empty($this->data)) { + return $this->data; + } + $model = new Post(); + $posts = $model->listFrontEnd([ + 'sort' => 'date desc', + 'perPage' => $maxItems, + ]); + + foreach ($posts as $post) { + $post->setUrl($this->page, $this->controller); + $post->comments_url = "{$post->url}/#{$this->commentsAnchor}"; + $post->feed_content = true === $this->displayFullContent ? $post->content : $post->summary; + } + + return $this->data = $posts; + } + + /** + * Retrieve posts from cache or load them and then return them + * + * @param int $maxItems + * + * @return mixed + */ + public function getData($maxItems = self::MAX_NO_ITEMS) + { + if (null !== $this->data && !empty($this->data)) { + return $this->data; + } + + $this->data = $this->loadData($maxItems); + + + return $this->data; + } + + /** + * Set if we display the full post content or a summary + * + * @param bool $fullContent + */ + public function setDisplayFullContent($fullContent = true) + { + $this->displayFullContent = $fullContent; + } +} diff --git a/plugins/koderhut/rssfeedster/classes/support/adapters/BlogPostXmlAdapter.php b/plugins/koderhut/rssfeedster/classes/support/adapters/BlogPostXmlAdapter.php new file mode 100755 index 0000000..c402164 --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/support/adapters/BlogPostXmlAdapter.php @@ -0,0 +1,108 @@ + + */ + +namespace KoderHut\RssFeedster\Classes\Support\Adapters; + +use DomElement, + DOMCdataSection; + +use KoderHut\RssFeedster\Classes\Contracts\IAdapter; + +/** + * Class BlogPostXmlAdapter + * Adapter between the Posts data source and the XML renderer + * + * @package KoderHut\RssFeedster\Classes\Support\Adapters + */ +class BlogPostXmlAdapter + implements IAdapter +{ + + /** + * Transform Post data into XML elements + * + * @param mixed $item + * @param mixed $dataItem + * + * @return void + */ + public function getDataValue($item, $dataItem) + { + switch ($item->tagName) { + case 'title': + $item->nodeValue = $dataItem->title; + break; + + case 'link': + case 'guid': + $item->nodeValue = $dataItem->url; + break; + + case 'pubDate': + $item->nodeValue = $dataItem->published_at->format('r'); + break; + + case 'dc:creator': + if (!$dataItem->user instanceof User) { + break; + } + $creator = new DOMCdataSection( + "{$dataItem->user->email} ({$dataItem->user->full_name})" + ); + $item->appendChild($creator); + break; + + case 'category': + $categories = $dataItem->categories; + + if (!empty($item->nodeValue)) { + break; + } + + if (0 !== $categories->count()) { + $this->addCategories($item, $categories->lists('name')); + } + break; + + case 'description': + $description = new DOMCdataSection($dataItem->summary); + $item->appendChild($description); + break; + + case 'content:encoded': + $content = new DOMCdataSection($dataItem->feed_content); + $item->appendChild($content); + break; + + case 'comments': + $item->nodeValue = $dataItem->comments_url; + break; + + default: + break; + } + } + + /** + * Parse and add the categories of the post to the current item + * + * @param DomElement $categoryNode + * @param array $categories + */ + protected function addCategories(DomElement $categoryNode, $categories) + { + $itemNode = $categoryNode->parentNode; + $itemNode->removeChild($categoryNode); + + foreach ($categories as $categoryName) { + $newCategNode = clone($categoryNode); + $newCategNode->appendChild(new DOMCdataSection($categoryName)); + + $itemNode->appendChild($newCategNode); + } + } +} diff --git a/plugins/koderhut/rssfeedster/classes/support/adapters/NewsXmlAdapter.php b/plugins/koderhut/rssfeedster/classes/support/adapters/NewsXmlAdapter.php new file mode 100755 index 0000000..388e116 --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/support/adapters/NewsXmlAdapter.php @@ -0,0 +1,97 @@ +tagName) { + case 'title': + $item->nodeValue = $dataItem->title; + break; + + case 'link': + case 'guid': + $item->nodeValue = $dataItem->url; + break; + + case 'pubDate': + $item->nodeValue = $dataItem->published_at->format('r'); + break; + + case 'dc:creator': + if (!$dataItem->user instanceof User) { + break; + } + $creator = new DOMCdataSection( + "{$dataItem->user->email} ({$dataItem->user->full_name})" + ); + $item->appendChild($creator); + break; + +// case 'category': +// $categories = $dataItem->categories; +// +// if (!empty($item->nodeValue)) { +// break; +// } +// +// if (0 !== $categories->count()) { +// $this->addCategory($item, $categories->lists('name')); +// } +// break; + + case 'description': + $description = new DOMCdataSection($dataItem->seo_desc); + $item->appendChild($description); + break; + + case 'content:encoded': + $content = new DOMCdataSection($dataItem->feed_content); + $item->appendChild($content); + break; + + case 'comments': + $item->nodeValue = $dataItem->comments_url; + break; + + default: + break; + } + } +// /** +// * Parse and add the categories of the post to the current item +// * +// * @param DomElement $categoryNode +// * @param array $categories +// */ +// protected function addCategory(DomElement $categoryNode, $categories) +// { +// $itemNode = $categoryNode->parentNode; +// $itemNode->removeChild($categoryNode); +// +// foreach ($categories as $categoryName) { +// $newCategNode = clone($categoryNode); +// $newCategNode->appendChild(new DOMCdataSection($categoryName)); +// +// $itemNode->appendChild($newCategNode); +// } +// } +} diff --git a/plugins/koderhut/rssfeedster/classes/support/facades/DataSource.php b/plugins/koderhut/rssfeedster/classes/support/facades/DataSource.php new file mode 100755 index 0000000..d0476a1 --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/support/facades/DataSource.php @@ -0,0 +1,29 @@ + + */ + +namespace KoderHut\RssFeedster\Classes\Support\Facades; + +use Illuminate\Support\Facades\Facade; + +/** + * Class DataSource + * Facade for the data source object + * + * @package KoderHut\RssFeedster\Classes\Support\Facades + */ +class DataSource + extends Facade +{ + /** + * Return the facade namespace + * + * @return string + */ + protected static function getFacadeAccessor() { + return 'KoderHut\RssFeedster\DataSource'; + } +} \ No newline at end of file diff --git a/plugins/koderhut/rssfeedster/classes/support/facades/Renderer.php b/plugins/koderhut/rssfeedster/classes/support/facades/Renderer.php new file mode 100755 index 0000000..1140d4e --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/support/facades/Renderer.php @@ -0,0 +1,30 @@ + + */ + +namespace KoderHut\RssFeedster\Classes\Support\Facades; + +use Illuminate\Support\Facades\Facade; + +/** + * Class Renderer + * Facade for the renderer object + * + * @package KoderHut\RssFeedster\Classes\Support\Facades + */ +class Renderer + extends Facade +{ + + /** + * Return the facade namespace + * + * @return string + */ + protected static function getFacadeAccessor() { + return 'KoderHut\RssFeedster\Renderer'; + } +} \ No newline at end of file diff --git a/plugins/koderhut/rssfeedster/classes/view/XmlRenderer.php b/plugins/koderhut/rssfeedster/classes/view/XmlRenderer.php new file mode 100755 index 0000000..e6ac8ef --- /dev/null +++ b/plugins/koderhut/rssfeedster/classes/view/XmlRenderer.php @@ -0,0 +1,134 @@ + + */ + +namespace KoderHut\RssFeedster\Classes\View; + +use KoderHut\RssFeedster\Classes\Contracts\IAdapter; +use KoderHut\RssFeedster\Classes\Contracts\IRenderer as Renderer; +use KoderHut\RssFeedster\Classes\Feedster; + + +/** + * Class XmlRenderer + * Build an RSS Atom valid feed xml file based on the data passed + * + * @package KoderHut\RssFeedster\Classes\View + */ +class XmlRenderer + implements Renderer +{ + /** + * Content type header + */ + const RENDERER_CONTENT_TYPE = 'text/xml'; + + /** + * Sections that need to be wrapped into a CDATA element + * + * @var array + */ + private $cdataSections = ['link', 'description', ]; + + /** + * Init method used to initialize the feed document + * + * @param array $channelData base channel data taken from settings + * @param string $xmlTemplate + * @param IAdapter $adapter + */ + public function __construct($channelData = [], $xmlTemplate = null, IAdapter $adapter = null) + { + $this->adapter = $adapter; + + $xmlDoc = new \DOMDocument('1.0', 'UTF-8'); + $xmlDoc->formatOutput = true; + + if (null !== $xmlTemplate) { + $xmlDoc->loadXML($xmlTemplate); + } + + $this->itemTmpl = $xmlDoc->getElementsByTagName('item')->item(0); + + if (null !== $this->itemTmpl) { + $channelElement = $xmlDoc->getElementsByTagName('channel')->item(0); + $channelElement->removeChild($this->itemTmpl); + } + + $this->addChannelData($channelData, $xmlDoc); + + $this->xml = $xmlDoc; + } + + /** + * Build the feed items and attach them to the feed document + * + * @param array|Illuminate\Contracts\Pagination\Paginator $data + * + * @return mixed + */ + public function renderData($data = []) + { + $channel = $this->xml->getElementsByTagName('channel')->item(0); + + if (0 == count($data) || null === $this->itemTmpl || !$this->itemTmpl->hasChildNodes()) { + return $this->xml->saveXML(); + } + + foreach ($data as $dataItem) { + $xmlItem = clone($this->itemTmpl); + + foreach ($xmlItem->childNodes as $node) { + if (!$node instanceof \DOMElement) { + continue; + } + + $this->adapter->getDataValue($node, $dataItem); + } + + $channel->appendChild($xmlItem); + } + + return $this->xml->saveXML(); + } + + /** + * Return the content-type for this renderer + * + * @return string + */ + public function getContentType() + { + return self::RENDERER_CONTENT_TYPE; + } + + /** + * Add the channel data + * + * @param \DomDocument $xmlDoc + * @param array $channelData + */ + protected function addChannelData($channelData, $xmlDoc) + { +// $xmlDoc->getElementsByTagName('generator')->item(0) +// ->textContent = Feedster::FEED_GENERATOR_NAME; + $xmlDoc->getElementsByTagName('lastBuildDate')->item(0) + ->textContent = date('r'); + + foreach ($channelData as $element => $elValue) { + $xmlItem = $xmlDoc->getElementsByTagName($element)->item(0); + + if ($xmlItem instanceof \DOMElement) { + $xmlItem->textContent = $elValue; + } + } + + $atomLink = $xmlDoc->getElementsByTagNameNS($xmlDoc->lookupNamespaceUri('atom'), 'link')->item(0); + if ($atomLink instanceof \DOMElement) { + $atomLink->setAttribute('href', isset($channelData['link']) ? $channelData['link']: ''); + } + } +} diff --git a/plugins/koderhut/rssfeedster/config/language_codes.yaml b/plugins/koderhut/rssfeedster/config/language_codes.yaml new file mode 100755 index 0000000..a03a0a7 --- /dev/null +++ b/plugins/koderhut/rssfeedster/config/language_codes.yaml @@ -0,0 +1,97 @@ +"Afrikaans": af +"Albanian": sq +"Basque": eu +"Belarusian": be +"Bulgarian": bg +"Catalan": ca +"Chinese (Simplified)": zh-cn +"Chinese (Traditional)": zh-tw +"Croatian": hr +"Czech": cs +"Danish": da +"Dutch": nl +"Dutch (Belgium)": nl-be +"Dutch (Netherlands)": nl-nl +"English": en +"English (Australia)": en-au +"English (Belize)": en-bz +"English (Canada)": en-ca +"English (Ireland)": en-ie +"English (Jamaica)": en-jm +"English (New Zealand)": en-nz +"English (Phillipines)": en-ph +"English (South Africa)": en-za +"English (Trinidad)": en-tt +"English (United Kingdom)": en-gb +"English (United States)": en-us +"English (Zimbabwe)": en-zw +"Estonian": et +"Faeroese": fo +"Finnish": fi +"French": fr +"French (Belgium)": fr-be +"French (Canada)": fr-ca +"French (France)": fr-fr +"French (Luxembourg)": fr-lu +"French (Monaco)": fr-mc +"French (Switzerland)": fr-ch +"Galician": gl +"Gaelic": gd +"German": de +"German (Austria)": de-at +"German (Germany)": de-de +"German (Liechtenstein)": de-li +"German (Luxembourg)": de-lu +"German (Switzerland)": de-ch +"Greek": el +"Hawaiian": haw +"Hungarian": hu +"Icelandic": is +"Indonesian": in +"Irish": ga +"Italian": it +"Italian (Italy)": it-it +"Italian (Switzerland)": it-ch +"Japanese": ja +"Korean": ko +"Macedonian": mk +"Norwegian": no +"Polish": pl +"Portuguese": pt +"Portuguese (Brazil)": pt-br +"Portuguese (Portugal)": pt-pt +"Romanian": ro +"Romanian (Moldova)": ro-mo +"Romanian (Romania)": ro-ro +"Russian": ru +"Russian (Moldova)": ru-mo +"Russian (Russia)": ru-ru +"Serbian": sr +"Slovak": sk +"Slovenian": sl +"Spanish": es +"Spanish (Argentina)": es-ar +"Spanish (Bolivia)": es-bo +"Spanish (Chile)": es-cl +"Spanish (Colombia)": es-co +"Spanish (Costa Rica)": es-cr +"Spanish (Dominican Republic)": es-do +"Spanish (Ecuador)": es-ec +"Spanish (El Salvador)": es-sv +"Spanish (Guatemala)": es-gt +"Spanish (Honduras)": es-hn +"Spanish (Mexico)": es-mx +"Spanish (Nicaragua)": es-ni +"Spanish (Panama)": es-pa +"Spanish (Paraguay)": es-py +"Spanish (Peru)": es-pe +"Spanish (Puerto Rico)": es-pr +"Spanish (Spain)": es-es +"Spanish (Uruguay)": es-uy +"Spanish (Venezuela)": es-ve +"Swedish": sv +"Swedish (Finland)": sv-fi +"Swedish (Sweden)": sv-se +"Turkish": tr +"Turkmen": tk +"Ukranian": uk diff --git a/plugins/koderhut/rssfeedster/controllers/Rss.php b/plugins/koderhut/rssfeedster/controllers/Rss.php new file mode 100755 index 0000000..5e439b0 --- /dev/null +++ b/plugins/koderhut/rssfeedster/controllers/Rss.php @@ -0,0 +1,32 @@ + + */ + +namespace KoderHut\RssFeedster\Controllers; + +use App; + +use Illuminate\Support\Facades\Response; +use Illuminate\Routing\Controller as ControllerBase; + + +/** + * Rss feed builder controller + */ +class Rss + extends ControllerBase +{ + /** + * Build the RSS feed action + */ + public function buildRssFeed($locale = 'en') + { + $feedster = App::make('KoderHut\RssFeedster\Feed'); + + return Response::make($feedster->getFeed($locale)) + ->header('Content-Type', $feedster->getContentType()); + } +} diff --git a/plugins/koderhut/rssfeedster/lang/en/lang.php b/plugins/koderhut/rssfeedster/lang/en/lang.php new file mode 100755 index 0000000..8378fa4 --- /dev/null +++ b/plugins/koderhut/rssfeedster/lang/en/lang.php @@ -0,0 +1,97 @@ + [ + 'name' => 'RSSFeedster', + 'description' => 'RSS Feed on-the-fly generator.', + 'namespace' => 'KoderHut', + ], + + 'settings' => [ + 'base' => [ + 'description' => 'Manage RSSFeedster base settings.', + ], + 'tabs' => [ + 'general_title' => 'General Options', + 'posts_title' => 'Posts Options', + ], + + 'fields' => [ + 'feed_url' => [ + 'label' => 'RSS Feed URL (without domain)', + 'comment' => 'The URL you want assigned to the RSS feed without the install path', + 'description' => '', + 'default' => '/rss.xml', + ], + + 'feed_title' => [ + 'label' => 'RSS Feed Title', + 'comment' => 'The title of your RSS feed (can also be the site name)', + 'description' => 'The title of your RSS feed (can also be the site name)', + 'placeholder' => '', + 'default' => 'RSS Feed Title', + ], + + 'feed_description' => [ + 'label' => 'Short Description of The RSS Feed', + 'comment' => 'A short description of the website that will be displayed on the feed', + 'description' => 'A short description of the website that will be displayed on the feed', + ], + + 'feed_category' => [ + 'label' => 'RSS Feed Category', + 'comment' => 'The category element is used to specify a category for your feed.', + 'description' => 'The category element makes it possible for RSS aggregators to group sites based on category.', + 'placeholder' => '', + ], + + 'feed_copyright' => [ + 'label' => 'RSS Feed Copyright Notice', + 'comment' => 'The copyright element notifies about copyrighted material.', + 'description' => 'The copyright element notifies about copyrighted material.', + 'placeholder' => '', + ], + + 'feed_language' => [ + 'label' => 'RSS Feed Language', + 'comment' => 'The language element is used to specify the language used to write your document.', + 'description' => 'The language element makes it possible for RSS aggregators to group sites based on language', + 'placeholder' => '', + ], + + 'post_max_number' => [ + 'label' => 'Max No. of Posts', + 'comment' => 'The maximum number of posts to display into the feed. Could generate overload if the number is to high! Use -1 to disable this limit.', + 'description' => 'The maximum number of posts to display into the feed. Could generate overload if the number is to high!', + ], + + 'post_full_content' => [ + 'label' => 'Display Full Content', + 'comment' => 'Display the full post content into the feed or an excerpt', + 'description' => 'Display the full post content into the feed or an excerpt', + ], + + 'post_page' => [ + 'label' => 'Post page', + 'comment' => 'Set the page used to render the post', + 'description' => 'Set the page used to render the post', + ], + + 'comments_anchor' => [ + 'label' => 'Comments section anchor', + 'comment' => 'Set ID of the element hosting the comments section', + 'description' => 'Set ID of the element hosting the comments section', + 'placeholder' => 'post-comments', + ], + + ], + + ], + + 'messages' => [ + 'permissions' => [ + 'access_config_label' => 'Access Feed Configs' + ], + ], + +]; diff --git a/plugins/koderhut/rssfeedster/models/Settings.php b/plugins/koderhut/rssfeedster/models/Settings.php new file mode 100755 index 0000000..14937a1 --- /dev/null +++ b/plugins/koderhut/rssfeedster/models/Settings.php @@ -0,0 +1,95 @@ + + */ + +namespace KoderHut\RssFeedster\Models; + +use Model, + Lang, + File, + Yaml as YamlParser; + +use System\Classes\PluginManager; + +use Cms\Classes\Page; + +use KoderHut\RssFeedster\Plugin; + +/** + * Settings Model + */ +class Settings + extends Model +{ + use \October\Rain\Database\Traits\Validation; + + /** + * @var array + */ + public $implement = ['System.Behaviors.SettingsModel']; + + /** + * @var string + */ + public $settingsCode = 'koderhut_rssfeedster_settings'; + + /** + * @var string + */ + public $settingsFields = 'fields.yaml'; + + /** + * Validation rules + */ + public $rules = [ + 'feed_url' => 'required', + 'feed_title' => 'required', + ]; + + + /** + * Init default data + */ + public function initSettingsData() + { + $this->feed_title + = Lang::get('koderhut.rssfeedster::lang.settings.fields.feed_title.default'); + $this->feed_url + = Lang::get('koderhut.rssfeedster::lang.settings.fields.feed_url.default'); + $this->post_page = '404'; + } + + /** + * Return the post_page dropdown options + * + * @return array + */ + public function getPostPageOptions() + { + return Page::sortBy('baseFileName')->lists('baseFileName', 'baseFileName'); + } + + /** + * Load and return the feed_language dropdown options + * + * @return array + */ + public function getFeedLanguageOptions() + { + $pluginPath = PluginManager::instance()->getPluginPath(Plugin::KODERHUT_RSSFEEDSTER_NS); + $path = $pluginPath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'language_codes.yaml'; + + if (!File::exists($path)) { + return []; + } + + $languages = YamlParser::parseFile($path); + + $languages = is_array($languages) ? array_flip($languages) : []; + + return $languages; + } +} \ No newline at end of file diff --git a/plugins/koderhut/rssfeedster/models/settings/fields.yaml b/plugins/koderhut/rssfeedster/models/settings/fields.yaml new file mode 100755 index 0000000..29de0a0 --- /dev/null +++ b/plugins/koderhut/rssfeedster/models/settings/fields.yaml @@ -0,0 +1,78 @@ +fields: + feed_url: + tab: koderhut.rssfeedster::lang.settings.tabs.general_title + label: koderhut.rssfeedster::lang.settings.fields.feed_url.label + commentAbove: koderhut.rssfeedster::lang.settings.fields.feed_url.comment + default: '/rss.xml' + +tabs: + fields: +# General tab + feed_title: + tab: koderhut.rssfeedster::lang.settings.tabs.general_title + label: koderhut.rssfeedster::lang.settings.fields.feed_title.label + placeholder: koderhut.rssfeedster::lang.settings.fields.feed_title.placeholder + comment: koderhut.rssfeedster::lang.settings.fields.feed_title.comment + description: koderhut.rssfeedster::lang.settings.fields.feed_title.description + + feed_description: + tab: koderhut.rssfeedster::lang.settings.tabs.general_title + label: koderhut.rssfeedster::lang.settings.fields.feed_description.label + comment: koderhut.rssfeedster::lang.settings.fields.feed_description.comment + description: koderhut.rssfeedster::lang.settings.fields.feed_description.description + type: textarea + size: small + + feed_category: + tab: koderhut.rssfeedster::lang.settings.tabs.general_title + label: koderhut.rssfeedster::lang.settings.fields.feed_category.label + placeholder: koderhut.rssfeedster::lang.settings.fields.feed_category.placeholder + comment: koderhut.rssfeedster::lang.settings.fields.feed_category.comment + description: koderhut.rssfeedster::lang.settings.fields.feed_category.description + + feed_copyright: + tab: koderhut.rssfeedster::lang.settings.tabs.general_title + label: koderhut.rssfeedster::lang.settings.fields.feed_copyright.label + placeholder: koderhut.rssfeedster::lang.settings.fields.feed_copyright.placeholder + comment: koderhut.rssfeedster::lang.settings.fields.feed_copyright.comment + description: koderhut.rssfeedster::lang.settings.fields.feed_copyright.description + + feed_language: + tab: koderhut.rssfeedster::lang.settings.tabs.general_title + label: koderhut.rssfeedster::lang.settings.fields.feed_language.label + placeholder: koderhut.rssfeedster::lang.settings.fields.feed_language.placeholder + comment: koderhut.rssfeedster::lang.settings.fields.feed_language.comment + description: koderhut.rssfeedster::lang.settings.fields.feed_language.description + type: dropdown + + comments_anchor: + tab: koderhut.rssfeedster::lang.settings.tabs.general_title + label: koderhut.rssfeedster::lang.settings.fields.comments_anchor.label + placeholder: koderhut.rssfeedster::lang.settings.fields.comments_anchor.placeholder + comment: koderhut.rssfeedster::lang.settings.fields.comments_anchor.comment + description: koderhut.rssfeedster::lang.settings.fields.comments_anchor.description + type: text + + +# Posts tab + post_max_number: + tab: koderhut.rssfeedster::lang.settings.tabs.posts_title + label: koderhut.rssfeedster::lang.settings.fields.post_max_number.label + comment: koderhut.rssfeedster::lang.settings.fields.post_max_number.comment + description: koderhut.rssfeedster::lang.settings.fields.post_max_number.description + default: 20 + + post_full_content: + tab: koderhut.rssfeedster::lang.settings.tabs.posts_title + label: koderhut.rssfeedster::lang.settings.fields.post_full_content.label + comment: koderhut.rssfeedster::lang.settings.fields.post_full_content.comment + description: koderhut.rssfeedster::lang.settings.fields.post_full_content.description + type: checkbox + + post_page: + tab: koderhut.rssfeedster::lang.settings.tabs.posts_title + label: koderhut.rssfeedster::lang.settings.fields.post_page.label + comment: koderhut.rssfeedster::lang.settings.fields.post_page.comment + description: koderhut.rssfeedster::lang.settings.fields.post_full_content.description + type: dropdown + default: 'blog/post' diff --git a/plugins/koderhut/rssfeedster/phpunit.xml b/plugins/koderhut/rssfeedster/phpunit.xml new file mode 100755 index 0000000..83246b5 --- /dev/null +++ b/plugins/koderhut/rssfeedster/phpunit.xml @@ -0,0 +1,24 @@ + +Ссылки на мобильные приложения других банков:
Государственный коммерческий банк Туркменистана "Туркменбаши" Государственный коммерческий банк Туркменистана "Туркменистан" Акционерный коммерческий банк "Сенагат" Туркмено-турецкий акционерный коммерческий банк Акционерный коммерческий банк "Рысгал" Государственный коммерческий банк Туркменистана "Дайханбанк" +Ссылки на мобильные приложения других банков:
Государственный коммерческий банк Туркменистана "Туркменбаши" Государственный коммерческий банк Туркменистана "Туркменистан" Акционерный коммерческий банк "Сенагат" Туркмено-турецкий акционерный коммерческий банк Акционерный коммерческий банк "Рысгал" Государственный коммерческий банк Туркменистана "Дайханбанк" \ No newline at end of file diff --git a/themes/halk_bank/content/static-pages/new.htm b/themes/halk_bank/content/static-pages/new.htm index cef069a..a0c5741 100644 --- a/themes/halk_bank/content/static-pages/new.htm +++ b/themes/halk_bank/content/static-pages/new.htm @@ -1,5 +1,5 @@ [viewBag] -title = "new" +title = "Денежные переводы Гырат" url = "/new" layout = "default" is_hidden = 0 diff --git a/themes/halk_bank/content/static-pages/od-first.htm b/themes/halk_bank/content/static-pages/od-first.htm old mode 100644 new mode 100755 index 0529dcd..ff0b28a --- a/themes/halk_bank/content/static-pages/od-first.htm +++ b/themes/halk_bank/content/static-pages/od-first.htm @@ -1,5 +1,5 @@ [viewBag] -title = "od-first" +title = "Как получить кредит" url = "/od-first" layout = "default" is_hidden = 0 @@ -8,7 +8,7 @@ navigation_hidden = 0