function flexisearch_settings() { $form = array(); $form['general'] = array( '#type' => 'fieldset', '#title' => t('General settings'), ); $form['general']['flexisearch_menu_title'] = array( '#type' => 'textfield', '#title' => t('Custom page title & menu name'), '#default_value' => variable_get('flexisearch_menu_title', 'Flexisearch'), '#size' => 70, '#maxlength' => 70, '#description' => t('Specify your own link name and page title for the flexisearch page. The default is Flexisearch.'), ); $form['general']['flexisearch_help'] = array( '#type' => 'textarea', '#title' => t('Flexisearch help text (optional)'), '#default_value' => variable_get('flexisearch_help', ''), '#cols' => 70, '#rows' => 5, '#description' => t('This text will be displayed at the top of the flexisearch form. It is useful for helping or instructing your users.'), ); $form['general']['flexisearch_index_reset'] = array( '#type' => 'select', '#title' => t('Refresh your database search index (optional)'), '#default_value' => variable_get('flexisearch_index_reset', no), '#options' => drupal_map_assoc(array(no, yes)), '#description' => t('

Select whether you want to update your Search Index. Recommended if you are using flexisearch for the first time.

If selected, your search index will be updated on the next cron run and may take a few moments depending on how your cron runs are setup under the Search Admin Settings page.

'), ); $content_types = flexinode_content_types(); //loads up content types foreach ($content_types as $ctype) { $group =''; $ctype = flexinode_load_content_type($ctype->ctype_id); if (count($ctype->fields) > 1) { $form[t($ctype->name)] = array( '#type' => 'fieldset', '#title' => t($ctype->name), ); foreach ($ctype->fields as $field) { if ($field->field_type == 'textfield' || $field->field_type == 'textarea') { //$group .= form_checkbox(t($field->label), ('flexisearch_'. $field->field_id), 1, variable_get(('flexisearch_'. $field->field_id .''),0)); $form[t($ctype->name)][('flexisearch_'. $field->field_id)] = array( '#type' => 'checkbox', '#title' => t($field->label), '#return_value' => 1, '#default_value' => variable_get(('flexisearch_'. $field->field_id .''),0), ); } } } } return $form; }