示例#1
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU 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    Shawn Rice <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @copyright Copyright 2005-2014 Open Source Matters, Inc.
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GPLv2
 */
$canDo = \Components\Installer\Admin\Helpers\Installer::getActions();
Toolbar::title(Lang::txt('COM_INSTALLER_HEADER_' . $this->getName()), 'install.png');
if ($canDo->get('core.admin')) {
    Toolbar::preferences('com_installer');
    Toolbar::divider();
}
Toolbar::help('warnings');
Document::setTitle(Lang::txt('COM_INSTALLER_TITLE_' . $this->getName()));
?>
<div id="installer-warnings">
	<form action="<?php 
echo Route::url('index.php?option=com_installer&controller=warnings');
?>
" method="post" name="adminForm" id="item-form">
		<?php 
if (!count($this->messages)) {
示例#2
0
 * @package   hubzero-cms
 * @author    Shawn Rice <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @copyright Copyright 2005-2014 Open Source Matters, Inc.
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GPLv2
 */
namespace Components\Installer\Admin;

// Access check.
if (!\User::authorise('core.manage', 'com_installer')) {
    return \App::abort(403, \Lang::txt('JERROR_ALERTNOAUTHOR'));
}
if ($task = \Request::getCmd('task')) {
    if (strstr($task, '.')) {
        @(list($c, $t) = explode('.', $task));
        $t = \Request::setVar('task', trim($t));
        $c = \Request::setVar('controller', trim($c));
    }
}
$controllerName = \Request::getCmd('controller', 'install');
if (!file_exists(__DIR__ . DS . 'controllers' . DS . $controllerName . '.php')) {
    \App::abort(404, \Lang::txt('JERROR_ALERTNOAUTHOR'));
}
require_once __DIR__ . DS . 'helpers' . DS . 'installer.php';
\Components\Installer\Admin\Helpers\Installer::addSubmenu($controllerName);
require_once __DIR__ . DS . 'controllers' . DS . $controllerName . '.php';
$controllerName = __NAMESPACE__ . '\\Controllers\\' . ucfirst($controllerName);
// initiate controller
$controller = new $controllerName();
$controller->execute();
$controller->redirect();