# HG changeset patch # User cavaliet # Date 1342433576 -7200 # Node ID b307fcd1435a1c712e23ab20d38218a519116c48 # Parent be6e1ae3965c2220e806250869b155f7d9305a6e readonly possibility for tag table in document page diff -r be6e1ae3965c -r b307fcd1435a Controller/WikiTagController.php --- a/Controller/WikiTagController.php Wed May 16 18:17:19 2012 +0200 +++ b/Controller/WikiTagController.php Mon Jul 16 12:12:56 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 be6e1ae3965c -r b307fcd1435a Resources/public/js/wikiTag.js --- a/Resources/public/js/wikiTag.js Wed May 16 18:17:19 2012 +0200 +++ b/Resources/public/js/wikiTag.js Mon Jul 16 12:12:56 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 be6e1ae3965c -r b307fcd1435a Resources/views/WikiTag/javascript.html.twig --- a/Resources/views/WikiTag/javascript.html.twig Wed May 16 18:17:19 2012 +0200 +++ b/Resources/views/WikiTag/javascript.html.twig Mon Jul 16 12:12:56 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