require_once dirname(__DIR__) . DS . 'tables' . DS . 'contributor' . DS . 'roletype.php'; // include helpers require_once dirname(__DIR__) . DS . 'helpers' . DS . 'html.php'; require_once dirname(__DIR__) . DS . 'helpers' . DS . 'permissions.php'; require_once dirname(__DIR__) . DS . 'helpers' . DS . 'utilities.php'; require_once dirname(__DIR__) . DS . 'helpers' . DS . 'tags.php'; // include importer require_once __DIR__ . DS . 'import' . DS . 'importer.php'; // get controller name $controllerName = \Request::getCmd('controller', 'items'); if (!file_exists(__DIR__ . DS . 'controllers' . DS . $controllerName . '.php')) { $controllerName = 'items'; } \Submenu::addEntry(\Lang::txt('COM_RESOURCES'), \Route::url('index.php?option=' . $option), $controllerName == 'items' && $task != 'orphans'); \Submenu::addEntry(\Lang::txt('COM_RESOURCES_ORPHANS'), \Route::url('index.php?option=' . $option . '&controller=items&task=orphans'), $task == 'orphans'); \Submenu::addEntry(\Lang::txt('COM_RESOURCES_TYPES'), \Route::url('index.php?option=' . $option . '&controller=types'), $controllerName == 'types'); \Submenu::addEntry(\Lang::txt('COM_RESOURCES_LICENSES'), \Route::url('index.php?option=' . $option . '&controller=licenses'), $controllerName == 'licenses'); \Submenu::addEntry(\Lang::txt('COM_RESOURCES_AUTHORS'), \Route::url('index.php?option=' . $option . '&controller=authors'), $controllerName == 'authors'); \Submenu::addEntry(\Lang::txt('COM_RESOURCES_ROLES'), \Route::url('index.php?option=' . $option . '&controller=roles'), $controllerName == 'roles'); require_once dirname(dirname(__DIR__)) . DS . 'com_plugins' . DS . 'admin' . DS . 'helpers' . DS . 'plugins.php'; if (\Components\Plugins\Admin\Helpers\Plugins::getActions()->get('core.manage')) { \Submenu::addEntry(\Lang::txt('COM_RESOURCES_PLUGINS'), \Route::url('index.php?option=' . $option . '&controller=plugins'), $controllerName == 'plugins'); } \Submenu::addEntry(\Lang::txt('COM_RESOURCES_IMPORT'), \Route::url('index.php?option=' . $option . '&controller=import'), $controllerName == 'import'); \Submenu::addEntry(\Lang::txt('COM_RESOURCES_IMPORTHOOK'), \Route::url('index.php?option=' . $option . '&controller=importhooks'), $controllerName == 'importhooks'); require_once __DIR__ . DS . 'controllers' . DS . $controllerName . '.php'; $controllerName = __NAMESPACE__ . '\\Controllers\\' . ucfirst($controllerName); // Instantiate controller $controller = new $controllerName(); $controller->execute(); $controller->redirect();
* @author Shawn Rice <*****@*****.**> * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ namespace Components\Courses\Admin; if (!\User::authorise('core.manage', 'com_courses')) { return \App::abort(404, \Lang::txt('JERROR_ALERTNOAUTHOR')); } // Include scripts require_once dirname(__DIR__) . DS . 'helpers' . DS . 'permissions.php'; require_once dirname(__DIR__) . DS . 'tables' . DS . 'log.php'; $controllerName = \Request::getCmd('controller', 'courses'); if (!file_exists(__DIR__ . DS . 'controllers' . DS . $controllerName . '.php')) { $controllerName = 'courses'; } \Submenu::addEntry(\Lang::txt('COM_COURSES_COURSES'), \Route::url('index.php?option=com_courses&controller=courses'), !in_array($controllerName, array('students', 'roles', 'pages'))); \Submenu::addEntry(\Lang::txt('COM_COURSES_PAGES'), \Route::url('index.php?option=com_courses&controller=pages&course=0'), $controllerName == 'pages'); \Submenu::addEntry(\Lang::txt('COM_COURSES_STUDENTS'), \Route::url('index.php?option=com_courses&controller=students&offering=0§ion=0'), $controllerName == 'students'); \Submenu::addEntry(\Lang::txt('COM_COURSES_ROLES'), \Route::url('index.php?option=com_courses&controller=roles'), $controllerName == 'roles'); require_once PATH_CORE . DS . 'components' . DS . 'com_plugins' . DS . 'admin' . DS . 'helpers' . DS . 'plugins.php'; $canDo = \Components\Plugins\Admin\Helpers\Plugins::getActions(); if ($canDo->get('core.manage')) { \Submenu::addEntry(\Lang::txt('COM_COURSES_PLUGINS'), \Route::url('index.php?option=com_plugins&view=plugins&filter_folder=courses&filter_type=courses')); } require_once __DIR__ . DS . 'controllers' . DS . $controllerName . '.php'; $controllerName = __NAMESPACE__ . '\\Controllers\\' . ucfirst($controllerName); // Instantiate controller $controller = new $controllerName(); $controller->execute(); $controller->redirect();