|
@@ -38,6 +38,10 @@ function materio_search_api_permission() {
|
|
|
'title' => t('use Materio search api filters'),
|
|
|
'description' => t('Use materio search api filters.'),
|
|
|
),
|
|
|
+ 'use materio search api advanced search' => array(
|
|
|
+ 'title' => t('use materio search api advanced search'),
|
|
|
+ 'description' => t('Use materio search api advanced search.'),
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -124,6 +128,12 @@ function materio_search_api_search_api_data_type_info() {
|
|
|
'prefix' => 'temmap',
|
|
|
'always multiValued' => TRUE,
|
|
|
),
|
|
|
+ // 'term_tid' => array(
|
|
|
+ // 'name' => t('Taxonomy term tid'),
|
|
|
+ // 'fallback' => 'integer',
|
|
|
+ // 'prefix' => 'im',
|
|
|
+ // 'always multiValued' => TRUE,
|
|
|
+ // ),
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -142,8 +152,11 @@ function materio_search_api_search_api_solr_dynamic_field_info() {
|
|
|
'prefix' => 'temmap',
|
|
|
'always multiValued' => TRUE,
|
|
|
),
|
|
|
+ // 'term_tid' => array(
|
|
|
+ // 'prefix' => 'im',
|
|
|
+ // 'always multiValued' => TRUE,
|
|
|
+ // ),
|
|
|
);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -164,33 +177,39 @@ function materio_search_api_entity_property_info_alter(&$info){
|
|
|
$node_props['materio_search_api_onthologie_term_'.$i.'_text'] = array(
|
|
|
'type'=>'text',
|
|
|
'label'=> t('Main onthologie term '.$i. ' as text (+ synonyms)'),
|
|
|
- // 'query callback'=>'entity_metadata_table_query',
|
|
|
'getter callback'=>'materio_search_api_get_onthologie_term_'.$i.'_text',
|
|
|
);
|
|
|
+ $node_props['materio_search_api_onthologie_term_'.$i.'_tid'] = array(
|
|
|
+ 'type'=>'text',
|
|
|
+ 'label'=> t('Main onthologie term '.$i. ' as tid'),
|
|
|
+ 'getter callback'=>'materio_search_api_get_onthologie_term_'.$i.'_tid',
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
$node_props['materio_search_api_onthologie_term_others_text'] = array(
|
|
|
'type'=>'list<text>',
|
|
|
'label'=> t('Others onthologie terms as text (+ synonyms)'),
|
|
|
- // 'query callback'=>'entity_metadata_table_query',
|
|
|
'getter callback'=>'materio_search_api_get_taxonomy_terms_others_text',
|
|
|
);
|
|
|
|
|
|
+ $node_props['materio_search_api_onthologie_term_others_tid'] = array(
|
|
|
+ 'type'=>'list<text>',
|
|
|
+ 'label'=> t('Others onthologie terms as tid'),
|
|
|
+ 'getter callback'=>'materio_search_api_get_taxonomy_terms_others_tid',
|
|
|
+ );
|
|
|
+
|
|
|
$node_props['materio_search_api_taglibres_text'] = array(
|
|
|
'type'=>'list<text>',
|
|
|
'label'=> t('Tag libres terms as text (+ synonyms)'),
|
|
|
- // 'query callback'=>'entity_metadata_table_query',
|
|
|
'getter callback'=>'materio_search_api_get_taglibres_terms_text',
|
|
|
);
|
|
|
|
|
|
|
|
|
-
|
|
|
$node_materiau_props = &$info['node']['bundles']['materiau']['properties'];
|
|
|
|
|
|
$node_materiau_props['materio_search_api_node_propertie_companie'] = array(
|
|
|
'type'=>'list<text>',
|
|
|
'label'=> t('Manufacturers and distributors companies localised (dont addresse)'),
|
|
|
- // 'query callback'=>'entity_metadata_table_query',
|
|
|
'getter callback'=>'materio_search_api_get_node_propertie_companie',
|
|
|
);
|
|
|
|
|
@@ -204,9 +223,11 @@ function materio_search_api_entity_property_info_alter(&$info){
|
|
|
'type' => 'text',
|
|
|
'getter callback' => 'materio_search_api_term_property_dup_name',
|
|
|
);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+* taxonomy propoerties as text + synonymes
|
|
|
+*/
|
|
|
function materio_search_api_get_onthologie_term_1_text($item){
|
|
|
// dsm($item, 'item');
|
|
|
return materio_search_api_get_taxo_term_field_text($item, "field_onthologie", 0);
|
|
@@ -288,6 +309,55 @@ function materio_search_api_get_taxo_term_field_text($item, $field_name, $delta)
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+* taxonomy properties as tid
|
|
|
+*/
|
|
|
+function materio_search_api_get_onthologie_term_1_tid($item){
|
|
|
+ // dsm($item, 'item');
|
|
|
+ return materio_search_api_get_taxo_term_field_tid($item, "field_onthologie", 0);
|
|
|
+}
|
|
|
+function materio_search_api_get_onthologie_term_2_tid($item){
|
|
|
+ // dsm($item, 'item');
|
|
|
+ return materio_search_api_get_taxo_term_field_tid($item, "field_onthologie", 1);
|
|
|
+}
|
|
|
+function materio_search_api_get_onthologie_term_3_tid($item){
|
|
|
+ // dsm($item, 'item');
|
|
|
+ return materio_search_api_get_taxo_term_field_tid($item, "field_onthologie", 2);
|
|
|
+}
|
|
|
+function materio_search_api_get_onthologie_term_4_tid($item){
|
|
|
+ // dsm($item, 'item');
|
|
|
+ return materio_search_api_get_taxo_term_field_tid($item, "field_onthologie", 3);
|
|
|
+}
|
|
|
+function materio_search_api_get_onthologie_term_5_tid($item){
|
|
|
+ // dsm($item, 'item');
|
|
|
+ return materio_search_api_get_taxo_term_field_tid($item, "field_onthologie", 4);
|
|
|
+}
|
|
|
+
|
|
|
+function materio_search_api_get_taxonomy_terms_others_tid($item){
|
|
|
+ // dsm($item, 'item');
|
|
|
+ $delta = 5;
|
|
|
+ $terms = array();
|
|
|
+ while( isset($item->field_onthologie['und'][$delta]) ){
|
|
|
+ $terms[] = materio_search_api_get_taxo_term_field_tid($item, "field_onthologie", $delta);
|
|
|
+ $delta++;
|
|
|
+ }
|
|
|
+ return $terms;
|
|
|
+}
|
|
|
+
|
|
|
+function materio_search_api_get_taxo_term_field_tid($item, $field_name, $delta){
|
|
|
+ // dsm($item, 'item');
|
|
|
+ // dsm($delta, 'delta');
|
|
|
+ $tid = null;
|
|
|
+ if(isset($item->{$field_name}['und'][$delta]))
|
|
|
+ $tid = $item->{$field_name}['und'][$delta]['tid'];
|
|
|
+
|
|
|
+ // print 'tid = '.$tid."\n";
|
|
|
+ return $tid;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+*
|
|
|
+*/
|
|
|
function materio_search_api_get_node_propertie_companie($item){
|
|
|
// dsm($item, '$item');
|
|
|
$lang = "fr";//$item->language;
|
|
@@ -365,12 +435,17 @@ function materio_search_api_term_property_dup_name($term){
|
|
|
* Implements hook_block_info().
|
|
|
*/
|
|
|
function materio_search_api_block_info() {
|
|
|
- // This example comes from node.module.
|
|
|
$blocks['materio_search_api_search'] = array(
|
|
|
'info' => t('Materio search api search'),
|
|
|
'cache' => DRUPAL_NO_CACHE
|
|
|
);
|
|
|
|
|
|
+ $blocks['materio_sa_adv_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'),
|
|
|
'cache' => DRUPAL_NO_CACHE
|
|
@@ -420,6 +495,14 @@ function materio_search_api_block_view($delta = '') {
|
|
|
// $block['content'] = theme('materio_search_api_filters_block', array());
|
|
|
// }
|
|
|
// break;
|
|
|
+
|
|
|
+ # NOT USED
|
|
|
+ case 'materio_sa_adv_search':
|
|
|
+ if(user_access('use materio search api advanced search')){
|
|
|
+ $block['subject'] = t('Advanced Search');
|
|
|
+ $block['content'] = theme('materio_search_api_advanced_search_block', array());
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
return $block;
|
|
|
}
|
|
@@ -493,7 +576,20 @@ function materio_search_api_search_form($form, &$form_state){
|
|
|
|
|
|
$args = arg();
|
|
|
$path = array_shift($args);
|
|
|
- $keys = implode('/', $args);
|
|
|
+ // dsm($args, 'args');
|
|
|
+ if($args[0] == "advanced"){
|
|
|
+ $advanced = true;
|
|
|
+ array_shift($args);
|
|
|
+ // dsm($args, 'shifted arsg');
|
|
|
+ // foreach ($args as $arg) {
|
|
|
+ // $typed[] = $arg;//(integer)$arg;
|
|
|
+ // }
|
|
|
+ $keys = implode(' +', $args);
|
|
|
+ }else{
|
|
|
+ $keys = implode('/', $args);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
if(user_access('use materio search api autocomplete')){ // use materio search api autocomplete | use materio search api filters
|
|
|
$query = new EntityFieldQuery();
|
|
@@ -509,7 +605,6 @@ function materio_search_api_search_form($form, &$form_state){
|
|
|
$form['searchfield'] = array(
|
|
|
'#type' => 'textfield',
|
|
|
'#default_value' => $path == 'explore' ? $keys : $default_value, // TODO: set the search page path global or a variable in settings
|
|
|
- // '#value' => $keys,
|
|
|
'#autocomplete_path' => 'materiosearchapi/autocomplete/searchapi',
|
|
|
//'#autocomplete_path' => 'materiosearchapi/autocomplete/dbselect',
|
|
|
'#size' => 30,
|
|
@@ -583,9 +678,195 @@ function materio_search_api_search_form_submit($form, &$form_state){
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * viewmode
|
|
|
+ * materiobase_advancedsearch_form()
|
|
|
*/
|
|
|
+function materio_search_api_advanced_search_form($form, &$form_state){
|
|
|
+ // dsm($form_state, 'form_state');
|
|
|
+ // dsm($form, 'form');
|
|
|
+ // global $user;
|
|
|
+
|
|
|
+ $keys = arg();
|
|
|
+ $path = array_shift($keys);
|
|
|
+ // dsm($keys, 'keys');
|
|
|
+ if($path == 'explore' && $keys[0] == "advanced"){
|
|
|
+ $advanced = true;
|
|
|
+ array_shift($keys);
|
|
|
+ $default_keys = $keys;
|
|
|
+ }
|
|
|
+
|
|
|
+ $form = array(
|
|
|
+ 'title' => array(
|
|
|
+ '#prefix' => "<h3>",
|
|
|
+ '#markup' => t("Advanced Search"),
|
|
|
+ '#suffix' => "</h3>",
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
+ $vocabularies = variable_get('advancedsearchvocs', array());
|
|
|
+
|
|
|
+ $form['slider'] = array(
|
|
|
+ '#type' => 'fieldset',
|
|
|
+ // '#title' => $voc->name,
|
|
|
+ '#tree' => true,
|
|
|
+ );
|
|
|
+
|
|
|
+ foreach ($vocabularies as $vid) {
|
|
|
+ // dsm($vid, "vid");
|
|
|
+
|
|
|
+ $voc = taxonomy_vocabulary_load($vid);
|
|
|
+ // dsm($voc, 'voc');
|
|
|
+
|
|
|
+ $form['slider']['voc-'.$vid] = array(
|
|
|
+ '#type' => 'fieldset',
|
|
|
+ // '#title' => $voc->name,
|
|
|
+ '#tree' => true,
|
|
|
+ );
|
|
|
+
|
|
|
+ $tree = taxonomy_get_tree($vid, 0, 1, TRUE);
|
|
|
+ // dsm($tree, 'tree');
|
|
|
+
|
|
|
+ if(!count($tree))
|
|
|
+ continue;
|
|
|
+
|
|
|
+ foreach ($tree as $term) {
|
|
|
+ // dsm($term, "term");
|
|
|
+
|
|
|
+ $children = taxonomy_get_children($term->tid, $vid);
|
|
|
+ // dsm($children, "children");
|
|
|
+
|
|
|
+ if($term->field_used_on_advanced_search['und'][0]['value'] == 0
|
|
|
+ || !count($children))
|
|
|
+ continue;
|
|
|
+
|
|
|
+ $form['slider']['voc-'.$vid]['tree-'.$term->tid] = array(
|
|
|
+ '#type' => 'fieldset',
|
|
|
+ // '#title' => $term->name,
|
|
|
+ '#attributes' => array("class"=>array("treelevel1")),
|
|
|
+ '#tree' => true,
|
|
|
+ );
|
|
|
+
|
|
|
+ $placeholder = t("Select an option");
|
|
|
+ $form['slider']['voc-'.$vid]['tree-'.$term->tid]['children'] = array(
|
|
|
+ '#type' => 'select',
|
|
|
+ '#title' => $term->name,
|
|
|
+ '#attributes' => array(
|
|
|
+ "class"=>array("treelevel1"),
|
|
|
+ "title"=>$placeholder,
|
|
|
+ "data-placeholder" => $placeholder,
|
|
|
+ ), //, "form-control"
|
|
|
+ '#theme_wrappers' => array('materio_search_api_form_element'),
|
|
|
+ '#empty_option' => $placeholder,
|
|
|
+ '#empty_value' => 1,
|
|
|
+ );
|
|
|
+
|
|
|
+ $options = array();
|
|
|
+ foreach ($children as $tid => $child) {
|
|
|
+ // $child = taxonomy_term_load($child->tid);
|
|
|
+ // if($child->field_used_on_advanced_search['und'][0]['value'] == 0){
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
+
|
|
|
+ $children2 = taxonomy_get_children($child->tid, $vid);
|
|
|
+ // dsm($children2, "children2");
|
|
|
+
|
|
|
+ if(count($children2))
|
|
|
+ $options[$tid] = $child->name;
|
|
|
+
|
|
|
+ $classes2 = array("treelevel2", $child->tid);
|
|
|
|
|
|
+ $options2 = [];
|
|
|
+ $dflt_values2 = [];
|
|
|
+ foreach ($children2 as $tid2 => $child2) {
|
|
|
+ // $child2 = taxonomy_term_load($child2->tid);
|
|
|
+ // if($child2->field_used_on_advanced_search['und'][0]['value'] == 0){
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
+
|
|
|
+ $options2[$tid2] = $child2->name;
|
|
|
+
|
|
|
+ // default Values
|
|
|
+ if(in_array($tid2, $default_keys))
|
|
|
+ $dflt_values2[] = $tid2;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if(count($options2)){
|
|
|
+
|
|
|
+ if(count($dflt_values2))
|
|
|
+ $classes2[] = 'visible';
|
|
|
+
|
|
|
+ $form['slider']['voc-'.$vid]['tree-'.$term->tid]['tid-'.$child->tid] = array(
|
|
|
+ '#type' => 'select',
|
|
|
+ '#title' => $child->name,
|
|
|
+ '#multiple' => true,
|
|
|
+ '#attributes' => array(
|
|
|
+ "class" => $classes2, // , "form-control"
|
|
|
+ "title" => "-Please select-",
|
|
|
+ "tid" => $child->tid,
|
|
|
+ ),
|
|
|
+ '#theme_wrappers' => array('materio_search_api_form_element'),
|
|
|
+ // '#empty_option' => '-Please select-',
|
|
|
+ // '#empty_value' => 1,
|
|
|
+ '#options' => $options2,
|
|
|
+ '#default_value' => $dflt_values2,
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(count($options)){
|
|
|
+ $form['slider']['voc-'.$vid]['tree-'.$term->tid]['children']['#options'] = $options;
|
|
|
+ }else{
|
|
|
+ unset($form['slider']['voc-'.$vid]['tree-'.$term->tid]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ $form['slider']['show'] = array(
|
|
|
+ '#type' => 'image_button',
|
|
|
+ '#src' => drupal_get_path('module', 'materio_search_api') . '/images/search.png',
|
|
|
+ '#value' => t('Find'),
|
|
|
+ // '#attributes' => array("class"=>array("btn","btn-lg")),
|
|
|
+ '#prefix' => '<div class="submits">',
|
|
|
+ '#suffix' => '</div>',
|
|
|
+ );
|
|
|
+ return $form;
|
|
|
+}
|
|
|
+
|
|
|
+function materio_search_api_advanced_search_form_validate($form, &$form_state){
|
|
|
+ // dsm($form, '$form');
|
|
|
+ // dsm($form_state, '$form_state');
|
|
|
+ // dsm(strlen($form_state['values']['searchfield']));
|
|
|
+ // if (strlen(trim($form_state['values']['searchfield'])) <= 1) {
|
|
|
+ // form_set_error('searchfield', 'Please enter at least 2 characters keyword.');
|
|
|
+ // }
|
|
|
+}
|
|
|
+
|
|
|
+function materio_search_api_advanced_search_form_submit($form, &$form_state){
|
|
|
+ // dsm($form, 'form');
|
|
|
+ // dsm($form_state, 'form_state');
|
|
|
+ $fs_values = $form_state['values']['slider'];
|
|
|
+ unset($fs_values['show']);
|
|
|
+ // dsm($fs_values, 'values');
|
|
|
+
|
|
|
+ foreach($fs_values as $voc => $trees){
|
|
|
+ foreach($trees as $tree => $values){
|
|
|
+ foreach ($values as $values => $selected) {
|
|
|
+ if(is_array($selected) && count($selected)){
|
|
|
+ foreach ($selected as $tid) {
|
|
|
+ $tids[] = $tid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $form_state['redirect'] = 'explore/advanced/'.implode('/', $tids);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * viewmode
|
|
|
+ */
|
|
|
function _materio_search_api_change_viewmode($vm){
|
|
|
// dsm($vm, '_materio_search_api_change_viewmode');
|
|
|
|
|
@@ -656,7 +937,15 @@ function materio_search_api_theme($existing, $type, $theme, $path) {
|
|
|
'pager' => NULL,
|
|
|
'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',
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -677,6 +966,9 @@ function materio_search_api_theme($existing, $type, $theme, $path) {
|
|
|
function template_preprocess_materio_search_api_search_block(&$vars){
|
|
|
// dsm($vars, '$vars');
|
|
|
$vars['searchform'] = drupal_get_form("materio_search_api_search_form");
|
|
|
+ if(user_access('use materio search api advanced search')){
|
|
|
+ $vars['advancedsearchform'] = drupal_get_form("materio_search_api_advanced_search_form");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function template_preprocess_materio_search_api_select_viewmode_block(&$vars){
|
|
@@ -842,7 +1134,6 @@ function template_preprocess_materio_search_api_results(array &$vars) {
|
|
|
//dsm($vars, '$vars');
|
|
|
}
|
|
|
|
|
|
-
|
|
|
function template_preprocess_materio_search_api_actuality(&$vars){
|
|
|
// dsm($vars, 'template_preprocess_materio_search_api_actuality | vars');
|
|
|
|
|
@@ -850,6 +1141,92 @@ function template_preprocess_materio_search_api_actuality(&$vars){
|
|
|
$vars['actualities_infos'] = t('');
|
|
|
}
|
|
|
|
|
|
+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 theme_materio_search_api_form_element($variables) {
|
|
|
+ // dsm($variables, 'variables');
|
|
|
+
|
|
|
+ $element = &$variables['element'];
|
|
|
+
|
|
|
+ // This function is invoked as theme wrapper, but the rendered form element
|
|
|
+ // may not necessarily have been processed by form_builder().
|
|
|
+ $element += array(
|
|
|
+ '#title_display' => 'before',
|
|
|
+ );
|
|
|
+
|
|
|
+ // Add element #id for #type 'item'.
|
|
|
+ if (isset($element['#markup']) && !empty($element['#id'])) {
|
|
|
+ $attributes['id'] = $element['#id'];
|
|
|
+ }
|
|
|
+ // Add element's #type and #name as class to aid with JS/CSS selectors.
|
|
|
+ $attributes['class'] = array('form-item');
|
|
|
+ if (!empty($element['#type'])) {
|
|
|
+ $attributes['class'][] = 'form-type-' . strtr($element['#type'], '_', '-');
|
|
|
+ }
|
|
|
+ if (!empty($element['#name'])) {
|
|
|
+ $attributes['class'][] = 'form-item-' . strtr($element['#name'], array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
|
|
|
+ }
|
|
|
+ // Add a class for disabled elements to facilitate cross-browser styling.
|
|
|
+ if (!empty($element['#attributes']['disabled'])) {
|
|
|
+ $attributes['class'][] = 'form-disabled';
|
|
|
+ }
|
|
|
+
|
|
|
+ # adding element class to wrapper
|
|
|
+ foreach ($element['#attributes']['class'] as $value) {
|
|
|
+ $attributes['class'][] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach ($element['#attributes'] as $attr => $value) {
|
|
|
+ if(!in_array($attr, array('class', 'multiple', 'id', 'type', 'name'))){
|
|
|
+ $attributes[$attr] = $value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $output = '<div' . drupal_attributes($attributes) . '>' . "\n";
|
|
|
+
|
|
|
+
|
|
|
+ // If #title is not set, we don't display any label or required marker.
|
|
|
+ if (!isset($element['#title'])) {
|
|
|
+ $element['#title_display'] = 'none';
|
|
|
+ }
|
|
|
+ $prefix = isset($element['#field_prefix']) ? '<span class="field-prefix">' . $element['#field_prefix'] . '</span> ' : '';
|
|
|
+ $suffix = isset($element['#field_suffix']) ? ' <span class="field-suffix">' . $element['#field_suffix'] . '</span>' : '';
|
|
|
+
|
|
|
+ switch ($element['#title_display']) {
|
|
|
+ case 'before':
|
|
|
+ case 'invisible':
|
|
|
+ $output .= ' ' . theme('form_element_label', $variables);
|
|
|
+ $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n";
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'after':
|
|
|
+ $output .= ' ' . $prefix . $element['#children'] . $suffix;
|
|
|
+ $output .= ' ' . theme('form_element_label', $variables) . "\n";
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'none':
|
|
|
+ case 'attribute':
|
|
|
+ // Output no label and no required marker, only the children.
|
|
|
+ $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!empty($element['#description'])) {
|
|
|
+ $output .= '<div class="description">' . $element['#description'] . "</div>\n";
|
|
|
+ }
|
|
|
+
|
|
|
+ $output .= "</div>\n";
|
|
|
+
|
|
|
+ return $output;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* - - - - - - - - - - - - SEARCH API PAGE - - - - - - - - - - - -
|
|
|
*/
|