コード例 #1
0
} else {
    require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_languages' . DS . 'helpers' . DS . 'jsonresponse.php';
}
/**
 * Content controller class.
 */
class J2XMLControllerCategories extends JControllerAbstract
{
    function __construct($default = array())
    {
        parent::__construct();
    }
    public function display($cachable = false, $urlparams = false)
    {
        JRequest::setVar('view', 'categories');
        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');
コード例 #2
0
ファイル: json.php プロジェクト: kleinhelmi/tus03_j3_2015_01
} else {
    require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_languages' . DS . 'helpers' . DS . 'jsonresponse.php';
}
/**
 * Content controller class.
 */
class J2XMLControllerJson 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 class_exists('JPlatform') && 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');
        if (!$sid) {
            $sid = JRequest::getVar('j2xml_send_id', null, null, 'int');
        }
        if (!$sid) {
            JError::raiseWarning(1, JText::_('UNKNOWN_HOST'));
            echo class_exists('JPlatform') && version_compare(JPlatform::RELEASE, '12', 'ge') ? new JResponseJson() : new JJsonResponse();