[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/themes/myzen/ -> search-theme-form.tpl.php (source)

   1  <?php
   2  // $Id: search-theme-form.tpl.php,v 1.1.2.1 2009/12/02 01:09:00 sociotech Exp $

   3  
   4  /**

   5   * @file search-theme-form.tpl.php

   6   * Default theme implementation for displaying a search form directly into the

   7   * theme layout. Not to be confused with the search block or the search page.

   8   *

   9   * Available variables:

  10   * - $search_form: The complete search form ready for print.

  11   * - $search: Array of keyed search elements. Can be used to print each form

  12   *   element separately.

  13   *

  14   * Default keys within $search:

  15   * - $search['search_theme_form']: Text input area wrapped in a div.

  16   * - $search['submit']: Form submit button.

  17   * - $search['hidden']: Hidden form elements. Used to validate forms when submitted.

  18   *

  19   * Since $search is keyed, a direct print of the form element is possible.

  20   * Modules can add to the search form so it is recommended to check for their

  21   * existance before printing. The default keys will always exist.

  22   *

  23   *   <?php if (isset($search['extra_field'])): ?>

  24   *     <div class="extra-field">

  25   *       <?php print $search['extra_field']; ?>

  26   *     </div>

  27   *   <?php endif; ?>

  28   *

  29   * To check for all available data within $search, use the code below.

  30   *

  31   *   <?php print '<pre>'. check_plain(print_r($search, 1)) .'</pre>'; ?>

  32   *

  33   * @see template_preprocess_search_theme_form()

  34   */
  35  ?>
  36  
  37  <?php /* Set search form label values and functions */ ?>
  38  <?php $search_label = t('Search...'); ?>
  39  <?php $search_phrase = t('Enter the terms you wish to search for.'); ?>
  40  <?php $on_blur = "if(this.value=='') this.value='" . $search_label . "';"; ?>
  41  <?php $on_focus = "if(this.value=='" . $search_label . "') this.value='';"; ?>
  42  
  43  <div id="search">
  44    <div id="search-input">
  45      <input type="text" maxlength="128" name="search_theme_form" id="edit-search-theme-form-header" size="15" title="<?php print $search_phrase; ?>" value="<?php print $search_label; ?>" onblur="<?php print $on_blur; ?>" onfocus="<?php print $on_focus; ?>" class="form-text" />
  46    </div>
  47  
  48    <div id="search-button">
  49      <input type="image" name="op" value="search" id="edit-submit-2" src="<?php print base_path() . $directory; ?>/images/search-icon.png" class="searchButtonPng"  alt="Search" />
  50    </div>
  51  
  52    <?php print $search['hidden'] ?>
  53  </div>


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7