コード例 #1
0
    $t = new TNT_VideoType();
    $t->videoTypeTitle = $_POST["typeTitle"];
    if ($t->tntInsertVideoType()) {
        $location = add_query_arg(array('m' => 1));
    } else {
        $location = add_query_arg(array('m' => 0));
    }
    Header("Location: {$location}");
}
/**
 * Process: Edit Video Type
 */
if (isset($_POST['tntEditVideoType'])) {
    $typeID = $_POST["typeID"];
    $t = new TNT_VideoType();
    $t->tntGetType($typeID);
    $t->videoTypeTitle = $_POST["typeTitle"];
    if ($t->tntUpdateVideoType() >= 0) {
        $location = add_query_arg(array('m' => 1));
    } else {
        if ($t->tntUpdateVideoType() == false) {
            $location = add_query_arg(array('m' => 0));
        }
    }
    Header("Location: {$location}");
}
/**
 * Process: Delete Video Type (Click Yes)
 */
if (isset($_POST['tntDelVideoType_Yes'])) {
    $location = admin_url() . "/admin.php?page=tnt_video_type_manager_page";
コード例 #2
0
/**
 * Function to display the "delete video type" page
 */
function tnt_video_type_del()
{
    ?>
		<div class="wrap">
			<?php 
    screen_icon('edit');
    ?>
			<h2>Delete Video Type</h2>
			<?php 
    $t = new TNT_VideoType();
    $typeID = isset($_GET['typeID']) ? $_GET['typeID'] : 0;
    if ($typeID != 0) {
        $t->tntGetType($typeID);
    } else {
        wp_die("typeID not found");
    }
    ?>
			<form method="POST" action="">
				<input type="hidden" name="typeID" value="<?php 
    echo $t->videoTypeID;
    ?>
" />
				<div style="padding-bottom: 10px;">
					<p>Do you want to delete the video type "<?php 
    echo $t->videoTypeTitle;
    ?>
 [<?php 
    echo $t->videoTypeWidth;
    ?>
x<?php 
    echo $t->videoTypeHeight;
    ?>
]" ? </p>
					<input type="submit" name="tntDelVideoType_Yes" class="button-secondary" value="Yes" />
					<input type="submit" name="tntDelVideoType_No" class="button-secondary" value="No" />
				</div>
			</form>
		</div>
	<?php 
}