-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodule.delete.configuration.php
executable file
·61 lines (58 loc) · 1.75 KB
/
module.delete.configuration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* Delete table configuration processor
*
* @package dbEdit Table Editor
* @version 1.0
* @author Jelle Jager
* @copyright 2008 Jelle Jager
* @license GPL
*
*/
if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the MODx Content Manager instead of accessing this file directly.");
//use permissions as for modules
if(!$modx->hasPermission('delete_module')) {
$e->setError(3);
$e->dumpError();
}
if($dbConfig){
//try to delete configuration
$table = $dbe_config_table;
$where = "recID=$db_id";
if( $modx->db->delete($modx->getFullTableName($dbe_config_table),$where) ){
$msg = "Configuration for table \"{$dbConfig['moduleName']}\" succesfully removed.";
$ok=true;
}else{
$msg = "<p>Unable to remove table configuration for " . $dbConfig['title']. "</p>";
$ok==false;
}
}else{
$msg = "<p>No table configuration specified!</p>";
$ok==false;
}
if($ok){
$_SESSION['dbedit_message'] = array('succes',$msg);
header("location: $moduleHomeUrl");
exit;
}
include($basePath.$mod_path.'/header.inc.php');
?>
<h1><?php echo $mod_name; ?></h1>
<div id="actions">
<ul class="actionButtons">
<li id="Button1">
<a onclick="document.location.href='<?php echo $moduleHomeUrl; ?>';">
<img src="media/style/<?php echo $manager_theme; ?>images/icons/cancel.png" alt="return"> Return</a>
</li>
</ul>
</div>
<div class="sectionHeader"><img src='media/style/<?php echo $manager_theme; ?>images/misc/dot.gif' alt="." />Delete Table Configuration</div>
<div class="sectionBody">
<?php echo $msg; ?>
<ul>
<li><a href="index.php?a=<?php echo $_REQUEST['a']; ?>&id=<?php echo $module_id; ?>">Return to dbEdit module</a></li>
</ul>
</div>
<?php
include($basePath.$mod_path.'/footer.inc.php');
?>