function deleteIn($loc) { global $user; if ($user && $user->is_acting_admin == 1) { include_once BASE . 'framework/core/models-1/container.php'; global $db; $containers = $db->selectObjects('container', "external='" . serialize($loc) . "'"); foreach ($containers as $container) { container::delete($container); $db->delete('container', 'id=' . $container->id); } } }
# GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } $container = null; if (isset($_GET['id'])) { $container = $db->selectObject('container', 'id=' . intval($_GET['id'])); } if ($container != null) { $iloc = unserialize($container->internal); $cloc = unserialize($container->external); $cloc->int = $container->id; if (exponent_permissions_check('delete_module', $loc) || exponent_permissions_check('delete_module', $cloc) || exponent_permissions_check('administrate', $iloc)) { container::delete($container, isset($_GET['rerank']) ? 1 : 0); $db->delete('container', 'id=' . $container->id); if (isset($_SESSION['containers_cache'])) { unset($_SESSION['containers_cache']); } // Check to see if its the last reference $locref = $db->selectObject('locationref', "module='" . $iloc->mod . "' AND source='" . $iloc->src . "' AND internal='" . $iloc->int . "'"); if ($locref->refcount == 0 && exponent_permissions_check('administrate', $iloc) && call_user_func(array($iloc->mod, 'hasContent')) == 1) { $template = new template('ContainerModule', '_lastreferencedelete', $loc); $template->assign('iloc', $iloc); $template->assign('redirect', exponent_flow_get()); $template->output(); } else { exponent_flow_redirect(); } } else {