Admin_ObjectHelperController::gridSaveColumnConfigAction PHP Метод

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

    public function gridSaveColumnConfigAction()
    {
        $object = Object::getById($this->getParam("id"));
        if ($object->isAllowed("publish")) {
            try {
                $classId = $this->getParam("class_id");
                $searchType = $this->getParam("searchType");
                $postfix = $searchType && $searchType != "folder" ? "_" . $this->getParam("searchType") : "";
                // grid config
                $gridConfig = \Zend_Json::decode($this->getParam("gridconfig"));
                if ($classId) {
                    $configFile = PIMCORE_CONFIGURATION_DIRECTORY . "/object/grid/" . $object->getId() . "_" . $classId . $postfix . "-user_" . $this->getUser()->getId() . ".psf";
                } else {
                    $configFile = PIMCORE_CONFIGURATION_DIRECTORY . "/object/grid/" . $object->getId() . $postfix . "-user_" . $this->getUser()->getId() . ".psf";
                }
                $configDir = dirname($configFile);
                if (!is_dir($configDir)) {
                    File::mkdir($configDir);
                }
                File::put($configFile, Tool\Serialize::serialize($gridConfig));
                $this->_helper->json(["success" => true]);
            } catch (\Exception $e) {
                $this->_helper->json(["success" => false, "message" => $e->getMessage()]);
            }
        }
        $this->_helper->json(["success" => false, "message" => "missing_permission"]);
    }