本文整理汇总了PHP中ajax::addReturn方法的典型用法代码示例。如果您正苦于以下问题:PHP ajax::addReturn方法的具体用法?PHP ajax::addReturn怎么用?PHP ajax::addReturn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ajax
的用法示例。
在下文中一共展示了ajax::addReturn方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: BackendAjax
protected static function BackendAjax()
{
$sort = type::post('array', 'array');
$sql = sql::factory();
$sql->setTable('metainfos');
foreach ($sort as $s => $id) {
$sql->setWhere('id=' . $id);
$sql->addPost('sort', $s + 1);
$sql->update();
}
ajax::addReturn(message::success(lang::get('save_sorting'), true));
}
示例2: mail
if (type::get('checkversion', 'int', 0) == 1) {
$cacheFile = cache::getFileName(0, 'dynaoVersion');
cache::exist($cacheFile, 0);
echo message::success(lang::get('connection_again'), true);
}
if (ajax::is()) {
if (type::super('text')) {
$mail = mail('info@dynao.de', 'Neue Idee', type::super('text'), 'From: ' . dyn::get('user')->get('firstname') . ' ' . dyn::get('user')->get('name') . '<' . dyn::get('user')->get('email') . '>');
if ($mail) {
ajax::addReturn(message::success(lang::get('idea_send')));
} else {
ajax::addReturn(message::danger(lang::get('idea_error')));
}
} else {
ajax::addReturn(message::danger(lang::get('idea_empty')));
}
}
$versionCheck = dyn::checkDynVersion();
if ($versionCheck === lang::get('version_fail_connect')) {
$message = lang::get('version_fail_connect');
$message .= '<br /><a href="' . url::backend('dashboard', ['subpage' => 'overview', 'checkversion' => 1]) . '">' . lang::get('try_again') . '</a>';
echo message::danger($message, true);
} elseif ($versionCheck) {
echo message::danger($versionCheck, true);
}
$stats = [];
$sql = sql::factory();
$numPages = $sql->num('SELECT * FROM ' . sql::table('structure'));
$sql = sql::factory();
$numModule = $sql->num('SELECT * FROM ' . sql::table('module'));
示例3: foreach
<?php
$pid = type::super('pid', 'int', 0);
$while_id = $pid;
if (ajax::is()) {
$sort = type::post('array', 'array');
$sql = sql::factory();
$sql->setTable('media_cat');
foreach ($sort as $s => $id) {
$sql->setWhere('id=' . $id);
$sql->addPost('sort', $s + 1);
$sql->update();
}
ajax::addReturn(message::success(lang::get('save_sorting'), true));
}
while ($while_id) {
$sql = sql::factory();
$sql->query('SELECT name, pid FROM ' . sql::table('media_cat') . ' WHERE id=' . $while_id)->result();
if ($pid != $while_id) {
$breadcrumb[] = '<li><a href="' . url::backend('media', ['pid' => $while_id, 'subpage' => 'category']) . '">' . $sql->get('name') . '</a></li>';
} else {
$breadcrumb[] = '<li class="active">' . $sql->get('name') . '</li>';
}
$while_id = $sql->get('pid');
}
$breadcrumb[] = '<li><a href="' . url::backend('media', ['subpage' => 'category']) . '">' . lang::get('start') . '</a></li>';
echo '<ul class="breadcrumb">' . implode('', array_reverse($breadcrumb)) . '</ul>';
if ($action == 'delete' && dyn::get('user')->hasPerm('media[category][delete]')) {
$error = [];
$sql = sql::factory();
$sql->query('SELECT id FROM ' . sql::table('media_cat') . ' WHERE `pid` = ' . $id)->result();
示例4: unset
<div class="panel">
<div class="content">
<div id="terminal">
<?php
$SSH = rp::get('SSH');
$host = $SSH['ip'];
$user = $SSH['user'];
$pass = $SSH['password'];
unset($SSH);
$ssh = new ssh($host, $user, $pass);
if (ajax::is()) {
$test = 1;
} else {
echo nl2br($ssh->read('/.*@.*[$|#]/', NET_SSH2_READ_REGEX));
$ssh->write("screen -r test123 \n\r");
$ssh->setTimeout(4);
$ssh->write("ping google.de \n\r");
}
if (ajax::is()) {
#$ssh->setTimeout(1);
#$ssh->write("ping google.de \n\r");
$ssh->setTimeout(4);
$ssh->exec("screen -r test123");
#$return = nl2br($ssh->read('/.*@.*[$|#]/', NET_SSH2_READ_REGEX));
ajax::addReturn($return);
}
?>
</div>
</div>
</div>
示例5:
<?php
ajax::addReturn(pageMisc::getTreeStructurePagePopup());