]> _ Git - fluidbook-v3.git/commitdiff
wait #7480 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Apr 2025 17:38:01 +0000 (19:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Apr 2025 17:38:01 +0000 (19:38 +0200)
.docker/dev/docker-compose.yml
.idea/workspace.xml
framework/application/configs/application.ini
framework/application/views/scripts/common/footer.phtml
framework/library/CubeIT/Bootstrap/Locale.php
framework/library/CubeIT/Bootstrap/Navigation.php
framework/library/CubeIT/Controller/SeoController.php
framework/library/CubeIT/Util/Locale.php

index cbf6223dff0b0173327141aab77b4036ea286197..19d85330b1a1b23093100f1759479a1bac2d8e92 100644 (file)
@@ -9,8 +9,8 @@ services:
             - './www/:/application/'
             - './config/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf'
         environment:
-            VIRTUAL_HOST: dev.fluidbook.com,en.dev.fluidbook.com,dev.elearning.fluidbook.com
-            LETSENCRYPT_HOST: dev.fluidbook.com,en.dev.fluidbook.com,dev.elearning.fluidbook.com
+            VIRTUAL_HOST: dev.fluidbook.com,en.dev.fluidbook.com,dev.elearning.fluidbook.com,fr.dev.elearning.fluidbook.com
+            LETSENCRYPT_HOST: dev.fluidbook.com,en.dev.fluidbook.com,dev.elearning.fluidbook.com,fr.dev.elearning.fluidbook.com
         networks:
             - fluidbook-v3-dev
             - nginxproxy
