/
jacc.php
61 lines (45 loc) · 1.58 KB
/
jacc.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
<?php
/**
* @version $Id: jacc.php 147 2013-10-06 08:58:34Z michel $
* @package Jacc
* @author mliebler
* @copyright Copyright (C) 2010, Michael Liebler. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
//--No direct access
defined('_JEXEC') or die('Resrtricted Access');
// DS has removed from J 3.0
if(!defined('DS')) {
define('DS','/');
}
// Require the base controller
require_once( JPATH_COMPONENT.DS.'controller.php' );
jimport('joomla.application.component.model');
require_once( JPATH_COMPONENT.DS.'models'.DS.'model.php' );
// Component Helper
jimport('joomla.application.component.helper');
//add Helperpath to JHTML
JHTML::addIncludePath(JPATH_COMPONENT.DS.'helpers');
//include Helper
require_once(JPATH_COMPONENT.DS.'helpers'.DS.'jacc.php' );
//set the default view
$controller = JRequest::getWord('view', 'jacc');
JaccHelper::addSubmenu($controller);
$ControllerConfig = array();
// Require specific controller if requested
if ($controller) {
$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
if (file_exists($path)) {
require_once $path;
} else {
$ControllerConfig = array('viewname'=>strtolower($controller), 'mainmodel'=>strtolower($controller), 'itemname'=>ucfirst(strtolower($controller)));
$controller = '';
}
}
// Create the controller
$classname = 'JaccController'.$controller;
$controller = new $classname($ControllerConfig );
// Perform the Request task
$controller->execute( JRequest::getVar( 'task' ) );
// Redirect if set by the controller
$controller->redirect();