started advenced serch form block
This commit is contained in:
		@@ -42,6 +42,10 @@ function materio_search_api_permission() {
 | 
			
		||||
      'title' => t('use Materio search api filters'),
 | 
			
		||||
      'description' => t('Use materio search api filters.'),
 | 
			
		||||
    ),
 | 
			
		||||
    'use materio advanced search' => array(
 | 
			
		||||
      'title' => t('Use materio advanced search'),
 | 
			
		||||
      'description' => t('Use materio advanced search.'),
 | 
			
		||||
    ),
 | 
			
		||||
  );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -468,6 +472,11 @@ function materio_search_api_block_info() {
 | 
			
		||||
    'cache' => DRUPAL_NO_CACHE
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  $blocks['materio_search_api_advanced_search'] = array(
 | 
			
		||||
    'info' => t('Materio search api advanced search'),
 | 
			
		||||
    'cache' => DRUPAL_NO_CACHE
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  # NOT USED
 | 
			
		||||
  $blocks['materio_search_api_viewmode'] = array(
 | 
			
		||||
    'info' => t('Materio search api view mode selection'),
 | 
			
		||||
@@ -497,6 +506,12 @@ function materio_search_api_block_view($delta = '') {
 | 
			
		||||
        $block['content'] = theme('materio_search_api_search_block', array());
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
    case 'materio_search_api_advanced_search':
 | 
			
		||||
      if (user_access('use materio advanced search')) {
 | 
			
		||||
        $block['subject'] = t('Advanced Search');
 | 
			
		||||
        $block['content'] = theme('materio_search_api_advanced_search_block', array());
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
    case 'materio_search_api_viewmode':
 | 
			
		||||
      // restrict display on node page for materiau and breve
 | 
			
		||||
      $block_is_visible = true;
 | 
			
		||||
@@ -710,6 +725,41 @@ function materio_search_api_search_form_submit($form, &$form_state){
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * materiobase_search_form()
 | 
			
		||||
 */
 | 
			
		||||
function materio_search_api_advanced_search_form($form, &$form_state){
 | 
			
		||||
  //  dsm($form_state, 'form_state');
 | 
			
		||||
  // dsm($form, 'form');
 | 
			
		||||
  global $user;
 | 
			
		||||
  $form = array();
 | 
			
		||||
 | 
			
		||||
  $args = arg();
 | 
			
		||||
  $path = array_shift($args);
 | 
			
		||||
 | 
			
		||||
  // add a back to search/base home bouton if on explore/foo
 | 
			
		||||
  if ($path == 'explore' || $path == 'bookmarks' || $path == 'lists' ) {
 | 
			
		||||
    $link = l('<i class="fi-home"></i>', base_path().'actuality', array(
 | 
			
		||||
      'html'=>true,
 | 
			
		||||
      'attributes'=>array('class'=>'back-search-home')
 | 
			
		||||
    ));
 | 
			
		||||
 | 
			
		||||
    $form['actu'] = array(
 | 
			
		||||
      '#type' => 'markup',
 | 
			
		||||
      '#markup' => $link,
 | 
			
		||||
      //'<a href="'.base_path().'actuality" class="back-search-home"><i class="fi-home"></i></a>'
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  $form['create'] = array(
 | 
			
		||||
    '#type' => 'image_button',
 | 
			
		||||
    '#src' => drupal_get_path('module', 'materio_search_api') . '/images/search.png',
 | 
			
		||||
    '#value' => t('Search'),
 | 
			
		||||
  );
 | 
			
		||||
  return $form;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * viewmode
 | 
			
		||||
 */
 | 
			
		||||
@@ -746,6 +796,11 @@ function materio_search_api_theme($existing, $type, $theme, $path) {
 | 
			
		||||
      'template' => 'materio-search-api-search-block',
 | 
			
		||||
      'path' => drupal_get_path('module', 'materio_search_api').'/templates',
 | 
			
		||||
    ),
 | 
			
		||||
    'materio_search_api_advanced_search_block' => array(
 | 
			
		||||
      'arguments' => array(),
 | 
			
		||||
      'template' => 'materio-search-api-advanced-search-block',
 | 
			
		||||
      'path' => drupal_get_path('module', 'materio_search_api').'/templates',
 | 
			
		||||
    ),
 | 
			
		||||
    'materio_search_api_select_viewmode_block' => array(
 | 
			
		||||
      'arguments' => array(),
 | 
			
		||||
      'template' => 'materio-search-api-select-viewmode-block',
 | 
			
		||||
@@ -784,11 +839,6 @@ function materio_search_api_theme($existing, $type, $theme, $path) {
 | 
			
		||||
        'count' => 0,
 | 
			
		||||
      )
 | 
			
		||||
    ),
 | 
			
		||||
    'materio_search_api_advanced_search_block' => array(
 | 
			
		||||
      'template' => 'materio-search-api-advanced-search-block',
 | 
			
		||||
      'path' => drupal_get_path('module', 'materio_search_api').'/templates',
 | 
			
		||||
      'arguments' => array(),
 | 
			
		||||
    ),
 | 
			
		||||
    'materio_search_api_form_element' => array(
 | 
			
		||||
      'render element' => 'element',
 | 
			
		||||
    ),
 | 
			
		||||
@@ -814,6 +864,14 @@ function template_preprocess_materio_search_api_search_block(&$vars){
 | 
			
		||||
  $vars['searchform'] = drupal_get_form("materio_search_api_search_form");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * template_preprocess_materiobase_advanced_search_block();
 | 
			
		||||
 */
 | 
			
		||||
function template_preprocess_materio_search_api_advanced_search_block(&$vars){
 | 
			
		||||
  // dsm($vars, '$vars');
 | 
			
		||||
  $vars['searchform'] = drupal_get_form("materio_search_api_advanced_search_form");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function template_preprocess_materio_search_api_select_viewmode_block(&$vars){
 | 
			
		||||
  global $user;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,5 @@
 | 
			
		||||
<div class="inner">
 | 
			
		||||
 | 
			
		||||
  <?php print render($searchform); ?>
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
		Reference in New Issue
	
	Block a user