You are here

stickynav.admin.inc in Sticky Navigation 6

Same filename and directory in other branches
  1. 7 admin/stickynav.admin.inc

Contains implementation of admin settings form for the sticky navigation

File

admin/stickynav.admin.inc
View source
<?php

/**
 * @file
 * Contains implementation of admin settings form for the sticky navigation
 */

/**
 * Admin form to set up the sticky nav logic.
 */
function stickynav_admin_form() {
  $form = array();
  $themes = list_themes();
  foreach ($themes as $name => $data) {

    // Only getting settings for enabled themes.
    if ($data->status == 1) {
      $form['stickynav-container=' . $name] = array(
        '#title' => check_plain($data->info['name']),
        '#type' => 'fieldset',
      );
      $form['stickynav-container=' . $name]['stickynav-enabled-' . $name] = array(
        '#type' => 'checkbox',
        '#title' => t('Enable'),
        '#default_value' => variable_get('stickynav-enabled-' . $name, FALSE),
      );

      // Selector is only visible when you activate sticky nav for the theme.
      $form['stickynav-container=' . $name]['stickynav-selector-' . $name] = array(
        '#type' => 'textfield',
        '#title' => t('Selector'),
        '#description' => t('Place your selector for your menu that will be sticky on your theme. Use jquery format.'),
        '#default_value' => variable_get('stickynav-selector-' . $name, ''),
      );
      $form['stickynav-container=' . $name]['stickynav-roles-' . $name] = array(
        '#type' => 'checkboxes',
        '#title' => t('Excluded Roles'),
        '#description' => t("Exclude specific roles from using sticky navigation."),
        '#options' => user_roles(),
        '#default_value' => variable_get('stickynav-roles-' . $name, array()),
      );
    }
  }
  return system_settings_form($form);
}

Functions

Namesort descending Description
stickynav_admin_form Admin form to set up the sticky nav logic.