Пример #1
0
                $classattr = 'class="active"';
            }
            echo "\n<li {$classattr}><a href=\"{$PHP_SELF}?type={$ADMIN_TYPE}&op=edit&s_item_type_group=" . $item_type_group_r['s_item_type_group'] . "&s_item_type=*\">Edit " . $item_type_group_r['s_item_type_group'] . "</a></li>";
        }
        db_free_result($results);
        echo "</ul>";
    }
    $results = fetch_s_item_type_rs('s_item_type');
    if ($results) {
        echo "<h3>Item Types</h3>";
        echo "<ul class=\"itemTypeGroupList\">";
        while ($item_type_r = db_fetch_assoc($results)) {
            $classattr = NULL;
            if (fetch_s_item_listing_conf_id(NULL, $item_type_r['s_item_type']) !== FALSE) {
                $classattr = 'class="active"';
            }
            echo "\n<li {$classattr}><a href=\"{$PHP_SELF}?type={$ADMIN_TYPE}&op=edit&s_item_type_group=*&s_item_type=" . $item_type_r['s_item_type'] . "\">Edit " . $item_type_r['s_item_type'] . "</a></li>";
        }
        db_free_result($results);
        echo "</ul>";
    }
    echo "\n<h3>Default</h3>";
    echo "\n<ul class=\"itemTypeGroupList\">";
    $classattr = NULL;
    if (fetch_s_item_listing_conf_id(NULL, NULL) !== FALSE) {
        $classattr = 'class="active"';
    }
    echo "\n<li {$classattr}><a href=\"{$PHP_SELF}?type={$ADMIN_TYPE}&op=edit&s_item_type_group=*&s_item_type=*\">Edit Default</a></li>";
    echo "\n</ul>";
    echo "</form>";
}
Пример #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'));
    }
}