Example #1
0
 echo "\n<form id=\"s_item_listing_conf\" name=\"s_item_listing_conf\" action=\"{$PHP_SELF}\" method=\"POST\">";
 echo "\n<input type=\"hidden\" name=\"op\" value=\"\">";
 echo "\n<input type=\"hidden\" name=\"type\" value=\"" . $ADMIN_TYPE . "\">";
 echo "\n<input type=\"hidden\" name=\"s_item_type_group\" value=\"" . $HTTP_VARS['s_item_type_group'] . "\">";
 echo "\n<input type=\"hidden\" name=\"s_item_type\" value=\"" . $HTTP_VARS['s_item_type'] . "\">";
 echo "\n<table>";
 echo '<tr class="navbar">';
 // now we want to build the input form
 for ($i = 0; $i < count($prompts_r); $i++) {
     echo '<th>' . $prompts_r[$i] . '</th>';
 }
 echo '</tr>';
 $row = 0;
 $HTTP_VARS['silc_id'] = fetch_s_item_listing_conf_id($HTTP_VARS['s_item_type_group'], $HTTP_VARS['s_item_type']);
 if (is_numeric($HTTP_VARS['silc_id'])) {
     $results = fetch_s_item_listing_column_conf_rs($HTTP_VARS['silc_id']);
     if ($results) {
         while ($item_listing_column_conf_r = db_fetch_assoc($results)) {
             echo get_column_details($item_listing_column_conf_r, $row);
             $row++;
         }
         db_free_result($results);
     }
 }
 if (is_numeric($HTTP_VARS['blank_rows'])) {
     $blank_rows = (int) $HTTP_VARS['blank_rows'];
 } else {
     if (is_numeric($HTTP_VARS['silc_id'])) {
         $blank_rows = 5;
     } else {
         $blank_rows = 10;
Example #2
0
/**
	This function is to be called from listings.php, for either a s_item_type_group or
	s_item_type.  if s_item_type is defined, thats used first, otherwise we rely on
	s_item_type_group
*/
function get_s_item_listing_column_conf_rs($s_item_type_group, $s_item_type)
{
    $silc_id = NULL;
    if (strlen($s_item_type) > 0 && $s_item_type != '*' && is_exists_item_type($s_item_type)) {
        $silc_id = fetch_s_item_listing_conf_id(NULL, $s_item_type);
    } else {
        if (strlen($s_item_type_group) > 0 && $s_item_type_group != '*' && is_exists_item_type_group($s_item_type_group)) {
            $silc_id = fetch_s_item_listing_conf_id($s_item_type_group, NULL);
        }
    }
    if (!is_numeric($silc_id)) {
        // get the default
        $silc_id = fetch_s_item_listing_conf_id(NULL, NULL);
    }
    if (is_exists_s_item_listing_column_conf($silc_id)) {
        $results = fetch_s_item_listing_column_conf_rs($silc_id);
        if ($results) {
            while ($item_listing_column_conf_r = db_fetch_assoc($results)) {
                // special indicator that this column is an item listings configuration column and should be
                // left in the listings page even if exact match on this column is being performed.
                $item_listing_column_conf_r['item_listing_conf_ind'] = 'Y';
                $item_listing_column_conf_rs[] = $item_listing_column_conf_r;
            }
            db_free_result($results);
        }
        return $item_listing_column_conf_rs;
    } else {
        return array(array(column_type => 's_field_type', s_field_type => 'TITLE'), array(column_type => 'action_links'), array(column_type => 's_field_type', s_field_type => 'OWNER'), array(column_type => 's_field_type', s_field_type => 'STATUSTYPE'), array(column_type => 's_field_type', s_field_type => 'CATEGORY'));
    }
}