From 3d7a03e7034fc28d70574ce11b840084e0ab5fb0 Mon Sep 17 00:00:00 2001 From: farazdy Date: Wed, 2 Oct 2024 06:20:07 +0330 Subject: [PATCH] added custom theme each post, category, group, product --- app/Helpers/Helper.php | 60 ++++++--- app/Http/Controllers/Admin/AreaController.php | 121 +++++++++++++++++- app/Http/Controllers/ClientController.php | 2 +- app/Models/Part.php | 9 +- .../2024_07_04_053952_create_parts_table.php | 3 +- resources/sass/panel/_common.scss | 3 + .../views/admin/areas/model-design.blade.php | 52 ++++++++ .../views/admin/groups/group-form.blade.php | 2 +- resources/views/client/category.blade.php | 6 +- resources/views/client/default-list.blade.php | 4 +- resources/views/client/gallery.blade.php | 4 +- resources/views/client/group.blade.php | 12 +- resources/views/client/invoice.blade.php | 4 +- resources/views/client/post.blade.php | 7 +- resources/views/client/product.blade.php | 25 ++++ resources/views/client/welcome.blade.php | 4 +- .../DenaAttachList/DenaAttachList.blade.php | 2 +- .../DenaAttachList/DenaAttachList.php | 6 +- .../CategoriesFavImageLinks.blade.php | 4 +- .../CategoriesFavImageLinks.php | 12 +- .../CategoriesGrid/CategoriesGrid.blade.php | 4 +- .../CategoriesGrid/CategoriesGrid.php | 18 +-- .../FavProductWithMeta.blade.php | 4 +- .../FavProductWithMeta/FavProductWithMeta.php | 12 +- .../AutoPlayClips/AutoPlayClips.blade.php | 2 +- .../clips/AutoPlayClips/AutoPlayClips.php | 6 +- .../CompareProducts/CompareProducts.php | 6 +- .../contact/MeloContact/MeloContact.blade.php | 12 +- .../contact/MeloContact/MeloContact.php | 12 +- .../floats/SimpleGoTop/SimpleGoTop.blade.php | 2 +- .../floats/SimpleGoTop/SimpleGoTop.php | 6 +- .../footer/FireFooter/FireFooter.blade.php | 8 +- .../segments/footer/FireFooter/FireFooter.php | 24 ++-- .../ParallaxFooter/ParallaxFooter.blade.php | 10 +- .../footer/ParallaxFooter/ParallaxFooter.php | 32 ++--- .../SimpleFooter/SimpleFooter.blade.php | 10 +- .../footer/SimpleFooter/SimpleFooter.php | 36 +++--- .../footer/WaveFooter/WaveFooter.blade.php | 6 +- .../segments/footer/WaveFooter/WaveFooter.php | 18 +-- .../GridGallery/GridGallery.blade.php | 4 +- .../galleries/GridGallery/GridGallery.php | 12 +- .../ParallaxHeader/ParallaxHeader.blade.php | 2 +- .../header/ParallaxHeader/ParallaxHeader.php | 8 +- .../ParallaxHeaderPin.blade.php | 2 +- .../ParallaxHeaderPin/ParallaxHeaderPin.php | 8 +- .../index/AuthorSlider/AuthorSlider.blade.php | 4 +- .../index/AuthorSlider/AuthorSlider.php | 22 ++-- .../index/CounterGrid/CounterGrid.blade.php | 6 +- .../index/CounterGrid/CounterGrid.php | 18 +-- .../GradientTextLink.blade.php | 6 +- .../GradientTextLink/GradientTextLink.php | 24 ++-- .../index/InlineMap/InlineMap.blade.php | 8 +- .../segments/index/InlineMap/InlineMap.php | 24 ++-- .../SimpleTextLink/SimpleTextLink.blade.php | 6 +- .../index/SimpleTextLink/SimpleTextLink.php | 18 +-- .../LianaInvoice/LianaInvoice.blade.php | 4 +- .../invoice/LianaInvoice/LianaInvoice.php | 6 +- .../login/LoginBigBg/LoginBigBg.blade.php | 2 +- .../segments/login/LoginBigBg/LoginBigBg.php | 8 +- .../LoginPatternBg/LoginPatternBg.blade.php | 2 +- .../login/LoginPatternBg/LoginPatternBg.php | 20 +-- .../segments/menu/AplMenu/AplMenu.blade.php | 2 +- .../views/segments/menu/AplMenu/AplMenu.php | 6 +- .../menu/DeebaMenu/DeebaMenu.blade.php | 4 +- .../segments/menu/DeebaMenu/DeebaMenu.php | 6 +- .../menu/RecetMenu/RecetMenu.blade.php | 2 +- .../segments/menu/RecetMenu/RecetMenu.php | 6 +- .../segments/menu/SideMenu/SideMenu.blade.php | 4 +- .../views/segments/menu/SideMenu/SideMenu.php | 18 +-- .../ParallaxShort/ParallaxShort.blade.php | 6 +- .../parallax/ParallaxShort/ParallaxShort.php | 22 ++-- .../post/PostSidebar/PostSidebar.blade.php | 4 +- .../segments/post/PostSidebar/PostSidebar.php | 6 +- .../LongHeightPosts/LongHeightPosts.blade.php | 12 +- .../posts/LongHeightPosts/LongHeightPosts.php | 20 +-- .../posts/NoLinkImage/NoLinkImage.blade.php | 4 +- .../posts/NoLinkImage/NoLinkImage.php | 12 +- .../PostIndexImage/PostIndexImage.blade.php | 12 +- .../posts/PostIndexImage/PostIndexImage.php | 12 +- .../PostsIconSimple/PostsIconSimple.blade.php | 8 +- .../posts/PostsIconSimple/PostsIconSimple.php | 16 +-- .../posts/PostsSlider/PostsSlider.blade.php | 4 +- .../posts/PostsSlider/PostsSlider.php | 18 +-- .../GridPostListSidebar.blade.php | 4 +- .../GridPostListSidebar.php | 6 +- .../SimplePostListSideBar.blade.php | 4 +- .../SimplePostListSideBar.php | 6 +- .../product/ProductKaren/ProductKaren.php | 6 +- .../TreeGridProducts.blade.php | 12 +- .../TreeGridProducts/TreeGridProducts.php | 66 +++++----- .../ProductGridSidebar.blade.php | 4 +- .../ProductGridSidebar/ProductGridSidebar.php | 6 +- .../slider/ParallaxSlider/ParallaxSlider.php | 12 +- routes/web.php | 4 +- 94 files changed, 672 insertions(+), 446 deletions(-) create mode 100644 resources/views/admin/areas/model-design.blade.php create mode 100644 resources/views/client/product.blade.php diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index f4e1177..3d237e6 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -757,12 +757,19 @@ function hasPart($areaName) /** * get parts of area * @param $areaName + * @param null $custom custom theme * @return Part[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Part_C */ -function getParts($areaName) +function getParts($areaName, $custom = null) { - $a = Area::where('name', $areaName)->first(); - return $a->parts()->orderBy('sort')->get(); + if ($custom != null) { + + $customs = Part::where('custom', $custom)->orderBy('sort'); + if ($customs->count() > 0) { + return $customs->get(); + } + } + return Area::where('name', $areaName)->first()->parts()->orderBy('sort')->get(); } @@ -1278,7 +1285,8 @@ function sendingSMS($text, $number, $args) * @param $html * @return array */ -function generateTOC($html) { +function generateTOC($html) +{ // Load HTML into a DOMDocument for parsing $doc = new DOMDocument(); @$doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); @@ -1333,7 +1341,8 @@ function generateTOC($html) { * @param $counter * @return string */ -function generateHeadingID($text, $counter) { +function generateHeadingID($text, $counter) +{ // Convert to lowercase and replace non-alphanumeric characters with dashes $id = strtolower(preg_replace('/[^a-zA-Z0-9]+/', '-', $text)); @@ -1352,7 +1361,8 @@ function generateHeadingID($text, $counter) { } // The buildTOC function remains unchanged -function buildTOC($items) { +function buildTOC($items) +{ $html = '