Beispiel #1
0
<?php

session_start();
header('Content-Type: text/html; charset= utf-8');
$clientData = json_decode(trim(file_get_contents('php://input')), true);
$userData = $clientData['data'];
//echo json_encode($_SESSION[0]);
switch ($clientData["target"]) {
    case 'menu':
        include_once 'data/get/getMenu.php';
        echo json_encode(getMenu::getDataMenu());
        break;
    case 'news':
        include_once 'data/get/getArticle.php';
        echo json_encode(getArticle::getDataArticle());
        break;
    case 'comment':
        include_once 'data/get/getComment.php';
        echo json_encode(getComment::getDataComment($userData));
        break;
    case 'addComment':
        include_once 'data/set/addComment.php';
        echo json_encode(addComment::addDataComment($userData));
        break;
    case 'authorization':
        include_once 'core/data/session/openSession.php';
        echo json_encode(openSession::openSession1($userData));
        break;
    case 'getSession':
        include_once 'core/data/session/getSession.php';
        echo json_encode(userInfo::sessionInfo());
<?php

include 'helper.php';
$length = $params->get('length');
$showtitle = $params->get('title');
$display = 0;
if ($params->get('singlearticle') == 1) {
    $view = 'article';
    $articleid = $params->get('article_id');
    $display = 1;
} else {
    if (getArticle::isCatOrArticle()) {
        $view = JFactory::getApplication()->input->get('view');
        $articleid = JFactory::getApplication()->input->get('id');
        $display = 1;
    }
}
if ($display == 1) {
    $articleclass = new getArticle($articleid, $length, $view, $showtitle);
    $articlecontent = $articleclass->getContent();
    require JModuleHelper::getLayoutPath('mod_display_article_intro', $params->get('layout', 'default'));
}