mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
merge & tag 1.4.3
git-svn-id: http://xe-core.googlecode.com/svn/trunk@7597 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
762ebbf445
commit
289973781a
200 changed files with 2296 additions and 1827 deletions
37
classes/display/VirtualXMLDisplayHandler.php
Normal file
37
classes/display/VirtualXMLDisplayHandler.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
class VirtualXMLDisplayHandler {
|
||||
/**
|
||||
* @brief Produce virtualXML compliant content given a module object.\n
|
||||
* @param[in] $oModule the module object
|
||||
**/
|
||||
|
||||
function toDoc(&$oModule)
|
||||
{
|
||||
$error = $oModule->getError();
|
||||
$message = $oModule->getMessage();
|
||||
$redirect_url = $oModule->get('redirect_url');
|
||||
$request_uri = Context::get('xeRequestURI');
|
||||
$request_url = Context::get('xeVirtualRequestUrl');
|
||||
if(substr($request_url,-1)!='/') $request_url .= '/';
|
||||
|
||||
if($error === 0) {
|
||||
if($message != 'success') $output->message = $message;
|
||||
if($redirect_url) $output->url = $redirect_url;
|
||||
else $output->url = $request_uri;
|
||||
} else {
|
||||
if($message != 'fail') $output->message = $message;
|
||||
}
|
||||
|
||||
$html = '<script type="text/javascript">'."\n";
|
||||
if($output->message) $html .= 'alert("'.$output->message.'");'."\n";
|
||||
if($output->url) {
|
||||
$url = preg_replace('/#(.+)$/i','',$output->url);
|
||||
$html .= 'self.location.href = "'.$request_url.'common/tpl/redirect.html?redirect_url='.urlencode($url).'";'."\n";
|
||||
}
|
||||
$html .= '</script>'."\n";
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue