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); }
/** * The getInterface action, acts as a service and should be requested through an XML HTTP REQUEST * in order to retrieve information about the interface of logged in user. The output format should be * 'json' or 'xml'. The output is simply written in the XML HTTP RESPONSe. * * @param string $format The output format that will be used in the XML HTTP RESPONSE. */ public function getInterface($format, $tabId) { if (!Auth::isAuth()) { throw new ServiceException(MwwException::CONTROLLER, 'getInterface', ServiceException::SERV_AUTH); } $interface = UserInterface::retrieve(Auth::getUserId(), $format, $tabId); echo $interface; }