This repository has been archived by the owner on May 5, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadminer.php
67 lines (56 loc) · 1.98 KB
/
adminer.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* @author mediahof, Kiel-Germany
* @link http://www.mediahof.de
* @copyright Copyright (c) 2013 - 2015 mediahof. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die;
class plgSystemAdminer extends JPlugin
{
private $layout = array(
'width' => '100%',
'height' => '500',
'style' => 'border: 0;',
'onload' => 'this.height=this.contentWindow.document.body.scrollHeight'
);
private $styles = array(
'.icon-48-database{background-image:url(../media/adminer/adminer.png);}',
'#toolbar{display:none;}'
);
public function onBeforeRender()
{
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
if ($app->isSite())
{
return;
}
if ($app->input->get('adminer') && $app->input->get('option') == 'com_admin' && $app->input->get('view') == 'sysinfo')
{
JToolbarHelper::title(JText::_('Adminer'), 'database');
$doc->setBuffer('', 'modules', 'submenu');
$doc->addStyleDeclaration(implode($this->styles));
$iframe = JHtml::_('iframe', JUri::root(true) . '/media/adminer/loader.php', 'adminer', $this->layout);
$doc->setBuffer($iframe, 'component');
}
}
public function onGetIcons()
{
return array(
array(
'link' => 'index.php?option=com_admin&view=sysinfo&adminer=true',
'image' => (version_compare(JVERSION, '3', '>=') ? 'database' : JUri::root() . 'media/adminer/adminer.png'),
'text' => JText::_('Adminer'),
'id' => 'plg_system_adminer',
'access' => array(
'core.manage',
'com_config',
'core.admin',
'com_config'
),
'group' => 'MOD_QUICKICON_MAINTENANCE'
)
);
}
}