monthlyarchive.php
3.9 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?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
========================================================= */
defined( '_JEXEC' ) or die( 'Restricted access' );
// BEGIN: Check if Web357 Framework plugin exists
jimport('joomla.plugin.helper');
if(!JPluginHelper::isEnabled('system', 'web357framework')):
$web357framework_required_msg = JText::_('<p>The <strong>"Web357 Framework"</strong> is required for this extension and must be active. Please, download and install it from <a href="http://downloads.web357.eu/?item=web357framework&type=free">here</a>. It\'s FREE!</p>');
JFactory::getApplication()->enqueueMessage($web357framework_required_msg, 'error');
return false;
endif;
// END: Check if Web357 Framework plugin exists
// BEGIN: Check if the plugin exists
if(!JPluginHelper::isEnabled('system', 'monthlyarchive')):
$plugin_required_msg = JText::_('<p>The <strong>"Monthly Archive"</strong> plugin is required for this extension and must be active. Check if is unpublished. If does not exists in the Plugins list, download and install it from <a href="https://www.web357.eu/downloads/" target="_blank">web357.eu/downloads</a>.</p>');
JFactory::getApplication()->enqueueMessage($plugin_required_msg, 'error');
return false;
endif;
// END: Check if the plugin exists
// BEGIN: Check if Download ID has been specified
if(JPluginHelper::isEnabled('system', 'monthlyarchive')):
$comParams = JComponentHelper::getParams('com_monthlyarchive');
$download_id = $comParams->get('download_id');
if (empty($download_id) || $download_id == ''): // check also if is validated?
$download_id_required_msg = JText::_('<p>You need to specify your <strong>Download ID</strong> before you can receive updates for <strong>Monthly Archive PRO</strong>. For more information please follow our instructions <a href="https://www.web357.eu/download-id" target="_blank"><strong>here</strong></a>.</p>');
JFactory::getApplication()->enqueueMessage($download_id_required_msg, 'warning');
endif;
endif;
// END: Check if Download ID has been specified
// Joomla version
JLoader::import( "joomla.version" );
$version = new JVersion();
if ($version->RELEASE >= '3.3') :
// joomla 3.x
JHtml::_('behavior.tabstate');
endif;
// Added for Joomla 3.0
if(!defined('DS')){
define('DS',DIRECTORY_SEPARATOR);
};
// ACL
if (!JFactory::getUser()->authorise('core.manage', 'com_monthlyarchive')):
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
endif;
// CSS
jimport('joomla.environment.uri' );
$host = JURI::root();
$document = JFactory::getDocument();
$document->addStyleSheet($host.'administrator/components/com_monthlyarchive/assets/css/default.css');
// Preferences
$user = JFactory::getUser();
if ($user->authorise('core.admin', 'com_monthlyarchive')):
JToolBarHelper::preferences('com_monthlyarchive',600);
endif;
// Load cms libraries
JLoader::registerPrefix('J', JPATH_PLATFORM . '/cms');
// Load joomla libraries without overwrite
JLoader::registerPrefix('J', JPATH_PLATFORM . '/joomla',false);
// require helper files
JLoader::register('MonthlyarchiveHelper', dirname(__FILE__) . DS . 'helpers' . DS . 'helper.php');
// import joomla controller library
jimport('joomla.application.component.controller');
// Get an instance of the controller prefixed by Estore
$controller = JControllerLegacy::getInstance('Monthlyarchive');
// Perform the Request task
$controller->execute(JFactory::getApplication()->input->get('task'));
// Redirect if set by the controller
$controller->redirect();