The short title * 'description' => The longer descriptive title * 'callback' => The callback to use for this section. If blank no menu entry * will be provided. * * Each menu entry has * 'title' => The short title of the menu entry * 'description' => The longer desc * 'weight' => A weight can be specified; this will override the default weight * and is not recommended; the default weight will put menu items * in the order they appear in the array. */ function _administration_menu_config() { $config['cssfile'] = 'civicspace.css'; $config['default']['sub_panel_theme'] = 'cs_administration_sub_menu_panel'; // This is for new links so that they get the right permissions. // Kind of annoying honestly. $config['section']['sadmin/features'] = array( 'title' => t('features'), 'description' => t('New Features and Applications'), 'long-desc' => t("You can configure new applications, known as modules, and learn how to add new features."), 'callback' => '_administration_sub_dashboard_page', 'panel_theme' => 'cs_administration_menu_panel', 'sub_panel_theme' => 'cs_administration_sub_menu_panel', 'sub_panel_css' => 'dashboard', 'items' => array( 'admin/help' => array( 'title' => t('help'), 'description' => t('Application (Module) help'), ), 'sadmin/features/support' => array( 'title' => t('get support'), 'description' => t('Get support'), 'short-desc' => t('A page that explains support options, including paid support'), 'long-desc' => t('This exists as an example of what the long-desc will do'), 'callback' => 'administration_offsite', 'callback arguments' => array('http://drupal.org/support'), ), 'admin/modules' => array( 'title' => t('activate/deactivate'), 'description' => t('Turn on and off applications (modules)'), ), 'admin/settings' => array( 'title' => t('configure modules'), 'description' => t("Configure my site's module settings"), ), 'admin' => array( 'title' => t('other'), 'description' => t("Configure uncategorized items for modules"), ), 'chat' => array( 'title' => t('chat'), 'description' => t('Chat live to volunteers'), 'short-desc' => t('Well researched questions may be answered'), 'callback' => 'administration_offsite', 'callback arguments' => array('http://drupal.org/support'), ), ), ); $config['section']['sadmin/content'] = array( 'title' => t('content'), 'description' => t('Manage web pages (content)'), 'long-desc' => t('Web pages are treated as content that can be managed with settings.'), 'callback' => '_administration_sub_dashboard_page', 'panel_theme' => 'cs_administration_menu_panel', 'sub_panel_theme' => 'cs_administration_sub_menu_panel', 'sub_panel_css' => 'dashboard', 'items' => array( 'admin/comment' => array( 'title' => t('manage comments'), 'description' => t("Moderate and publish comments"), ), 'admin/taxonomy' => array( 'title' => t('manage categories'), 'description' => t("Set up and maintain your site's categories (vocabularies/taxonomy)"), ), 'node/add' => array( 'title' => t('create content'), 'description' => t("Add new web pages (content) to your site"), ), 'sadmin/content/no-link1' => array( 'title' => t('apply tags'), 'description' => t('Apply tags to web pages (content)'), 'callback' => 'drupal_not_found', ), 'admin/node' => array( 'title' => t('organize'), 'description' => t('Order and organize web pages (content)'), ), ), ); $config['section']['sadmin/build'] = array( 'title' => t('build'), 'description' => t('Build your web site'), 'long-desc' => t('Adminstering users, installing new applications, upgrading, creating menus, checking versions'), 'callback' => '_administration_sub_dashboard_page', 'panel_theme' => 'cs_administration_menu_panel', 'sub_panel_theme' => 'cs_administration_sub_menu_panel', 'sub_panel_css' => 'dashboard', 'items' => array( 'sadmin/build/no-link2' => array( 'title' => t('install modules'), 'description' => t('Install new modules'), 'short-desc' => t('Download module files, database install'), 'callback' => 'drupal_not_found' ), 'admin/menu' => array( 'title' => t('menus'), 'description' => t("Create and configure menus"), ), 'admin/access' => array( 'title' => t('access control'), 'description' => t("Setup site security (access control to site features)"), ), 'admin/path' => array( 'title' => t('url aliases'), 'description' => t("Create and manage URL aliases"), ), 'admin/filters' => array( 'title' => t('input formats'), 'description' => t("Configure allowable input formats/input filters"), ), ), ); $config['section']['sadmin/style'] = array( 'title' => t('style'), 'description' => t('Style and layout'), 'long-desc' => t('Administering style and layout elements of your web site'), 'callback' => '_administration_sub_dashboard_page', 'panel_theme' => 'cs_administration_menu_panel', 'sub_panel_theme' => 'cs_administration_sub_menu_panel', 'sub_panel_css' => 'dashboard', 'items' => array( 'admin/themes' => array( 'title' => t('themes'), 'description' => t("Activate/configure themes"), ), 'admin/block' => array( 'title' => t('blocks'), 'description' => t("Activate/configure blocks"), ), 'sadmin/style/no-link1' => array( 'title' => t('fix themes'), 'description' => t('Fix theme problems'), 'callback' => 'drupal_not_found', ), 'sadmin/style/no-link2' => array( 'title' => t('page layout'), 'description' => t('Page layout'), 'short-desc' => t('Page layouts, front pages, number of columns'), 'callback' => 'drupal_not_found' ), ), ); $config['section']['sadmin/overview'] = array( 'title' => t('site overview'), 'description' => t('Site overview'), 'long-desc' => t('View site users, manage content, view system logs'), 'callback' => '_administration_sub_dashboard_page', 'panel_theme' => 'cs_administration_menu_panel', 'sub_panel_theme' => 'cs_administration_sub_menu_panel', 'sub_panel_css' => 'dashboard', 'items' => array( 'admin/user' => array( 'title' => t('manage users'), 'description' => t("Change or add users"), ), 'admin/node' => array( 'title' => t('manage content'), 'description' => t("Moderate, promote and manage your web pages"), ), 'admin/logs' => array( 'title' => t('logs'), 'description' => t("Site errors and other logs"), ), ), ); $config['section']['sadmin/mail'] = array( 'title' => t('mail'), 'description' => t('Mail and subscriptions'), 'long-desc' => t('Manage mail, compose newsletters, subscription management'), 'callback' => '_administration_sub_dashboard_page', 'panel_theme' => 'cs_administration_menu_panel', 'sub_panel_theme' => 'cs_administration_sub_menu_panel', 'sub_panel_css' => 'dashboard', 'items' => array( 'sadmin/mail/no-link1' => array( 'title' => t('mailing lists'), 'description' => t('Mailing lists'), 'callback' => 'drupal_not_found', ), 'admin/aggregator' => array( 'title' => t('news feeds'), 'description' => t("Manage my news feeds"), ), ), ); $config['section']['sadmin/statistics'] = array( 'title' => t('statistics'), 'description' => t('Site Statistics'), 'long-desc' => t('A glance at administrative statistics about your site'), 'callback' => '_administration_sub_dashboard_page', 'panel_theme' => 'administration_statistics', 'sub_panel_css' => 'dashboard', ); // This special one clones the system settings section so it goes into the // right place $config['section']['sadmin/build/settings'] = array( 'title' => t('site settings'), 'description' => t('Configure site-wide settings'), 'callback' => 'system_site_settings', ); // overrides to repoint a couple of settings. $config['section']['admin/settings'] = array( 'title' => t('configure modules'), 'description' => t("Configure my site's module settings"), 'callback' => '_administration_settings_page', ); // overrides to repoint a couple of settings. $config['section']['admin'] = array( 'title' => t('configure modules'), 'description' => t("Configure uncategorized module settings"), 'callback' => '_administration_sub_dashboard_page', ); $config['dashboard']['dashboard'] = array( 'sadmin/features', 'sadmin/content', 'sadmin/build', 'sadmin/style', 'sadmin/overview', 'sadmin/mail', 'sadmin/statistics', ); return $config; } function theme_cs_administration_menu_panel($path) { // Just a copy of the standard one, but uses 2 columns. $config = _administration_menu_config(); $menu = menu_get_menu(); $mid = $menu['path index'][$path]; $output .= '
'; $output .= '
'; $output .= $menu['items'][$mid]['description']; $output .= '
'; $output .= '
'; $output .= '
'; $output .= $config['section'][$path]['long-desc']; $output .= '
'; $col1 = '
    '; $col2 = '
      '; $counter = 0; foreach ($menu['visible'][$mid]['children'] as $cid) { $item = ''; $item .= '
    • '; $title = !empty($menu['items'][$cid]['description']) ? $menu['items'][$cid]['description'] : $menu['items'][$cid]['title']; $item .= l($title, $menu['items'][$cid]['path'], array('title' => $menu['items'][$cid]['title'])); $longdesc = $config['section'][$path]['items'][$menu['items'][$cid]['path']]['short-desc']; if ($longdesc) { $item .= " $longdesc"; } $item .= '
    • '; if ($counter++ % 2 == 0) { $col1 .= $item; } else { $col2 .= $item; } } $col1 .= '
    '; $col2 .= '
'; $output .= $col1 . $col2; $output .= '
'; $output .= '
'; return $output; } function theme_cs_administration_sub_menu_panel() { drupal_set_title(''); $config = _administration_menu_config(); $menu = menu_get_menu(); $mid = menu_get_active_item(); $path = $menu['items'][$mid]['path']; $output .= '
'; $output .= '
'; $output .= $menu['items'][$mid]['description']; $output .= '
'; $output .= '
'; $output .= '
'; $output .= $config['section'][$path]['long-desc']; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'; return $output; } function theme_administration_statistics_panel($stats, $path = NULL) { $config = _administration_menu_config(); $menu = menu_get_menu(); if (!$path) { $mid = menu_get_active_item(); $path = $menu['items'][$mid]['path']; } else { $mid = $menu['path index'][$path]; } $output .= '
'; $output .= '
'; $output .= $menu['items'][$mid]['description']; $output .= '
'; $output .= '
'; $output .= '
'; $output .= $config['section'][$path]['long-desc']; $output .= '
'; $output .= ''; $counter = 0; $last = count($stats); foreach ($stats as $stat) { $item .= ""; if ($counter++ % 2 == 1 || $counter == $last) { $output .= "$item\n"; $item = ""; } } $output .= '
$stat[title]$stat[value]
'; $output .= '
'; $output .= '
'; return $output; } /** * This function generates some basic site statistics, then sends them * into a theme function for display. */ function theme_administration_statistics($path) { $users = db_result(db_query("SELECT COUNT(*) FROM users WHERE status = 1")); $stats['users'] = array('title' => t("Users"), 'value' => $users); $nodes = db_result(db_query("SELECT COUNT(*) FROM node WHERE status = 1")); $stats['nodes'] = array('title' => t("Published Nodes"), 'value' => $nodes); $comments = db_result(db_query("SELECT COUNT(*) FROM comments WHERE status = 1")); $stats['comments'] = array('title' => t("Published comments"), 'value' => $comments); $config = administration_menu_config(); return theme('administration_statistics_panel', $stats, $path); } ?>