Example #1
0
 public function destroy_extension()
 {
     if (!isset($_POST['extension_id'])) {
         error(__("Error"), __("No extension ID specified.", "extend"));
     }
     $extension = new Extension($_POST['extension_id']);
     if ($extension->no_results) {
         error(__("Error"), __("Invalid extension ID specified.", "extend"));
     }
     if (!$extension->deletable()) {
         show_403(__("Access Denied"), __("You do not have sufficient privileges to delete this extension.", "extend"));
     }
     Extension::delete($extension->id);
     Flash::notice(__("Extension deleted.", "extend"), $extension->type->url());
 }