You are here

function uc_store_block in Ubercart 5

Implementation of hook_block().

File

uc_store/uc_store.module, line 419
Contains global Ubercart functions and store administration functionality.

Code

function uc_store_block($op = 'list', $delta = 0, $edit = array()) {
  if ($op == 'list') {
    $blocks[0]['info'] = t('Store links');
    return $blocks;
  }
  else {
    if ($op == 'view') {
      switch ($delta) {
        case 0:
          if (!user_access('administer store')) {
            break;
          }
          uc_add_js(drupal_get_path('module', 'uc_store') . '/uc_store.js');
          $menu = menu_get_item(null, 'admin/store');
          $output = '<ul id="store-links">' . "\n";
          $output .= theme('uc_store_block_links', $menu);
          $output .= "</ul>\n";
          $block['subject'] = t('Store links');
          $block['content'] = $output . '<br class="clear" /><br />';
          break;
      }
      return $block;
    }
  }
}