Controller/WikiTagController.php
changeset 98 b307fcd1435a
parent 95 5d10273e892a
child 102 d1af10ee0aa5
equal deleted inserted replaced
96:be6e1ae3965c 98:b307fcd1435a
    48      * Renders the little html to add the javascript
    48      * Renders the little html to add the javascript
    49      *
    49      *
    50      * @param unknown_type $tags_list
    50      * @param unknown_type $tags_list
    51      * @return \Symfony\Bundle\FrameworkBundle\Controller\Response
    51      * @return \Symfony\Bundle\FrameworkBundle\Controller\Response
    52      */
    52      */
    53     public function addJavascriptAction($tags_list=false, $profile_name=null)
    53     public function addJavascriptAction($tags_list=false, $profile_name=null, $read_only="false")
    54     {
    54     {
    55         $cats = $this->getDoctrine()->getRepository('WikiTagBundle:Category')->findOrderedCategories();
    55         $cats = $this->getDoctrine()->getRepository('WikiTagBundle:Category')->findOrderedCategories();
    56         // $cats is {"Label":"Créateur"},{"Label":"Datation"},...
    56         // $cats is {"Label":"Créateur"},{"Label":"Datation"},...
    57         $nbCats = count($cats);
    57         $nbCats = count($cats);
    58         $ar = array('' => '');
    58         $ar = array('' => '');
    66         $profile_array = $this->container->getParameter("wiki_tag.document_list_profile");
    66         $profile_array = $this->container->getParameter("wiki_tag.document_list_profile");
    67         $columns_array = null;
    67         $columns_array = null;
    68         if($profile_array!=null && $profile_name!=null && $profile_name!=""){
    68         if($profile_array!=null && $profile_name!=null && $profile_name!=""){
    69             $columns_array = $profile_array[$profile_name];
    69             $columns_array = $profile_array[$profile_name];
    70         }
    70         }
    71         return $this->render('WikiTagBundle:WikiTag:javascript.html.twig', array('categories' => $categories, 'tags_list' => $tags_list, 'columns' => $columns_array));
    71         // Set read_only if asked
       
    72         if(strtolower($read_only)=="true"){
       
    73             $read_only = true;
       
    74         }
       
    75         else{
       
    76             $read_only = false;
       
    77         }
       
    78         return $this->render('WikiTagBundle:WikiTag:javascript.html.twig', array('categories' => $categories, 'tags_list' => $tags_list, 'columns' => $columns_array, 'read_only' => $read_only));
    72     }
    79     }
    73 
    80 
    74     /**
    81     /**
    75      * Renders the little html to add the javascript for context search
    82      * Renders the little html to add the javascript for context search
    76      */
    83      */