XpressEngine Core
1.11.2
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
classes
display
VirtualXMLDisplayHandler.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (C) NAVER <http://www.navercorp.com> */
3
4
class
VirtualXMLDisplayHandler
5
{
11
function
toDoc
(&$oModule)
12
{
13
$error = $oModule->getError();
14
$message = $oModule->getMessage();
15
$redirect_url = $oModule->get(
'redirect_url'
);
16
$request_uri =
Context::get
(
'xeRequestURI'
);
17
$request_url =
Context::getRequestUri
();
18
$output
=
new
stdClass();
19
20
if
(substr_compare($request_url,
'/'
, -1) !== 0)
21
{
22
$request_url .=
'/'
;
23
}
24
25
if
($error === 0)
26
{
27
if
($message !=
'success'
)
$output
->message = $message;
28
29
$output
->url = ($redirect_url) ? $redirect_url : $request_uri;
30
}
31
else
32
{
33
if
($message !=
'fail'
)
$output
->message = $message;
34
}
35
36
$html = array();
37
$html[] =
'<!DOCTYPE html><html><head><title>Moved...</title><meta charset="utf-8" /><script>'
;
38
39
if
(
$output
->message)
40
{
41
$html[] =
'alert('
. json_encode(
$output
->message, JSON_UNESCAPED_SLASHES) .
');'
;
42
}
43
44
if
(
$output
->url)
45
{
46
$url = json_encode(preg_replace(
'/#(.+)$/i'
,
''
,
$output
->url), JSON_UNESCAPED_SLASHES);
47
$html[] =
'var win = (window.opener) ? window.opener : window.parent;'
;
48
$html[] =
'win.location.href = '
. $url;
49
$html[] =
'if(window.opener) self.close();'
;
50
}
51
52
$html[] =
'</script></head></html>'
;
53
54
return
join(PHP_EOL, $html);
55
}
56
57
}
58
/* End of file VirtualXMLDisplayHandler.class.php */
59
/* Location: ./classes/display/VirtualXMLDisplayHandler.class.php */
$output
$output
Definition:
ko.install.php:193
VirtualXMLDisplayHandler
Definition:
VirtualXMLDisplayHandler.php:4
VirtualXMLDisplayHandler\toDoc
toDoc(&$oModule)
Definition:
VirtualXMLDisplayHandler.php:11
Context\getRequestUri
getRequestUri($ssl_mode=FOLLOW_REQUEST_SSL, $domain=null)
Definition:
Context.class.php:1849
Context\get
get($key)
Definition:
Context.class.php:1973
Generated on Tue Dec 18 2018 17:04:25 for XpressEngine Core by
1.8.5