From fa60944439e0fe2ceeb0d90fb715abd006fe1073 Mon Sep 17 00:00:00 2001 From: GP_DV Date: Wed, 2 Apr 2025 15:11:14 +0300 Subject: [PATCH] Task 4067 --- .user.ini | 0 wp-content/ai1wm-backups/.htaccess | 9 - wp-content/ai1wm-backups/index.html | 1 - wp-content/ai1wm-backups/index.php | 1 - wp-content/ai1wm-backups/robots.txt | 3 - wp-content/ai1wm-backups/web.config | 13 -- .../modules/header/module-ajax-controller.php | 0 .../modules/header/module-controller.php | 65 ++++++++ .../modules/header/module.template_ENG.twig | 154 ------------------ .../modules/header/module.template_RU.twig | 150 ----------------- .../themes/cosmopet/templates/header.twig | 26 +-- 11 files changed, 80 insertions(+), 342 deletions(-) delete mode 100644 .user.ini delete mode 100644 wp-content/ai1wm-backups/.htaccess delete mode 100644 wp-content/ai1wm-backups/index.html delete mode 100644 wp-content/ai1wm-backups/index.php delete mode 100644 wp-content/ai1wm-backups/robots.txt delete mode 100644 wp-content/ai1wm-backups/web.config delete mode 100644 wp-content/themes/cosmopet/modules/header/module-ajax-controller.php delete mode 100644 wp-content/themes/cosmopet/modules/header/module.template_ENG.twig delete mode 100644 wp-content/themes/cosmopet/modules/header/module.template_RU.twig diff --git a/.user.ini b/.user.ini deleted file mode 100644 index e69de29..0000000 diff --git a/wp-content/ai1wm-backups/.htaccess b/wp-content/ai1wm-backups/.htaccess deleted file mode 100644 index a9e229d..0000000 --- a/wp-content/ai1wm-backups/.htaccess +++ /dev/null @@ -1,9 +0,0 @@ - -AddType application/octet-stream .wpress - - -DirectoryIndex index.php - - -Options -Indexes - \ No newline at end of file diff --git a/wp-content/ai1wm-backups/index.html b/wp-content/ai1wm-backups/index.html deleted file mode 100644 index cce3445..0000000 --- a/wp-content/ai1wm-backups/index.html +++ /dev/null @@ -1 +0,0 @@ -Kangaroos cannot jump here \ No newline at end of file diff --git a/wp-content/ai1wm-backups/index.php b/wp-content/ai1wm-backups/index.php deleted file mode 100644 index cce3445..0000000 --- a/wp-content/ai1wm-backups/index.php +++ /dev/null @@ -1 +0,0 @@ -Kangaroos cannot jump here \ No newline at end of file diff --git a/wp-content/ai1wm-backups/robots.txt b/wp-content/ai1wm-backups/robots.txt deleted file mode 100644 index 7c8ec89..0000000 --- a/wp-content/ai1wm-backups/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -User-agent: * -Disallow: /ai1wm-backups/ -Disallow: /wp-content/ai1wm-backups/ \ No newline at end of file diff --git a/wp-content/ai1wm-backups/web.config b/wp-content/ai1wm-backups/web.config deleted file mode 100644 index 4f2998e..0000000 --- a/wp-content/ai1wm-backups/web.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/wp-content/themes/cosmopet/modules/header/module-ajax-controller.php b/wp-content/themes/cosmopet/modules/header/module-ajax-controller.php deleted file mode 100644 index e69de29..0000000 diff --git a/wp-content/themes/cosmopet/modules/header/module-controller.php b/wp-content/themes/cosmopet/modules/header/module-controller.php index dc10d56..ca66363 100644 --- a/wp-content/themes/cosmopet/modules/header/module-controller.php +++ b/wp-content/themes/cosmopet/modules/header/module-controller.php @@ -1,4 +1,69 @@ 'page', + 'name' => 'o-kompanii', + 'limit' => 1 + ]); + + $production_page = Timber::get_post([ + 'post_type' => 'page', + 'name' => 'proizvodstvo', // Обратите внимание на возможную опечатку в slug + 'limit' => 1 + ]); + + // Устанавливаем URL для страницы "О компании" + if ($about_page) { + $context['about_url'] = '/o-kompanii/'; + $context['about_url_en'] = '/en/about-us/'; + } else { + $context['about_url'] = 'https://cosmopet.shop/chto-takoe-entoprotein/'; + $context['about_url_en'] = 'https://cosmopet.shop/en/about-2/'; + } + + // Устанавливаем URL для страницы "Производство" + if ($production_page) { + $context['production_url'] = '/proizvodstvo/'; + $context['production_url_en'] = '/en/production/'; + } else { + $context['production_url'] = 'https://cosmopet.shop/proizvodstvo/'; + $context['production_url_en'] = 'https://cosmopet.shop/en/production/'; + } + if (!is_home_page_posts_archive()) { + $context['front_url'] = "/"; + $context['front_url_en'] = "/en/main/"; + } + else{ + $context['front_url'] = "https://cosmopet.shop/"; + $context['front_url_en'] = "https://cosmopet.shop/en/main/"; + } + + return $context; +}); ?> \ No newline at end of file diff --git a/wp-content/themes/cosmopet/modules/header/module.template_ENG.twig b/wp-content/themes/cosmopet/modules/header/module.template_ENG.twig deleted file mode 100644 index 2fabde6..0000000 --- a/wp-content/themes/cosmopet/modules/header/module.template_ENG.twig +++ /dev/null @@ -1,154 +0,0 @@ -
-
- -
- - PRODUCTS - - For cats - - For dogs - -
- - - -
- -
- - - - - - -
-
-
- -
-
    - {{ function('pll_the_languages', {'echo': false, 'display_names_as': 'slug'}) }} -
-
-
-
-
- - -
- -
-
-
-
- For cats - -
-
- For dogs - -
-
-
- - -
\ No newline at end of file diff --git a/wp-content/themes/cosmopet/modules/header/module.template_RU.twig b/wp-content/themes/cosmopet/modules/header/module.template_RU.twig deleted file mode 100644 index 3d5da02..0000000 --- a/wp-content/themes/cosmopet/modules/header/module.template_RU.twig +++ /dev/null @@ -1,150 +0,0 @@ -
- -
- - - - - - -
-
-
- -
-
    - {{ function('pll_the_languages', {'echo': false, 'display_names_as': 'slug'}) }} -
-
-
-
-
- -
\ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/header.twig b/wp-content/themes/cosmopet/templates/header.twig index c2b1637..86e36f2 100644 --- a/wp-content/themes/cosmopet/templates/header.twig +++ b/wp-content/themes/cosmopet/templates/header.twig @@ -1,3 +1,10 @@ +{# Получаем ID страницы блога из настроек #} +{% set posts_page_id = function('get_option', 'page_for_posts') %} + +{# Получаем URL этой страницы #} +{% set blog_url = function('get_permalink', posts_page_id) %} + +