# HG changeset patch # User ymh # Date 1342454741 -7200 # Node ID a5376c281d0807fcb130be1fb57d113a0f80d28c # Parent b9366b6e28c20eb8bec130f5f1ba6a7bd32c9a64# Parent f938477c3376c1fbc4e6a616ee50c50dbc35c3b6 merged diff -r b9366b6e28c2 -r a5376c281d08 .hgtags diff -r b9366b6e28c2 -r a5376c281d08 Controller/WikiTagController.php --- a/Controller/WikiTagController.php Tue May 22 02:31:52 2012 +0200 +++ b/Controller/WikiTagController.php Mon Jul 16 18:05:41 2012 +0200 @@ -50,7 +50,7 @@ * @param unknown_type $tags_list * @return \Symfony\Bundle\FrameworkBundle\Controller\Response */ - public function addJavascriptAction($tags_list=false, $profile_name=null) + public function addJavascriptAction($tags_list=false, $profile_name=null, $read_only="false") { $cats = $this->getDoctrine()->getRepository('WikiTagBundle:Category')->findOrderedCategories(); // $cats is {"Label":"Créateur"},{"Label":"Datation"},... @@ -68,7 +68,14 @@ if($profile_array!=null && $profile_name!=null && $profile_name!=""){ $columns_array = $profile_array[$profile_name]; } - return $this->render('WikiTagBundle:WikiTag:javascript.html.twig', array('categories' => $categories, 'tags_list' => $tags_list, 'columns' => $columns_array)); + // Set read_only if asked + if(strtolower($read_only)=="true"){ + $read_only = true; + } + else{ + $read_only = false; + } + return $this->render('WikiTagBundle:WikiTag:javascript.html.twig', array('categories' => $categories, 'tags_list' => $tags_list, 'columns' => $columns_array, 'read_only' => $read_only)); } /** diff -r b9366b6e28c2 -r a5376c281d08 Resources/public/js/wikiTag.js --- a/Resources/public/js/wikiTag.js Tue May 22 02:31:52 2012 +0200 +++ b/Resources/public/js/wikiTag.js Mon Jul 16 18:05:41 2012 +0200 @@ -270,6 +270,7 @@ } }; $(document).ready(function(){ + $("#wikitag_context_div").offset({left:0,top:0}); for(c in reactive_selectors){ $(reactive_selectors[c]).bind("mouseup", Kolich.Selector.mouseup); } diff -r b9366b6e28c2 -r a5376c281d08 Resources/views/WikiTag/javascript.html.twig --- a/Resources/views/WikiTag/javascript.html.twig Tue May 22 02:31:52 2012 +0200 +++ b/Resources/views/WikiTag/javascript.html.twig Mon Jul 16 18:05:41 2012 +0200 @@ -98,7 +98,14 @@ notInList.push(14); $(document).ready(function(){ - wikitag_init_tags_events(); + {% if read_only==true %} + // Hide/show column management. + $('#wikitag_table').columnManager({listTargetID:'wikitag_ul_target', onClass: 'wikitag_advon', offClass: 'wikitag_advoff', hideInList: notInList, saveState: true, colsHidden:columsToHide }); + //create the clickmenu from the target + $('#wikitag_ulSelectColumn').clickMenu({onClick: function(){}}); + {% else %} + wikitag_init_tags_events(); wikitag_init_datasheet_events(); + {% endif %} }); \ No newline at end of file