Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F49507237
MediaWikiMirrorApplication.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
MediaWikiMirrorApplication.php
View Options
<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* MediaWiki mirror application class
*
* @package ObsidianWorkspaces
* @subpackage MediaWikiMirror
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*/
/**
* MediaWiki mirror application class
*/
class
MediaWikiMirrorApplication
extends
Application
{
/**
* Gets rendered version URL
*
* @return string the URL
*/
public
function
getRenderUrl
()
{
return
$this
->
context
->
configuration
->
url
[
0
]
.
$this
->
context
->
configuration
->
url
[
1
]
.
"/index.php?action=render&title="
.
$this
->
context
->
configuration
->
page
;
}
public
function
fix_links
(
$content
)
{
$fullUrl
=
$this
->
context
->
configuration
->
url
[
0
]
.
$this
->
context
->
configuration
->
url
[
1
];
$content
=
str_replace
(
'<a href="'
.
$this
->
context
->
configuration
->
url
[
1
],
'<a href="'
.
$fullUrl
,
$content
);
$content
=
str_replace
(
' src="'
.
$this
->
context
->
configuration
->
url
[
1
],
' src="'
.
$fullUrl
,
$content
);
return
$content
;
}
/**
* Handles controller request
*/
public
function
handleRequest
()
{
$smarty
=
$this
->
context
->
templateEngine
;
//Serves header
$smarty
->
assign
(
'PAGE_TITLE'
,
$title
);
HeaderController
::
run
(
$this
->
context
);
//Output Hello world
$url
=
$this
->
getRenderUrl
();
echo
"
<style>
.mw-editsection {
display: block;
float: right;
font-size: 12pt;
}
</style>"
;
$content
=
file_get_contents
(
$url
);
$content
=
$this
->
fix_links
(
$content
);
echo
$content
;
//Serves footer
FooterController
::
run
(
$this
->
context
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Sep 14, 16:09 (21 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4085841
Default Alt Text
MediaWikiMirrorApplication.php (1 KB)
Attached To
Mode
rOBSIDIAN Obsidian Workspaces
Attached
Detach File
Event Timeline
Log In to Comment