function processEditActions(&$validation, $params) { $http = eZHTTPTool::instance(); if ($http->hasPostVariable('SurveyQuestion_' . $this->ID . '_Text') && $http->postVariable('SurveyQuestion_' . $this->ID . '_Text') != $this->Text) { $inputXML = $http->postVariable('SurveyQuestion_' . $this->ID . '_Text'); $xmlData = "<section xmlns:image='http://ez.no/namespaces/ezpublish3/image/' xmlns:xhtml='http://ez.no/namespaces/ezpublish3/xhtml/' xmlns:custom='http://ez.no/namespaces/ezpublish3/custom/' >"; $xmlData .= "<paragraph>"; $xmlData .= $inputXML; $xmlData .= "</paragraph>"; $xmlData .= "</section>"; $xmlObject = new eZXMLText($inputXML, null); $inputHandler = $xmlObject->attribute('input'); $data =& $inputHandler->convertInput($xmlData); $domString =& eZXMLTextType::domString($data[0]); $domString = preg_replace("#<paragraph> </paragraph>#", "<paragraph> </paragraph>", $domString); $domString = str_replace("<paragraph />", "", $domString); $domString = str_replace("<line />", "", $domString); $domString = str_replace("<paragraph></paragraph>", "", $domString); $domString = preg_replace("#<paragraph> </paragraph>#", "<paragraph />", $domString); $domString = preg_replace("#<paragraph></paragraph>#", "", $domString); $domString = preg_replace("#[\n]+#", "", $domString); $domString = preg_replace("#</line>#", "\n", $domString); $domString = preg_replace("#<paragraph>#", "\n\n", $domString); $xml = new eZXML(); $tmpDom = $xml->domTree($domString, array('CharsetConversion' => false)); $domString = eZXMLTextType::domString($tmpDom); $this->setAttribute('text', $domString); } if ($http->hasPostVariable('SurveyQuestion_' . $this->ID . '_Text2') && $http->postVariable('SurveyQuestion_' . $this->ID . '_Text2') != $this->Text2) { $this->setAttribute('text2', $http->postVariable('SurveyQuestion_' . $this->ID . '_Text2')); } if ($http->hasPostVariable('SurveyQuestion_' . $this->ID . '_Text3') && $http->postVariable('SurveyQuestion_' . $this->ID . '_Text3') != $this->Text3) { $this->setAttribute('text3', $http->postVariable('SurveyQuestion_' . $this->ID . '_Text3')); } if ($http->hasPostVariable('SurveyQuestion_' . $this->ID . '_Num') && $http->postVariable('SurveyQuestion_' . $this->ID . '_Num') != $this->Num) { $this->setAttribute('num', $http->postVariable('SurveyQuestion_' . $this->ID . '_Num')); } if ($http->hasPostVariable('SurveyQuestion_' . $this->ID . '_Num2') && $http->postVariable('SurveyQuestion_' . $this->ID . '_Num2') != $this->Num2) { $this->setAttribute('num2', $http->postVariable('SurveyQuestion_' . $this->ID . '_Num2')); } if ($http->hasPostVariable('SurveyQuestion_' . $this->ID . '_Mandatory_Hidden')) { if ($http->hasPostVariable('SurveyQuestion_' . $this->ID . '_Mandatory')) { $newMandatory = 1; } else { $newMandatory = 0; } if ($newMandatory != $this->Mandatory) { $this->setAttribute('mandatory', $newMandatory); } } if ($http->hasPostVariable('SurveyQuestion_' . $this->ID . '_Default') && $http->postVariable('SurveyQuestion_' . $this->ID . '_Default') != $this->Default) { $this->setAttribute('default_value', $http->postVariable('SurveyQuestion_' . $this->ID . '_Default')); } }
function attribute($name) { switch ($name) { case 'input_xml': return $this->inputXML(); break; case 'edit_template_name': return $this->editTemplateName(); break; case 'information_template_name': return $this->informationTemplateName(); break; case 'aliased_type': eZDebug::writeWarning("'aliased_type' is deprecated as of 4.1 and not in use anymore, meaning it will always return false.", __METHOD__); return $this->AliasedType; break; case 'aliased_handler': if ($this->AliasedHandler === null) { $this->AliasedHandler = eZXMLText::inputHandler($this->XMLData, $this->AliasedType, false, $this->ContentObjectAttribute); } return $this->AliasedHandler; break; default: eZDebug::writeError("Attribute '{$name}' does not exist", __METHOD__); return null; break; } }
function attribute($name) { switch ($name) { case 'output_text': return $this->outputText(); break; case 'aliased_type': return $this->AliasedType; break; case 'view_template_name': return $this->viewTemplateName(); break; case 'aliased_handler': if ($this->AliasHandler === null) { $this->AliasedHandler = eZXMLText::inputHandler($this->XMLData, $this->AliasedType, false, $this->ContentObjectAttribute); } return $this->AliasedHandler; break; default: eZDebug::writeError("Attribute '{$name}' does not exist", __METHOD__); return null; break; } }