forked from hubzero/hubzero-cms
/
cart.php
58 lines (51 loc) · 1.92 KB
/
cart.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
<?php
/**
* HUBzero CMS
*
* Copyright 2005-2011 Purdue University. All rights reserved.
*
* This file is part of: The HUBzero(R) Platform for Scientific Collaboration
*
* The HUBzero(R) Platform for Scientific Collaboration (HUBzero) is free
* software: you can redistribute it and/or modify it under the terms of
* the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* HUBzero is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* HUBzero is a registered trademark of Purdue University.
*
* @package hubzero-cms
* @author Ilya Shunko <ishunko@purdue.edu>
* @copyright Copyright 2005-2011 Purdue University. All rights reserved.
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPLv3
*/
namespace Components\Cart\Site;
//import needed Joomla! libs
//jimport('joomla.filesystem.folder');
//jimport('joomla.application.component.view');
use Filesystem;
// require base component controller
require_once(__DIR__ . DS . 'controllers' . DS . 'component.php');
$controllerName = \Request::getCmd('controller', '');
if (empty($controllerName))
{
$controllerName = 'cart';
}
if (!file_exists(__DIR__ . DS . 'controllers' . DS . $controllerName . '.php'))
{
App::abort(404, Lang::txt('Page Not Found'));
}
require_once(__DIR__ . DS . 'controllers' . DS . $controllerName . '.php');
$controllerName = __NAMESPACE__ . '\\Controllers\\' . ucfirst(strtolower($controllerName));
// Instantiate controller
$controller = new $controllerName();
$controller->execute();
$controller->redirect();