예제 #1
0
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $Blog;
// Create query
$SQL = new SQL();
$SQL->SELECT('t.*, IF( tb.itc_ityp_ID > 0, 1, 0 ) AS type_enabled');
$SQL->FROM('T_items__type AS t');
$SQL->FROM_add('LEFT JOIN T_items__type_coll AS tb ON itc_ityp_ID = ityp_ID AND itc_coll_ID = ' . $Blog->ID);
// Create result set:
$Results = new Results($SQL->get(), 'ityp_');
$Results->title = T_('Item/Post/Page types') . get_manual_link('managing-item-types');
// get reserved and default ids
global $default_ids;
$default_ids = ItemType::get_default_ids();
/**
 * Callback to build possible actions depending on post type id
 *
 */
function get_actions_for_itemtype($id)
{
    global $default_ids;
    $action = action_icon(T_('Duplicate this Post Type...'), 'copy', regenerate_url('action', 'ityp_ID=' . $id . '&action=new'));
    if (!ItemType::is_reserved($id)) {
        // Edit all post types except of not reserved post type
        $action = action_icon(T_('Edit this Post Type...'), 'edit', regenerate_url('action', 'ityp_ID=' . $id . '&action=edit')) . $action;
    }
    if (!ItemType::is_special($id) && !in_array($id, $default_ids)) {
        // Delete only the not reserved and not default post types
        $action .= action_icon(T_('Delete this Post Type!'), 'delete', regenerate_url('action', 'ityp_ID=' . $id . '&action=delete&' . url_crumb('itemtype') . ''));