Changeset 9367


Ignore:
Timestamp:
Feb 24, 2011, 2:49:48 PM (13 years ago)
Author:
plg
Message:

ability to to display the album name as a single link and not several links depending on uppercats, with get_cat_display_name_cache

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_html.inc.php

    r8728 r9367  
    112112function get_cat_display_name_cache($uppercats,
    113113                                    $url = '',
    114                                     $replace_space = true)
     114                                    $replace_space = true,
     115                                    $single_link = false,
     116                                    $link_class = null)
    115117{
    116118  global $cache, $conf;
     
    126128
    127129  $output = '';
     130  if ($single_link)
     131  {
     132    $single_url = get_root_url().$url.array_pop(explode(',', $uppercats));
     133    $output.= '<a href="'.$single_url.'"';
     134    if (isset($link_class))
     135    {
     136      $output.= ' class="'.$link_class.'"';
     137    }
     138    $output.= '>';
     139  }
    128140  $is_first = true;
    129141  foreach (explode(',', $uppercats) as $category_id)
     
    146158    }
    147159
    148     if ( !isset($url) )
     160    if ( !isset($url) or $single_link )
    149161    {
    150162      $output.= $cat['name'];
     
    167179    }
    168180  }
     181 
     182  if ($single_link and isset($single_url))
     183  {
     184    $output.= '</a>';
     185  }
     186
    169187  if ($replace_space)
    170188  {
Note: See TracChangeset for help on using the changeset viewer.