Controller/WikiTagController.php
changeset 104 af79031ee002
parent 102 d1af10ee0aa5
child 112 14653baf4f6b
equal deleted inserted replaced
102:d1af10ee0aa5 104:af79031ee002
   107             $columns_array = $profile_array[$profile_name];
   107             $columns_array = $profile_array[$profile_name];
   108         }
   108         }
   109         
   109         
   110         $ordered_tags = $this->getDoctrine()->getRepository('WikiTagBundle:DocumentTag')->findOrderedTagsForDoc($id_doc);
   110         $ordered_tags = $this->getDoctrine()->getRepository('WikiTagBundle:DocumentTag')->findOrderedTagsForDoc($id_doc);
   111         //$ordered_tags = null;
   111         //$ordered_tags = null;
   112         return $this->render('WikiTagBundle:WikiTag:documentTags.html.twig', array('ordered_tags' => $ordered_tags, 'doc_id' => $id_doc, 'columns' => $columns_array));
   112         return $this->render('WikiTagBundle:WikiTag:documentTags.html.twig', array('ordered_tags' => $ordered_tags, 'doc_id' => $id_doc, 'columns' => $columns_array, 'profile_name' => $profile_name));
   113     }
   113     }
   114 
   114 
   115     /**
   115     /**
   116      *
   116      *
   117      * The action called when a tag is moved in a document tag list.
   117      * The action called when a tag is moved in a document tag list.
   149                 $dt->setTagOrder($dt->getTagOrder() + 1);
   149                 $dt->setTagOrder($dt->getTagOrder() + 1);
   150             }
   150             }
   151         }
   151         }
   152         // Save datas.
   152         // Save datas.
   153         $em->flush();
   153         $em->flush();
   154 
   154         
   155         return $this->renderDocTags($id_doc, $req->get('wikitag_document_profile'));
   155         return $this->renderDocTags($id_doc, $req->get('wikitag_document_profile'));
   156     }
   156     }
   157 
   157 
   158     /**
   158     /**
   159      * Action to remove a tag from a document tag list
   159      * Action to remove a tag from a document tag list
   387     /**
   387     /**
   388      *
   388      *
   389      * Generic render partial template
   389      * Generic render partial template
   390      * @param unknown_type $id_doc
   390      * @param unknown_type $id_doc
   391      */
   391      */
   392     public function renderDocTags($id_doc)
   392     public function renderDocTags($id_doc, $profile_name="")
   393     {
   393     {
   394         // Get tags and render the table
   394         // Management of profiles for the list of displayed columns and reorder tag button
       
   395         $profile_array = $this->container->getParameter("wiki_tag.document_list_profile");
       
   396         $columns_array = null;
       
   397         if($profile_array!=null && $profile_name!=null && $profile_name!=""){
       
   398             $columns_array = $profile_array[$profile_name];
       
   399         }
   395         $ordered_tags = $this->getDoctrine()->getRepository('WikiTagBundle:DocumentTag')->findOrderedTagsForDoc($id_doc);
   400         $ordered_tags = $this->getDoctrine()->getRepository('WikiTagBundle:DocumentTag')->findOrderedTagsForDoc($id_doc);
   396         return $this->render('WikiTagBundle:WikiTag:tagTable.html.twig', array('ordered_tags' => $ordered_tags, 'doc_id' => $id_doc));
   401         return $this->render('WikiTagBundle:WikiTag:tagTable.html.twig', array('ordered_tags' => $ordered_tags, 'doc_id' => $id_doc, 'columns' => $columns_array, 'profile_name' => $profile_name));
   397     }
   402     }
   398 
   403 
   399 
   404 
   400     /**
   405     /**
   401      * Action to update the tag alias.
   406      * Action to update the tag alias.