improvement: tags replace keywords. Better data model, less

limitations. Each image can be associated to as many tag as needed. Tags can
contain non ASCII characters. Oriented navigation with tags by association.


git-svn-id: http://piwigo.org/svn/trunk@1119 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall 2006-04-02 22:26:19 +00:00
parent 68ed2ea617
commit 42abf4c576
44 changed files with 1863 additions and 368 deletions

View file

@ -5,7 +5,6 @@
// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | branch : BSF (Best So Far)
// | file : $Id$
// | last update : $Date$
// | last modifier : $Author$
// | revision : $Revision$
@ -494,6 +493,56 @@ function get_cat_display_name_from_id($cat_id,
return get_cat_display_name($cat_info['name'], $url, $replace_space);
}
/**
* Returns an HTML list of tags. It can be a multi select field or a list of
* checkboxes.
*
* @param string HTML field name
* @param array selected tag ids
* @return array
*/
function get_html_tag_selection(
$tags,
$fieldname,
$selecteds = array(),
$forbidden_categories = null
)
{
global $conf;
$output = '<ul class="tagSelection">';
foreach ($tags as $tag)
{
$output.=
'<li>'
.'<label>'
.'<input type="checkbox" name="'.$fieldname.'[]"'
.' value="'.$tag['tag_id'].'"'
;
if (in_array($tag['tag_id'], $selecteds))
{
$output.= ' checked="checked"';
}
$output.=
' />'
.' '.$tag['name']
.'</label>'
.'</li>'
."\n"
;
}
$output.= '</ul>';
return $output;
}
function name_compare($a, $b)
{
return strcmp($a['name'], $b['name']);
}
/**
* exits the current script (either exit or redirect)
*/
@ -519,4 +568,4 @@ function access_denied()
redirect($login_url);
}
}
?>
?>