<?php

/**
 * @Package: WordPress Plugin
 * @Subpackage: Ultra Portfolio
 * @Since: Ultra Portfolio 1.0
 * @Current Version: Ultra Portfolio 3.1
 * @WordPress Version: 3.5 or above
 * This file is part of Ultra Portofolio WordPress Plugin.
 */
function uport_categories_page() {
    if (isset($_GET['type']) && ($_GET['type']) == "del_category") {
        uport_delete($_GET['id'], $_GET['type']);
    }
    uport_get_categories_page();
}

function uport_add_new_category_page() {
    if (isset($_POST['which']) && $_POST['which'] == 'new_category' && $_GET['type'] == 'save') {
        uport_get_new_category_page_insert();
    } else if (isset($_POST['which']) && $_POST['which'] == 'update_category' && $_GET['type'] == 'save') {
        uport_get_new_category_page_update();
    }
    uport_get_new_category_page();
}

function uport_portfolio_list() {

    if (isset($_GET['type']) && ($_GET['type']) == "uport_edit_portfolio") {
        uport_panel_steps();
    } else if (isset($_GET['type']) && ($_GET['type']) == "uport_display_portfolio") {
        if (isset($_GET['id']) && trim($_GET['id']) != "") {
            $id = $_GET['id'];
            echo "<style type='text/css'> #wpcontent{padding-left: 0px;} </style>";
            echo "<div class='uport-view-wrapper'>";
                echo uport_shortcode_display($id,"","","showtitle");
            echo "</div>";
        } else {
            $id = "";
        }
    } else if (isset($_GET['type']) && ($_GET['type']) == "del_portfolio") {
        uport_delete($_GET['id'], $_GET['type']);
    } else {
        uport_dashboard();
    }
}

function uport_items_page() {
    uport_get_potfolio_items_page();
}

function uport_add_new_page() {
    if (isset($_POST['which']) && $_POST['which'] == 'new_item' && $_GET['type'] == 'save') {
        uport_get_new_item_page_insert();
    } else if (isset($_POST['which']) && $_POST['which'] == 'update_item' && $_GET['type'] == 'save') {
        uport_get_new_item_page_update();
    }
    uport_get_new_item_page();
}

?>