aboutsummaryrefslogtreecommitdiffstats
path: root/template/default/htmlfunctions.inc.php
diff options
context:
space:
mode:
authorgweltas <gweltas@piwigo.org>2004-03-26 17:08:09 +0000
committergweltas <gweltas@piwigo.org>2004-03-26 17:08:09 +0000
commit9fd459d0510534ab6f92b7f4e9a3a4598ff3c1ab (patch)
tree95e08d38d2604c350c1b200e0cb2c20cc53bbfc8 /template/default/htmlfunctions.inc.php
parent4128835db8d7b8e619951d4c31e23bd934758f09 (diff)
- Template migration
- Admin Control Panel migration - Category management git-svn-id: http://piwigo.org/svn/trunk@394 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/htmlfunctions.inc.php (renamed from template/default/htmlfunctions.inc.php)59
1 files changed, 27 insertions, 32 deletions
diff --git a/template/default/htmlfunctions.inc.php b/include/htmlfunctions.inc.php
index 6031d1e45..426ef8e82 100644
--- a/template/default/htmlfunctions.inc.php
+++ b/include/htmlfunctions.inc.php
@@ -107,38 +107,6 @@ function create_navigation_bar( $url, $nb_element, $start,
return $navigation_bar;
}
-
-
-function make_jumpbox($value, $selected, $usekeys=false)
-{
- $boxstring = '';
- $nb = sizeof( $value);
- $keys = ($usekeys?array_keys($value):$value);
- $value = ($usekeys?array_values($value):$value);
- for ( $i = 0; $i < $nb; $i++ )
- {
- $boxstring .= '<option value="'.$keys[$i].'"';
- if ($selected == $keys[$i]) $boxstring .=' selected="selected"';
- $boxstring .='>'.$value[$i].'</option>';
- }
- return $boxstring;
-}
-
-function make_radio($name, $value, $selected, $usekeys=false)
-{
- $boxstring = '';
- $nb = sizeof( $value);
- $keys = ($usekeys?array_keys($value):$value);
- $value = ($usekeys?array_values($value):$value);
- for ( $i = 0; $i < $nb; $i++ )
- {
- $boxstring .= '<input type="radio" name="'.$name.'" value="'.$keys[$i].'"';
- if ($selected == $keys[$i]) $boxstring .=' checked';
- $boxstring .='/>'.$value[$i];
- }
- return $boxstring;
-}
-
//
// Pick a language, any language ...
//
@@ -192,4 +160,31 @@ function style_select($default_style, $select_name = "style")
closedir($dir);
return $style_select;
}
+
+// The function get_cat_display_name returns a string containing the list
+// of upper categories to the root category from the lowest category shown
+// example : "anniversaires - fete mere 2002 - animaux - erika"
+// You can give this parameters :
+// - $style : the style of the span tag for the lowest category,
+// "font-style:italic;" for example
+function get_cat_display_name( $cat_informations, $separator,
+ $url = 'category.php?cat=', $replace_space = true)
+{
+ $output = '';
+ $i=0;
+ while ( list ($id, $name) = each($cat_informations))
+ {
+ if ( $i ) $output.= $separator;
+ $i++;
+ if (empty($style) && empty($url) || ($i == count( $cat_informations)))
+ $output.= $name;
+ elseif (!empty($url))
+ $output.= '<a class="" href="'.add_session_id(PHPWG_ROOT_PATH.$url.$id).'">'.$name."</a>";
+ else
+ $output.= '<span style="'.$style.'">'.$name.'</span>';
+ }
+ if ( $replace_space ) return replace_space( $output );
+ else return $output;
+}
?>
+