本文整理汇总了PHP中ajax_echo函数的典型用法代码示例。如果您正苦于以下问题:PHP ajax_echo函数的具体用法?PHP ajax_echo怎么用?PHP ajax_echo使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ajax_echo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_ajax_echo
function test_ajax_echo()
{
ob_start();
ajax_echo('test');
$out1 = ob_get_contents();
ob_end_clean();
$this->assertEqual($out1, 'test');
}
示例2: login
function login()
{
if ($user = login(v('email'), v('password'))) {
foreach ($user as $key => $value) {
$_SESSION[$key] = $value;
}
return ajax_echo(__('LOGIN_OK_NOTICE') . jsforword('?c=dashboard'));
} elseif ($user === null) {
return ajax_echo(__('API_CONNECT_ERROR_NOTICE'));
} else {
return ajax_echo(__('LOGIN_BAD_ARGS_NOTICE'));
}
}
示例3: plugin_basic_auth_save
function plugin_basic_auth_save()
{
if (z(t(v('bauth_password'))) != z(t(v('bauth_password2')))) {
return ajax_echo('两次输入的密码不一致,请重新输入');
}
$bauth_username = z(t(v('bauth_username')));
$bauth_password = z(t(v('bauth_password')));
$bauth_on = intval(t(v('bauth_on')));
kset('bauth_username', $bauth_username);
kset('bauth_password', $bauth_password);
kset('bauth_on', $bauth_on);
return ajax_echo('设置已保存<script>setTimeout( close_float_box, 500)</script>');
}
示例4: login
function login()
{
if ($user = login(v('email'), v('password'))) {
foreach ($user as $key => $value) {
$_SESSION[$key] = $value;
}
return ajax_echo('成功登入,正在转向中 ' . jsforword('?c=dashboard'));
} elseif ($user === null) {
return ajax_echo('尝试连接服务器失败,请稍后再试');
} else {
return ajax_echo('错误的Email地址或者密码,请重试');
}
}
示例5: plugin_basic_auth_save
function plugin_basic_auth_save()
{
if (z(t(v('bauth_password'))) != z(t(v('bauth_password2')))) {
return ajax_echo(__('PL_BASIC_AUTH_PASSWORD_NOT_SAME'));
}
$bauth_username = z(t(v('bauth_username')));
$bauth_password = z(t(v('bauth_password')));
$bauth_on = intval(t(v('bauth_on')));
kset('bauth_username', $bauth_username);
kset('bauth_password', $bauth_password);
kset('bauth_on', $bauth_on);
return ajax_echo(__('PL_BASIC_AUTH_SETTINGS_UPDATED') . '<script>setTimeout( close_float_box, 500)</script>');
}
示例6: plugin_sendcloud_update
function plugin_sendcloud_update()
{
$sendcloud_on = intval(t(v('sendcloud_on')));
$sendcloud_user = z(t(v('sendcloud_user')));
$sendcloud_key = z(t(v('sendcloud_key')));
$sendcloud_from = z(t(v('sendcloud_from')));
$sendcloud_url = z(t(v('sendcloud_url')));
if (strlen($sendcloud_user) < 1 || strlen($sendcloud_key) < 1 || strlen($sendcloud_from) < 1 || strlen($sendcloud_url) < 1) {
return ajax_echo(__('PL_SENDCLOUD_SETTINGS_CANNOT_EMPTY'));
}
kset('sendcloud_on', $sendcloud_on);
kset('sendcloud_user', $sendcloud_user);
kset('sendcloud_key', $sendcloud_key);
kset('sendcloud_from', $sendcloud_from);
kset('sendcloud_url', $sendcloud_url);
return ajax_echo(__('PL_SENDCLOUD_SETTINGS_UPDATED') . '<script>setTimeout( close_float_box, 500)</script>');
}
示例7: plugin_mail_queue_save
function plugin_mail_queue_save()
{
$mqueue_on = intval(t(v('mqueue_on')));
$mqueue_server = z(t(v('mqueue_server')));
$mqueue_port = z(t(v('mqueue_port')));
$mqueue_username = z(t(v('mqueue_username')));
$mqueue_password = z(t(v('mqueue_password')));
if (strlen($mqueue_server) < 1 || strlen($mqueue_port) < 1 || strlen($mqueue_username) < 1 || strlen($mqueue_password) < 1) {
return ajax_echo('设置内容不能为空');
}
kset('mqueue_on', $mqueue_on);
kset('mqueue_server', $mqueue_server);
kset('mqueue_port', $mqueue_port);
kset('mqueue_username', $mqueue_username);
kset('mqueue_password', $mqueue_password);
return ajax_echo('设置已保存<script>setTimeout( close_float_box, 500)</script>');
}
示例8: plugin_mail_queue_save
function plugin_mail_queue_save()
{
$mqueue_on = intval(t(v('mqueue_on')));
$mqueue_server = z(t(v('mqueue_server')));
$mqueue_port = z(t(v('mqueue_port')));
$mqueue_username = z(t(v('mqueue_username')));
$mqueue_password = z(t(v('mqueue_password')));
$mqueue_not_online = intval(t(v('mqueue_not_online')));
if (strlen($mqueue_server) < 1 || strlen($mqueue_port) < 1 || strlen($mqueue_username) < 1 || strlen($mqueue_password) < 1) {
return ajax_echo(__('PL_MAIL_QUEUE_SETTINGS_CANNOT_EMPTY'));
}
kset('mqueue_on', $mqueue_on);
kset('mqueue_server', $mqueue_server);
kset('mqueue_port', $mqueue_port);
kset('mqueue_username', $mqueue_username);
kset('mqueue_password', $mqueue_password);
kset('mqueue_not_online', $mqueue_not_online);
return ajax_echo(__('PL_MAIL_QUEUE_SETTINGS_UPDATED') . '<script>setTimeout( close_float_box, 500)</script>');
}
示例9: todo_flow_item
function todo_flow_item()
{
$uid = intval(z(v(t('uid'))));
if ($uid < 0) {
return ajax_echo('BAD UID');
}
$params = array();
$params['uid'] = $uid;
$params['ord'] = 'desc';
$params['by'] = 'last_action_at';
$params['count'] = '20';
if ($content = send_request('todo_list', $params, token())) {
$data = json_decode($content, 1);
$data['user'] = get_user_info_by_id($uid);
if (isset($data['data'])) {
foreach ($data['data'] as $k => $v) {
if ($v['is_follow'] == 1) {
unset($data['data'][$k]);
}
}
}
return render($data, 'ajax', 'plugin', 'todo_flow');
}
}
示例10: plugin_system_setting_save
function plugin_system_setting_save()
{
$new_lang = z(t(v('new_lang')));
$sql = "UPDATE `user` SET `language`='" . $new_lang . "' WHERE `id`='" . intval(uid()) . "'";
run_sql($sql);
$sql = "UPDATE ip_br_os_lang SET language='" . $new_lang . "' WHERE ip = '" . $GLOBALS['sys']['ip'] . "' AND browser = '" . $GLOBALS['sys']['browser'] . "' AND browser_ver='" . $GLOBALS['sys']['browser_version'] . "' AND platform= '" . $GLOBALS['sys']['platform'] . "' AND uid='" . intval(uid()) . "'";
run_sql($sql);
plugin_system_setting();
$script = '
<script type="text/javascript" src="static/script/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(function(){
$("#sys_confirm").tablesorter();
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": false,
"positionClass": "toast-top-full-width",
"preventDuplicates": false,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut",
}
toastr.options.onHidden = function() { location.reload(); }
toastr["success"]("' . __('PL_SYS_SUCCESS') . '", "' . __('PL_SYS_RELOADING') . '");
});</script>';
return ajax_echo($script);
}
示例11: send_error
function send_error($type, $info = null)
{
$ret = array('errno' => $GLOBALS['rest_errors'][$type], 'errmsg' => $info);
ajax_echo(json_encode($ret));
exit(0);
}
示例12: api
function api()
{
$request = array('source' => v('source'), 'data' => v('data'), 'ckeys' => v('ckeys'));
$queue = new SaeTaskQueue('nowboard');
$queue->addTask("http://" . c('site_domain') . "/?a=apido", "request=" . serialize($request));
$ret = $queue->push();
return ajax_echo('sent.' . print_r($ret, 1));
}
示例13: ajax_echo_r
function ajax_echo_r($txt) {
ajax_echo (nl2br(str_replace(" "," ",(print_r($txt,true)))))."<br>";
}
示例14: plugin_dropbox_save
function plugin_dropbox_save()
{
$dropbox_on = intval(t(v('dropbox_on')));
$dropbox_akey = z(t(v('dropbox_akey')));
if (strlen($dropbox_akey) < 1) {
return ajax_echo(__('PL_DROPBOX_SETTINGS_CANNOT_EMPTY'));
}
kset('dropbox_on', $dropbox_on);
kset('dropbox_akey', $dropbox_akey);
return ajax_echo(__('PL_DROPBOX_SETTINGS_UPDATED') . '<script>setTimeout( close_float_box, 500)</script>');
}
示例15: todo_edit
function todo_edit()
{
$tid = intval(v('tid'));
if ($tid < 1) {
return ajax_echo(__('INPUT_CHECK_BAD_ARGS', 'TID'));
}
$text = z(t(v('text')));
if (strlen($text) < 1) {
return ajax_echo(__('INPUT_CHECK_NO_TODO_TITLE'));
}
$data['tid'] = $tid;
$data['text'] = $text;
return render($data, 'ajax', 'raw');
}