--- a/Controller/WikiTagController.php Mon Oct 24 18:45:34 2011 +0200
+++ b/Controller/WikiTagController.php Mon Oct 24 19:08:04 2011 +0200
@@ -339,7 +339,6 @@
/**
*
- * @Route("/wtrwi")
* TODO: Enter description here ...
* TODO : implement
*/
@@ -358,8 +357,27 @@
*/
public function updateTagAliasAction()
{
+ $id_tag = $this->getRequest()->request->get('id');
+ $alias = $this->getRequest()->request->get('value');
+ // We get the Tag and update its category.
+ $em = $this->getDoctrine()->getEntityManager();
+ $tag = $this->getDoctrine()->getRepository('WikiTagBundle:Tag')->find($id_tag);
+ $tag->setAlias($alias);
+ $em->flush();
+
$id_doc = $this->getRequest()->request->get('wikitag_document_id');
- return $this->renderDocTags($id_doc);
+ if($id_doc && $id_doc!=""){
+ // In case we changed the alias from the document view
+ return $this->renderDocTags($id_doc);
+ }
+ else{
+ // In case we changed the alias from the tag list.
+ $num_page = $this->getRequest()->request->get('num_page');
+ $nb_by_page = $this->getRequest()->request->get('nb_by_page');
+ $sort = $this->getRequest()->request->get('sort');
+ $searched = $this->getRequest()->request->get('searched');
+ return $this->renderAllTags($num_page, $nb_by_page, $sort, $searched);
+ }
}
/**
@@ -444,7 +462,6 @@
$searched = $ar[3];
$sort = $ar[4];
$reverse_sort = $ar[5];
- //$pagerfanta = $ar[6];
return $this->render('WikiTagBundle:WikiTag:TagListTable.html.twig',
array('tags' => $tags, 'searched' => $searched, 'nb_by_page' => $nb_by_page, 'sort' => $sort, 'num_page' => $num_page, 'reverse_sort' => $reverse_sort));