]> _ Git - fluidbook-v3.git/commitdiff
CMS pages tag list element for footer menus WIP #481 @2
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 22 Jun 2016 16:41:17 +0000 (16:41 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 22 Jun 2016 16:41:17 +0000 (16:41 +0000)
framework/application/forms/CMS/Element/PagesTagList.php [new file with mode: 0644]
framework/application/forms/Settings.php
less/102-footer.less

diff --git a/framework/application/forms/CMS/Element/PagesTagList.php b/framework/application/forms/CMS/Element/PagesTagList.php
new file mode 100644 (file)
index 0000000..c8f715b
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+
+class Fluidbook_Form_CMS_Element_PagesTagList extends CubeIT_Form_Element_TagList {
+
+    public function init() {
+        parent::init();
+        $this->setLabel('');
+        $this->setAttrib('minChars', 1);
+        $this->setAttrib('tagsPosition', "after");
+        $this->setAttrib('searchAnywhere', 1); // Search anywhere in the word :)
+        //$this->setAttrib('manageurl', '/admin/ajaxpopup/openselectlist/Fluidbook_Form_CMS_Sub_Pages/' . $this->getName());
+        $this->setAttrib('displayListManagement', 0);
+        $this->_setOptions();
+    }
+
+    protected function _setOptions() {
+
+        $bootstrap = Bootstrap::getInstance();
+
+        /* @var $container Zend_Navigation_Page */
+        $nav = $bootstrap->getNavigation();
+
+        $iteratorMode = RecursiveIteratorIterator::SELF_FIRST;
+        $multilang = $bootstrap->isMultilang();
+
+        if ($multilang) {
+            $container = $nav->findOneByLabel($bootstrap->getDefaultLocale());
+        } else {
+            $container = $nav;
+        }
+
+        $it = new RecursiveIteratorIterator($container, $iteratorMode);
+
+        $options = array();
+
+        foreach ($it as $p) {
+            /* @var $p CubeIT_Navigation_Page */
+            $id = $p->getId();
+            $e = explode('/', $id);
+            if ($multilang) {
+                array_shift($e);
+            }
+            if ($e[0] <= 0) {
+                continue;
+            }
+            $id = implode('/', $e);
+
+            $title = $p->getTitle();
+            if ($title == '') {
+                $title = $p->getLabel();
+            }
+            $level = $it->getDepth();
+
+            //$options[$id] = str_repeat('---- ', $level) . $id . ' - ' . $title;
+            $options[$id] = "[$id] - $title";
+        }
+
+        fb($options, 'page options');
+
+        $this->setMultiOptions($options);
+    }
+
+    protected function _refreshOptions() {
+
+    }
+}
\ No newline at end of file
index fc72ab4526e48ea977909a4dc50a182768a2872c..36fc21162f4d6a957956c8da6549ecc83a1cf8c2 100644 (file)
@@ -23,6 +23,11 @@ class Fluidbook_Form_Settings extends CubeIT_Form_Settings {
                $adresse->setLabel('Adresse');
                $this->addSubFormLocalized($adresse, 'address');
 
+               $footer_menu_main = new Fluidbook_Form_CMS_Element_PagesTagList('footer_menu_main');
+               $footer_menu_main->setLabel('Pages for menu "Plan du site"');
+               $footer_menu_main->setAttrib('placeholder', 'Tapez une page');
+               $this->addElement($footer_menu_main);
+
                $footer = new CubeIT_Form_Element_Markitup('footer');
                $footer->setLabel('Footer');
                $footer->setAttrib('rows', 6);
index 947c828fabfb1bad135521e4239b0d5d403e825c..90aecf2ded071d589ffd2cf94b8ff84208783ab3 100644 (file)
@@ -20,4 +20,5 @@ footer.legal {
   background-color: @color-footer-bg-secondary;
   color: #5c6268;
   padding: 40px 85px;
+  font-size: 14px;
 }
\ No newline at end of file