index 812d48492d2fad5d5c6b85f0051f735faa2e734f..7e59b8dd69eed9555c3c0b6ecfee69c1e8d2f774 100644 (file)
@@ -5,13 +5,14 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="530ffb50-16c9-4bb3-ad22-e76f531eb78c" name="Default" comment="wip #7474">
-      <change afterPath="$PROJECT_DIR$/.docker/syncprodtodev" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/.docker/syncprodtodev.exclude" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/.docker/config/httpd/httpd.conf" beforeDir="false" afterPath="$PROJECT_DIR$/.docker/config/httpd/httpd.conf" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.docker/dev/docker-compose.yml" beforeDir="false" afterPath="$PROJECT_DIR$/.docker/dev/docker-compose.yml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/framework/application/configs/application.ini" beforeDir="false" afterPath="$PROJECT_DIR$/framework/application/configs/application.ini" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/index.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/application/views/scripts/common/footer.phtml" beforeDir="false" afterPath="$PROJECT_DIR$/framework/application/views/scripts/common/footer.phtml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/library/CubeIT/Bootstrap/Locale.php" beforeDir="false" afterPath="$PROJECT_DIR$/framework/library/CubeIT/Bootstrap/Locale.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/library/CubeIT/Bootstrap/Navigation.php" beforeDir="false" afterPath="$PROJECT_DIR$/framework/library/CubeIT/Bootstrap/Navigation.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/library/CubeIT/Controller/SeoController.php" beforeDir="false" afterPath="$PROJECT_DIR$/framework/library/CubeIT/Controller/SeoController.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/library/CubeIT/Util/Locale.php" beforeDir="false" afterPath="$PROJECT_DIR$/framework/library/CubeIT/Util/Locale.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="hideEmptyMiddlePackages" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent"><![CDATA[{
-  "keyToString": {
-    "RunOnceActivity.OpenProjectViewOnStart": "true",
-    "RunOnceActivity.ShowReadmeOnStart": "true",
-    "RunOnceActivity.git.unshallow": "true",
-    "WebServerToolWindowFactoryState": "true",
-    "WebServerToolWindowPanel.toolwindow.highlight.mappings": "true",
-    "WebServerToolWindowPanel.toolwindow.highlight.symlinks": "true",
-    "WebServerToolWindowPanel.toolwindow.show.date": "false",
-    "WebServerToolWindowPanel.toolwindow.show.permissions": "false",
-    "WebServerToolWindowPanel.toolwindow.show.size": "false",
-    "git-widget-placeholder": "master",
-    "ignore.virus.scanning.warn.message": "true",
-    "kotlin-language-version-configured": "true",
-    "last_opened_file_path": "D:/Works/FluidbookWebV3/.docker",
-    "node.js.detected.package.eslint": "true",
-    "node.js.detected.package.tslint": "true",
-    "node.js.selected.package.eslint": "(autodetect)",
-    "node.js.selected.package.tslint": "(autodetect)",
-    "nodejs_package_manager_path": "npm",
-    "project.structure.last.edited": "Project",
-    "project.structure.proportion": "0.0",
-    "project.structure.side.proportion": "0.2",
-    "ruby.rails.projectView.checked": "true",
-    "settings.editor.selected.configurable": "project.propVCSSupport.DirectoryMappings",
-    "vue.rearranger.settings.migration": "true"
+  <component name="PropertiesComponent">{
+  &quot;keyToString&quot;: {
+    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
+    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
+    &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
+    &quot;WebServerToolWindowFactoryState&quot;: &quot;true&quot;,
+    &quot;WebServerToolWindowPanel.toolwindow.highlight.mappings&quot;: &quot;true&quot;,
+    &quot;WebServerToolWindowPanel.toolwindow.highlight.symlinks&quot;: &quot;true&quot;,
+    &quot;WebServerToolWindowPanel.toolwindow.show.date&quot;: &quot;false&quot;,
+    &quot;WebServerToolWindowPanel.toolwindow.show.permissions&quot;: &quot;false&quot;,
+    &quot;WebServerToolWindowPanel.toolwindow.show.size&quot;: &quot;false&quot;,
+    &quot;git-widget-placeholder&quot;: &quot;master&quot;,
+    &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
+    &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
+    &quot;last_opened_file_path&quot;: &quot;D:/Works/FluidbookWebV3/.docker&quot;,
+    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
+    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
+    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
+    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
+    &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
+    &quot;project.structure.last.edited&quot;: &quot;Project&quot;,
+    &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
+    &quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
+    &quot;ruby.rails.projectView.checked&quot;: &quot;true&quot;,
+    &quot;settings.editor.selected.configurable&quot;: &quot;project.propVCSSupport.DirectoryMappings&quot;,
+    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
   }
-}]]></component>
+}</component>
   <component name="RecentsManager">
     <key name="CopyFile.RECENT_KEYS">
       <recent name="D:\Works\FluidbookWebV3\.docker" />
       <workItem from="1743685828952" duration="2161000" />
       <workItem from="1744010760355" duration="3501000" />
       <workItem from="1744211486656" duration="5649000" />
+      <workItem from="1744294067933" duration="116000" />
+      <workItem from="1744297988591" duration="226000" />
+      <workItem from="1744391230839" duration="1813000" />
     </task>
     <task id="LOCAL-00117" summary="fix #1407 @1">
       <created>1494411210038</created>
           <line>338</line>
           <option name="timeStamp" value="1" />
         </line-breakpoint>
+        <line-breakpoint enabled="true" type="php">
+          <url>file://$PROJECT_DIR$/framework/library/CubeIT/Bootstrap/Locale.php</url>
+          <line>38</line>
+          <option name="timeStamp" value="2" />
+        </line-breakpoint>
       </breakpoints>
     </breakpoint-manager>
   </component>
index 59e5215257e0410d73fc82622f8c511da7fbe3b8..d0b1aaf650433272eedb82932cbd9c2194e814ff 100644 (file)
@@ -57,7 +57,7 @@ privacy.analytics = 1
 
 [learning : production]
 
-dev=false
+dev = false
 
 seo.robots = false
 
@@ -65,11 +65,12 @@ webhost = elearning.fluidbook.com
 
 locales.en = elearning.fluidbook.com
 locales.fr = fr.elearning.fluidbook.com
+locales.ignore[] = fr
 
 database.params.dbname = fluidbook-v3-elearning
 
 [testing-learning : learning]
-dev=false
+dev = false
 
 seo.robots = false
 
@@ -83,6 +84,7 @@ webhost = dev.elearning.fluidbook.com
 locales.en = dev.elearning.fluidbook.com
 locales.fr = fr.dev.elearning.fluidbook.com
 
+
 database.params.dbname = fluidbook-v3-elearning
 database.params.host = fluidbook-v3-dev-mariadb
 
index f3bd87c1b60cb30b20d4b3655cfcb990c15f5bdb..2df8e18ad999af677e584a8bf8079da7033a9370 100644 (file)
@@ -68,21 +68,21 @@ foreach ($this->option('social_networks') as $social) {
     if (!file_exists($SVG_file)) continue;\r
     $SVG = file_get_contents(PUBLIC_PATH . CubeIT_View_Helper_ImageCms::getPath($social['icon']));\r
 \r
-       $res .= '<style type="text/css">';\r
-       $res .= '#s-' . $social_ID . ':hover{background-color: ' . $social['color'] . ';border-color: ' . $social['color'] . ';}';\r
-       $res .= '</style>';\r
-       $res .= $this->link($SVG, $social['url'], ['id' => 's-' . $social_ID,\r
-                                                     'title' => $social['title'],\r
-                                                     'class' => 'social-link',\r
-                                                     'itemprop' => 'sameAs',\r
-                                                     'target' => '_blank',\r
-                                                     'rel' => 'noopener',\r
-                                                     'data-event' => [\r
-                                                         'category' => 'social',\r
-                                                         'action' => 'go',\r
-                                                         'label' => $social['title']\r
-                                                  ]\r
-                                              ]);\r
+    $res .= '<style type="text/css">';\r
+    $res .= '#s-' . $social_ID . ':hover{background-color: ' . $social['color'] . ';border-color: ' . $social['color'] . ';}';\r
+    $res .= '</style>';\r
+    $res .= $this->link($SVG, $social['url'], ['id' => 's-' . $social_ID,\r
+        'title' => $social['title'],\r
+        'class' => 'social-link',\r
+        'itemprop' => 'sameAs',\r
+        'target' => '_blank',\r
+        'rel' => 'noopener',\r
+        'data-event' => [\r
+            'category' => 'social',\r
+            'action' => 'go',\r
+            'label' => $social['title']\r
+        ]\r
+    ]);\r
 }\r
 $res .= '</div>'; // .footer-external\r
 \r
@@ -98,9 +98,11 @@ $res .= '</footer>';
 $res .= '<footer class="legal">';\r
 $res .= '<div class="footer-inner">';\r
 \r
-$res .= '<div class="locale-nav">';\r
-$res .= $this->localeNavigation(true, CubeIT_View_Helper_LocaleNavigation::BIGRAMME);\r
-$res .= '</div>'; // .locale-nav\r
+if (count(Bootstrap::getInstance()->getNotIgnoredLocales()) > 1) {\r
+    $res .= '<div class="locale-nav">';\r
+    $res .= $this->localeNavigation(true, CubeIT_View_Helper_LocaleNavigation::BIGRAMME);\r
+    $res .= '</div>'; // .locale-nav\r
+}\r
 \r
 $res .= $this->markupDotclear($this->option('footer'));\r
 \r
index 371acebf8f7530adbf4e40c476f310f73c87a3b4..cee65cce97641d74c14df08392e8eb6eed20e54a 100644 (file)
@@ -37,6 +37,9 @@ class CubeIT_Bootstrap_Locale extends CubeIT_Bootstrap_Auth
     public function getOptionLocales()
     {
         $res = $this->_getLocalesOption();
+        if (isset($res['ignore'])) {
+            unset($res['ignore']);
+        }
         if (isset($res['hub'])) {
             unset($res['hub']);
         }
@@ -132,6 +135,30 @@ class CubeIT_Bootstrap_Locale extends CubeIT_Bootstrap_Auth
         return $this->getOption('localesEnabled');
     }
 
+
+    public function getNotIgnoredLocales()
+    {
+        $locales = $this->getAppLocales();
+        $res = [];
+
+        foreach ($locales as $locale) {
+            if (!$this->isIgnoredLocale($locale)) {
+                $res[] = $locale;
+            }
+        }
+        return $res;
+    }
+
+    public function isIgnoredLocale($locale = null)
+    {
+        $locale = $locale ?? $this->getActiveLocale();
+        $opt = $this->_getLocalesOption();
+        if (!isset($opt['ignore']) || !is_array($opt['ignore']) || !in_array($locale, $opt['ignore'])) {
+            return false;
+        }
+        return true;
+    }
+
     /**
      * @return string
      */
index 65152486d94f37c0f225b76f15af2a73111caa32..7b0aba4352025304e934fdb65cd3532ae41f304c 100644 (file)
@@ -191,9 +191,13 @@ class CubeIT_Bootstrap_Navigation extends CubeIT_Bootstrap_Locale
         $longTitle = isset($t['longTitle']) && $t['longTitle'] != '' ? $t['longTitle'] : $title;
         $seoUrl = isset($t['seourl']) && $t['seourl'] != '' ? $t['seourl'] : '';
         $robots = isset($t['robots']) ? $t['robots'] == true : true;
+        $ignored = false;
 
         if ($locale) {
             $domain = $this->getLocaleDomain($locale);
+            if ($this->isIgnoredLocale($locale)) {
+                $ignored = true;
+            }
             $page = new CubeIT_Navigation_Page_Locale();
             $page->setId($locale . '/' . $r->id);
             $url = $this->_makeURL($r, $seoUrl, $locale, $title, $parent, $isAdmin);
@@ -217,7 +221,7 @@ class CubeIT_Bootstrap_Navigation extends CubeIT_Bootstrap_Locale
         $page->setEditable(true);
         $page->setName($r->label);
         $page->setUri($url);
-        $page->setSitemap($robots);
+        $page->setSitemap($robots && !$ignored);
         $page->setVariant($this->getVariant());
         if ($domain['domain']) {
             $page->setDomain($domain['domain']);
index 2853798a1941c64c9c628188aadd11a76fee9d1c..9d56c801d7b14947821a489389b112af6ca7863a 100644 (file)
@@ -1,75 +1,85 @@
 <?php
 
-class CubeIT_Controller_SeoController extends CubeIT_Controller_LayoutlessController {
+class CubeIT_Controller_SeoController extends CubeIT_Controller_LayoutlessController
+{
 
-       public function robotsAction() {
+    public function robotsAction()
+    {
 
 
-               $this->getResponse()->setHeader('Content-type', 'text/plain', true);
-               $this->getResponse()->clearBody();
+        $this->getResponse()->setHeader('Content-type', 'text/plain', true);
+        $this->getResponse()->clearBody();
 
-               $robotsConfig = $this->getOpt('seo.robots', true);
+        $robotsConfig = $this->getOpt('seo.robots', true);
+        if (Bootstrap::getInstance()->isIgnoredLocale()) {
+            $robotsConfig = false;
+        }
 
-               $robots = 'User-agent: *' . "\n";
-               if ($robotsConfig) {
-                       $robots .= 'Disallow: /admin/' . "\n";
-                       $robots .= 'Disallow: /ajax/' . "\n";
-                       $robots .= 'Disallow: /ajaxpopup/' . "\n";
-               } else {
-                       $robots .= 'Disallow: /' . "\n";
-               }
-               if ($robotsConfig) {
-                       $robots .= 'Sitemap: ' . SITE_PROTOCOL . $this->getOption('webhost') . '/sitemap' . "\n";
-               }
+        $robots = 'User-agent: *' . "\n";
+        if ($robotsConfig) {
+            $robots .= 'Disallow: /admin/' . "\n";
+            $robots .= 'Disallow: /ajax/' . "\n";
+            $robots .= 'Disallow: /ajaxpopup/' . "\n";
+        } else {
+            $robots .= 'Disallow: /' . "\n";
+        }
+        if ($robotsConfig) {
+            $robots .= 'Sitemap: ' . SITE_PROTOCOL . $this->getOption('webhost') . '/sitemap' . "\n";
+        }
 
-               echo $robots;
-               return;
-       }
+        echo $robots;
+        return;
+    }
 
-       public function googleverificationAction() {
-               $this->getResponse()->setHeader('Content-type', 'text/html', true);
-               $this->getResponse()->clearBody();
-               $seo = $this->getOption('seo');
-               echo 'google-site-verification: ' . $this->getParam('code');
-       }
+    public function googleverificationAction()
+    {
+        $this->getResponse()->setHeader('Content-type', 'text/html', true);
+        $this->getResponse()->clearBody();
+        $seo = $this->getOption('seo');
+        echo 'google-site-verification: ' . $this->getParam('code');
+    }
 
-       public function bingverificationAction() {
-               $this->getResponse()->setHeader('Content-type', 'text/xml', true);
-               $this->getResponse()->clearBody();
-               $seo = $this->getOption('seo');
-               echo '<?xml version="1.0"?>
+    public function bingverificationAction()
+    {
+        $this->getResponse()->setHeader('Content-type', 'text/xml', true);
+        $this->getResponse()->clearBody();
+        $seo = $this->getOption('seo');
+        echo '<?xml version="1.0"?>
 <users>
        <user>' . $seo['bing'] . '</user>
 </users>';
-       }
+    }
 
-       public function sitemapAction() {
-               $this->getResponse()->setHeader('Content-type', 'text/xml', true);
-               $this->getResponse()->clearBody();
+    public function sitemapAction()
+    {
+        $this->getResponse()->setHeader('Content-type', 'text/xml', true);
+        $this->getResponse()->clearBody();
 
-               $navigation = $this->getSitemapNavigation();
+        $navigation = $this->getSitemapNavigation();
 
-               echo $this->view->navigation($navigation)
-                       ->sitemap()
-                       ->setFormatOutput(false)
-                       ->setMinDepth($this->_getSitemapMinDepth($navigation))
-                       ->setRole();
-               return;
-       }
+        echo $this->view->navigation($navigation)
+            ->sitemap()
+            ->setFormatOutput(false)
+            ->setMinDepth($this->_getSitemapMinDepth($navigation))
+            ->setRole();
+        return;
+    }
 
-       protected function getSitemapNavigation() {
-               return $this->getNavigation();
-       }
+    protected function getSitemapNavigation()
+    {
+        return $this->getNavigation();
+    }
 
-       protected function _getSitemapMinDepth($navigation) {
-               $minDepth = 0;
-               if ($navigation instanceof CubeIT_Navigation) {
-                       $minDepth == 1;
-               }
-               if ($navigation instanceof CubeIT_Navigation_Locale) {
-                       $minDepth = 2;
-               }
-               return $minDepth;
-       }
+    protected function _getSitemapMinDepth($navigation)
+    {
+        $minDepth = 0;
+        if ($navigation instanceof CubeIT_Navigation) {
+            $minDepth == 1;
+        }
+        if ($navigation instanceof CubeIT_Navigation_Locale) {
+            $minDepth = 2;
+        }
+        return $minDepth;
+    }
 
 }
\ No newline at end of file
index 0f7a1445c03b8347482bb90555602033054ea353..ed784839e495a29341b686639b99122a74c4b6df 100644 (file)
@@ -27,6 +27,9 @@ class CubeIT_Util_Locale
             if ($k == 'hub') {
                 continue;
             }
+            if($k=='ignore'){
+                continue;
+            }
             $e = explode('/', $l, 2);
             $r = array('domain' => '', 'segment' => '', 'first' => false);