/** * Action to store a new widget order * @return null */ public function orderAction() { if (!$_POST) { $this->reponse->setRedirect($this->request->getBasePath()); return; } $order = array(); $columns = explode(';', $_POST['order']); foreach ($columns as $column) { if (empty($column)) { continue; } list($column, $widgets) = explode(':', $column); $columnNumber = str_replace('column', '', $column); $order[$columnNumber] = array(); $widgets = explode(',', $widgets); foreach ($widgets as $index => $widget) { $widgetId = trim(str_replace('widget', '', $widget)); if (!$widgetId) { continue; } $order[$columnNumber][] = $widgetId; } } $this->dashboard->setWidgetOrder($order); }
/** * Removes a dashboard from the model * @param Dashboard $dashboard * @return null */ public function removeDashboard(Dashboard $dashboard) { $this->cache->clear(self::CACHE_TYPE, $dashboard->getName()); }