Esempio n. 1
0
/**
 * Display required javascript codes for AJAX function calls
 **/
function azrulSysBot()
{
    static $added = false;
    if (!$added) {
        $format = JRequest::getWord('format', 'html');
        if ($format == 'pdf') {
            return;
        }
        // Include ajax file
        include_once AZRUL_SYSTEM_PATH . '/pc_includes/ajax.php';
        $jax = new JAX(AZRUL_SYSTEM_LIVE . '/pc_includes');
        $jax->setReqURI(AZRUL_BASE_LIVE . '/index.php');
        $jax->process();
        $noHTML = JRequest::getInt('no_html', 0);
        if (!$noHTML && $format == 'html') {
            $document =& JFactory::getDocument();
            if ($document->getType() == 'html') {
                $document->addCustomTag($jax->getScript());
            }
        }
        $added = true;
    }
}
Esempio n. 2
0
/**
 * Display required javascript codes for AJAX function calls
 **/
function azrulSysBot()
{
    static $added = false;
    if (!$added) {
        $format = 'html';
        // Don't display mambots on pdf view for 1.5
        if (azrulGetJoomlaVersion() == '1.5') {
            $format = JRequest::getWord('format', 'html');
            if ($format == 'pdf') {
                return;
            }
        }
        // Include ajax file
        include_once AZRUL_SYSTEM_PATH . '/pc_includes/ajax.php';
        $jax = new JAX(AZRUL_SYSTEM_LIVE . '/pc_includes');
        $jax->setReqURI(AZRUL_BASE_LIVE . '/index.php');
        $jax->process();
        if (!isset($_POST['no_html']) && $format == 'html') {
            global $mainframe;
            $mainframe->addCustomHeadTag($jax->getScript());
        }
        $added = true;
    }
}
Esempio n. 3
0
if (!defined('JAX_SITE_ROOT') && defined('AZRUL_SYSTEM_PATH')) {
    require_once AZRUL_SYSTEM_PATH . '/pc_includes/ajax.php';
}
// Let's test if the task is azrul_ajax , we skip the controller part at all.
if (isset($task) && $task == 'azrul_ajax') {
    require_once JPATH_ROOT . '/administrator/components/com_community/ajax.community.php';
} else {
    ob_start();
    // Load AJAX library for the back end. Only if the plugin exist
    if (class_exists('JAX')) {
        $jax = new JAX(AZRUL_SYSTEM_LIVE . '/pc_includes');
        $jax->setReqURI(rtrim(JURI::root(), '/') . '/administrator/index.php');
        // @rule: We do not want to add these into tmpl=component or no_html=1 in the request.
        if ($jinput->request->get('no_html', '', 'NONE') != 1 && $jinput->request->get('tmpl', '', 'NONE') != 'component') {
            // Override previously declared jax_live_site stuffs
            if (!$jax->process()) {
                echo $jax->getScript();
            }
        }
    }
    // We treat the view as the controller. Load other controller if there is any.
    $controller = JRequest::getWord('view', 'community');
    if (!empty($controller)) {
        $controller = JString::strtolower($controller);
        $path = JPATH_ROOT . '/administrator/components/com_community/controllers/' . $controller . '.php';
        // Test if the controller really exists
        if (file_exists($path)) {
            require_once $path;
        } else {
            JError::raiseError(500, $path . JText::_('COM_COMMUNITY_CONTROLLER_NOT_EXISTS'));
        }