Exemple #1
0
 public function __call($name, $arguments)
 {
     try {
         $replaced = 0;
         $act = str_replace('action_', '', $name, $replaced);
         if ($replaced == 0) {
             throw new Exception("Нет такого метода {$name}");
         }
         $act = $this->getName() . "_" . $act;
         if (class_exists($act)) {
             $this->table = new $act();
         } else {
             $this->table = new sqltable($act);
         }
         if ($this->table == null) {
             throw new Exception("Не возможно создать такую таблицу {$act}");
         }
     } catch (Exception $e) {
         return $this->_404("[class=" . get_class($this) . "] : " . $e->getMessage());
     }
     if ($arguments[nooutput]) {
         return;
     }
     if ($this->table->run()) {
         if (Ajax::isAjaxRequest()) {
             return $this->table->getOutput();
         }
         $this->setOutputAssigns();
         Output::assign('menu', $this->getIndexMenu());
         Output::setContent($this->table->getOutput());
         return $this->fetch("body_base.tpl");
     }
 }
Exemple #2
0
 public function action_help()
 {
     if (Ajax::isAjaxRequest()) {
         return $this->fetch("help.tpl");
     } else {
         CTitle::addSection('Помощь');
         $this->setOutputAssigns();
         Output::assign('menu', $this->getIndexMenu());
         Output::setContent($this->fetch("help.tpl"));
         return $this->fetch("body_base.tpl");
     }
 }
 public function handleRequest()
 {
     $path = $this->getRequestUriAsArray();
     // ajax extension will handle ajax Requests
     $ajax = Ajax::getInstance();
     if (Ajax::isAjaxRequest()) {
         $ajax->enableAjaxErrorHandling();
         $ajax->handleRequest($path);
     } else {
         $indexExtensions = $this->getExtensionByType("IIndexExtension");
         $indexExtensions[0]->handleRequest($path);
     }
 }
Exemple #4
0
 public function action_blocks()
 {
     $_SESSION[customer_id] = '';
     $this->table = new orders_blocks();
     if ($this->table->run()) {
         if (Ajax::isAjaxRequest()) {
             return $this->table->getOutput();
         }
         $this->setOutputAssigns();
         Output::assign('menu', $this->getIndexMenu());
         Output::setContent($this->table->getOutput());
         return $this->fetch("body_base.tpl");
     }
 }
Exemple #5
0
 public function __call($name, $arguments)
 {
     $arguments[nooutput] = true;
     parent::__call($name, $arguments);
     $this->need_yaer_arc = $this->table->model->getNeedArc();
     //console::getInstance()->out("lss=".Auth::$lss." ".print_r($_SESSION,true));
     if ($this->table->run()) {
         if (Ajax::isAjaxRequest()) {
             return $this->table->getOutput();
         }
         $this->setOutputAssigns();
         Output::assign('menu', $this->getIndexMenu());
         Output::setContent($this->table->getOutput());
         return $this->fetch("body_base.tpl");
     }
 }
Exemple #6
0
	public function action_index($show=false) {
		Output::assign('linkshowbash',$this->actUri('showbash')->url());
		Output::assign('linkhidebash',$this->actUri('hidebash')->url());
		Output::assign('linkplusbash',$this->actUri('plusbash')->url());
		Output::assign('linkminusbash',$this->actUri('minusbash')->url());

                if ($_SESSION[bashcite]) {
                    $ret = $this->_getcite();
                    Output::assign('bashcite',$ret);
                    $ret = $this->fetch("bashcite.tpl");
                } else {
                    $ret = $this->fetch("bashcitehide.tpl");
                }
                if (Ajax::isAjaxRequest())
                    return $ret;
                else
                    return "<div id='bashcite'>{$ret}</div>";
	}
Exemple #7
0
 /**
  * Переход на главную страницу
  */
 private function gohome()
 {
     if (Ajax::isAjaxRequest()) {
         echo "<script>";
         echo "window.location = 'http://{$_SERVER['HTTP_HOST']}'";
         echo "</script>";
     } else {
         header("Location: http://{$_SERVER['HTTP_HOST']}");
     }
     exit;
 }
Exemple #8
0
 public function action_delete($id, $confirmed = false, $delstr = '')
 {
     if (Ajax::isAjaxRequest() || $confirmed) {
         // в этом случае уже подтверждено иначе надо проверить
     } else {
         $out = empty($delstr) ? "Удалить {$id}?" : "Удалить {$delstr}?";
         return $this->view->getConfirm($out, 'delete', $id, true);
     }
     $this->model->delete($id);
     return $this->action_index();
 }
Exemple #9
0
}
if (empty($_REQUEST["level"])) {
    $_REQUEST["level"] = 'baza';
}
include "_setup.php";
header("Content-Type: text/html; charset={$_SERVER[Encoding]}");
if ($_SERVER[Auth]) {
    // update и getdata делается без авторизации
    if (!Auth::getInstance()->run()->success) {
        echo Auth::getInstance()->getOutput();
        echo console::getInstance()->run()->getOutput();
        exit;
    }
}
$classname = $_REQUEST["level"];
$m = new $classname();
if ($m->run()) {
    if (!Ajax::isAjaxRequest()) {
        echo $m->getOutput();
    }
}
//    echo "<script>";
//    echo "storeSetting(".multibyte::Json_encode($_SESSION["user_setting"]).");";
//    echo "</script>";
if ($_SERVER[debug][report]) {
    if (Ajax::isAjaxRequest()) {
        echo console::getInstance()->getScripts();
    } else {
        echo console::getInstance()->run()->getOutput();
    }
}
Exemple #10
0
 public function getMessage($message, $form = false)
 {
     if (Ajax::isAjaxRequest()) {
         $out = "<div id=dialog>{$message}</div><script>dialog_modal(" . ($form ? "false" : "true") . ");</script>";
     } else {
         Output::assign('message', $message);
         Output::assign('oklink', $this->owner->actUri('index', $this->owner->all, $this->owner->order, $this->owner->find, $this->owner->idstr)->url());
         // шаблон message.tpl не сможет быть изменен потомками
         //$out = $this->fetch(__DIR__.'message.tpl');
         $out = $this->fetch('message.tpl');
     }
     return $out;
 }