xml =& $xmlObject; $this->pageNumber = $pageNumber + 1; $this->validatePageNumber = $pageNumber; $this->pages = array(); $this->startSession(); }function setPageNumber($pageNumber){ $this->pageNumber = $pageNumber; }function execute($mode){ if (!isset($this->xml->is_mobile) || $this->xml->is_mobile != '1') { if (!$this->getSession() || !isset($_SERVER['HTTP_REFERER']) || !$_SERVER['HTTP_REFERER'] || !strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) { $mode = 'input'; $this->pageNumber = 1; $this->validatePageNumber = 0; }}$hiddens = array(); $errors = array(); $errorPageFilename = false; $isMultipart = false; if (!$this->checkXMLValidate()) { exit; }$this->setSession(); if (isset($this->xml->charset) && is_array($_POST)) { foreach ($_POST as $k => $v) { if (is_array($v)) { foreach ($v as $kk => $vv) { $_POST[$k][$kk] = mb_convert_encoding($vv, 'utf8', $this->xml->charset); }} else { $_POST[$k] = mb_convert_encoding($v, 'utf8', $this->xml->charset); }}}$plugins = $this->getPluginArray(); $pluginObjects =& $this->getPluginObjects($plugins); if ($mode == 'return') { if ($this->pageNumber > 1) { $this->pageNumber--; }}foreach ($pluginObjects as $pageNumber => $pluginObject) { if ($mode != 'return' && $pageNumber == $this->validatePageNumber && $this->validatePageNumber > 0 && is_array($pluginObject)){ foreach ($pluginObject as $object) { if ($error = $object->validate()) { $errors[$object->name] = $error; }}}foreach ($pluginObject as $object) { $ov = $object->getValue(); $name = $object->getName('confirm'); if (strlen(trim($object->getValue())) > 0) { $name = $object->getName('confirm'); if (is_array($name)) { foreach ($name as $n) { $hiddens[$n] = $this->getHiddenTag($n, $object->getValue('hidden')); }} else { if ($object->isMultipart()) { $name .= '_hidden'; }$hiddens[$name] = $this->getHiddenTag($name, $object->getValue('hidden')); }}if ($object->tag->type == 'checkgroup') { $checkHiddenVal = ''; if (!empty($ov) && !empty($name)) { $ov = @unserialize(urldecode($ov)); $type = gettype($ov); if ($type == "string") { $checkHiddenVal = $ov; } elseif ($type == "array") { $ovCount = count($ov); $currentCount = '1'; foreach ($ov as $k => $o) { if ($ovCount == $currentCount) { $checkHiddenVal .= $o; } else { $checkHiddenVal .= $o . ', '; }$hiddens[$k] = ''; $currentCount++; }}$hiddens[$name] = ''; }}}}if (count($errors)) { $this->pageNumber--; $errorPageFilename = $this->getErrorPage($this->validatePageNumber); }if ($errorPageFilename) { $mode = 'error'; } else if ($mode == 'send' || count($pluginObjects) < $this->pageNumber) { if ($mode != 'send' && isset($this->xml->templates->confirm)) { $mode = 'confirm'; } else { $mode = 'send'; }} else { $mode = 'input'; }$filename = $errorPageFilename ? $errorPageFilename : $this->getPageTemplateFileName($mode, $this->pageNumber); if (is_array($filename)) { $this->sendForm($pluginObjects); $filename = $filename[0]; $this->resetSession(); }if (file_exists((string)$this->xml->templates['directory'] . $filename)) { $this->templateStrings = file_get_contents((string)$this->xml->templates['directory'] . $filename); } else { $this->raiseError('template'); }if (!isset($this->pages[$this->pageNumber])) { $this->pages[$this->pageNumber] = array(); }if ($mode == 'input') { foreach ($pluginObjects[$this->pageNumber] as $object) { $name = $object->getName('confirm'); if (is_array($name)) { foreach ($name as $n) { unset($hiddens[$n]); }} else { unset($hiddens[$name]); }$this->makeupTemplate('input', $object); if (!$isMultipart) { $isMultipart = $object->isMultipart(); }}}if (count($hiddens)) { foreach ($hiddens as $hidden) { $this->setHiddenTag($hidden); }}$this->replaceTemplate('{form}', $this->getFormTag($mode, $isMultipart)); $this->replaceTemplate('{/form}', ''); if ($mode != 'confirm') { $this->makeupSendButton($this->pages[$this->pageNumber], $errorPageFilename ? true : false); $this->makeupReturnButton($this->pages[$this->pageNumber]); }$this->makeupResetButton($this->pages[$this->pageNumber]); if (isset($this->xml->templates->confirm)) { $this->makeupConfirmTemplate($pluginObjects, $mode); }if (isset($pluginObjects[$this->pageNumber])) { $this->makeupJavaScript($pluginObjects[$this->pageNumber]); }$errorHTML = ''; foreach ($errors as $e) { $errorHTML .= '
  • ' . $e . '
  • ' . PHP_EOL; }$this->replaceTemplate('{errors}', sprintf('', $errorHTML)); $this->viewFinalCharset($this->templateStrings); } function makeupJavaScript($pluginObjects){ $scripts = array(); $submitScripts = array(); foreach ($pluginObjects as $object) { if ($script = $object->getJavaScript()) { $scripts[] = $script; }if ($script = $object->getSubmitJavaScript()) { $submitScripts[] = $script; }}if (!isset($this->xml->is_mobile) || $this->xml->is_mobile != '1') { $script = sprintf( '', implode(PHP_EOL, $scripts), ($this->xml->submit_check == 1 ? ('var WebossReturnFlag=false;' . PHP_EOL . 'function WebossFormConfirm() { ' . PHP_EOL . 'if (WebossReturnFlag) return true;' . PHP_EOL . implode(PHP_EOL, $submitScripts) . PHP_EOL . '}') : '') ); $this->replaceTemplate('', $script . PHP_EOL . ''); }} function makeupConfirmTemplate($pluginObjects, $mode = null){ $formatType = (strtolower($this->xml->templates->confirm_format) == 'dl') ? 'dl' : 'table'; preg_match('/{forms\s*excepts="(.*)"/', $this->templateStrings, $exceptMatches); if (isset($exceptMatches[1])) { $excepts = explode(',', str_replace(' ', '', $exceptMatches[1])); } else { $excepts = array(); }$values = array(); foreach ($pluginObjects as $pluginObject) { foreach ($pluginObject as $object) { $this->replaceTemplate($object->getLabelTag(), $object->getLabel('confirm')); $this->replaceTemplate($object->getFormTag(), $object->getValue('confirm')); if (array_search($object->getName(), $excepts) !== false) { continue; }if ($formatType == 'dl') { $tag = "
    %s
    \n
    %s
    "; } else { $tag = " \n %s\n %s\n "; }$values[] = $object->getLabel('confirm') ? sprintf($tag, $object->getLabel('confirm'), (strlen(trim($object->getValue('confirm'))) > 0 ? htmlspecialchars($object->getValue('confirm')) : '-')) : ''; }}if (strtolower($this->xml->templates->confirm_format) == 'dl') { $html = sprintf("
    \n%s\n
    \n", implode("\n", $values)); } else { $html = sprintf("\n%s\n
    \n", implode("\n", $values)); }$this->replaceTemplate('{forms[^}]*}', $html); if ($mode == 'confirm') { if (isset($this->xml->templates->confirm_send_image)) { $buttonValue = $this->xml->templates->confirm_send_image; } else if (isset($this->xml->templates->confirm_send)) { $buttonValue = $this->xml->templates->confirm_send; } else { $buttonValue = '送信'; }$title = isset($this->xml->templates->confirm_send_title) ? sprintf(' title="%s"', $this->xml->templates->confirm_send_title) : ''; $tabindex = isset($this->xml->templates->confirm_send_tabindex) ? sprintf(' tabindex="%s"', $this->xml->templates->confirm_send_tabindex) : ''; $accesskey = isset($this->xml->templates->confirm_send_accesskey) ? sprintf(' accesskey="%s"', $this->xml->templates->confirm_send_accesskey) : ''; $append = isset($this->xml->templates->confirm_send_append) ? sprintf(' %s', $this->xml->templates->confirm_send_append) : ''; if (isset($this->xml->templates->confirm_send_image)) { $button = sprintf('', $buttonValue, $this->xml->templates->confirm_send, $title, $tabindex, $accesskey, $append); } else { $button = sprintf('', $buttonValue, $title, $tabindex, $accesskey, $append); }if (strpos($this->templateStrings, '{submit}')) { $this->replaceTemplate('{submit}', $button . ''); } else { $this->replaceTemplate('', $button . ''); } if (isset($this->xml->templates->confirm_return_image)) { $buttonValue = $this->xml->templates->confirm_return_image; } else if (isset($this->xml->templates->confirm_return)) { $buttonValue = $this->xml->templates->confirm_return; } else { $buttonValue = '戻る'; }$title = isset($this->xml->templates->confirm_return_title) ? sprintf(' title="%s"', $this->xml->templates->confirm_return_title) : ''; $tabindex = isset($this->xml->templates->confirm_return_tabindex) ? sprintf(' tabindex="%s"', $this->xml->templates->confirm_return_tabindex) : ''; $accesskey = isset($this->xml->templates->confirm_return_accesskey) ? sprintf(' accesskey="%s"', $this->xml->templates->confirm_return_accesskey) : ''; $append = isset($this->xml->templates->confirm_return_append) ? sprintf(' %s', $this->xml->templates->confirm_return_append) : ''; if (isset($this->xml->templates->confirm_return_image)) { $button = sprintf('', $buttonValue, $this->xml->templates->confirm_return, $title, $tabindex, $accesskey, $append); } else { $button = sprintf('', $buttonValue, $title, $tabindex, $accesskey, $append); }if (strpos($this->templateStrings, '{return}')) { $tag = '{return}'; } else { $tag = ''; }$this->replaceTemplate($tag, $button . PHP_EOL); }}function sendForm($pluginObjects){ if (isset($this->xml->csv_filename)) { $this->putCsvFile($pluginObjects); }$this->sendMailToCompany($pluginObjects); $this->sendMailToCustomer($pluginObjects); $this->sendMailToChecked($pluginObjects); } function sendMailToChecked($pluginObjects){ $tags = $this->xml->pages->page->tags->tag; if (!empty($tags)) { if (isset($this->xml->mail_from_tag) && isset($_POST[(string)$this->xml->mail_from_tag]) && strlen($_POST[(string)$this->xml->mail_from_tag])) { $mailFrom = $_POST[(string)$this->xml->mail_from_tag]; } else { $mailFrom = isset($this->xml->mail_from) ? (string)$this->xml->mail_from : ''; } $mailCc = isset($this->xml->mail_cc) ? (string)$this->xml->mail_cc : ''; $mailBcc = isset($this->xml->mail_bcc) ? (string)$this->xml->mail_bcc : ''; $subject = isset($this->xml->mail_templates->send_subject) ? (string)$this->xml->mail_templates->send_subject : 'フォーム投稿がありました'; $returnPath = isset($this->xml->mail_returnpath) ? ('-f' . (string)$this->xml->mail_returnpath) : null; $ua = (isset($this->xml->mail_templates->ua) && $this->xml->mail_templates->ua == 1) ? $_SERVER['HTTP_USER_AGENT'] : ''; $remoteHost = (isset($this->xml->mail_templates->ua) && $this->xml->mail_templates->ua == 1) ? gethostbyaddr($_SERVER['REMOTE_ADDR']) : ''; if ($filename = (string)$this->xml->mail_templates->checksend) { if (file_exists((string)$this->xml->mail_templates['directory'] . $filename)) { $body = file_get_contents((string)$this->xml->mail_templates['directory'] . $filename); $body = str_replace('{ua}', $ua, $body); $body = str_replace('{remotehost}', $remoteHost, $body); } } $files = $this->getAttachedFiles($pluginObjects); foreach ($tags as $tag) { $name = (string)$tag->attributes()->name; if ($tag->type == 'checkbox' && !empty($tag->mail) && !empty($_POST[$name])) { $mailName = $_POST[$name]; $mailBody = $this->makeupCheckboxMailTemplate($body, $pluginObjects, $mailName); $mailTo = (string)$tag->mail; $this->sendMail($mailTo, $mailFrom, $subject, $mailBody, $mailCc, $mailBcc, $files, $returnPath); } } } } function sendMailToCompany($pluginObjects){ if (isset($this->xml->mail_to)) { $mailTo = (string)$this->xml->mail_to; } else { return false; }if (isset($this->xml->mail_to_select)) { $mailToSelects = explode('#', $_POST[(string)$this->xml->mail_to_select]); $mailToSelect = array_shift($mailToSelects); } else { $mailToSelect = null; }if (isset($this->xml->mail_from_tag) && isset($_POST[(string)$this->xml->mail_from_tag]) && strlen($_POST[(string)$this->xml->mail_from_tag])) { $mailFrom = $_POST[(string)$this->xml->mail_from_tag]; } else { $mailFrom = isset($this->xml->mail_from) ? (string)$this->xml->mail_from : ''; }$mailCc = isset($this->xml->mail_cc) ? (string)$this->xml->mail_cc : ''; $mailBcc = isset($this->xml->mail_bcc) ? (string)$this->xml->mail_bcc : ''; $subject = isset($this->xml->mail_templates->send_subject) ? (string)$this->xml->mail_templates->send_subject : 'フォーム投稿がありました'; $returnPath = isset($this->xml->mail_returnpath) ? ('-f' . (string)$this->xml->mail_returnpath) : null; $ua = (isset($this->xml->mail_templates->ua) && $this->xml->mail_templates->ua == 1) ? $_SERVER['HTTP_USER_AGENT'] : ''; $remoteHost = (isset($this->xml->mail_templates->ua) && $this->xml->mail_templates->ua == 1) ? gethostbyaddr($_SERVER['REMOTE_ADDR']) : ''; if ($filename = (string)$this->xml->mail_templates->send) { if (file_exists((string)$this->xml->mail_templates['directory'] . $filename)) { $body = file_get_contents((string)$this->xml->mail_templates['directory'] . $filename); $body = str_replace('{ua}', $ua, $body); $body = str_replace('{remotehost}', $remoteHost, $body); }$body = $this->makeupMailTemplate($body, $pluginObjects); }$files = $this->getAttachedFiles($pluginObjects); $this->sendMail($mailTo, $mailFrom, $subject, $body, $mailCc, $mailBcc, $files, $returnPath); if ($mailToSelect) { $this->sendMail($mailToSelect, $mailFrom, $subject, $body, null, null, $files, $returnPath); }} function makeupCheckboxMailTemplate($templateStrings, $pluginObjects, $mailName = '') { $templateStrings = preg_replace('/{checkvalue}/', $mailName, $templateStrings); preg_match('/{forms\s*excepts="(.*)"/', $templateStrings, $exceptMatches); if (isset($exceptMatches[1])) { $excepts = explode(',', str_replace(' ', '', $exceptMatches[1])); } else { $excepts = array(); } $forms = array(); foreach ($pluginObjects as $pluginObject) { foreach ($pluginObject as $object) { $templateStrings = preg_replace('/' . $object->getLabelTag() . '/', $object->getLabel('mail'), $templateStrings); $templateStrings = preg_replace('/' . $object->getFormTag() . '/', $object->getValue('mail'), $templateStrings); if (array_search($object->getName(), $excepts) !== false) { continue; } $name = $object->getLabel('mail'); $value = $object->getValue('mail'); $value = str_replace('m²', '平米', $value); $value = str_replace("\r\n","\r", $value); $value = str_replace("\r","\n", $value); if ($name) { $forms[] = '■ ' . $name . PHP_EOL . $value . PHP_EOL; } } } $templateStrings = preg_replace('/{forms[^}]*}/', implode(PHP_EOL, $forms), $templateStrings); $templateStrings = preg_replace('/{remote_host}/', gethostbyaddr($_SERVER['REMOTE_ADDR']) . '(' . $_SERVER['REMOTE_ADDR'] . ')', $templateStrings); return $templateStrings; } function getAttachedFiles($pluginObjects){ $files = array(); foreach ($pluginObjects as $pluginObject) { foreach ($pluginObject as $object) { if ($object->isMultipart()) { $files[] = (string)$object->tag->directory . DIRECTORY_SEPARATOR . $object->getValue(); }}}return $files; }function sendMailToCustomer($pluginObjects){ if (isset($this->xml->mail_form) && isset($_POST[(string)$this->xml->mail_form])) { $mailTo = trim($_POST[(string)$this->xml->mail_form]); } else { return false; }$mailFrom = isset($this->xml->mail_from) ? (string)$this->xml->mail_from : ''; $mailCc = isset($this->xml->mail_cc) ? (string)$this->xml->mail_cc : ''; $mailBcc = isset($this->xml->mail_bcc) ? (string)$this->xml->mail_bcc : ''; $subject = isset($this->xml->mail_templates->thanks_subject) ? (string)$this->xml->mail_templates->thanks_subject : 'フォームへの投稿ありがとうございました'; $returnPath = isset($this->xml->mail_returnpath) ? ('-f ' . (string)$this->xml->mail_returnpath) : null; if ($filename = (string)$this->xml->mail_templates->thanks) { if (file_exists((string)$this->xml->mail_templates['directory'] . $filename)) { $body = file_get_contents((string)$this->xml->mail_templates['directory'] . $filename); }$body = $this->makeupMailTemplate($body, $pluginObjects); }$this->sendMail($mailTo, $mailFrom, $subject, $body, null, $mailBcc, null, $returnPath); }function makeupMailTemplate($templateStrings, $pluginObjects){ preg_match('/{forms\s*excepts="(.*)"/', $templateStrings, $exceptMatches); if (isset($exceptMatches[1])) { $excepts = explode(',', str_replace(' ', '', $exceptMatches[1])); } else { $excepts = array(); }$forms = array(); foreach ($pluginObjects as $pluginObject) { foreach ($pluginObject as $object) { $templateStrings = preg_replace('/' . $object->getLabelTag() . '/', $object->getLabel('mail'), $templateStrings); $templateStrings = preg_replace('/' . $object->getFormTag() . '/', $object->getValue('mail'), $templateStrings); if (array_search($object->getName(), $excepts) !== false) { continue; }$name = $object->getLabel('mail'); $value = $object->getValue('mail'); $value = str_replace('m²', '平米', $value); $value = str_replace("\r\n","\r", $value); $value = str_replace("\r","\n", $value); if ($name) { $forms[] = '■ ' . $name . PHP_EOL . $value . PHP_EOL; }}}$templateStrings = preg_replace('/{forms[^}]*}/', implode(PHP_EOL, $forms), $templateStrings); $templateStrings = preg_replace('/{remote_host}/', gethostbyaddr($_SERVER['REMOTE_ADDR']) . '(' . $_SERVER['REMOTE_ADDR'] . ')', $templateStrings); return $templateStrings; }function sendMail($to, $from, $subject, $body, $cc = null, $bcc = null, $files = array(), $returnPath = null){ if (is_array($files) && count($files)) { $boundary = md5(uniqid(rand())); $header = sprintf("From: %s\n%s%sContent-Type: multipart/mixed;\n\tboundary=\"%s\"\nX-Mailer: WEBOSSFORM", $from, ($cc ? sprintf("Cc: %s\n", $cc) : ''), ($bcc ? sprintf("Bcc: %s\n", $bcc) : ''), $boundary ); $subject = sprintf('=?iso-2022-jp?B?%s?=', base64_encode(mb_convert_encoding($subject, 'jis', 'utf-8'))); $mailBody = sprintf("This is a multi-part message in MIME format.\n\n--%s\nContent-Type: text/plain; charset=iso-2022-jp\nContent-Transfer-Encoding: 7bit\n", $boundary); $mailBody .= mb_convert_encoding($body, 'jis', 'utf-8'); $mailBody .= "\n"; foreach ($files as $file) { if (basename($file) && file_exists($file)) { if ($contents = @file_get_contents($file)) { $encodedContents = chunk_split(base64_encode($contents)); $encodedContents = str_replace("\r\n","\r", $encodedContents); $encodedContents = str_replace("\r","\n", $encodedContents); $filename = basename($file); $mailBody .= sprintf( "\n\n--%s\nContent-Type: application/octet-stream;\n\tname=\"%s\"\n" . "Content-Transfer-Encoding: base64\nContent-Disposition: attachment;\n" . "\tfilename=\"%s\"\n\n%s\n", $boundary, $filename, $filename, $encodedContents ); }}}$mailBody .= sprintf("--%s--", $boundary); } else { $header = sprintf("From: %s\n%s%sContent-Type: text/plain;charset=iso-2022-jp\nX-Mailer: WEBOSSFORM", $from, ($cc ? sprintf("Cc: %s\n", $cc) : ''), ($bcc ? sprintf("Bcc: %s\n", $bcc) : '') ); $subject = sprintf('=?iso-2022-jp?B?%s?=', base64_encode(mb_convert_encoding($subject, 'jis', 'utf-8'))); $mailBody = mb_convert_encoding($body, 'jis', 'utf-8'); }if ($returnPath) { mail($to, $subject, $mailBody, $header, $returnPath); } else { mail($to, $subject, $mailBody, $header); }}function putCsvFile($pluginObjects){ $filename = (string)$this->xml->csv_filename; if (!file_exists($filename) || !file_get_contents($filename)) { $headerData = array(); foreach ($pluginObjects as $page => $pageObjects) { foreach ($pageObjects as $object) { if ($data = $object->getLabel('csv')) { $headerData[] = $data; }}}$headerData[] = '送信ホスト'; $headerData[] = '送信日時'; $csvdata = '"' . implode('","', $headerData) . '"' . PHP_EOL; file_put_contents($filename, mb_convert_encoding($csvdata, 'sjis-win', 'utf8')); } else { $csvdata = mb_convert_encoding(file_get_contents($filename), 'utf-8', 'sjis-win'); }$lineData = array(); foreach ($pluginObjects as $page => $pageObjects) { foreach ($pageObjects as $object) { if ($object->getLabel('csv')) { $lineData[] = str_replace('"', '""', $object->getValue('csv')); }}}$lineData[] = gethostbyaddr($_SERVER['REMOTE_ADDR']) . '(' . $_SERVER['REMOTE_ADDR'] . ')'; $lineData[] = date('Y-m-d H:i:s'); $csvdata .= '"' . implode('","', $lineData) . '"' . PHP_EOL; file_put_contents($filename, mb_convert_encoding($csvdata, 'sjis-win', 'utf8')); }function makeupReturnButton($pageObject){ if (isset($pageObject->return_title)) { $title = sprintf(' title="%s"', $pageObject->return_title); } else { $title = ''; }if (isset($pageObject->return_tabindex)) { $tabindex = sprintf(' tabindex="%s"', $pageObject->return_tabindex); } else { $tabindex = ''; }if (isset($pageObject->return_accesskey)) { $accesskey = sprintf(' accesskey="%s"', $pageObject->return_accesskey); } else { $accesskey = ''; }if (isset($pageObject->return_image)) { $button = sprintf('', $pageObject->return_image, $pageObject->return, $title, $tabindex, $accesskey); } else if (isset($pageObject->return)){ $button = sprintf('', $pageObject->return, $title, $tabindex, $accesskey); } else { return false; }if (strpos($this->templateStrings, '{return}')) { $tag = '{return}'; } else { $tag = ''; }$this->replaceTemplate($tag, $button . PHP_EOL); }function makeupResetButton($pageObject){ $append = isset($pageObject->reset_append) ? sprintf(' %s', $pageObject->reset_append) : ''; if (isset($pageObject->reset_title)) { $title = sprintf(' title="%s"', $pageObject->reset_title); } else { $title = ''; }if (isset($pageObject->reset_tabindex)) { $tabindex = sprintf(' tabindex="%s"', $pageObject->reset_tabindex); } else { $tabindex = ''; }if (isset($pageObject->reset_accesskey)) { $accesskey = sprintf(' accesskey="%s"', $pageObject->reset_accesskey); } else { $accesskey = ''; }if (isset($pageObject->reset)){ $value = (string)$pageObject->reset; } else { $value = 'リセット'; }if (isset($pageObject->reset_image)) { $button = sprintf('', $pageObject->reset_image, $value, $title, $tabindex, $accesskey, FORM_ID, $append); } else { $button = sprintf('', $value, $title, $tabindex, $accesskey, $append); }$this->replaceTemplate('{reset}', $button . "\n"); }function getErrorPage($pageNumber){ if ($errorPage = (string)$this->pages[$pageNumber]->error) { return $errorPage; } else { return false; }}function setHiddenTag($hidden){ $this->templateStrings = str_replace('{/form}', $hidden . PHP_EOL . '{/form}', $this->templateStrings); }function getHiddenTag($name, $value){ return sprintf('', $name, htmlspecialchars($value)); }function makeupSendButton($pageObject, $isError = false){ $isImage = false; if ($isError) { $append = isset($pageObject->error_send_append) ? sprintf(' %s', $pageObject->error_send_append) : ''; if (isset($pageObject->error_send_image)) { $buttonValue = $pageObject->error_send_image; $pageObject->send = $pageObject->error_send; $isImage = true; } else if (isset($pageObject->error_send)){ $buttonValue = $pageObject->error_send; } else { $buttonValue = '戻る'; }if (isset($pageObject->error_send_title)) { $title = sprintf(' title="%s"', $pageObject->error_send_title); } else { $title = ''; }if (isset($pageObject->error_send_tabindex)) { $tabindex = sprintf(' tabindex="%s"', $pageObject->error_send_tabindex); } else { $tabindex = ''; }if (isset($pageObject->error_send_accesskey)) { $accesskey = sprintf(' accesskey="%s"', $pageObject->error_send_accesskey); } else { $accesskey = ''; }} else { $append = isset($pageObject->send_append) ? sprintf(' %s', $pageObject->send_append) : ''; if (isset($pageObject->send_image)) { $buttonValue = $pageObject->send_image; $isImage = true; } else if (isset($pageObject->send)) { $buttonValue = $pageObject->send; } else { $buttonValue = '送信'; }if (isset($pageObject->send_title)) { $title = sprintf(' title="%s"', $pageObject->send_title); } else { $title = ''; }if (isset($pageObject->send_tabindex)) { $tabindex = sprintf(' tabindex="%s"', $pageObject->send_tabindex); } else { $tabindex = ''; }if (isset($pageObject->send_accesskey)) { $accesskey = sprintf(' accesskey="%s"', $pageObject->send_accesskey); } else { $accesskey = ''; }}if ($isImage) { $button = sprintf('', $buttonValue, $pageObject->send, $title, $tabindex, $accesskey, $append); } else { $button = sprintf('', $buttonValue, $title, $tabindex, $accesskey, $append); }if (strpos($this->templateStrings, '{submit}')) { $this->replaceTemplate('{submit}', $button . ''); } else { $this->replaceTemplate('', $button . ''); }}function getFormTag($mode = 'input', $isMultipart = false){ if ($this->xml->submit_check == 1 && $mode == 'input') { $onsubmit = 'onsubmit="return WebossFormConfirm();"'; } else { $onsubmit = ''; }if (isset($this->xml->jquery_mobile)) { if ($this->xml->jquery_mobile == 1) { $html = '
    ' . PHP_EOL; } else { $html = '' . PHP_EOL; }} else { $html = '' . PHP_EOL; }$html = sprintf($html, FORM_ID, FORM_ID, FORM_ACTION, ($isMultipart ? 'enctype="multipart/form-data"' : ''), $onsubmit); if ($mode == 'input') { $html .= '' . PHP_EOL . sprintf('', $this->pageNumber) . PHP_EOL; } else if ($mode == 'confirm') { $html .= '' . PHP_EOL; } else if ($mode == 'error') { $html .= '' . PHP_EOL . sprintf('', $this->pageNumber) . PHP_EOL; }return $html; }function getPageTemplateFileName($mode, $pageNumber){ if ($mode == 'input') { $filename = $this->pages[$pageNumber]->template; } else if ($mode == 'confirm') { $filename = (string)$this->xml->templates->confirm; } else if ($mode == 'send') { if ($this->xml->templates->thanks) { $filename = array((string)$this->xml->templates->thanks); } else { $this->raiseError('template format'); }} else { $this->raiseError('template format'); }return $filename; }function makeupTemplate($mode = 'input', $object = null){ $this->replaceTemplate($object->getLabelTag(), $object->getLabel()); $html = $object->getForm(); $this->replaceTemplate($object->getFormTag(), $html); }function replaceTemplate($templateTag, $convertedTag){ $templateTag = sprintf('|%s|', str_replace(array('{', '}'), array('\\{', '\\}'), $templateTag)); $this->templateStrings = preg_replace($templateTag, $convertedTag, $this->templateStrings); }function viewFinalCharset($html){ if ($this->xml->charset != 'utf8') { $html = mb_convert_encoding($html, $this->xml->charset, 'utf8,euc,sjis'); header("Content-type: text/html; charset=", ($this->xml->charset == 'sjis' ? 'Shift-JIS' : $this->xml->charset)); } else { header("Content-type: text/html; charset=utf8"); }print $html; }function checkXMLValidate(){ $forms['charset'] = $this->_initval($this->xml->charset, 'utf-8'); if (!strlen(trim($this->xml->mail_to))) { $this->raiseError('xml format', 'Mail address'); }return true; }function getPluginObjects($pluginsArray, $pageNumber = null){ $pluginObjects = array(); if (is_array($pluginsArray)) { foreach ($pluginsArray as $pluginPageNumber => $plugin) { if (is_null($pageNumber) || $pageNumber == $pluginPageNumber) { foreach ($plugin as $id => $tag) { $className = 'Plugin' . ucfirst($tag->type); if (class_exists($className)) { $pluginObjects[$pluginPageNumber][] =& new $className($tag); } else { $this->raiseError('class'); }}}}}return $pluginObjects; }function getPluginArray(){ $pluginNames = array(); if ($this->xml->pages) { $pageCount = 1; foreach ($this->xml->pages as $pageObjects) { foreach ($pageObjects->page as $page) { $this->pages[$pageCount] = $page; if ($page->tags) { foreach ($page->tags as $tagObjects) { foreach ($tagObjects->tag as $tag) { if (strlen(trim((string)$tag->type))) { $filename = './plugins/plugin_' . (string)$tag->type . '.class.php'; if (file_exists($filename)) { require_once($filename); }$pluginNames[$pageCount][(string)$tag['name']] = $tag; }} }}$pageCount++; }}}return $pluginNames; }function raiseError($errorMode, $parameter = null){ $errorMessages = array( 'xml' => 'XML file not found.', 'xml format' => 'XML file format error : not defined %s.', 'template' => 'template file not found.', 'template format' => 'template xml data not found.', 'class' => 'class file is not found.' ); echo (($msg = $errorMessages[$errorMode]) ? sprintf($msg, $parameter) : 'undefined error.') . "\n"; exit; }function _initval($value, $default = null){ if (is_null($value)) { $value = $default; }return $value; }function setSession(){ if ($this->xml->session_use != '0') { $_SESSION[FORM_ID] = md5(time() . mt_rand(10000, 99999)); }}function getSession(){ if ($this->xml->session_use != '0') { return isset($_SESSION[FORM_ID]) ? $_SESSION[FORM_ID] : ''; } else { return true; }}function resetSession(){ if ($this->xml->session_use != '0') { unset($_SESSION[FORM_ID]); }}function startSession(){ if ($this->xml->session_use != '0') { session_set_cookie_params(0); session_id(FORM_ID); session_start(); }}} class Weboss_FormObject{ var $parse; var $tag; var $name; function Weboss_FormObject($tag){ $this->name = (string)$tag['name']; $this->tag = $tag; }function getFormTag(){ $tag = '{tag name="%s"}'; return sprintf($tag, $this->name); }function isMultipart(){ return false; }function getName(){ return $this->name; }function getValue($mode = null){ if (isset($_POST[$this->getName()])) { return $this->filter($_POST[$this->getName()], $mode); } else { return ''; }}function filter($param){ return $param; }function getLabelTag(){ $tag = '{label name="%s"}'; return sprintf($tag, $this->name); }function getLabel($mode = null){ if (isset($this->tag->label)) { return $this->tag->label; } else { return $this->name; }}function getJavaScript() {}function getSubmitJavaScript() {}function validate($param) {}}class Weboss_XMLParser{ function parse($filename = null){ if (!$filename) { $filename = DEFAULT_XML_FILE; }if (!file_exists($filename)) { return false; }if (function_exists('simplexml_load_file')) { $xmlObject = simplexml_load_file($filename); if ($xmlObject) { return $xmlObject; } else { return false; }} else { return false; }}} define('ERROR_SELECT_REQUIRED', '%sが選択されていません。'); class PluginSelect extends Weboss_FormObject{ function getForm(){ $size = $this->tag->size ? sprintf(' size="%d"', intval($this->tag->size)) : ''; $class = $this->tag->class ? sprintf(' class="%s"', $this->tag->class) : ''; $accesskey = isset($this->tag->accesskey) ? sprintf(' accesskey="%s"', $this->tag->accesskey) : ''; $tabindex = isset($this->tag->tabindex) ? sprintf(' tabindex="%s"', $this->tag->tabindex) : ''; $title = isset($this->tag->title) ? sprintf(' title="%s"', $this->tag->title) : ''; $append = $this->tag->append ? sprintf(' %s', $this->tag->append) : ''; $optionTags = array(); if (isset($this->tag->options)) { foreach ($this->tag->options as $options) { foreach ($options as $option) { $value = (string)$option['value']; $selectedStrings = ' selected="selected"'; $selected = ''; if ($this->getValue() === $value) { $selected = $selectedStrings; } else { if (isset($option['get']) && isset($_GET[$this->getName()]) && $_GET[$this->getName()] == (string)$option['get']) { $selected = $selectedStrings; } else { if (!isset($_GET[$this->getName()]) && !isset($_POST[$this->getName()]) && $option['selected'] == 1) { $selected = $selectedStrings; }}}$optionTags[] = sprintf('', $value, $selected, ((string)$option['class'] ? sprintf(' class="%s"', (string)$option['class']) : ''), ((string)$option ? (string)$option : $value) ); }}}if (isset($this->tag->begin) && isset($this->tag->end) && isset($this->tag->interval)) { for ($i = intval($this->tag->begin); $i <= intval($this->tag->end); $i = $i + intval($this->tag->interval)) { $optionTags[] = sprintf('', $i, (strlen($this->getValue()) > 0 && $this->getValue() == sprintf('%s', $i)) ? ' selected="selected"' : '', $i ); }}$html = sprintf('', $this->getName(), $this->getName(), $class, $accesskey, $tabindex, $title, $size, $append, implode(PHP_EOL, $optionTags) ); return $html; }function validate(){ if ($this->tag->required == 1) { if (!$this->getValue()) { return sprintf(ERROR_SELECT_REQUIRED, $this->getLabel()); }}}function getValue($mode = null){ if ($mode == 'confirm' || $mode == 'mail') { foreach ($this->tag->options as $options) { foreach ($options as $option) { if ($this->getValue() == (string)$option['value']) { return (string)$option; }}}if (isset($this->tag->begin) && isset($this->tag->end) && isset($this->tag->interval)) { for ($i = intval($this->tag->begin); $i <= intval($this->tag->end); $i = $i + intval($this->tag->interval)) { if (strlen($this->getValue()) > 0 && $this->getValue() == sprintf('%s', $i)) { return $i; }}}return ''; } else { return isset($_POST[$this->getName()]) ? $_POST[$this->getName()] : ''; }}}define('ERROR_TEXTAREA_REQUIRED', '%sが入力されていません。'); define('ERROR_TEXTAREA_NOTZENKAKU', '%sは全角文字列で入力してください。'); class PluginTextarea extends Weboss_FormObject{ function getForm(){ $cols = $this->tag->cols ? sprintf(' cols="%d"', intval($this->tag->cols)) : ''; $rows = $this->tag->rows ? sprintf(' rows="%d"', intval($this->tag->rows)) : ''; $class = $this->tag->class ? sprintf(' class="%s"', $this->tag->class) : ''; $accesskey = isset($this->tag->accesskey) ? sprintf(' accesskey="%s"', $this->tag->accesskey) : ''; $tabindex = isset($this->tag->tabindex) ? sprintf(' tabindex="%s"', $this->tag->tabindex) : ''; $title = isset($this->tag->title) ? sprintf(' title="%s"', $this->tag->title) : ''; $append = isset($this->tag->append) ? sprintf(' %s', $this->tag->append) : ''; $html = sprintf('', $this->getName(), $this->getName(), $cols, $rows, $class, $accesskey, $tabindex, $title, $append, htmlspecialchars($this->getValue()) ); return $html; }function validate(){ if ($this->tag->required == 1) { if (!$this->getValue()) { return sprintf(ERROR_TEXTAREA_REQUIRED, $this->getLabel()); }}if ($this->tag->zenkaku == 1) { if ($this->getValue() != mb_convert_kana( $this->getValue(), 'RNASKHV' )) { return sprintf(ERROR_TEXTAREA_NOTZENKAKU, $this->getLabel()); }}}function getValue($mode = null){ if ($mode == 'confirm') { return isset($_POST[$this->getName()]) ? str_replace("\n", '
    ', $_POST[$this->getName()]) : ''; } else { return isset($_POST[$this->getName()]) ? $_POST[$this->getName()] : ''; }}}define('ERROR_OPTSELECT_REQUIRED', '%sが選択されていません。'); class PluginOptselect extends Weboss_FormObject{ function getForm(){ $size = $this->tag->size ? sprintf(' size="%d"', intval($this->tag->size)) : ''; $class = $this->tag->class ? sprintf(' class="%s"', $this->tag->class) : ''; $accesskey = isset($this->tag->accesskey) ? sprintf(' accesskey="%s"', $this->tag->accesskey) : ''; $tabindex = isset($this->tag->tabindex) ? sprintf(' tabindex="%s"', $this->tag->tabindex) : ''; $title = isset($this->tag->title) ? sprintf(' title="%s"', $this->tag->title) : ''; $append = isset($this->tag->append) ? sprintf(' %s', $this->tag->append) : ''; $optionTags = array(); if (isset($this->tag->optgroups)) { $optNumber = 1; $labels = array(); foreach ($this->tag->optgroups as $optgroups) { foreach ($optgroups as $optgroup) { $labels[$optNumber] = (string)$optgroup['label']; foreach ($optgroup->options->option as $option) { $value = (string)$option['value']; $selectedStrings = ' selected="selected"'; $selected = ''; if ($this->getValue() === $value) { $selected = $selectedStrings; } else { if (isset($option['get']) && isset($_GET[$this->getName()]) && $_GET[$this->getName()] == (string)$option['get']) { $selected = $selectedStrings; } else { if (!isset($_GET[$this->getName()]) && !isset($_POST[$this->getName()]) && $option['selected'] == 1) { $selected = $selectedStrings; }}}$optionTags[$optNumber][] = sprintf('', $value, $selected, ((string)$option['class'] ? sprintf(' class="%s"', (string)$option['class']) : ''), ((string)$option ? (string)$option : $value) ); }$optNumber++; }}}$optGroups = array(); foreach ($optionTags as $optNumber => $options) { $optGroups[] = sprintf('' . PHP_EOL . '%s' . PHP_EOL . '', $labels[$optNumber], implode(PHP_EOL, $options)); }$html = sprintf('', $this->getName(), $this->getName(), $class, $accesskey, $tabindex, $title, $size, $append, implode(PHP_EOL, $optGroups) ); return $html; }function validate(){ if ($this->tag->required == 1) { if (!$this->getValue()) { return sprintf(ERROR_OPTSELECT_REQUIRED, $this->getLabel()); }}}function getValue($mode = null){ if ($mode == 'confirm' || $mode == 'mail') { if (isset($this->tag->optgroups)) { $optNumber = 1; $labels = array(); $optNumber = 1; foreach ($this->tag->optgroups as $optgroups) { foreach ($optgroups as $optgroup) { $labels[$optNumber] = (string)$optgroup['label']; foreach ($optgroup->options->option as $option) { if ($this->getValue() == (string)$option['value']) { return (string)$option['value']; }}}}}return ''; } else { return isset($_POST[$this->getName()]) ? $_POST[$this->getName()] : ''; }}}class PluginHidden extends Weboss_FormObject{ function getForm(){ $html = sprintf('', $this->getName(), $this->getName(), htmlspecialchars(($this->getValue() ? $this->getValue() : $this->tag->value)) ); return $html; }function validate(){ }}define('ERROR_TEXT_REQUIRED', '%sが入力されていません。'); define('ERROR_TEXT_MAXLENGTH', '%sの文字数を確認してください。'); define('ERROR_TEXT_NOTNUMERIC', '%sは数値を入力してください。'); define('ERROR_TEXT_NOTALPHANUM', '%sは半角英数字を入力してください。'); define('ERROR_TEXT_NOTMAIL', '%sにはメールアドレスを入力してください。'); define('ERROR_TEXT_NOTREGEXP', '%sの入力内容が正しくありません。'); define('ERROR_TEXT_NOMATCH', '%sが一致していません。'); define('ERROR_TEXT_KANA', '%sにひらがな・カタカナ以外が入力されています。'); define('ERROR_TEXT_NOTZENKAKU', '%sは全角文字列で入力してください。'); class PluginText extends Weboss_FormObject{ function getForm(){ $maxlength = isset($this->tag->maxlength) ? sprintf(' maxlength="%d"', intval($this->tag->maxlength)) : ''; $size = isset($this->tag->size) ? sprintf(' size="%d"', intval($this->tag->size)) : ''; $class = isset($this->tag->class) ? sprintf(' class="%s"', $this->tag->class) : ''; $accesskey = isset($this->tag->accesskey) ? sprintf(' accesskey="%s"', $this->tag->accesskey) : ''; $tabindex = isset($this->tag->tabindex) ? sprintf(' tabindex="%s"', $this->tag->tabindex) : ''; $title = isset($this->tag->title) ? sprintf(' title="%s"', $this->tag->title) : ''; $append = isset($this->tag->append) ? sprintf(' %s', $this->tag->append) : ''; if (isset($this->tag->imemode)) { $style = sprintf(' style="ime-mode:%s"', $this->tag->imemode); } else if (isset($this->tag->numeric) || isset($this->tag->alphanum) || isset($this->tag->is_mail)) { $style = ' style="ime-mode:disabled"'; } else { $style = ''; }if (isset($this->tag->notcopy) && $this->tag->notcopy == 1) { $notcopy = ' oncopy="return false;"'; } else { $notcopy = ''; }if (isset($this->tag->notpaste) && $this->tag->notpaste == 1) { $notpaste = ' onpaste="return false;"'; } else { $notpaste = ''; }if (isset($this->tag->notrightclick) && $this->tag->notrightclick == 1) { $notrightclick = ' oncontextmenu="return false;"'; } else { $notrightclick = ''; }$html = sprintf('', $this->getName(), $this->getName(), htmlspecialchars(($this->getValue() ? $this->getValue() : '')), $maxlength, $size, $class, $style, $accesskey, $tabindex, $title, $notcopy, $notpaste, $notrightclick, $append ); return $html; }function validate(){ if (isset($this->tag->required) && $this->tag->required == 1) { if (!$this->getValue()) { return sprintf(ERROR_TEXT_REQUIRED, $this->getLabel()); }}if (isset($this->tag->maxlength) && $this->tag->maxlength > 0) { if (mb_strlen($this->getValue(), 'utf8') > $this->tag->maxlength) { return sprintf(ERROR_TEXT_MAXLENGTH, $this->getLabel()); }}if (isset($this->tag->numeric) && $this->tag->numeric == 1) { if ($this->getValue() && !is_numeric($this->getValue())) { return sprintf(ERROR_TEXT_NOTNUMERIC, $this->getLabel()); }}if (isset($this->tag->numeric) && $this->tag->numeric == 2) { if ($this->getValue() && preg_match("/[^0-9\-\+]+/", $this->getValue())) { return sprintf(ERROR_TEXT_NOTNUMERIC, $this->getLabel()); }}if (isset($this->tag->alphanum) && $this->tag->alphanum == 1) { if ($this->getValue() && preg_match("/^[^0-9a-zA-Z]+$/", $this->getValue())) { return sprintf(ERROR_TEXT_NOTALPHANUM, $this->getLabel()); }}if ($this->tag->zenkaku == 1) { if ($this->getValue() != mb_convert_kana( $this->getValue(), 'RNASKHV' )) { return sprintf(ERROR_TEXTAREA_NOTZENKAKU, $this->getLabel()); }}if (isset($this->tag->kana) && $this->tag->kana > 0) { if ($this->getValue() && preg_match('/[^ァ-ヶーぁ-んア-ン゙゚]+/u', $this->getValue())) { return sprintf(ERROR_TEXT_KANA, $this->getLabel()); }}if (isset($this->tag->is_mail) && $this->tag->is_mail == 1) { if ($this->getValue() && !preg_match("/^(?:(?:(?:(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+)(?:\.(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+))*)|(?:\"(?:\\[^\r\n]|[^\\\"])*\")))\@(?:(?:(?:(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+)(?:\.(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+))*)|(?:\[(?:\\\S|[\x21-\x5a\x5e-\x7e])*\])))$/", $this->getValue())) { return sprintf(ERROR_TEXT_NOTMAIL, $this->getLabel()); }}if (isset($this->tag->regexp) && strlen(trim($this->tag->regexp)) > 0) { if ($this->getValue() && !preg_match('/' . $this->tag->regexp . '/', $this->getValue())) { return sprintf(ERROR_TEXT_NOTREGEXP, $this->getLabel()); }}if (isset($this->tag->confirm_name) && strlen(trim((string)$this->tag->confirm_name))) { if (isset($_POST[(string)$this->tag->confirm_name])) { $confirmValue = $_POST[(string)$this->tag->confirm_name]; } else { $confirmValue = ''; }if ($this->getValue() && ($_POST[(string)$this->tag->confirm_name] != $this->getValue())) { return sprintf(ERROR_TEXT_NOMATCH, $this->getLabel()); }}}function filter($param, $mode){ if (($mode == 'confirm' || $mode == 'hidden') && isset($this->tag->kana) && $this->tag->kana > 0) { if ($this->tag->kana == 1) { if (function_exists('mb_convert_kana')) { return mb_convert_kana($param, 'Hc', 'utf8'); } else { echo 'server mbstring setting error!!.'; return $param; }} else if ($this->tag->kana == 2) { if (function_exists('mb_convert_kana')) { return mb_convert_kana($param, 'KC', 'utf8'); } else { echo 'server mbstring setting error!!.'; return $param; }} else if ($this->tag->kana == 3) { if (function_exists('mb_convert_kana')) { return mb_convert_kana($param, 'kh', 'utf8'); } else { echo 'server mbstring setting error!!.'; return $param; }}} else { return $param; }}function getJavaScript(){ $script = 'function %s_check() {' . '}'; return sprintf($script, str_replace('-', '_', $this->getName())); }function getSubmitJavaScript(){ $script = ''; if ($this->tag->required == 1) { $script .= sprintf( 'if (!document.getElementById(\'%s\').value) {' . 'alert(\'%sを入力してください\');return false;}', $this->getName(), $this->getLabel() ); }if ($this->tag->numeric == 1) { $script .= sprintf( 'if (document.getElementById(\'%s\').value && document.getElementById(\'%s\').value.match(/[^0-9]/g)) {' . 'alert(\'%sは半角のみ入力できます。\');return false;}', $this->getName(), $this->getName(), $this->getLabel() ); }if ($this->tag->numeric == 2) { $script .= sprintf( 'if (document.getElementById(\'%s\').value && document.getElementById(\'%s\').value.match(/[^0-9\-\+]/g)) {' . 'alert(\'%sは半角のみ入力できます。\');return false;}', $this->getName(), $this->getName(), $this->getLabel() ); }if ($this->tag->alphanum == 1) { $script .= sprintf( 'if (document.getElementById(\'%s\').value && document.getElementById(\'%s\').value.match(/[^0-9a-zA-Z]/g)) {' . 'alert(\'%sは半角英数のみ入力できます。\');return false;}', $this->getName(), $this->getName(), $this->getLabel() ); }if (isset($this->tag->confirm_name) && strlen(trim((string)$this->tag->confirm_name))) { $script .= sprintf( 'if (document.getElementById(\'%s\').value && document.getElementById(\'%s\').value &&' . ' document.getElementById(\'%s\').value != document.getElementById(\'%s\').value) {' . 'alert(\'%sが一致していません。\');return false;}', $this->getName(), (string)$this->tag->confirm_name, $this->getName(), (string)$this->tag->confirm_name, $this->getLabel() ); }return $script; }} if (isset($_POST['actionmode'])) { $mode = $_POST['actionmode']; } else { $mode = 'input'; }if (isset($_POST['currentpage'])) { $pageNumber = $_POST['currentpage']; } else { $pageNumber = 0; }if (isset($_POST['return']) || isset($_POST['return_x'])) { if ($mode == 'send') { $mode = 'input'; $pageNumber = 0; } else { $mode = 'return'; $pageNumber--; }} if (isset($isModuleForm) && $isModuleForm) { executeMainModule(); } else { if ($xml = Weboss_XMLParser::parse()) { $formCreater =& new Weboss_FormCreater($xml, $pageNumber); $formCreater->execute($mode); } else { Weboss_FormCreater::raiseError('xml'); }}