Exemplo n.º 1
0
    if (Citruscart::load('CitruscartController' . $controller . $protocol, "controllers." . $controller . "_" . $protocol, $options)) {
        $controller .= $protocol;
    }
} else {
    if (!Citruscart::load('CitruscartController' . $controller, "controllers.{$controller}", $options)) {
        $controller = '';
    }
}
if (empty($controller)) {
    // redirect to default
    $redirect = "index.php?option=com_citruscart&view=products";
    $redirect = JRoute::_($redirect, false);
    JFactory::getApplication()->redirect($redirect);
}
$js = "var com_citruscart = {};\n";
$js .= "com_citruscart.jbase = '" . Citruscart::getUriRoot() . "';\n";
$doc->addScriptDeclaration($js);
JHtml::_('script', 'media/citruscart/js/common.js', false, false);
require_once JPATH_SITE . '/libraries/dioscouri/loader.php';
$parentPath = JPATH_ADMINISTRATOR . '/components/com_citruscart/helpers';
DSCLoader::discover('CitruscartHelper', $parentPath, true);
$parentPath = JPATH_ADMINISTRATOR . '/components/com_citruscart/library';
DSCLoader::discover('Citruscart', $parentPath, true);
$parentPath = JPATH_ADMINISTRATOR . '/components/com_citruscart/tables';
DSCLoader::discover('CitruscartTable', $parentPath, true);
// load the plugins
JPluginHelper::importPlugin('citruscart');
// Check Json Class Existance
if (!function_exists('json_decode')) {
    // This should load not only the class, but also json_encode / json_decode
    Citruscart::load('Services_JSON', 'library.json');