You are here

function uc_store_admin in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_store/uc_store.module \uc_store_admin()
  2. 7.3 uc_store/uc_store.admin.inc \uc_store_admin()

Displays dashboard to other admin pages for the store.

1 string reference to 'uc_store_admin'
uc_store_menu in uc_store/uc_store.module
Implements hook_menu().

File

uc_store/uc_store.admin.inc, line 11
Store administration menu items.

Code

function uc_store_admin() {
  $tree = menu_navigation_links('navigation', 2);
  if (($type = variable_get('uc_store_admin_page_display', 1)) == 4) {
    $main_menu = menu_get_item('admin/store');
    $content = system_admin_menu_block((array) $main_menu);
    $output = theme('admin_block_content', $content);
  }
  else {
    $output = theme('uc_admin_dashboard', $type, $tree);
  }
  $results = module_invoke_all('store_status');
  foreach ($results as $message) {
    switch ($message['status']) {
      case 'warning':
        $icon = 'alert.gif';
        break;
      case 'error':
        $icon = 'error.gif';
        break;
      case 'ok':
      default:
        $icon = 'info.gif';
    }
    $icon = theme('image', drupal_get_path('module', 'uc_store') . '/images/' . $icon);
    $rows[] = array(
      array(
        'data' => $icon,
        'class' => 'icon',
      ),
      array(
        'data' => $message['title'],
        'class' => 'title',
      ),
      array(
        'data' => $message['desc'],
        'class' => 'message',
      ),
    );
  }
  $output .= '<div style="clear: both;">';
  $output .= theme('table', NULL, $rows, array(
    'class' => 'uc-store-status',
  ), '<h2>' . t('Store status') . '</h2>');
  $output .= '</div>';
  return $output;
}