/**
  * Define page Org html with ul/li balises.
  *
  * <code>
  *  {% set options_chartpage = {
  *       'entity':'PiAppGedmoBundle:Menu',
  *       'category':'Menuwrapper',
  *       'action':'renderDefault',
  *       'menu': 'organigram',
  *       'fields':{
  *                  '0':{'content':'title', 'class':'pi_tree_desc'}
  *              },
  *       'id':'orga' } %}
  *  {{ renderJquery('MENU', 'org-chart-page', options_chartpage )|raw }}
  * <code> 
  *
  * @param array $options
  * 
  * @access public
  * @return string
  * @author Etienne de Longeaux <*****@*****.**>
  */
 public function organigramMenu($options = null)
 {
     // Options management
     if (!isset($options['entity']) || empty($options['entity'])) {
         throw ExtensionException::optionValueNotSpecified('entity', __CLASS__);
     }
     if (!isset($options['category'])) {
         throw ExtensionException::optionValueNotSpecified('category', __CLASS__);
     }
     if (!isset($options['locale'])) {
         $locale = $this->container->get('request')->getLocale();
     } else {
         $locale = $options['locale'];
     }
     $TreeManager = $this->container->get('pi_app_admin.manager.tree');
     if ($TreeManager instanceof PiTreeManager) {
         return $TreeManager->defaultOrganigram($locale, $options['entity'], $options['category'], $options);
     } else {
         throw ExtensionException::serviceUndefined('PiTreeManager');
     }
 }
 /**
  * Define page Org html with ul/li balises.
  *
  * @param    array $options
  * @access public
  * @return string
  *
  * @author Etienne de Longeaux <*****@*****.**>
  */
 public function pageMenu()
 {
     $PageManager = $this->container->get('pi_app_admin.manager.page');
     if ($PageManager instanceof PiPageManager) {
         $htmlTree = $PageManager->getChildrenHierarchyRub();
         $htmlTree = $PageManager->setTreeWithPages($htmlTree);
         $htmlTree = $PageManager->setHomePage($htmlTree);
         $htmlTree = $PageManager->setNode($htmlTree);
         return $htmlTree;
     } else {
         throw ExtensionException::serviceUndefined('PiPageManager');
     }
 }
 /**
  * Define all slides of a category of a slider entity.
  *
  * <code>
  *
  *  {% set options_slider = {
  *       'entity':'Slider',
  *       'category':'Menuwrapper',
  *       'action':'renderDefault',
  *       'menu': 'default',
  *       'id':'orga' } %}
  *  {{ renderJquery('SLIDER', 'slide-default', options_slider )|raw }}
  *
  * <code>
  * 
  * @param    array $options
  * @access public
  * @return string
  *
  * @author Etienne de Longeaux <*****@*****.**>
  */
 public function entityMenu($options = null)
 {
     if (!isset($options['entity']) || empty($options['entity'])) {
         throw ExtensionException::optionValueNotSpecified('entity', __CLASS__);
     }
     if (!isset($options['category'])) {
         throw ExtensionException::optionValueNotSpecified('category', __CLASS__);
     }
     if (!isset($options['locale'])) {
         $locale = $this->container->get('request')->getLocale();
     } else {
         $locale = $options['locale'];
     }
     if (!isset($options['template']) || empty($options['template'])) {
         $options['template'] = 'slide.html.twig';
     }
     // we take slides ​​depending on options
     $SliderManager = $this->container->get('pi_app_admin.manager.slider');
     if ($SliderManager instanceof PiSliderManager) {
         return $SliderManager->getSlider($locale, $options['entity'], $options['category'], $options['template'], $options);
     } else {
         throw ExtensionException::serviceUndefined('PiSliderManager');
     }
 }
 /**
  * Search all page based on the query.
  *
  * <code>
  *        {% set options_searchlucene = {
  *                'action':'renderpage',
  *                'menu': 'searchpage' 
  *                'template': 'searchlucene-result.html.twig',
  *                'locale': "fr",
  *                "MaxResults":0
  *                'searchBool': "true",
  *                'searchBoolType': "AND",
  *                'searchByMotif': "true",
  *                'setMinPrefixLength': "0",
  *                'getResultSetLimit': "0",
  *                "searchFields": [
  *                                    {"sortField":"Contents","sortType":"SORT_STRING","sortOrder":"SORT_ASC"},
  *                                    {"sortField":"Key","sortType":"SORT_NUMERIC","sortOrder":"SORT_DESC"}
  *                                ]
  *                } 
  *        %}
  *        {{ renderJquery('SEARCH', 'search-lucene', options_searchlucene )|raw }}
  * </code>
  * 
  * @param    array $options
  * @access public
  * @return array
  *
  * @author Etienne de Longeaux <*****@*****.**>
  */
 public function searchpageMenu($options = null)
 {
     // Options management
     if (isset($options['locale'])) {
         $this->locale = $options['locale'];
     }
     $query = $this->container->get('request')->query->get('query_search');
     $searchManager = $this->container->get('pi_app_admin.manager.search_lucene');
     if ($searchManager instanceof PiLuceneManager) {
         return $result_searchpage = $searchManager->searchPage($query, $options, $this->locale);
     } else {
         throw ExtensionException::serviceUndefined('PiSearchLuceneManager');
     }
 }