You are here

function menu_minipanels_admin in Menu Minipanels 7.2

Same name and namespace in other branches
  1. 6 menu_minipanels.admin.inc \menu_minipanels_admin()
  2. 7 menu_minipanels.admin.inc \menu_minipanels_admin()

Page callback for admin/settings/menu_minipanels.

1 string reference to 'menu_minipanels_admin'
menu_minipanels_menu in ./menu_minipanels.module
Implements hook_menu().

File

./menu_minipanels.admin.inc, line 10
Menu Minipanels administration include file for configuration.

Code

function menu_minipanels_admin() {
  $form = array();

  // Show the current status of the qTip library.
  include_once 'includes/install.inc';
  module_load_include('install', 'menu_minipanels');

  // Give shortcuts to the menu-edit pages.
  $result = db_query("SELECT * FROM {menu_custom} ORDER BY title", array(), array(
    'fetch' => PDO::FETCH_ASSOC,
  ));
  $header = array(
    t('Title'),
    array(
      'data' => t('Can be used?'),
    ),
  );
  $rows = array();
  foreach ($result as $menu) {
    $row = array();
    $row[] = array(
      'data' => l($menu['title'], 'admin/structure/menu/manage/' . $menu['menu_name'] . '/edit', array(
        'query' => array(
          'destination' => 'admin/config/content/menu_minipanels',
        ),
        'attributes' => array(
          'title' => t('Edit this menu'),
        ),
      )),
    );
    if (variable_get('menu_minipanels_' . $menu['menu_name'] . '_enabled', FALSE)) {
      $label = 'Yes';
    }
    else {
      $label = 'No';
    }
    $row[] = array(
      'data' => l(t($label), 'admin/config/user-interface/menu_minipanels/toggle/' . $menu['menu_name'], array(
        'attributes' => array(
          'title' => t('Toggle this menu'),
        ),
      )),
    );
    $rows[] = $row;
  }
  $form['menus'] = array(
    '#markup' => theme('table', array(
      'caption' => t('Menu selection'),
      'header' => $header,
      'rows' => $rows,
    )),
  );

  // Additional global settings.
  // Control which pages are excluded from having megamenus.
  $form['menu_minipanels_exclude_paths'] = array(
    '#type' => 'textarea',
    '#title' => t("Don't show Menu_Minipanels on specific pages"),
    '#default_value' => variable_get('menu_minipanels_exclude_paths', "admin\nadmin/*"),
    '#description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array(
      '%blog' => 'blog',
      '%blog-wildcard' => 'blog/*',
      '%front' => '<front>',
    )),
  );
  return system_settings_form($form);
}