本文整理汇总了PHP中isAjaxRequest函数的典型用法代码示例。如果您正苦于以下问题:PHP isAjaxRequest函数的具体用法?PHP isAjaxRequest怎么用?PHP isAjaxRequest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isAjaxRequest函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: daemons_servers_delete
function daemons_servers_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$server_id = intval(params('server_id'));
$daemon_id = intval(params('daemon_id'));
$arrService = $db->select("SELECT id\n FROM {$cfg['tblService']}\n WHERE server_id='{$server_id}'\n AND daemon_id='{$daemon_id}'");
if (!$arrService) {
halt(SERVER_ERROR);
return;
}
$id = $arrService[0]['id'];
$result = $db->delete("DELETE FROM {$cfg['tblService']}\n WHERE id='{$id}'\n LIMIT 1");
$resultForeign = $db->delete("DELETE FROM {$cfg['tblAccess']}\n WHERE dienst_id='{$id}'");
if (!$result || !$resultForeign) {
halt(SERVER_ERROR);
return;
}
set('server', array('id' => $server_id));
set('daemon', array('id' => $daemon_id));
if (isAjaxRequest()) {
return js('daemons_servers/delete.js.php', null);
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:26,代码来源:daemons_servers.php
示例2: dump
function dump($msg)
{
if (Config::Get('sys.logs.hacker_console') && !isAjaxRequest()) {
call_user_func(array('Debug_HackerConsole_Main', 'out'), $msg);
} else {
//var_dump($msg);
}
}
开发者ID:randomtoy,项目名称:livestreet,代码行数:8,代码来源:function.php
示例3: after
function after($output, $route)
{
if (!isAjaxRequest()) {
$time = number_format((double) substr(microtime(), 0, 10) - LIM_START_MICROTIME, 6);
$output .= "\n<!-- page rendered in {$time} sec., on " . date("D M j G:i:s T Y") . " -->\n";
$output .= "<!-- for route\n";
$output .= print_r($route, true);
$output .= "-->";
}
return $output;
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:11,代码来源:config.inc.php
示例4: dump
/**
* функция вывода отладочных сообщений через "хакерскую" консоль Дмитрия Котерова
*/
function dump($msg)
{
if (Config::Get('sys.logs.hacker_console') && !isAjaxRequest()) {
if (!class_exists('Debug_HackerConsole_Main')) {
require_once Config::Get('path.root.server') . "/engine/lib/external/HackerConsole/Main.php";
new Debug_HackerConsole_Main(true);
}
call_user_func(array('Debug_HackerConsole_Main', 'out'), $msg);
} else {
//var_dump($msg);
}
}
开发者ID:cbrspc,项目名称:LIVESTREET-1-DISTRIB,代码行数:15,代码来源:function.php
示例5: ports_delete
function ports_delete()
{
$id = intval(params('id'));
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$result = $db->delete("DELETE FROM {$cfg['tblPort']}\n WHERE id={$id}\n LIMIT 1");
if (!$result) {
halt(SERVER_ERROR);
return;
}
set('port', array('id' => $id));
if (isAjaxRequest()) {
return js('ports/delete.js.php', null);
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:17,代码来源:ports.php
示例6: access_delete
function access_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$role_id = intval(params('role_id'));
$dienst_id = intval(params('service_id'));
$result = $db->delete("DELETE FROM {$cfg['tblAccess']}\n WHERE rolle_id='{$role_id}'\n AND dienst_id='{$dienst_id}'\n LIMIT 1");
if (!$result) {
halt(SERVER_ERROR);
return;
}
set('role', array('id' => $role_id));
set('service', array('id' => $dienst_id));
if (isAjaxRequest()) {
return js('access/delete.js.php', null);
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:19,代码来源:access.php
示例7: roles_services_delete
function roles_services_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$role_id = intval($_POST['role_id']);
$service_id = intval($_POST['service_id']);
$connect = isset($_POST['connect']) ? true : false;
$result = $db->delete("DELETE FROM {$cfg['tblAccess']}\n WHERE rolle_id='{$role_id}'\n AND dienst_id='{$service_id}'\n LIMIT 1");
if (!$result) {
halt(SERVER_ERROR);
return;
}
if (isAjaxRequest() && $connect) {
$arrRoles = fetchRolesServices("WHERE {$cfg['tblRole']}.id = {$role_id}");
return js('roles_services/role.js.php', null, array('role' => array_pop($arrRoles)));
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:19,代码来源:roles_services.php
示例8: people_delete
function people_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$id = intval(params('id'));
$result = $db->delete("DELETE FROM {$cfg['tblPerson']}\n WHERE id={$id}\n LIMIT 1");
$resClientForeign = $db->delete("DELETE FROM {$cfg['tblClient']}\n WHERE person_id={$id}");
$resHasRolleForeign = $db->delete("DELETE FROM {$cfg['tblPersonHasRole']}\n WHERE person_id={$id}");
if ($result && $resClientForeign && $resHasRolleForeign) {
set('person', array('id' => $id));
if (isAjaxRequest()) {
return js('people/delete.js.php', null);
} else {
redirect_to('people');
}
} else {
halt(SERVER_ERROR);
}
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:19,代码来源:people.php
示例9: isAjaxPost
function isAjaxPost()
{
return isPost() && isAjaxRequest() ? true : false;
}
开发者ID:typ6a,项目名称:newhtf,代码行数:4,代码来源:KDGGeneral.php
示例10: people_roles_delete
function people_roles_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$role_id = intval(params('role_id'));
$person_id = intval(params('person_id'));
$connect = isset($_POST['connect']) ? true : false;
if ($connect) {
$role_id = intval($_POST['role_id']);
$person_id = intval($_POST['person_id']);
}
$result = $db->delete("DELETE FROM {$cfg['tblPersonHasRole']}\n WHERE rolle_id='{$role_id}'\n AND person_id='{$person_id}'\n LIMIT 1");
if (!$result) {
halt(SERVER_ERROR);
return;
}
if (isAjaxRequest()) {
if ($connect) {
$arrRoles = fetchRoles("WHERE {$cfg['tblRole']}.id = {$role_id}");
return js('people_roles/role.js.php', null, array('role' => array_pop($arrRoles)));
} else {
set('role', array('id' => $role_id));
set('person', array('id' => $person_id));
return js('people_roles/delete.js.php', null);
}
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:29,代码来源:people_roles.php
示例11: Connection
require_once 'main.php';
require_once 'Connection.class.php';
require_once 'CustomerPaginator.class.php';
$c = new Connection();
$conn = $c->getConnection();
$limit = from_get('limit', 10);
$page = from_get('page', 1);
$links = from_get('links', 7);
$expanded = from_get('expanded', 'on');
$search_name = from_get('search_name', '');
$search_participants = from_get('search_participants', '');
$query = "SELECT DISTINCT A.id, A.name, A.email, A.phone, A.participants, A.observations, A.timestamp FROM wp_musicteach_customer A ";
$conn->set_charset("utf8");
$Paginator = new CustomerPaginator($conn, $query, $search_name, $search_participants);
$results = $Paginator->getData($limit, $page);
if (isAjaxRequest()) {
include 'include_list_customers.php';
} else {
include 'head.php';
?>
<h1 class="text-center">Cercador de famílies</h1>
<div id="form-list" class="form-list" data-model="customer">
<?php
include 'include_search_customers.php';
include 'include_list_customers.php';
?>
</div>
<?php
include 'foot.php';
}
?>
开发者ID:JordiCruells,项目名称:mtbd,代码行数:31,代码来源:customer_list.php
示例12: clients_delete
function clients_delete()
{
$id = intval(params('id'));
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$result = $db->delete("DELETE FROM {$cfg['tblClient']}\n WHERE id={$id}\n LIMIT 1");
if ($result) {
set('client', array('id' => $id));
if (isAjaxRequest()) {
return js('clients/delete.js.php', null);
} else {
redirect_to('clients');
}
} else {
halt(SERVER_ERROR);
}
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:17,代码来源:clients.php
示例13: error_reporting
<?php
include 'access.php';
error_reporting(E_ALL);
ini_set("display_errors", 1);
require_once 'main.php';
require_once 'Connection.class.php';
require_once 'GroupDAO.class.php';
$response = array('status' => '1', 'message' => '');
$isAjax = isAjaxRequest();
$action = from_post_or_get('action', '');
if (!isset($action)) {
die('accio no informada');
exit;
}
$id = -1;
if ($action !== 'new' && $action !== 'update' && $action !== 'delete') {
die('accio incorrecta: ' . $action);
}
switch ($action) {
case 'delete':
$id = $_GET['id'] or die('id de grup no informat');
break;
case 'update':
$id = $_POST['id'] or die('id de grup no informat');
case 'new':
$name = $_POST['name'] or die('nom de grup no informat');
$age = $_POST['age'] or die('edat no informada');
$date_start = $_POST['date_start'] or die('data inici informada');
$date_end = $_POST['date_end'] or die('data fi informada');
$location = $_POST['location'] or die('ubicació no informada');
开发者ID:JordiCruells,项目名称:mtbd,代码行数:31,代码来源:group.php
示例14: flag
function flag()
{
loggedInSection();
// urika_helper.php
if (isAjaxRequest()) {
$image = $this->image_model->getImage($this->input->xss_clean($_POST["image_id"]));
$image = $image->row();
$this->load->model("flag_model");
if ($this->flag_model->flagExists($this->session->userdata("user_id"), $image->image_id) == true) {
echo "false";
} else {
// need to add a new favourite
$insert_data = array("fl_upload_id" => $image->image_id, "fl_flagger_id" => $this->session->userdata("user_id"));
$insert = $this->flag_model->createNewFlag($insert_data);
if ($insert !== false) {
echo "true";
} else {
echo "false";
}
}
} else {
$data = array("errorTitle" => "Request Denied", "content" => "An error has occurred: you cannot access this page from the browser.");
$this->template->write_view("content", "general/error", $data, TRUE);
//now render templates
$this->template->render();
}
}
开发者ID:redroot,项目名称:URIKA,代码行数:27,代码来源:image.php
示例15: delete
function delete()
{
loggedInSection();
// urika_helper.php
if (isAjaxRequest()) {
if (isset($_POST["delete_id"]) && is_numeric($_POST["delete_id"])) {
// check this post belongs to the user
$comment = $this->comment_model->getComment($this->input->xss_clean($_POST["delete_id"]));
if ($comment != false) {
$comment = $comment->row();
if ($comment->c_poster_id == $this->session->userdata("user_id")) {
// now delete the comment
if ($this->comment_model->deleteComment($_POST["delete_id"]) == true) {
echo "true";
} else {
echo "false";
}
} else {
echo "false";
}
} else {
echo "false";
}
} else {
echo "false";
}
} else {
$data = array("errorTitle" => "Request Denied", "content" => "An error has occurred: you cannot access this page from the browser.");
$this->template->write_view("content", "general/error", $data, TRUE);
//now render templates
$this->template->render();
}
}
开发者ID:redroot,项目名称:URIKA,代码行数:33,代码来源:comment.php
示例16: ajaxresults
/**
AJAX browse super function, used to grab image results follow results,
and comments results etc but in an a straight upload return form
Params are part of the post var, the type of results determines by the url parameter
@param type : type of results to grab
*/
function ajaxresults($type = null)
{
if (isAjaxRequest()) {
if ($type != null) {
$allowedTypes = array("images", "moodboards", "comments");
$this->input->xss_clean($_POST);
// check it actually exists
if (in_array(strtolower($type), $allowedTypes)) {
$result_html = "";
$result;
$base = base_url();
// some universal or multiplue use variables
$search_term = $tag = "";
$page = 1;
$per_page = 20;
$base = base_url();
// now process the post terms
if (isset($_POST["search"]) && $_POST["search"] != "") {
$search_term = trim($_POST["search"]);
}
if (isset($_POST["tag"]) && $_POST["tag"] != "") {
$tag = trim($_POST["tag"]);
}
if (isset($_POST["page"]) && $_POST["page"] != "") {
$page = $_POST["page"];
}
if (isset($_POST["per_page"]) && $_POST["per_page"] != "") {
$per_page = $_POST["per_page"];
}
// set offset
$offset = (int) ($page * $per_page);
if (strtolower($type) == "images") {
/*
1) Images search
Handles:
Order by Date
Order by Views
User's uploads
User's favs
Follow feed
Tag
Search term
*/
$order_by = "";
$order_dir = "";
if (isset($_POST["order_by"]) && $_POST["order_by"] == "") {
$order_by = trim($_POST["order_by"]);
}
// Now determine which functions to run
if (isset($_POST["user_id"]) && !isset($_POST["user_favs"])) {
// this means we are looking at user uploads
$this->load->model("user_model");
$results = $this->user_model->getUserImages($_POST["user_id"], $per_page * ($page - 1));
// generate user lis from results
} else {
if (isset($_POST["user_favs"])) {
// this means we are looking at favurites
$this->load->model("user_model");
$results = $this->user_model->getUserFavs($_POST["user_id"], $per_page * ($page - 1));
}
}
// now process results into upload list li
if ($results["count"] != false) {
$out = "";
for ($i = 0; $i < $results["count"]; $i++) {
$irow = $results["result"][$i];
if (!isset($irow->f_type)) {
// load li through view
$data = array("thumb_url" => $irow->i_thumb_url, "title" => $irow->i_title, "url" => $base . 'image/view/' . $irow->image_id . '/' . slugify($irow->i_title) . '/', "user_url" => $base . 'user/u/' . $irow->u_username . '/', "username" => $irow->u_username, "views" => $irow->i_views, "overlay" => $base . 'assets/images/layout/uploadListOverlay.gif');
$out .= $this->load->view("components/uploadListLi", $data, true);
} else {
if ($irow->f_type == "image") {
// load li through view
$data = array("thumb_url" => $irow->i_thumb_url, "title" => $irow->i_title, "url" => $base . 'image/view/' . $irow->image_id . '/' . slugify($irow->i_title) . '/', "user_url" => $base . 'user/u/' . $irow->u_username . '/', "username" => $irow->u_username, "views" => $irow->i_views, "overlay" => $base . 'assets/images/layout/uploadListOverlay.gif');
$out .= $this->load->view("components/uploadListLi", $data, true);
} else {
if ($irow->f_type == "moodboard") {
// load li through view
$data = array("thumb_url" => $irow->m_thumb_url, "title" => $irow->m_title, "url" => $base . 'moodboard/view/' . $irow->moodboard_id . '/' . slugify($irow->m_title) . '/', "user_url" => $base . 'user/u/' . $irow->u_username . '/', "username" => $irow->u_username, "views" => $irow->m_views, "overlay" => $base . 'assets/images/layout/mbListOverlay.gif');
$out .= $this->load->view("components/mbListLi", $data, true);
}
}
}
}
} else {
$out = "no_more";
}
$return_html = $out;
} else {
if (strtolower($type) == "moodboards") {
/*
//.........这里部分代码省略.........
开发者ID:redroot,项目名称:URIKA,代码行数:101,代码来源:browse.php
示例17: security_warnOnInputWithNoReferer
function security_warnOnInputWithNoReferer()
{
if (!@$GLOBALS['SETTINGS']['advanced']['checkReferer']) {
return;
}
if (@$_SERVER['HTTP_REFERER']) {
return;
}
if (isFlashUploader()) {
return;
}
// skip for flash uploader (flash doesn't always send referer)
// allowed link combinations
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
if (!array_diff(array_keys($_REQUEST), array('menu', 'userNum', 'resetCode'))) {
return;
}
// skip if nothing but password-reset form keys
}
//
$error = '';
$userInput = @$_REQUEST || @$_POST || @$_GET || @$_SERVER['QUERY_STRING'] || @$_SERVER['PATH_INFO'];
if ($userInput) {
$format = "Security Warning: A manually entered link with user input was detected.\n";
$format .= "If you didn't type this url in yourself, please close this browser window.\n";
$error = nl2br(t($format));
if (isAjaxRequest()) {
$error = strip_tags(html_entity_decode($error));
}
}
return $error;
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:32,代码来源:common.php
示例18: form_track
</div>
<br>
<div class="text-center">
<button class="btn btn-primary" type="submit">Guardar <span class="glyphicon glyphicon-ok"></span></button>
<button class="btn btn-info btn-back" type="button">Tornar</span></button>
</button></div>
</form>
</div>
<div id="form-track">
<?php
form_track();
?>
</div>
<?php
if (!isAjaxRequest()) {
include 'foot.php';
}
?>
开发者ID:JordiCruells,项目名称:mtbd,代码行数:25,代码来源:activity_form.php
示例19: apache_setenv
apache_setenv("AUTOLOADER_BUILD_RUNNING", false);
} catch (AutoloaderException $e) {
if ($e instanceof AutoloaderException_Parser_IO) {
die("ERROR: Check you file permissions!");
} else {
if ($e instanceof AutoloaderException_IndexBuildCollision) {
if (!isAjaxRequest()) {
echo $e->getMessage();
}
} else {
var_dump($e);
die;
}
}
}
if (!isPhpCli() && !isAjaxRequest()) {
echo "\n\n Trying to reload in 10 sec.<script type=\"text/javascript\">window.setTimeout('window.location.reload()', 10000);</script>";
die;
}
}
// start session
session_name(str_replace(".", "-", PLATFORM_ID . KOALA_VERSION));
session_start();
// style
if (!empty($_GET["style"]) && DEVELOPMENT_MODE == TRUE) {
$STYLE = $_GET["style"];
$_SESSION["STYLE"] = $_GET["style"];
get_cache()->clean();
} else {
if (!empty($_SESSION["STYLE"]) && DEVELOPMENT_MODE == TRUE) {
$STYLE = $_SESSION["STYLE"];
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:core.conf.php
示例20: showInterfaceError
function showInterfaceError($alert)
{
$errors = alert($alert);
if (isAjaxRequest()) {
die($errors);
} else {
showInterface('', true);
}
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:9,代码来源:admin_functions.php
注:本文中的isAjaxRequest函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论