Esempio n. 1
0
} else {
    require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_languages' . DS . 'helpers' . DS . 'jsonresponse.php';
}
/**
 * Content controller class.
 */
class J2XMLControllerContent extends JControllerAbstract
{
    function __construct($default = array())
    {
        parent::__construct();
    }
    public function display($cachable = false, $urlparams = false)
    {
        JRequest::setVar('view', 'content');
        parent::display($cachable, $urlparams);
    }
    function send()
    {
        if (!JSession::checkToken('request')) {
            // Check for a valid token. If invalid, send a 403 with the error message.
            JError::raiseWarning(403, JText::_('JINVALID_TOKEN'));
            echo version_compare(JPlatform::RELEASE, '12', 'ge') ? new JResponseJson() : new JJsonResponse();
            return;
        }
        $cid = JRequest::getVar('cid', array(0), null, 'array');
        $sid = JRequest::getVar('w_id', null, null, 'int');
Esempio n. 2
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $cid = JRequest::getVar('cid');
     $ids = explode(",", $cid);
     $params = JComponentHelper::getParams('com_j2xml');
     $images = array();
     $xml = J2XMLExporter::contents($ids, $params->get('export_images', '1'), 1, $params->get('export_users', '1'), $images);
     foreach ($images as $image) {
         $xml .= $image;
     }
     if (!J2XMLExporter::export($xml, $params->get('debug', 0), $params->get('export_gzip', '0'))) {
         $app->redirect('index.php?option=com_content');
     }
 }