function uc_catalog_block_view in Ubercart 7.3
Implements hook_block_view().
File
- uc_catalog/
uc_catalog.module, line 249 - Ubercart Catalog module.
Code
function uc_catalog_block_view($delta = '') {
if ($delta == 'catalog') {
$block = array();
if (user_access('view catalog')) {
drupal_add_css(drupal_get_path('module', 'uc_catalog') . '/uc_catalog.css');
// Get the vocabulary tree information.
$vid = variable_get('uc_catalog_vid', 0);
$tree = taxonomy_get_tree($vid);
// Then convert it into an actual tree structure.
$seq = 0;
$menu_tree = new UcTreeNode();
$level = array();
$curr_depth = -1;
foreach ($tree as $knot) {
$seq++;
$knot->sequence = $seq;
$knothole = new UcTreeNode($knot);
// Begin at the root of the tree and find the proper place.
$menu_tree
->add_child($knothole);
}
// Now, create a structured menu, separate from Drupal's menu.
$content = theme('uc_catalog_block', array(
'menu_tree' => $menu_tree,
));
$block = array(
'subject' => t('Catalog'),
'content' => $content,
);
}
return $block;
}
}