Beispiel #1
0
// CJLib includes
$cjlib = JPATH_ROOT . '/components/com_cjlib/framework.php';
if (file_exists($cjlib)) {
    require_once $cjlib;
} else {
    die('CJLib (CoreJoomla API Library) component not found. Please download and install it to continue.');
}
CJLib::import('corejoomla.framework.core');
CJLib::import('corejoomla.template.core');
require_once JPATH_COMPONENT . '/controller.php';
require_once JPATH_COMPONENT . '/helpers/constants.php';
require_once JPATH_COMPONENT . '/helpers/helper.php';
$app = JFactory::getApplication();
$params = JComponentHelper::getParams(S_APP_NAME);
define('S_DEBUG_ENABLED', $params->get('enable_debugging', 0) == '1');
CJFunctions::load_component_language(S_APP_NAME);
$task = $app->input->getCmd('task');
if (strpos($task, '.') !== false) {
    $controller = JControllerLegacy::getInstance('CommunitySurveys');
    $controller->execute($task);
    $controller->redirect();
} else {
    if ($params->get('enable_bootstrap', true)) {
        CJLib::import('corejoomla.ui.bootstrap', false);
    }
    CJFunctions::load_jquery(array('libs' => array('fontawesome')));
    $view = $app->input->getCmd('view', 'survey');
    if (JFile::exists(JPATH_COMPONENT . '/controllers/' . $view . '.php')) {
        require_once JPATH_COMPONENT . '/controllers/' . $view . '.php';
    } else {
        return CJFunctions::throw_error('View ' . JString::ucfirst($view) . ' not found!', 500);