diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/ContentController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/ContentController.php new file mode 100644 index 0000000..14c8f19 --- /dev/null +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/ContentController.php @@ -0,0 +1,52 @@ +About = $About; + $this->helpers = $helpers; + } + + public function index(Request $request){ + + $data = $request->all(); + + $validator = Validator::make($data, [ + 'locale' => 'required|in:ru,en,tm', + 'type' => 'required|in:about', + ]); + + if($validator->fails()) { + return $this->helpers->apiArrayResponseBuilder(400, 'fail', $validator->errors() ); + } + + + return response()->json(ContentResource::collection($this->About::where("type", $data['type'])->get())->response()->getData(), 200); + } + + + + public static function getAfterFilters() {return [];} + public static function getBeforeFilters() {return [];} + public static function getMiddleware() {return [];} + public function callAction($method, $parameters=false) { + return call_user_func_array(array($this, $method), $parameters); + } + +} diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/PostsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/PostsController.php index a7af9e2..19223d3 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/PostsController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/PostsController.php @@ -10,6 +10,8 @@ use Illuminate\Support\Facades\Validator; use RainLab\Blog\Models\Post; use RainLab\Blog\Classes\PostResource; +use RainLab\Blog\Classes\PostDetailResource; + class PostsController extends Controller { @@ -139,9 +141,8 @@ class PostsController extends Controller $data = response()->json(PostResource::collection( - $this->Post::with(['categories:id,name']) + $this->Post::with(['categories']) ->listFrontEnd($filter) - )->response()->getData(), 200); return $data; @@ -182,7 +183,7 @@ class PostsController extends Controller ]); } - return new PostResource($post); + return new PostDetailResource($post); } } diff --git a/plugins/ahmadfatoni/apigenerator/routes.php b/plugins/ahmadfatoni/apigenerator/routes.php index 294125e..a54e0f8 100644 --- a/plugins/ahmadfatoni/apigenerator/routes.php +++ b/plugins/ahmadfatoni/apigenerator/routes.php @@ -14,3 +14,6 @@ Route::get('api/v1/posts/{id}/delete', ['as' => 'api/v1/posts.delete', 'uses' => Route::get('api/v1/pagination/posts', 'AhmadFatoni\ApiGenerator\Controllers\API\PostsController@indexPagination'); Route::get('api/v1/pagination/new/posts', 'AhmadFatoni\ApiGenerator\Controllers\API\PostsController@indexPaginationLast'); Route::get('api/v1/popular/posts', 'AhmadFatoni\ApiGenerator\Controllers\API\PostsController@popular'); + + +Route::get('api/v1/content', 'AhmadFatoni\ApiGenerator\Controllers\API\ContentController@index'); diff --git a/plugins/rainlab/blog/classes/CategoryResource.php b/plugins/rainlab/blog/classes/CategoryResource.php index 5984eaa..6c5c01f 100644 --- a/plugins/rainlab/blog/classes/CategoryResource.php +++ b/plugins/rainlab/blog/classes/CategoryResource.php @@ -1,24 +1,27 @@ -get('locale'); - - return [ - 'id' => $this->id, - 'name' => $this->getAttributeTranslated('name', $locale), - ]; - } -} +get('locale'); + + return [ + 'id' => $this->id, + 'name' => $this->getAttributeTranslated('name', $locale), + 'powerseo_title' => $this->getAttributeTranslated('powerseo_title', $locale), + 'powerseo_description' => $this->getAttributeTranslated('powerseo_description', $locale), + 'powerseo_keywords' => $this->getAttributeTranslated('powerseo_keywords', $locale), + ]; + } +} diff --git a/plugins/rainlab/blog/classes/PostDetailResource.php b/plugins/rainlab/blog/classes/PostDetailResource.php new file mode 100644 index 0000000..2627e2f --- /dev/null +++ b/plugins/rainlab/blog/classes/PostDetailResource.php @@ -0,0 +1,39 @@ +get('locale'); + $path = Config::get('app.url').Config::get('cms.storage.media.path'); + + return [ + 'id' => $this->id, + 'title' => $this->getAttributeTranslated('title', $locale), + 'slug' => $this->getAttributeTranslated('slug', $locale), + 'excerpt' => $this->getAttributeTranslated('excerpt', $locale), + 'published_at' => $this->published_at->format('d.m.Y'), + 'type' => $this->type, + 'awtor' => $this->getAttributeTranslated('awtor', $locale), + 'featured_images' => ImageResource::collection($this->featured_images), + 'video' => $path.$this->video, + 'views' => $this->views, + 'content_html' => $this->getAttributeTranslated('content_html', $locale), + 'categories' => CategoryResource::collection($this->categories), + 'powerseo_title' => $this->getAttributeTranslated('powerseo_title', $locale), + 'powerseo_description' => $this->getAttributeTranslated('powerseo_description', $locale), + 'powerseo_keywords' => $this->getAttributeTranslated('powerseo_keywords', $locale), + ]; + } +} diff --git a/plugins/rainlab/blog/classes/PostResource.php b/plugins/rainlab/blog/classes/PostResource.php index 0bcdd6e..0311caa 100644 --- a/plugins/rainlab/blog/classes/PostResource.php +++ b/plugins/rainlab/blog/classes/PostResource.php @@ -28,11 +28,11 @@ class PostResource extends JsonResource 'awtor' => $this->getAttributeTranslated('awtor', $locale), 'featured_images' => ImageResource::collection($this->featured_images), 'video' => $path.$this->video, - 'content_html' => $this->getAttributeTranslated('content_html', $locale), + //'content_html' => $this->getAttributeTranslated('content_html', $locale), 'categories' => CategoryResource::collection($this->categories), - 'powerseo_title' => $this->getAttributeTranslated('powerseo_title', $locale), - 'powerseo_description' => $this->getAttributeTranslated('powerseo_description', $locale), - 'powerseo_keywords' => $this->getAttributeTranslated('powerseo_keywords', $locale), + //'powerseo_title' => $this->getAttributeTranslated('powerseo_title', $locale), + //'powerseo_description' => $this->getAttributeTranslated('powerseo_description', $locale), + //'powerseo_keywords' => $this->getAttributeTranslated('powerseo_keywords', $locale), ]; } } diff --git a/plugins/rainlab/blog/models/Category.php b/plugins/rainlab/blog/models/Category.php index 7f83355..aac93c0 100644 --- a/plugins/rainlab/blog/models/Category.php +++ b/plugins/rainlab/blog/models/Category.php @@ -1,315 +1,318 @@ - 'required', - 'slug' => 'required|between:3,64|unique:rainlab_blog_categories', - 'code' => 'nullable|unique:rainlab_blog_categories', - ]; - - /** - * @var array Attributes that support translation, if available. - */ - public $translatable = [ - 'name', - 'description', - ['slug', 'index' => true] - ]; - - protected $guarded = []; - - public $belongsToMany = [ - 'posts' => ['RainLab\Blog\Models\Post', - 'table' => 'rainlab_blog_posts_categories', - 'order' => 'published_at desc', - 'scope' => 'isPublished' - ], - 'posts_count' => ['RainLab\Blog\Models\Post', - 'table' => 'rainlab_blog_posts_categories', - 'scope' => 'isPublished', - 'count' => true - ] - ]; - - public function beforeValidate() - { - // Generate a URL slug for this model - if (!$this->exists && !$this->slug) { - $this->slug = Str::slug($this->name); - } - } - - public function afterDelete() - { - $this->posts()->detach(); - } - - public function getPostCountAttribute() - { - return optional($this->posts_count->first())->count ?? 0; - } - - /** - * Count posts in this and nested categories - * @return int - */ - public function getNestedPostCount() - { - return $this->post_count + $this->children->sum(function ($category) { - return $category->getNestedPostCount(); - }); - } - - /** - * Sets the "url" attribute with a URL to this object - * - * @param string $pageName - * @param Cms\Classes\Controller $controller - * - * @return string - */ - public function setUrl($pageName, $controller) - { - $params = [ - 'id' => $this->id, - 'slug' => $this->slug - ]; - - return $this->url = $controller->pageUrl($pageName, $params, false); - } - - /** - * Handler for the pages.menuitem.getTypeInfo event. - * Returns a menu item type information. The type information is returned as array - * with the following elements: - * - references - a list of the item type reference options. The options are returned in the - * ["key"] => "title" format for options that don't have sub-options, and in the format - * ["key"] => ["title"=>"Option title", "items"=>[...]] for options that have sub-options. Optional, - * required only if the menu item type requires references. - * - nesting - Boolean value indicating whether the item type supports nested items. Optional, - * false if omitted. - * - dynamicItems - Boolean value indicating whether the item type could generate new menu items. - * Optional, false if omitted. - * - cmsPages - a list of CMS pages (objects of the Cms\Classes\Page class), if the item type requires a CMS page reference to - * resolve the item URL. - * @param string $type Specifies the menu item type - * @return array Returns an array - */ - public static function getMenuTypeInfo($type) - { - $result = []; - - if ($type == 'blog-category') { - $result = [ - 'references' => self::listSubCategoryOptions(), - 'nesting' => true, - 'dynamicItems' => true - ]; - } - - if ($type == 'all-blog-categories') { - $result = [ - 'dynamicItems' => true - ]; - } - - if ($result) { - $theme = Theme::getActiveTheme(); - - $pages = CmsPage::listInTheme($theme, true); - $cmsPages = []; - foreach ($pages as $page) { - if (!$page->hasComponent('blogPosts')) { - continue; - } - - /* - * Component must use a category filter with a routing parameter - * eg: categoryFilter = "{{ :somevalue }}" - */ - $properties = $page->getComponentProperties('blogPosts'); - if (!isset($properties['categoryFilter']) || !preg_match('/{{\s*:/', $properties['categoryFilter'])) { - continue; - } - - $cmsPages[] = $page; - } - - $result['cmsPages'] = $cmsPages; - } - - return $result; - } - - protected static function listSubCategoryOptions() - { - $category = self::getNested(); - - $iterator = function($categories) use (&$iterator) { - $result = []; - - foreach ($categories as $category) { - if (!$category->children) { - $result[$category->id] = $category->name; - } - else { - $result[$category->id] = [ - 'title' => $category->name, - 'items' => $iterator($category->children) - ]; - } - } - - return $result; - }; - - return $iterator($category); - } - - /** - * Handler for the pages.menuitem.resolveItem event. - * Returns information about a menu item. The result is an array - * with the following keys: - * - url - the menu item URL. Not required for menu item types that return all available records. - * The URL should be returned relative to the website root and include the subdirectory, if any. - * Use the Url::to() helper to generate the URLs. - * - isActive - determines whether the menu item is active. Not required for menu item types that - * return all available records. - * - items - an array of arrays with the same keys (url, isActive, items) + the title key. - * The items array should be added only if the $item's $nesting property value is TRUE. - * @param \RainLab\Pages\Classes\MenuItem $item Specifies the menu item. - * @param \Cms\Classes\Theme $theme Specifies the current theme. - * @param string $url Specifies the current page URL, normalized, in lower case - * The URL is specified relative to the website root, it includes the subdirectory name, if any. - * @return mixed Returns an array. Returns null if the item cannot be resolved. - */ - public static function resolveMenuItem($item, $url, $theme) - { - $result = null; - - if ($item->type == 'blog-category') { - if (!$item->reference || !$item->cmsPage) { - return; - } - - $category = self::find($item->reference); - if (!$category) { - return; - } - - $pageUrl = self::getCategoryPageUrl($item->cmsPage, $category, $theme); - if (!$pageUrl) { - return; - } - - $pageUrl = Url::to($pageUrl); - - $result = []; - $result['url'] = $pageUrl; - $result['isActive'] = $pageUrl == $url; - $result['mtime'] = $category->updated_at; - - if ($item->nesting) { - $iterator = function($categories) use (&$iterator, &$item, &$theme, $url) { - $branch = []; - - foreach ($categories as $category) { - - $branchItem = []; - $branchItem['url'] = self::getCategoryPageUrl($item->cmsPage, $category, $theme); - $branchItem['isActive'] = $branchItem['url'] == $url; - $branchItem['title'] = $category->name; - $branchItem['mtime'] = $category->updated_at; - - if ($category->children) { - $branchItem['items'] = $iterator($category->children); - } - - $branch[] = $branchItem; - } - - return $branch; - }; - - $result['items'] = $iterator($category->children); - } - } - elseif ($item->type == 'all-blog-categories') { - $result = [ - 'items' => [] - ]; - - $categories = self::with('posts_count')->orderBy('name')->get(); - foreach ($categories as $category) { - try { - $postCount = $category->posts_count->first()->count ?? null; - if ($postCount === 0) { - continue; - } - } - catch (\Exception $ex) {} - - $categoryItem = [ - 'title' => $category->name, - 'url' => self::getCategoryPageUrl($item->cmsPage, $category, $theme), - 'mtime' => $category->updated_at - ]; - - $categoryItem['isActive'] = $categoryItem['url'] == $url; - - $result['items'][] = $categoryItem; - } - } - - return $result; - } - - /** - * Returns URL of a category page. - * - * @param $pageCode - * @param $category - * @param $theme - */ - protected static function getCategoryPageUrl($pageCode, $category, $theme) - { - $page = CmsPage::loadCached($theme, $pageCode); - if (!$page) { - return; - } - - $properties = $page->getComponentProperties('blogPosts'); - if (!isset($properties['categoryFilter'])) { - return; - } - - /* - * Extract the routing parameter name from the category filter - * eg: {{ :someRouteParam }} - */ - if (!preg_match('/^\{\{([^\}]+)\}\}$/', $properties['categoryFilter'], $matches)) { - return; - } - - $paramName = substr(trim($matches[1]), 1); - $url = CmsPage::url($page->getBaseFileName(), [$paramName => $category->slug]); - - return $url; - } -} + 'required', + 'slug' => 'required|between:3,64|unique:rainlab_blog_categories', + 'code' => 'nullable|unique:rainlab_blog_categories', + ]; + + /** + * @var array Attributes that support translation, if available. + */ + public $translatable = [ + 'name', + 'description', + 'powerseo_title', + 'powerseo_description', + 'powerseo_keywords', + ['slug', 'index' => true] + ]; + + protected $guarded = []; + + public $belongsToMany = [ + 'posts' => ['RainLab\Blog\Models\Post', + 'table' => 'rainlab_blog_posts_categories', + 'order' => 'published_at desc', + 'scope' => 'isPublished' + ], + 'posts_count' => ['RainLab\Blog\Models\Post', + 'table' => 'rainlab_blog_posts_categories', + 'scope' => 'isPublished', + 'count' => true + ] + ]; + + public function beforeValidate() + { + // Generate a URL slug for this model + if (!$this->exists && !$this->slug) { + $this->slug = Str::slug($this->name); + } + } + + public function afterDelete() + { + $this->posts()->detach(); + } + + public function getPostCountAttribute() + { + return optional($this->posts_count->first())->count ?? 0; + } + + /** + * Count posts in this and nested categories + * @return int + */ + public function getNestedPostCount() + { + return $this->post_count + $this->children->sum(function ($category) { + return $category->getNestedPostCount(); + }); + } + + /** + * Sets the "url" attribute with a URL to this object + * + * @param string $pageName + * @param Cms\Classes\Controller $controller + * + * @return string + */ + public function setUrl($pageName, $controller) + { + $params = [ + 'id' => $this->id, + 'slug' => $this->slug + ]; + + return $this->url = $controller->pageUrl($pageName, $params, false); + } + + /** + * Handler for the pages.menuitem.getTypeInfo event. + * Returns a menu item type information. The type information is returned as array + * with the following elements: + * - references - a list of the item type reference options. The options are returned in the + * ["key"] => "title" format for options that don't have sub-options, and in the format + * ["key"] => ["title"=>"Option title", "items"=>[...]] for options that have sub-options. Optional, + * required only if the menu item type requires references. + * - nesting - Boolean value indicating whether the item type supports nested items. Optional, + * false if omitted. + * - dynamicItems - Boolean value indicating whether the item type could generate new menu items. + * Optional, false if omitted. + * - cmsPages - a list of CMS pages (objects of the Cms\Classes\Page class), if the item type requires a CMS page reference to + * resolve the item URL. + * @param string $type Specifies the menu item type + * @return array Returns an array + */ + public static function getMenuTypeInfo($type) + { + $result = []; + + if ($type == 'blog-category') { + $result = [ + 'references' => self::listSubCategoryOptions(), + 'nesting' => true, + 'dynamicItems' => true + ]; + } + + if ($type == 'all-blog-categories') { + $result = [ + 'dynamicItems' => true + ]; + } + + if ($result) { + $theme = Theme::getActiveTheme(); + + $pages = CmsPage::listInTheme($theme, true); + $cmsPages = []; + foreach ($pages as $page) { + if (!$page->hasComponent('blogPosts')) { + continue; + } + + /* + * Component must use a category filter with a routing parameter + * eg: categoryFilter = "{{ :somevalue }}" + */ + $properties = $page->getComponentProperties('blogPosts'); + if (!isset($properties['categoryFilter']) || !preg_match('/{{\s*:/', $properties['categoryFilter'])) { + continue; + } + + $cmsPages[] = $page; + } + + $result['cmsPages'] = $cmsPages; + } + + return $result; + } + + protected static function listSubCategoryOptions() + { + $category = self::getNested(); + + $iterator = function($categories) use (&$iterator) { + $result = []; + + foreach ($categories as $category) { + if (!$category->children) { + $result[$category->id] = $category->name; + } + else { + $result[$category->id] = [ + 'title' => $category->name, + 'items' => $iterator($category->children) + ]; + } + } + + return $result; + }; + + return $iterator($category); + } + + /** + * Handler for the pages.menuitem.resolveItem event. + * Returns information about a menu item. The result is an array + * with the following keys: + * - url - the menu item URL. Not required for menu item types that return all available records. + * The URL should be returned relative to the website root and include the subdirectory, if any. + * Use the Url::to() helper to generate the URLs. + * - isActive - determines whether the menu item is active. Not required for menu item types that + * return all available records. + * - items - an array of arrays with the same keys (url, isActive, items) + the title key. + * The items array should be added only if the $item's $nesting property value is TRUE. + * @param \RainLab\Pages\Classes\MenuItem $item Specifies the menu item. + * @param \Cms\Classes\Theme $theme Specifies the current theme. + * @param string $url Specifies the current page URL, normalized, in lower case + * The URL is specified relative to the website root, it includes the subdirectory name, if any. + * @return mixed Returns an array. Returns null if the item cannot be resolved. + */ + public static function resolveMenuItem($item, $url, $theme) + { + $result = null; + + if ($item->type == 'blog-category') { + if (!$item->reference || !$item->cmsPage) { + return; + } + + $category = self::find($item->reference); + if (!$category) { + return; + } + + $pageUrl = self::getCategoryPageUrl($item->cmsPage, $category, $theme); + if (!$pageUrl) { + return; + } + + $pageUrl = Url::to($pageUrl); + + $result = []; + $result['url'] = $pageUrl; + $result['isActive'] = $pageUrl == $url; + $result['mtime'] = $category->updated_at; + + if ($item->nesting) { + $iterator = function($categories) use (&$iterator, &$item, &$theme, $url) { + $branch = []; + + foreach ($categories as $category) { + + $branchItem = []; + $branchItem['url'] = self::getCategoryPageUrl($item->cmsPage, $category, $theme); + $branchItem['isActive'] = $branchItem['url'] == $url; + $branchItem['title'] = $category->name; + $branchItem['mtime'] = $category->updated_at; + + if ($category->children) { + $branchItem['items'] = $iterator($category->children); + } + + $branch[] = $branchItem; + } + + return $branch; + }; + + $result['items'] = $iterator($category->children); + } + } + elseif ($item->type == 'all-blog-categories') { + $result = [ + 'items' => [] + ]; + + $categories = self::with('posts_count')->orderBy('name')->get(); + foreach ($categories as $category) { + try { + $postCount = $category->posts_count->first()->count ?? null; + if ($postCount === 0) { + continue; + } + } + catch (\Exception $ex) {} + + $categoryItem = [ + 'title' => $category->name, + 'url' => self::getCategoryPageUrl($item->cmsPage, $category, $theme), + 'mtime' => $category->updated_at + ]; + + $categoryItem['isActive'] = $categoryItem['url'] == $url; + + $result['items'][] = $categoryItem; + } + } + + return $result; + } + + /** + * Returns URL of a category page. + * + * @param $pageCode + * @param $category + * @param $theme + */ + protected static function getCategoryPageUrl($pageCode, $category, $theme) + { + $page = CmsPage::loadCached($theme, $pageCode); + if (!$page) { + return; + } + + $properties = $page->getComponentProperties('blogPosts'); + if (!isset($properties['categoryFilter'])) { + return; + } + + /* + * Extract the routing parameter name from the category filter + * eg: {{ :someRouteParam }} + */ + if (!preg_match('/^\{\{([^\}]+)\}\}$/', $properties['categoryFilter'], $matches)) { + return; + } + + $paramName = substr(trim($matches[1]), 1); + $url = CmsPage::url($page->getBaseFileName(), [$paramName => $category->slug]); + + return $url; + } +} diff --git a/plugins/rainlab/blog/models/category/fields.yaml b/plugins/rainlab/blog/models/category/fields.yaml index adcf1bc..fe5a81a 100644 --- a/plugins/rainlab/blog/models/category/fields.yaml +++ b/plugins/rainlab/blog/models/category/fields.yaml @@ -1,23 +1,30 @@ -# =================================== -# Field Definitions -# =================================== - fields: - name: - label: rainlab.blog::lang.category.name - placeholder: rainlab.blog::lang.category.name_placeholder + label: 'rainlab.blog::lang.category.name' + placeholder: 'rainlab.blog::lang.category.name_placeholder' span: left - + type: text slug: - label: rainlab.blog::lang.category.slug + label: 'rainlab.blog::lang.category.slug' span: right - placeholder: rainlab.blog::lang.category.slug_placeholder + placeholder: 'rainlab.blog::lang.category.slug_placeholder' preset: name - + type: text description: label: 'rainlab.blog::lang.category.description' size: large oc.commentPosition: '' span: full type: textarea + powerseo_title: + label: 'Powerseo title' + span: auto + type: text + powerseo_description: + label: 'Powerseo description' + span: auto + type: text + powerseo_keywords: + label: 'Powerseo keywords' + span: auto + type: text diff --git a/plugins/rainlab/blog/updates/builder_table_update_rainlab_blog_categories.php b/plugins/rainlab/blog/updates/builder_table_update_rainlab_blog_categories.php new file mode 100644 index 0000000..0c23ab2 --- /dev/null +++ b/plugins/rainlab/blog/updates/builder_table_update_rainlab_blog_categories.php @@ -0,0 +1,27 @@ +string('powerseo_title')->nullable(); + $table->string('powerseo_description')->nullable(); + $table->string('powerseo_keywords')->nullable(); + }); + } + + public function down() + { + Schema::table('rainlab_blog_categories', function($table) + { + $table->dropColumn('powerseo_title'); + $table->dropColumn('powerseo_description'); + $table->dropColumn('powerseo_keywords'); + }); + } +} diff --git a/plugins/rainlab/blog/updates/version.yaml b/plugins/rainlab/blog/updates/version.yaml index 153115e..fc32c0a 100644 --- a/plugins/rainlab/blog/updates/version.yaml +++ b/plugins/rainlab/blog/updates/version.yaml @@ -79,3 +79,6 @@ 1.6.6: - 'Updated table rainlab_blog_posts' - builder_table_update_rainlab_blog_posts_4.php +1.6.7: + - 'Updated table rainlab_blog_categories' + - builder_table_update_rainlab_blog_categories.php diff --git a/plugins/tps/tps/Plugin.php b/plugins/tps/tps/Plugin.php new file mode 100644 index 0000000..aa59454 --- /dev/null +++ b/plugins/tps/tps/Plugin.php @@ -0,0 +1,14 @@ +get('locale'); + + return [ + 'id' => $this->id, + 'name' => $this->name, + 'type' => $this->type, + 'content' => $this->getAttributeTranslated('content', $locale), + 'title' => $this->getAttributeTranslated('title', $locale), + 'powerseo_title' => $this->getAttributeTranslated('powerseo_title', $locale), + 'powerseo_description' => $this->getAttributeTranslated('powerseo_description', $locale), + 'powerseo_keywords' => $this->getAttributeTranslated('powerseo_keywords', $locale), + ]; + } +} diff --git a/plugins/tps/tps/controllers/About.php b/plugins/tps/tps/controllers/About.php new file mode 100644 index 0000000..8027ac6 --- /dev/null +++ b/plugins/tps/tps/controllers/About.php @@ -0,0 +1,18 @@ + + = e(trans('backend::lang.form.create')) ?> + + diff --git a/plugins/tps/tps/controllers/about/config_form.yaml b/plugins/tps/tps/controllers/about/config_form.yaml new file mode 100644 index 0000000..2af81ff --- /dev/null +++ b/plugins/tps/tps/controllers/about/config_form.yaml @@ -0,0 +1,10 @@ +name: About +form: $/tps/tps/models/about/fields.yaml +modelClass: Tps\Tps\Models\About +defaultRedirect: tps/tps/about +create: + redirect: 'tps/tps/about/update/:id' + redirectClose: tps/tps/about +update: + redirect: tps/tps/about + redirectClose: tps/tps/about diff --git a/plugins/tps/tps/controllers/about/config_list.yaml b/plugins/tps/tps/controllers/about/config_list.yaml new file mode 100644 index 0000000..19167f3 --- /dev/null +++ b/plugins/tps/tps/controllers/about/config_list.yaml @@ -0,0 +1,12 @@ +list: $/tps/tps/models/about/columns.yaml +modelClass: Tps\Tps\Models\About +title: About +noRecordsMessage: 'backend::lang.list.no_records' +showSetup: true +showCheckboxes: true +recordsPerPage: 20 +toolbar: + buttons: list_toolbar + search: + prompt: 'backend::lang.list.search_prompt' +recordUrl: 'tps/tps/about/update/:id' diff --git a/plugins/tps/tps/controllers/about/create.htm b/plugins/tps/tps/controllers/about/create.htm new file mode 100644 index 0000000..8bafd35 --- /dev/null +++ b/plugins/tps/tps/controllers/about/create.htm @@ -0,0 +1,46 @@ + +
= e(trans('backend::lang.form.return_to_list')) ?>
+ \ No newline at end of file diff --git a/plugins/tps/tps/controllers/about/index.htm b/plugins/tps/tps/controllers/about/index.htm new file mode 100644 index 0000000..ea43a36 --- /dev/null +++ b/plugins/tps/tps/controllers/about/index.htm @@ -0,0 +1 @@ += $this->listRender() ?> diff --git a/plugins/tps/tps/controllers/about/preview.htm b/plugins/tps/tps/controllers/about/preview.htm new file mode 100644 index 0000000..47319a9 --- /dev/null +++ b/plugins/tps/tps/controllers/about/preview.htm @@ -0,0 +1,22 @@ + ++ + = e(trans('backend::lang.form.return_to_list')) ?> + +
\ No newline at end of file diff --git a/plugins/tps/tps/controllers/about/update.htm b/plugins/tps/tps/controllers/about/update.htm new file mode 100644 index 0000000..4e33390 --- /dev/null +++ b/plugins/tps/tps/controllers/about/update.htm @@ -0,0 +1,54 @@ + +