helper.php
2.01 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
62
<?php
/* ======================================================
# Monthly Archive - Joomla! Component v4.3.3 (PRO version)
# -------------------------------------------------------
# For Joomla! 3.x
# Author: Yiannis Christodoulou (yiannis@web357.eu)
# Copyright (©) 2009-2018 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https://www.web357.eu/
# Demo: http://demo.web357.eu/?item=monthlyarchive
# Support: support@web357.eu
# Last modified: 09 Feb 2018, 13:55:18
========================================================= */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
abstract class MonthlyarchiveHelper
{
public static function addSubmenu($submenu)
{
JLoader::import( "joomla.version" );
$version = new JVersion();
if (!version_compare( $version->RELEASE, "2.5", "<=")) :
// J3X
JHtmlSidebar::addEntry(JText::_('Overview'), 'index.php?option=com_monthlyarchive&view=overv', $submenu == 'overv');
JHtmlSidebar::addEntry(JText::_('Settings'), 'index.php?option=com_config&view=component&component=com_monthlyarchive', $submenu == 'settingscore');
JHtmlSidebar::addEntry(JText::_('About Web357'), 'index.php?option=com_monthlyarchive&view=about', $submenu == 'about');
else:
// J25X
$vName = JRequest::getCmd('view', 'overv');
echo JSubMenuHelper::addEntry( JText::_('Overview'), 'index.php?option=com_monthlyarchive&view=overv', $vName == 'overv' );
$vName = JRequest::getCmd('view', 'about');
echo JSubMenuHelper::addEntry( JText::_('About Web357'), 'index.php?option=com_monthlyarchive&view=about', $vName == 'about' );
endif;
}
public static function getActions()
{
$user = JFactory::getUser();
$result = new JObject;
$assetName = 'com_snippets';
$actions = array(
'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete'
);
foreach ($actions as $action)
{
$result->set($action, $user->authorise($action, $assetName));
}
return $result;
}
}