-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCacheviewerModule.php
50 lines (43 loc) · 1.28 KB
/
CacheviewerModule.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* This file is part of the {@link http://ontowiki.net OntoWiki} project.
*
* @copyright Copyright (c) 2013, {@link http://aksw.org AKSW}
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
*/
/**
* OntoWiki module - cache viewer
*
* Displays status of cache for selected resource
*
* @category OntoWiki
* @package Extensions_Site
*/
class CacheviewerModule extends OntoWiki_Module
{
public function init()
{
}
public function shouldShow()
{
return $this->_erfurt->getAc()->isActionAllowed('CacheManagement');
}
public function getTitle()
{
return 'Site Page Cache';
}
public function getContents()
{
$helper = $this->_owApp->extensionManager->getComponentHelper('site');
$uri = $this->_owApp->selectedResource;
if (!empty($uri) && $uri != (string)$this->_owApp->selectedModel) {
$uri .= '.html';
}
$uri = preg_replace('~^http://~', '', $uri);
$this->view->r = $this->_owApp->selectedResource;
$this->view->uri = $uri;
$this->view->resourceUri = (string)$this->_owApp->selectedResource;
$this->view->test = $helper->testCache($uri);
return $this->render('templates/cacheviewer');
}
}