+function record_status_list_row($label, $name) {
+ return yesno_list_row($label, $name, null, _('Inactive'), _('Active'));
+}
+
+function class_types_list_row($label, $name, $selected_id=null, $submit_on_change=false)
+{
+ global $class_types;
+
+ echo "<tr><td>$label</td><td>";
+ array_selector($name, $selected_id, $class_types,
+ array(
+ 'select_submit'=> $submit_on_change
+ ) );
+ echo "</td></tr>\n";
+}
+
+//------------------------------------------------------------------------------------------------
+
+function security_roles_list($name, $selected_id=null, $new_item=false, $submit_on_change=false,
+ $show_inactive = false)
+{
+ global $all_items;
+
+ $sql = "SELECT id, role, inactive FROM ".TB_PREF."security_roles";
+
+return combo_input($name, $selected_id, $sql, 'id', 'description',
+ array(
+ 'spec_option'=>$new_item ? _("New role") : false,
+ 'spec_id' => '',
+ 'select_submit'=> $submit_on_change,
+ 'show_inactive' => $show_inactive
+ ) );
+}
+
+function security_roles_list_cells($label, $name, $selected_id=null, $new_item=false, $submit_on_change=false,
+ $show_inactive = false)
+{
+ if ($label != null)
+ echo "<td>$label</td>\n";
+ echo "<td>";
+ $str = security_roles_list($name, $selected_id, $new_item, $submit_on_change, $show_inactive);
+ echo "</td>\n";
+ return $str;
+}
+
+function security_roles_list_row($label, $name, $selected_id=null, $new_item=false, $submit_on_change=false,
+ $show_inactive = false)
+{
+ echo "<tr>";
+ $str = security_roles_list_cells($label, $name, $selected_id, $new_item, $submit_on_change, $show_inactive);
+ echo "</tr>\n";
+ return $str;
+}
+
+function tab_list_row($label, $name, $selected_id=null, $all = false)
+{
+ 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 "<tr>\n";
+ echo "<td>$label</td><td>\n";
+ array_selector($name, $selected_id, $tabs);
+ 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
+//
+function extset_list($name, $value=null, $submit_on_change=false)
+{
+ global $db_connections;
+
+ $items = array();
+ foreach ($db_connections as $comp)
+ $items[] = sprintf(_("Activated for '%s'"), $comp['name']);
+ array_selector( $name, $value, $items,
+ array(
+ 'spec_option'=> _("Installed on system"),
+ 'spec_id' => -1,
+ 'select_submit'=> $submit_on_change,
+ 'async' => true
+ ));
+}