Controller/WikiTagController.php
changeset 102 d1af10ee0aa5
parent 98 b307fcd1435a
child 104 af79031ee002
equal deleted inserted replaced
101:f39a53234909 102:d1af10ee0aa5
    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, $read_only="false")
    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         // Set read_only if asked
    71         
    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         return $this->render('WikiTagBundle:WikiTag:javascript.html.twig', array('categories' => $categories, 'tags_list' => $tags_list, 'columns' => $columns_array, 'read_only' => $read_only));
    79     }
    73     }
    80 
    74 
    81     /**
    75     /**
    82      * Renders the little html to add the javascript for context search
    76      * Renders the little html to add the javascript for context search