You are here

function theme_uc_catalog_item in Ubercart 5

Same name and namespace in other branches
  1. 8.4 uc_catalog/uc_catalog.theme.inc \theme_uc_catalog_item()
  2. 6.2 uc_catalog/uc_catalog.module \theme_uc_catalog_item()
  3. 7.3 uc_catalog/uc_catalog.theme.inc \theme_uc_catalog_item()

Display a formatted link in the catalog block.

See also

theme_uc_catalog_block_start

theme_uc_catalog_block_end

1 theme call to theme_uc_catalog_item()
_uc_catalog_navigation in uc_catalog/uc_catalog.module
Emulates Drupal's menu system, but based soley on the structure of "Product Catalog".

File

uc_catalog/uc_catalog.module, line 1322
Übercart Catalog module.

Code

function theme_uc_catalog_item($here, $active_link = '', $lis, $expand, $inpath, $link, $count_children) {
  $output = '';
  if ($expand || $count_children) {
    if ($here) {
      $output = '<li class="expanded"><strong>' . $active_link . "</strong>\n";
      if (count($lis)) {
        $output .= '<ul class="menu">';
        foreach ($lis as $li) {
          $output .= $li . "\n";
        }
        $output .= "</ul>\n";
      }
      $output .= "</li>";
    }
    elseif ($expand || $inpath) {
      $output = '<li class="expanded">' . ($referer == $branch_path ? '<strong>' : '') . $link . ($referer == $branch_path ? '</strong>' : '') . "\n";
      if (count($lis)) {
        $output .= '<ul class="menu">';
        foreach ($lis as $li) {
          $output .= $li;
        }
        $output .= "</ul>\n";
      }
      $output .= "</li>";
    }
    else {
      $output = '<li class="collapsed">' . $link . "</li>\n";
    }
  }
  else {
    $output = '<li class="leaf">' . ($inpath ? '<strong>' : '') . ($here ? $active_link : $link) . ($inpath ? '</strong>' : '') . '</li>' . "\n";
  }
  return $output;
}