/** * Remove a layout from $gp_titles and $gpLayouts * */ function RmLayout($layout) { global $gp_titles, $gpLayouts, $langmessage; $gpLayoutsBefore = $gpLayouts; $this->RmLayoutPrep($layout); //determine if code in /data/_theme should be removed $layout_info = $gpLayouts[$layout]; $rm_addon = false; if (isset($layout_info['addon_key'])) { $rm_addon = $gpLayouts[$layout]['addon_key']; //don't remove if there are other layouts using the same code foreach ($gpLayouts as $layout_id => $info) { if ($layout_id == $layout) { continue; } if (!array_key_exists('addon_key', $info)) { continue; } if ($info['addon_key'] == $rm_addon) { $rm_addon = false; } } } unset($gpLayouts[$layout]); //delete and save if ($rm_addon) { includeFile('admin/admin_addon_installer.php'); $installer = new admin_addon_installer(); $installer->rm_folders = false; if (!$installer->Uninstall($rm_addon)) { $gpLayouts = $gpLayoutsBefore; } $installer->OutputMessages(); } elseif (!admin_tools::SavePagesPHP()) { $gpLayouts = $gpLayoutsBefore; message($langmessage['OOPS'] . ' (s1)'); return false; } else { message($langmessage['SAVED']); } //remove custom css $this->RemoveCSS($layout); }
function Confirm_Uninstall() { $addon =& $_POST['addon']; includeFile('admin/admin_addon_installer.php'); $installer = new admin_addon_installer(); $installer->Uninstall($addon); $installer->OutputMessages(); }