public static function delete($title) { $userId = Auth::getUserId(); // First remove all widget of this tabs // Get the list of widgets of this tab $installedWidgetList = UserInterface::retrieve(Auth::getUserId(), 'raw', $title); $cleanResTable = array(); foreach ($installedWidgetList as $widgetInfo) { $widgetInstanceId = $widgetInfo['widgetInstanceId']; UserInterface::deleteWidget($userId, $widgetInstanceId, array()); } // Next Delete the tab in tab table echo json_encode(Tabs::deleteTab($userId, $title)); exit(0); }