Project

General

Profile

Revision b18d70f6

IDb18d70f667520ea1abe78debd68e868d7c964763
Parent 5195ddf2
Child 0b494565

Added by Andreas Kohlbecker about 2 years ago

ref #7835 adding registration search block combining filter and taxongraph search

View differences:

modules/cdm_dataportal/cdm_dataportal.module
322 322
    );
323 323
  }
324 324

  
325
  function _add_js_ui_accordion(){
326
    _add_jquery_ui();
327
    drupal_add_js('jQuery(document).ready(function() {
328
        jQuery( "#accordion" ).accordion();
329
      });',
330
      array('type' => 'inline')
331
    );
332
  }
333

  
325 334
  /**
326 335
   * Provides the markup for an font awesome icon.
327 336
   *
......
865 874
      'pages' => "cdm_dataportal/taxon/*", // multiple page paths separated by "\n"!!!
866 875
    );
867 876
  $block['registrations_search_filter'] =  array(
868
    'title' => 'Search registrations',
877
    'title' => 'Filter registrations',
869 878
    'info' => t('CDM - Registrations search filter'),
870 879
    'cache' => DRUPAL_CACHE_PER_PAGE,
871 880
    'visibility' => BLOCK_VISIBILITY_NOTLISTED,
872
    'pages' => "cdm_dataportal/search-registration\ncdm_dataportal/search-registration/*", // multiple page paths separated by "\n"!!!
881
    'pages' => "cdm_dataportal/registration-search\ncdm_dataportal/registration-search/*", // multiple page paths separated by "\n"!!!
873 882
  );
874 883
  $block['registrations_search_taxongraph'] =  array(
875 884
    'title' => 'Taxonomic registration search',
876 885
    'info' => t('CDM - Registrations search by taxon graph'),
877 886
    'cache' => DRUPAL_CACHE_PER_PAGE,
878 887
    'visibility' => BLOCK_VISIBILITY_NOTLISTED,
879
    'pages' => "cdm_dataportal/search-registration\ncdm_dataportal/search-registration/*", // multiple page paths separated by "\n"!!!
888
    'pages' => "cdm_dataportal/registration-search\ncdm_dataportal/registration-search/*", // multiple page paths separated by "\n"!!!
889
  );
890
  $block['registrations_search'] =  array(
891
    'title' => 'Search',
892
    'info' => t('CDM - Registrations search combining filter and taxon graph search' ),
893
    'cache' => DRUPAL_CACHE_PER_PAGE,
894
    'visibility' => BLOCK_VISIBILITY_NOTLISTED,
895
    'pages' => "cdm_dataportal/registration-search\ncdm_dataportal/registration-search/*", // multiple page paths separated by "\n"!!!
880 896
  );
881 897
  return $block;
882 898
}
......
943 959
      $block['subject'] = '<none>';
944 960
      $block['content'] = drupal_get_form('cdm_dataportal_search_registration_taxongraph_form'); // see cdm_dataportal_search_registration_taxongraph_form($form, &$form_state)
945 961
      return $block;
962
    case 'registrations_search':
963
      _add_js_ui_accordion();
964
      _add_font_awesome_font();
965
      $block['subject'] = '<none>';
966
      $filter_form = drupal_get_form('cdm_dataportal_search_registration_filter_form');
967
      $filter_form['#prefix'] = '<div>';
968
      $filter_form['#suffix'] = '</div>';
969
      $taxongraph_form = drupal_get_form('cdm_dataportal_search_registration_taxongraph_form');
970
      $taxongraph_form['#prefix'] = '<div>';
971
      $taxongraph_form['#suffix'] = '</div>';
972
      $block['content'] = array(
973
        'accordion' => array(
974
          '#markup' => '',
975
          '#prefix' => '<div id="accordion">',
976
          '#suffix' => '</div>',
977
          'content' => array(
978
            array('#markup' => '<h3>Filter</h3>'),
979
            $filter_form,
980
            array('#markup' => '<h3>Taxon graph</h3>'),
981
            $taxongraph_form,
982
          )
983
        )
984
    );
985
       return $block;
946 986
    default:
947 987
      return null;
948 988
  }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)