admin.php
1.46 KB
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
<?php
defined('_JEXEC') or die;
/**
* Admin helper.
*
* @since 3.0
*/
class JceHelperAdmin
{
/**
* Configure the Submenu links.
*
* @param string $vName The view name
*
* @since 3.0
*/
public static function addSubmenu($vName)
{
$uri = (string)JUri::getInstance();
$return = urlencode(base64_encode($uri));
$user = JFactory::getUser();
JHtmlSidebar::addEntry(
JText::_('WF_CPANEL'),
'index.php?option=com_jce&view=cpanel',
$vName == 'cpanel'
);
$views = array(
'config' => 'WF_CONFIGURATION',
'profiles' => 'WF_PROFILES',
'browser' => 'WF_CPANEL_BROWSER',
'mediabox' => 'WF_MEDIABOX'
);
foreach($views as $key => $label) {
if ($key === "mediabox" && !JPluginHelper::isEnabled('system', 'jcemediabox')) {
continue;
}
if ($user->authorise('jce.' . $key, 'com_jce')) {
JHtmlSidebar::addEntry(
JText::_($label),
'index.php?option=com_jce&view=' . $key,
$vName == $key
);
}
}
}
public static function getTemplateStylesheets()
{
require_once(JPATH_SITE . '/components/com_jce/editor/libraries/classes/editor.php');
return WFEditor::getTemplateStyleSheets();
}
}