From: Janusz Dobrowolski Date: Thu, 22 Oct 2009 10:32:18 +0000 (+0000) Subject: Fixed bug in default selection in array selector, added tags lists. X-Git-Tag: v2.4.2~19^2~1105 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=dd09f71fabc65963aa0abcab5bca3b2b6d6355ae;p=fa-stable.git Fixed bug in default selection in array selector, added tags lists. --- diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 72abeecb..f23d736d 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -330,7 +330,7 @@ $opts = array( // default options if ($spec_option !== false) { // if special option used - add it $first_id = $spec_id; $first_opt = $spec_option; - $sel = $found!==false ? 'selected' : ''; + $sel = $found===false ? 'selected' : ''; $selector = "\n" . $selector; } @@ -2139,6 +2139,45 @@ function tab_list_row($label, $name, $selected_id=null) echo "\n"; } +//----------------------------------------------------------------------------------------------- + +function tag_list($name, $height, $type, $multi=false, $all=false) +{ + // Get tags + global $path_to_root; + include_once($path_to_root . "/admin/db/tags_db.inc"); + $results = get_tags($type,$all); + + while ($tag = db_fetch($results)) + $tags[$tag['id']] = $tag['name']; + + if (!isset($tags)) { + $tags[''] = _("No ".($all?"":"active ")."tags defined."); + } + return array_selector($name, null, $tags, + array( + 'multi' => $multi, + 'height' => $height, + ) ); +} + +function tag_list_cells($label, $name, $height, $type, $mult=false, $all=false) +{ + if ($label != null) + echo "$label\n"; + echo "\n"; + tag_list($name, $height, $type, $mult, $all); + echo "\n"; + +} + +function tag_list_row($label, $name, $height, $type, $mult=false, $all=false) +{ + echo "\n"; + tag_list_cells($label, $name, $height, $type, $mult, $all); + echo "\n"; +} + //--------------------------------------------------------------------------------------------- // List of sets of active extensions //