# HG changeset patch # User cavaliet # Date 1321528073 -3600 # Node ID 540607cf3447770c798e081bc5b2a9548b21e0dd # Parent 92ddb5488eb4bee2a9fab6c71b0dad9cf412accb Context search v1 is finished. Context allowing various configuration is set. Css and templates are clearly set. diff -r 92ddb5488eb4 -r 540607cf3447 Controller/WikiTagController.php --- a/Controller/WikiTagController.php Thu Nov 17 11:37:05 2011 +0100 +++ b/Controller/WikiTagController.php Thu Nov 17 12:07:53 2011 +0100 @@ -71,7 +71,16 @@ // which is gotten by the jQuery call $('#wikitag_document_id').val() in the page. // So the page holding this context search MUST have a input value with this id. // We add the reactive selectors - $reactive_selectors = $this->container->getParameter("wiki_tag.reactive_selectors"); + $reac_sel_array = $this->container->getParameter("wiki_tag.reactive_selectors"); + $reactive_selectors = null; + if(array_key_exists($context_name, $reac_sel_array)){ + if($reac_sel_array[$context_name][0]=='document'){ + $reactive_selectors = 'document'; + } + else{ + $reactive_selectors = '"'.join('","',$reac_sel_array[$context_name]).'"'; + } + } return $this->render('WikiTagBundle:WikiTag:javascriptForContextSearch.html.twig', array('reactive_selectors' => $reactive_selectors)); } diff -r 92ddb5488eb4 -r 540607cf3447 DependencyInjection/Configuration.php --- a/DependencyInjection/Configuration.php Thu Nov 17 11:37:05 2011 +0100 +++ b/DependencyInjection/Configuration.php Thu Nov 17 12:07:53 2011 +0100 @@ -2,6 +2,8 @@ namespace IRI\Bundle\WikiTagBundle\DependencyInjection; +use Symfony\Component\Config\Definition\ScalarNode; + use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -23,7 +25,6 @@ $rootNode ->children() ->scalarNode('route_for_documents_by_tag')->defaultNull()->end() - ->scalarNode('reactive_selectors')->defaultNull()->end() ->scalarNode('document_class')->isRequired()->end() ->scalarNode('document_id_column')->defaultValue('id')->end() ->end() @@ -52,6 +53,11 @@ ->end() ->end() ->end() + ->arrayNode('reactive_selectors') + ->treatNullLike(array()) + ->useAttributeAsKey('name') + ->prototype('variable') + ->end() ->end(); return $treeBuilder; diff -r 92ddb5488eb4 -r 540607cf3447 Resources/public/css/wikiTag.css --- a/Resources/public/css/wikiTag.css Thu Nov 17 11:37:05 2011 +0100 +++ b/Resources/public/css/wikiTag.css Thu Nov 17 12:07:53 2011 +0100 @@ -88,13 +88,20 @@ /* Styles for hidden context div, displayed on text selected */ -#wikitag_context_div { - width: 260px; - border: 2px; - background: #97fefd; +/* These styles are not meant to be changed. There are needed in order to place and display the context div. */ +.wikitag_context_static { display: none; float: none; position: absolute; } +/* These styles can be changed. */ +.wikitag_context_change { + width: 260px; + border: 2px; + background: #97fefd; +} +.wikitag_context_change input { + width: 250px; +} diff -r 92ddb5488eb4 -r 540607cf3447 Resources/views/WikiTag/contextSearchDiv.html.twig --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/views/WikiTag/contextSearchDiv.html.twig Thu Nov 17 12:07:53 2011 +0100 @@ -0,0 +1,5 @@ +{# partial display for context search div #} +
+

Choisissez le tag à ajouterX

+

+
\ No newline at end of file diff -r 92ddb5488eb4 -r 540607cf3447 Resources/views/WikiTag/documentTags.html.twig --- a/Resources/views/WikiTag/documentTags.html.twig Thu Nov 17 11:37:05 2011 +0100 +++ b/Resources/views/WikiTag/documentTags.html.twig Thu Nov 17 12:07:53 2011 +0100 @@ -10,8 +10,4 @@
{% include 'WikiTagBundle:WikiTag:tagTable.html.twig' %}
-
-

Choisissez le tag à ajouterX

-

-
{% endblock %}