X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=a68454cf8b267c7c1a0a430a0e9e81ae49da44dd;hb=967f3b0f52a7f6e4afedea35bf2303414a41022f;hp=72abeecb1879f5b9bf20ab0719edbff241fe3a97;hpb=f01281f8a5806f708aa137f6236c3c3112277a0b;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 72abeecb..a68454cf 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; } @@ -1823,7 +1823,8 @@ function systypes_list_cells($label, $name, $value=null, $submit_on_change=false $str = array_selector($name, $value, $systypes_array, array( 'select_submit'=> $submit_on_change, - 'async' => false + 'async' => false, + 'default' => 0 ) ); echo "\n"; @@ -2126,17 +2127,63 @@ function security_roles_list_row($label, $name, $selected_id=null, $new_item=fal return $str; } -function tab_list_row($label, $name, $selected_id=null) +function tab_list_row($label, $name, $selected_id=null, $all = false) { - global $tabs; + global $installed_extensions; + + $tabs = array(); + foreach ($_SESSION['App']->applications as $app) { + $tabs[$app->id] = access_string($app->name, true); + } + if ($all) { // add also not active ext. modules + foreach ($installed_extensions as $ext) { + if ($ext['type'] == 'module' && !$ext['active']) + $tabs[$ext['tab']] = access_string($ext['title'], true); + } + } echo "\n"; echo "$label\n"; + array_selector($name, $selected_id, $tabs); + echo "\n"; +} - $items = array(); +//----------------------------------------------------------------------------------------------- - array_selector($name, $selected_id, $tabs); +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); - echo "\n"; + 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"; } //---------------------------------------------------------------------------------------------