本文整理汇总了PHP中Ajax::isAjaxRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Ajax::isAjaxRequest方法的具体用法?PHP Ajax::isAjaxRequest怎么用?PHP Ajax::isAjaxRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ajax
的用法示例。
在下文中一共展示了Ajax::isAjaxRequest方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __call
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");
}
}
示例2: action_help
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");
}
}
示例3: handleRequest
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);
}
}
示例4: action_blocks
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");
}
}
示例5: __call
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");
}
}
示例6: action_index
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>";
}
示例7: gohome
/**
* Переход на главную страницу
*/
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;
}
示例8: action_delete
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();
}
示例9: header
}
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();
}
}
示例10: getMessage
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;
}