public function saveAction() { $id = $this->_getParam("id"); $table = new Formbuilder_Formbuilder(); $name = $table->getName($id); $configuration = Zend_Json::decode($this->_getParam("configuration")); $values = Zend_Json::decode($this->_getParam("values")); if ($values["name"] != $name) { $values["name"] = $this->correctClassname($values["name"]); $table = new Formbuilder_Formbuilder(); $table->rename($id, $values["name"]); } if (!is_dir(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/")) { mkdir(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/"); } if (file_exists(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/main_" . $id . ".json")) { unlink(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/main_" . $id . ".json"); } $settings = $values; $settings["mainDefinitions"] = $configuration; $config = new Zend_Config($settings, true); $writer = new Zend_Config_Writer_Json(array("config" => $config, "filename" => PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/main_" . $id . ".json")); $writer->write(); $builder = new Formbuilder_Builder(); $builder->setDatas($config->toArray()); $builder->buildForm($id); $this->removeViewRenderer(); }