public function setWeb2printAction()
{
$this->checkPermission("web2print_settings");
$values = \Zend_Json::decode($this->getParam("data"));
if ($values['wkhtml2pdfOptions']) {
$optionArray = [];
$lines = explode("\n", $values['wkhtml2pdfOptions']);
foreach ($lines as $line) {
$parts = explode(" ", substr($line, 2));
$key = trim($parts[0]);
if ($key) {
$value = trim($parts[1]);
$optionArray[$key] = $value;
}
}
$values['wkhtml2pdfOptions'] = $optionArray;
}
$configFile = \Pimcore\Config::locateConfigFile("web2print.php");
File::putPhpFile($configFile, to_php_data_file_format($values));
$this->_helper->json(["success" => true]);
}