

<div class="tags_prompt" id="tags_prompt_{{ form_name }}">
    
  {% if display_specials_buttons is defined %}
    {% if display_specials_buttons == true %}
      <input class="clear button" type="button" value="{{ 'filter.clear'|trans({}, 'userui') }}" />
      <input type="hidden" class="filter_clear_url" value="{{ path('filter_clear') }}" />
      <input class="mytags button" type="button" value="{{ 'filter.mytags'|trans({}, 'userui') }}" />
      <input type="hidden" class="filter_mytags_url" value="{{ path('filter_mytags') }}" />
    {% endif %}
  {% endif %}
  
   <input class="tags_prompt_list" name="tags" value=""> 
   <input id="tags_selected_tag_{{ form_name }}" type="hidden" value="" />
   <input class="tag_text_help" type="hidden" value="{{ 'tags.inputtext.help'|trans({}, 'userui') }}"/>
   <div id="search_tag_{{ form_name }}" class="search_tag_list" style="display: none;">
     <span class="info"></span>
     <div class="tag_loader_div">
       <img id="tag_loader_{{ form_name }}" class="tag_loader" style="display: none;" src="{{ asset('/bundles/muzichcore/img/ajax-loader.gif') }}" alt="loading"/>
     </div>
     <ul class="search_tag_list"></ul>
     <a class="more button" href="#" style="display: none;">
       {{ 'tags.search.display_more'|trans({}, 'userui') }}
     </a>
   </div>
</div>

<script language="javascript" type="text/javascript">
  
  var taginit = new Array();
  {% if search_tags is defined %}
    {% for tid, tname in search_tags %}
      taginit[{{ loop.index0 }}] = {"id":"{{ tid }}", "name":"{{ tname }}"};
    {% endfor %}
  {% endif %}
  
  var options = new Array();
  options.form_name  = "{{ form_name }}";
  options.tag_init   = taginit;
  
  // tags_prompt_list_
  $("div#tags_prompt_{{ form_name }} input.tags_prompt_list").tagBox(options);
  
  // text help en cas de rafraichissement de la page (nav. comme firefox 
  // garde la valeur de l'input)
  $(document).ready(function(){
    $('div#tags_prompt_{{ form_name }} ul.tagbox li.input input[type="text"]')
      .val(string_tag_prompt_input_help)
    ;
  });
  
  // On détruit la variable taginit
  delete taginit;
    
</script>