You are here

function views_attach_plugin_display_profile::options_form in Views attach 6

Same name and namespace in other branches
  1. 6.2 views_attach_plugin_display_profile.inc \views_attach_plugin_display_profile::options_form()
  2. 7.2 views_attach_plugin_display_profile.inc \views_attach_plugin_display_profile::options_form()

Provide the default form for setting options.

File

./views_attach_plugin_display_profile.inc, line 62

Class

views_attach_plugin_display_profile
The plugin that handles a user profile.

Code

function options_form(&$form, &$form_state) {

  // It is very important to call the parent function here:
  parent::options_form($form, $form_state);
  switch ($form_state['section']) {
    case 'weight':
      $form['#title'] .= t('Weight');
      $form['weight'] = array(
        '#type' => 'weight',
        '#description' => t('The position of this view in relation to other profile elements.'),
        '#default_value' => $this
          ->get_option('weight'),
      );
      break;
    case 'category':
      $form['#title'] .= t('Category');
      $form['category'] = array(
        '#type' => 'textfield',
        '#description' => t('The name of the profile tab this view should be listed in. If empty, it will be displayed on the main profile tab.'),
        '#default_value' => $this
          ->get_option('category'),
      );
      break;
    case 'default_argument':
      $form['#title'] .= t('Default argument');
      $form['default_argument'] = array(
        '#type' => 'checkbox',
        '#title' => t("Provide the current user id as a default argument."),
        '#default_value' => $this
          ->get_option('default_argument') === 'uid',
        '#return_value' => 'uid',
      );
      break;
  }
}