2004-12-12 03:51:51 +00:00
|
|
|
<?php
|
2004-12-25 20:03:34 +00:00
|
|
|
/****************************************************/
|
|
|
|
|
/* code to delete versions, families and categories */
|
|
|
|
|
/****************************************************/
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-25 20:03:34 +00:00
|
|
|
/*
|
|
|
|
|
* application environment
|
|
|
|
|
*/
|
2006-07-07 18:14:53 +00:00
|
|
|
require("path.php");
|
|
|
|
|
require(BASE."include/incl.php");
|
2005-10-29 04:41:10 +00:00
|
|
|
require_once(BASE."include/category.php");
|
|
|
|
|
require_once(BASE."include/application.php");
|
|
|
|
|
require_once(BASE."include/monitor.php");
|
2006-07-12 00:29:35 +00:00
|
|
|
require_once(BASE."include/testData.php");
|
2005-10-29 04:41:10 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if($aClean['sConfirmed'] != "yes")
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
|
|
|
|
// ask for confirmation
|
|
|
|
|
// could do some Real Damage if someone accidently hits the delete button on the main category :)
|
|
|
|
|
//
|
|
|
|
|
// perhaps we can do this with some javascript, popup
|
|
|
|
|
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit("Not confirmed");
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if($aClean['sWhat'])
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2006-07-06 17:27:54 +00:00
|
|
|
switch($aClean['sWhat'])
|
2005-10-26 02:09:49 +00:00
|
|
|
{
|
|
|
|
|
case "category":
|
|
|
|
|
// delete category and the apps in it
|
2006-07-06 17:27:54 +00:00
|
|
|
$oCategory = new Category($aClean['iCatId']);
|
2005-10-26 02:09:49 +00:00
|
|
|
if(!$oCategory->delete())
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit();
|
2005-10-26 02:09:49 +00:00
|
|
|
else
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit(BASE."appbrowse.php");
|
2005-10-26 02:09:49 +00:00
|
|
|
break;
|
|
|
|
|
case "appFamily":
|
|
|
|
|
// delete app family & all its versions
|
2006-07-06 17:27:54 +00:00
|
|
|
$oApp = new Application($aClean['iAppId']);
|
2005-10-26 02:09:49 +00:00
|
|
|
if(!$oApp->delete())
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit();
|
2005-10-26 02:09:49 +00:00
|
|
|
else
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit(BASE."appbrowse.php");
|
2005-10-26 02:09:49 +00:00
|
|
|
break;
|
|
|
|
|
case "appVersion":
|
2006-07-06 17:27:54 +00:00
|
|
|
$oVersion = new Version($aClean['iVersionId']);
|
2005-10-26 02:09:49 +00:00
|
|
|
if(!$oVersion->delete())
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit();
|
2005-10-26 02:09:49 +00:00
|
|
|
else
|
2007-04-03 02:08:44 +00:00
|
|
|
{
|
|
|
|
|
$oApp = new application($aClean['iAppId']);
|
|
|
|
|
util_redirect_and_exit($oApp->objectMakeUrl());
|
|
|
|
|
}
|
2005-10-26 02:09:49 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
?>
|