aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_html.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-02-24 13:49:48 +0000
committerplegall <plg@piwigo.org>2011-02-24 13:49:48 +0000
commitb6457719daa116698caeb2b42ee415870d5bf7e9 (patch)
tree9a8e765de93e765444649657aa2fbd7d81ad47e0 /include/functions_html.inc.php
parentbf4d7dca1411d0127f6b47dbc18cc2b1cb007f88 (diff)
ability to to display the album name as a single link and not several links depending on uppercats, with get_cat_display_name_cache
git-svn-id: http://piwigo.org/svn/trunk@9367 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_html.inc.php')
-rw-r--r--include/functions_html.inc.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php
index 0d7c6e97f..9e422288e 100644
--- a/include/functions_html.inc.php
+++ b/include/functions_html.inc.php
@@ -111,7 +111,9 @@ function get_cat_display_name($cat_informations,
*/
function get_cat_display_name_cache($uppercats,
$url = '',
- $replace_space = true)
+ $replace_space = true,
+ $single_link = false,
+ $link_class = null)
{
global $cache, $conf;
@@ -125,6 +127,16 @@ SELECT id, name, permalink
}
$output = '';
+ if ($single_link)
+ {
+ $single_url = get_root_url().$url.array_pop(explode(',', $uppercats));
+ $output.= '<a href="'.$single_url.'"';
+ if (isset($link_class))
+ {
+ $output.= ' class="'.$link_class.'"';
+ }
+ $output.= '>';
+ }
$is_first = true;
foreach (explode(',', $uppercats) as $category_id)
{
@@ -145,7 +157,7 @@ SELECT id, name, permalink
$output.= $conf['level_separator'];
}
- if ( !isset($url) )
+ if ( !isset($url) or $single_link )
{
$output.= $cat['name'];
}
@@ -166,6 +178,12 @@ SELECT id, name, permalink
<a href="'.PHPWG_ROOT_PATH.$url.$category_id.'">'.$cat['name'].'</a>';
}
}
+
+ if ($single_link and isset($single_url))
+ {
+ $output.= '</a>';
+ }
+
if ($replace_space)
{
return replace_space($output);