*** empty log message ***
[fa-stable.git] / includes / ui / ui_lists.inc
index 72abeecb1879f5b9bf20ab0719edbff241fe3a97..3a34efba66bcd3d8a98af592fb9253775691acd6 100644 (file)
@@ -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 = "<option $sel value='$spec_id'>$spec_option</option>\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 "</td>\n";
@@ -2139,6 +2140,45 @@ function tab_list_row($label, $name, $selected_id=null)
        echo "</td></tr>\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 "<td>$label</td>\n";
+       echo "<td>\n";
+       tag_list($name, $height, $type, $mult, $all);
+       echo "</td>\n";
+       
+}
+
+function tag_list_row($label, $name, $height, $type, $mult=false, $all=false)
+{
+       echo "<tr>\n";
+       tag_list_cells($label, $name, $height, $type, $mult, $all);
+       echo "</tr>\n"; 
+}
+
 //---------------------------------------------------------------------------------------------
 //     List of sets of active extensions 
 //