]> _ Git - cubist_cms-back.git/commitdiff
wip #2922 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 6 Sep 2019 09:02:08 +0000 (11:02 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 6 Sep 2019 09:02:08 +0000 (11:02 +0200)
src/app/Magic/Models/CubistMagicPageModel.php

index e19ae7f74adbb1164303beb8f3113e863e605100..61617d08c8e56b393fb1075faff8127d9e9a235f 100644 (file)
@@ -9,11 +9,40 @@ class CubistMagicPageModel extends CubistMagicModel
     public function setFields()
     {
         parent::setFields();
+
         $this->_seo();
         if (config('cubist.internal_search', false)) {
             $this->_internalSearch();
         }
         $this->_social();
+        $this->_menu();
+    }
+
+    public function _menu()
+    {
+        $tab = 'Menus';
+
+        $options = ['children' => 'Cette page et tous ces enfants', 'page' => 'Cette page uniquement', 'no' => 'Non intégrée'];
+
+        $this->addField(['name' => 'menu_desktop',
+            'label' => 'Intégration dans le menu « Desktop »',
+            'default' => 'children',
+            'type' => 'SelectFromArray',
+            'translatable' => false,
+            'allows_null' => false,
+            'options' => $options,
+            'tab' => $tab]);
+
+        $options = array_merge(['desktop' => 'Comme le menu « Desktop »'], $options);
+
+        $this->addField(['name' => 'menu_mobile',
+            'label' => 'Intégration dans le menu « Mobile »',
+            'default' => 'desktop',
+            'type' => 'SelectFromArray',
+            'translatable' => false,
+            'allows_null' => false,
+            'options' => $options,
+            'tab' => $tab]);
     }
 
     protected function _internalSearch()