-
Notifications
You must be signed in to change notification settings - Fork 4
/
tz_portfolio_plus.php
62 lines (41 loc) · 1.98 KB
/
tz_portfolio_plus.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
<?php
/*------------------------------------------------------------------------
# TZ Portfolio Plus Extension
# ------------------------------------------------------------------------
# author DuongTVTemPlaza
# copyright Copyright (C) 2015 templaza.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.templaza.com
# Technical Support: Forum - http://templaza.com/Forum
-------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
// Access check.
if (!Factory::getUser()->authorise('core.manage', 'com_tz_portfolio_plus')) {
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}
$input = Factory::getApplication() -> input;
$option = $input -> getCmd('option','com_tz_portfolio_plus');
$view = $input -> getCmd('view','dashboard');
$task = $input -> getCmd('task',null);
/* Setup */
$file = dirname(__FILE__).'/setup/index.php';
if(File::exists($file)){
require_once($file);
}else {
JLoader::import('com_tz_portfolio_plus.includes.framework', JPATH_ADMINISTRATOR . '/components');
// Register helper class
JLoader::register('TZ_Portfolio_PlusHelper', dirname(__FILE__) . '/helpers/tz_portfolio_plus.php');
// Register helper class
JLoader::register('TZ_Portfolio_PlusHelperACL', dirname(__FILE__) . '/helpers/acl.php');
// Register helper class
JLoader::register('TZ_Portfolio_PlusHelperAddons', COM_TZ_PORTFOLIO_PLUS_ADMIN_PATH . '/helpers/addons.php');
JLoader::register('TZ_Portfolio_PlusHelperTemplates', COM_TZ_PORTFOLIO_PLUS_ADMIN_PATH . '/helpers/templates.php');
// Includes my html object
JHtml::addIncludePath(COM_TZ_PORTFOLIO_PLUS_ADMIN_HELPERS_PATH . '/html');
$controller = JControllerLegacy::getInstance('TZ_Portfolio_Plus');
$controller->execute($input->get('task'));
$controller->redirect();
}