} ?> <div class="success"><?php echo htmlspecialchars(BB_Translate("Widget Deleted.")); ?> </div> <script type="text/javascript"> ReloadIFrame(); CloseProperties(); </script> <?php BB_RunPluginAction("post_bb_main_edit_site_opt_delete_widget_submit"); } else { if ($bb_account["type"] == "dev" && $_REQUEST["bb_action"] == "bb_main_edit_site_opt_delete_widget") { BB_RunPluginAction("pre_bb_main_edit_site_opt_delete_widget"); $data = BB_GetWidgetList(); if (!count($data)) { BB_PropertyFormLoadError("No widgets found."); } $widgets = array(); foreach ($data as $widget) { $widgets[$widget["_dir"]] = $widget["_n"]; } $options = array("title" => "Delete Widget", "desc" => "Select a widget to delete. Deletion is permanent and may delete all related content!", "fields" => array(array("type" => "select", "name" => "dir", "options" => $widgets)), "submit" => "Delete", "focus" => true); BB_RunPluginAction("bb_main_edit_site_opt_delete_widget_options"); BB_PropertyForm($options); BB_RunPluginAction("post_bb_main_edit_site_opt_delete_widget"); } else { if ($_REQUEST["bb_action"] == "bb_main_edit_site_opt_flush_cache") { BB_RunPluginAction("pre_bb_main_edit_site_opt_flush_cache"); if (!BB_WidgetStatusUpdate()) {
function BB_DeleteWidgetFiles($dir) { global $bb_paths; $widgets = BB_GetWidgetList(); foreach ($widgets as $widget) { if ($widget["_dir"] == $dir) { BB_RunPluginActionInfo("pre_bb_deletewidgetfiles", $dir); if (!BB_RemoveDirectory((isset($bb_paths) ? $bb_paths["ROOT_PATH"] . "/" . $bb_paths["WIDGET_PATH"] : ROOT_PATH . "/" . WIDGET_PATH) . "/" . $dir)) { return false; } BB_RunPluginAction("post_bb_deletewidgetfiles"); return BB_WidgetStatusUpdate(); } } return false; }