--- /dev/null
+<?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
$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);