From 4f71b15bc33f91d385417e4209814bf6f6cdecbf Mon Sep 17 00:00:00 2001 From: Andrey Kharanenka Date: Wed, 17 Apr 2019 15:34:21 +0300 Subject: [PATCH] Remove old category components --- components/ArticleList.php | 5 +--- components/ArticlePage.php | 8 +++--- components/CategoryData.php | 34 ----------------------- components/CategoryList.php | 43 ----------------------------- components/CategoryPage.php | 54 ------------------------------------- 5 files changed, 5 insertions(+), 139 deletions(-) delete mode 100644 components/CategoryData.php delete mode 100644 components/CategoryList.php delete mode 100644 components/CategoryPage.php diff --git a/components/ArticleList.php b/components/ArticleList.php index e86a982..ad93ae0 100644 --- a/components/ArticleList.php +++ b/components/ArticleList.php @@ -13,9 +13,6 @@ */ class ArticleList extends SortingElementList { - /** @var ArticleListStore */ - protected $obArticleListStore; - /** * @return array */ @@ -59,7 +56,7 @@ public function make($arElementIDList = null) { return ArticleCollection::make($arElementIDList); } - + public function onAjaxRequest() { return true; diff --git a/components/ArticlePage.php b/components/ArticlePage.php index 397e7dc..26cebd0 100644 --- a/components/ArticlePage.php +++ b/components/ArticlePage.php @@ -25,7 +25,7 @@ public function componentDetails() 'description' => 'lovata.goodnews::lang.component.article_page_desc' ]; } - + /** * Get element object * @param string $sElementSlug @@ -36,17 +36,17 @@ protected function getElementObject($sElementSlug) if(empty($sElementSlug)) { return null; } - + $obElement = Article::getBySlug($sElementSlug) ->getByStatus(Article::STATUS_PUBLISHED) ->getPublished() ->first(); - + if(!empty($obElement)) { $obElement->view_count++; $obElement->save(); } - + return $obElement; } diff --git a/components/CategoryData.php b/components/CategoryData.php deleted file mode 100644 index c29e939..0000000 --- a/components/CategoryData.php +++ /dev/null @@ -1,34 +0,0 @@ - 'lovata.goodnews::lang.component.category_data', - 'description' => 'lovata.goodnews::lang.component.category_data_desc' - ]; - } - - /** - * Make new element item - * @param int $iElementID - * @return CategoryItem - */ - protected function makeItem($iElementID) - { - return CategoryItem::make($iElementID); - } -} diff --git a/components/CategoryList.php b/components/CategoryList.php deleted file mode 100644 index 99ff042..0000000 --- a/components/CategoryList.php +++ /dev/null @@ -1,43 +0,0 @@ - 'lovata.goodnews::lang.component.category_list', - 'description' => 'lovata.goodnews::lang.component.category_list_desc', - ]; - } - - /** - * Make element collection - * @param array $arElementIDList - * - * @return CategoryCollection - */ - public function make($arElementIDList = null) - { - return CategoryCollection::make($arElementIDList); - } - - /** - * Method for ajax request with empty response - * @return bool - */ - public function onAjaxRequest() - { - return true; - } -} \ No newline at end of file diff --git a/components/CategoryPage.php b/components/CategoryPage.php deleted file mode 100644 index 195cb50..0000000 --- a/components/CategoryPage.php +++ /dev/null @@ -1,54 +0,0 @@ - 'lovata.goodnews::lang.component.category_page', - 'description' => 'lovata.goodnews::lang.component.category_page_desc' - ]; - } - - /** - * Get element object - * @param string $sElementSlug - * @return Category - */ - protected function getElementObject($sElementSlug) - { - if(empty($sElementSlug)) { - return null; - } - - $obElement = Category::active()->getBySlug($sElementSlug)->first(); - return $obElement; - } - - /** - * Make new element item - * @param int $iElementID - * @param Category $obElement - * @return CategoryItem - */ - protected function makeItem($iElementID, $obElement) - { - return CategoryItem::make($iElementID, $obElement); - } -}