<?php

namespace Application;

include_once "../../vendor/autoload.php";
$action = $_GET['action'];
$url = $_GET['url'];
$is_limited = $_GET['limit_link'] == 'false' ? false : true;
$custom_link = $_GET['custom_link'];
session_start();
if (!isset($_SESSION['server_time'])) {
    $_SESSION['server_time'] = time();
}
$main = new Main();
$main->checkElapsedTime();
switch ($action) {
    case 'redirect':
        $main->redirect($url);
        break;
    case 'minimize':
        $main->minimize($url, $is_limited);
        break;
    case 'minimizeCustomUrl':
        $main->minimizeCustomUrl($url, $is_limited, $custom_link);
        break;
    case 'getStatistic':
        $main->getStatistic();
        break;
}
예제 #2
0
$currentPage = isset($_REQUEST['action']) ? $_GET['action'] : 'index';
$currentTemplate = '/pages/' . $currentPage;
$isPost = $_SERVER['REQUEST_METHOD'] == 'POST' ? true : false;
$componentId = $elementId = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$componentName = isset($_GET['componentname']) ? trim($_GET['componentname']) : '';
switch ($currentPage) {
    case 'componentslist':
    case 'index':
        Arr::set($arResult, 'componentsList', $main->getComponentsList($curPageNum, Config::get('module.perPage')));
        break;
    case 'showcomponent':
        if ($componentId > 0) {
            $arComponent = $main->db->getRow('SELECT * FROM ?n WHERE id = ?i', PREFIX . '_components', $componentId);
            if (!$arComponent) {
                // Делаем редирект с сообщенем об ошибочной выборке
                $main->redirect(Arr::get($arResult, 'home') . '&action=componentslist', 'error', 'Компонент с кодом <b>' . $componentId . '</b> не найден');
            }
            Arr::set($arResult, 'component', $arComponent);
            $componentList = $main->getComponentElements($arComponent['name'], $curPageNum, Config::get('module.perPage'));
            Arr::set($arResult, 'componentList', $componentList);
        } else {
            // Делаем редирект с сообщенем об ошибочной выборке
            $main->redirect(Arr::get($arResult, 'home') . '&action=componentslist', 'error', 'Не задан ID компонента');
        }
        break;
    case 'showelement':
        if ($componentName != '' && $elementId > 0) {
            $arElement = $main->getElementById($componentName, $elementId);
            if (!$arElement['id']) {
                $main->redirect(Arr::get($arResult, 'home') . '&action=componentslist', 'error', 'Элемент с кодом <b>' . $elementId . '</b> не найден');
            }
예제 #3
0
파일: FormLang.php 프로젝트: iAxel/my-site
 public static function setCurrentLang($lang)
 {
     \Session::set('current_admin_form_locale', $lang);
     self::$currentLocal = $lang;
     return Main::redirect('');
 }