Admin_PortalController::createDashboardAction PHP Метод

createDashboardAction() публичный Метод

    public function createDashboardAction()
    {
        $this->protectCSRF();
        $dashboards = $this->dashboardHelper->getAllDashboards();
        $key = trim($this->getParam("key"));
        if ($dashboards[$key]) {
            $this->_helper->json(["success" => false, "message" => "dashboard_already_exists"]);
        } elseif (!empty($key)) {
            $this->dashboardHelper->saveDashboard($key);
            $this->_helper->json(["success" => true]);
        } else {
            $this->_helper->json(["success" => false, "message" => "empty"]);
        }
    }