Changeset 2814


Ignore:
Timestamp:
Oct 28, 2008, 10:19:25 PM (15 years ago)
Author:
grum
Message:

menu item "quicksearch" will be displayed only if a $block->data is set (like
other menu items)
use of a boolean value for the "qsearch" $block->data variable
(see topic #98370)

Location:
branches/2.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/include/menubar.inc.php

    r2515 r2814  
    216216  if ( ($block=$menu->get_block('mbMenu')) != null )
    217217  {
     218    // quick search block will be displayed only if data['qsearch'] is set
     219    // to "yes"
     220    $block->data['qsearch']=true;
     221
    218222    // tags link
    219223    $block->data['tags'] =
  • branches/2.0/template/yoga/menubar_menu.tpl

    r2521 r2814  
    11<dt>{'title_menu'|@translate}</dt>
    22<dd>
    3         <form action="{$ROOT_URL}qsearch.php" method="get" id="quicksearch" onsubmit="return this.q.value!='' && this.q.value!=qsearch_prompt;">
    4                 <p style="margin:0;padding:0"{*this <p> is for html validation only - does not affect positioning*}>
    5                         <input type="text" name="q" id="qsearchInput" onfocus="if (value==qsearch_prompt) value='';" onblur="if (value=='') value=qsearch_prompt;" style="width:90%"/>
    6                 </p>
    7         </form>
    8         <script type="text/javascript">var qsearch_prompt="{'qsearch'|@translate|@escape:'javascript'}"; document.getElementById('qsearchInput').value=qsearch_prompt;</script>
     3  {if isset($block->data.qsearch) and  $block->data.qsearch==true}
     4    <form action="{$ROOT_URL}qsearch.php" method="get" id="quicksearch" onsubmit="return this.q.value!='' && this.q.value!=qsearch_prompt;">
     5      <p style="margin:0;padding:0"{*this <p> is for html validation only - does not affect positioning*}>
     6        <input type="text" name="q" id="qsearchInput" onfocus="if (value==qsearch_prompt) value='';" onblur="if (value=='') value=qsearch_prompt;" style="width:90%"/>
     7      </p>
     8    </form>
     9    <script type="text/javascript">var qsearch_prompt="{'qsearch'|@translate|@escape:'javascript'}"; document.getElementById('qsearchInput').value=qsearch_prompt;</script>
     10  {/if}
    911
    1012        <ul>
Note: See TracChangeset for help on using the changeset viewer.