コード例 #1
0
        ecrLoadHelper('g11n_dummy');
    }
}
try {
    if (class_exists('g11n')) {
        // TEMP@@debug
        // @   g11n::cleanStorage();//@@DEBUG
        g11n::setDebug($debug);
        // Get our special language file
        g11n::loadLanguage();
    }
} catch (Exception $e) {
    JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}
$document = JFactory::getDocument();
// Add css
$document->addStyleSheet('media/com_easycreator/site/css/default.css');
// Add javascript
$document->addScript('media/com_easycreator/site/js/easycreator.js');
// Include standard html
JLoader::import('helpers.html', JPATH_COMPONENT);
// Require the base controller
require_once JPATH_COMPONENT . DS . 'controller.php';
$controller = new EasyCreatorController();
easyHTML::start();
// Perform the Request task
$controller->execute(JFactory::getApplication()->input->get('task'));
easyHTML::end();
$debug && class_exists('g11n') ? g11n::debugPrintTranslateds() : null;
// Redirect if set by the controller
$controller->redirect();
コード例 #2
0
JFactory::getDocument()->addScriptDeclaration("var ECR_JVERSION = '" . ECR_JVERSION . "';" . NL);
$prevErrorReporting = error_reporting(-1);
try {
    $controller = EcrEasycreator::getController();
    $input = JFactory::getApplication()->input;
    if ('component' == $input->get('tmpl')) {
        // Perform the Request task only - raw view
        $controller->execute($input->get('task'));
    } else {
        // Display the menu
        EcrHtmlMenu::main();
        // Perform the Request task
        $controller->execute($input->get('task'));
        if (ECR_DEV_MODE && ECR_DEBUG_LANG && class_exists('g11n')) {
            g11n::debugPrintTranslateds(true);
            g11n::debugPrintTranslateds();
        }
        // Display the footer
        EcrHtml::footer();
        JDEBUG ? JProfiler::getInstance('Application')->mark('com_easycreator finished') : null;
    }
    // Restore error_reporting
    error_reporting($prevErrorReporting);
    // Redirect if set by the controller
    // We don't do this very often =;)
    $controller->redirect();
} catch (Exception $e) {
    EcrHtml::message($e);
    JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
    if (ECR_DEBUG) {
        echo '<pre>' . $e->getTraceAsString() . '</pre>';