Beispiel #1
0
 /**
  * Display the widget!
  *
  * @param array MUST contain at least the basic display params
  */
 function display($params)
 {
     global $Blog;
     $this->init_display($params);
     // Collection search form:
     echo $this->disp_params['block_start'];
     $this->disp_title(T_('Search'));
     form_formstart($Blog->gen_blogurl(), 'search', 'SearchForm');
     echo '<p>';
     $s = get_param('s');
     echo '<input type="text" name="s" size="25" value="' . htmlspecialchars($s) . '" class="SearchField" /><br />';
     $sentence = get_param('sentence');
     echo '<input type="radio" name="sentence" value="AND" id="sentAND" ' . ($sentence == 'AND' ? 'checked="checked" ' : '') . '/><label for="sentAND">' . T_('All Words') . '</label><br />';
     echo '<input type="radio" name="sentence" value="OR" id="sentOR" ' . ($sentence == 'OR' ? 'checked="checked" ' : '') . '/><label for="sentOR">' . T_('Some Word') . '</label><br />';
     echo '<input type="radio" name="sentence" value="sentence" id="sentence" ' . ($sentence == 'sentence' ? 'checked="checked" ' : '') . '/><label for="sentence">' . T_('Entire phrase') . '</label>';
     echo '</p>';
     echo '<input type="submit" name="submit" class="submit" value="' . T_('Search') . '" class="search_submit" />';
     echo '</form>';
     echo $this->disp_params['block_end'];
     return true;
 }
    user_login_link('<li>', '</li>');
    user_register_link('<li>', '</li>');
    user_admin_link('<li>', '</li>');
    user_profile_link('<li>', '</li>');
    user_subs_link('<li>', '</li>');
    user_logout_link('<li>', '</li>');
    ?>
</ul>
</div>

<?php 
    // --------------------- SEARCH BOX INCLUDED HERE ---------------------
    ?>
<div class="bSideItem">
<?php 
    form_formstart($Blog->dget('blogurl', 'raw'), 'search', 'SearchForm');
    ?>
<p><input type="text" name="s" size="30" value="<?php 
    if (htmlspecialchars($s) == '') {
        echo 'Search';
    } else {
        echo htmlspecialchars($s);
    }
    ?>
" onclick="if(this.value=='Search') { this.value='';}" class="SearchField" /></p>
<input type="hidden" name="sentence" value="AND" id="sentAND" <?php 
    if ($sentence == 'AND') {
        echo 'checked="checked" ';
    }
    ?>
/>
 /**
  * Display the widget!
  *
  * @param array MUST contain at least the basic display params
  */
 function display($params)
 {
     global $Blog;
     $this->init_display($params);
     // Collection search form:
     echo $this->disp_params['block_start'];
     $this->disp_title();
     form_formstart($Blog->gen_blogurl(), 'search', 'SearchForm');
     if ($this->disp_params['disp_search_options']) {
         echo '<div class="extended_search_form">';
     } else {
         echo '<div class="compact_search_form">';
     }
     if ($this->disp_params['disp_search_options']) {
         $sentence = get_param('sentence');
         echo '<div class="search_options">';
         echo '<div class="search_option"><input type="radio" name="sentence" value="AND" id="sentAND" ' . ($sentence == 'AND' ? 'checked="checked" ' : '') . '/><label for="sentAND">' . T_('All words') . '</label></div>';
         echo '<div class="search_option"><input type="radio" name="sentence" value="OR" id="sentOR" ' . ($sentence == 'OR' ? 'checked="checked" ' : '') . '/><label for="sentOR">' . T_('Some word') . '</label></div>';
         echo '<div class="search_option"><input type="radio" name="sentence" value="sentence" id="sentence" ' . ($sentence == 'sentence' ? 'checked="checked" ' : '') . '/><label for="sentence">' . T_('Entire phrase') . '</label></div>';
         echo '</div>';
     }
     $s = get_param('s');
     echo '<input type="text" name="s" size="25" value="' . htmlspecialchars($s) . '" class="search_field SearchField" title="' . format_to_output(T_('Enter text to search for'), 'htmlattr') . '" />';
     if ($this->disp_params['use_search_disp']) {
         echo '<input type="hidden" name="disp" value="search" />';
     }
     echo '<input type="submit" name="submit" class="search_submit submit" value="' . format_to_output($this->disp_params['button'], 'htmlattr') . '" />';
     echo '</div>';
     echo '</form>';
     echo $this->disp_params['block_end'];
     return true;
 }
 /**
  * Display the widget!
  *
  * @param array MUST contain at least the basic display params
  */
 function display($params)
 {
     $this->init_display($params);
     $blog_ID = intval($this->disp_params['blog_ID']);
     if ($blog_ID > 0) {
         // Get Blog for widget setting
         $BlogCache =& get_BlogCache();
         $widget_Blog =& $BlogCache->get_by_ID($blog_ID, false, false);
     }
     if (empty($widget_Blog)) {
         // Use current blog
         global $Blog;
         $widget_Blog =& $Blog;
     }
     // Collection search form:
     echo $this->disp_params['block_start'];
     $this->disp_title();
     echo $this->disp_params['block_body_start'];
     form_formstart($widget_Blog->gen_blogurl(), 'search', 'SearchForm');
     if (empty($this->disp_params['search_class'])) {
         // Class name is not defined, Use class depend on serach options
         $search_form_class = 'compact_search_form';
     } else {
         // Use class from params
         $search_form_class = $this->disp_params['search_class'];
     }
     echo '<div class="' . $search_form_class . '">';
     echo $this->disp_params['search_input_before'];
     echo '<input type="text" name="s" size="25" value="' . htmlspecialchars(get_param('s')) . '" class="search_field SearchField form-control" title="' . format_to_output(T_('Enter text to search for'), 'htmlattr') . '" />';
     echo $this->disp_params['search_input_after'];
     echo $this->disp_params['search_submit_before'];
     echo '<input type="submit" name="submit" class="search_submit submit btn btn-primary" value="' . format_to_output($this->disp_params['button'], 'htmlattr') . '" />';
     echo $this->disp_params['search_submit_after'];
     echo '</div>';
     echo '<input type="hidden" name="disp" value="search" />';
     echo '</form>';
     echo $this->disp_params['block_body_end'];
     echo $this->disp_params['block_end'];
     return true;
 }