You are here

function og_views_form_og_admin_settings_alter in Organic groups 6.2

Same name and namespace in other branches
  1. 6 modules/og_views/og_views.module \og_views_form_og_admin_settings_alter()

Implementation of hook_form_FORM-ID_alter().

File

modules/og_views/og_views.module, line 174

Code

function og_views_form_og_admin_settings_alter(&$form, $form_state) {
  $views = views_get_all_views();
  $options = array();
  foreach ($views as $key => $view) {
    if (substr($key, 0, strlen('og_ghp_')) == 'og_ghp_') {
      $options[$key] = $view->name;
    }
  }
  $form['og_settings']['group_details']['og_home_page_view'] = array(
    '#type' => 'select',
    '#title' => t('Group home page view'),
    '#description' => t('Pick a View for your group home page. Only Views whose names start with <strong>og_ghp_</strong> are eligible. The View determines the layout of your group home page. You may alter the presentation using typical Views themeing techniques. See the Theme information link when editing your View and also see the Theme section of the !README. Also note that group admins can override this presentation using the included <em>Organic Groups Panels</em> module.', array(
      '!README' => og_readme(),
    )),
    '#options' => array(
      0 => t('None'),
    ) + $options,
    '#default_value' => variable_get('og_home_page_view', 'og_ghp_ron'),
  );
}