57 $temp = array($cats[$i]["label"] => $cats[$i]["label"]); |
57 $temp = array($cats[$i]["label"] => $cats[$i]["label"]); |
58 $ar = array_merge($ar, $temp); |
58 $ar = array_merge($ar, $temp); |
59 } |
59 } |
60 // ... so we create is json like {"":""},{"Créateur":"Créateur"},{"Datation":"Datation"},... |
60 // ... so we create is json like {"":""},{"Créateur":"Créateur"},{"Datation":"Datation"},... |
61 $categories = json_encode($ar); |
61 $categories = json_encode($ar); |
62 return $this->render('WikiTagBundle:WikiTag:javascript.html.twig', array('categories' => $categories,'tags_list' => $tags_list)); |
62 return $this->render('WikiTagBundle:WikiTag:javascript.html.twig', array('categories' => $categories, 'tags_list' => $tags_list)); |
|
63 } |
|
64 |
|
65 /** |
|
66 * Renders the little html to add the javascript for context search |
|
67 */ |
|
68 public function addJavascriptForContextSearchAction($context_name) |
|
69 { |
|
70 // WARNING : PREREQUISITE : the request to add a tag needs the external document id, |
|
71 // which is gotten by the jQuery call $('#wikitag_document_id').val() in the page. |
|
72 // So the page holding this context search MUST have a input value with this id. |
|
73 // We add the reactive selectors |
|
74 $reactive_selectors = $this->container->getParameter("wiki_tag.reactive_selectors"); |
|
75 return $this->render('WikiTagBundle:WikiTag:javascriptForContextSearch.html.twig', array('reactive_selectors' => $reactive_selectors)); |
63 } |
76 } |
64 |
77 |
65 /** |
78 /** |
66 * Display a list of ordered tag for a document |
79 * Display a list of ordered tag for a document |
67 * @param integer $id_doc |
80 * @param integer $id_doc |