本文整理汇总了PHP中fn_jsonEncode函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_jsonEncode函数的具体用法?PHP fn_jsonEncode怎么用?PHP fn_jsonEncode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_jsonEncode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ctl_list
/**
* ctl_list function.
*
* @access public
* @return void
*/
function ctl_list()
{
if (!isset($this->adminLogged["groupRow"]["group_allow"]["opt"]["custom"])) {
return array("alert" => "x200301");
exit;
}
$_str_key = fn_getSafe(fn_get("key"), "txt", "");
$_str_status = fn_getSafe(fn_get("status"), "txt", "");
$_str_type = fn_getSafe(fn_get("type"), "txt", "");
$_num_customId = fn_getSafe(fn_get("custom_id"), "int", 0);
$_arr_search = array("act_get" => $GLOBALS["act_get"], "key" => $_str_key, "status" => $_str_status, "type" => $_str_type);
$_num_customCount = $this->mdl_custom->mdl_count($_str_key, $_str_type, $_str_status);
$_arr_page = fn_page($_num_customCount);
//取得分页数据
$_str_query = http_build_query($_arr_search);
$_arr_customRows = $this->mdl_custom->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_type, $_str_status);
//print_r($_arr_customRows);
if ($_num_customId > 0) {
$_arr_customRow = $this->mdl_custom->mdl_read($_num_customId);
if ($_arr_customRow["alert"] != "y200102") {
return $_arr_customRow;
exit;
}
} else {
$_arr_customRow = array("custom_id" => 0, "custom_name" => "", "custom_target" => "", "custom_type" => "", "custom_opt" => "", "custom_status" => "enable");
}
$_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "customRow" => $_arr_customRow, "customRows" => $_arr_customRows, "fields" => $this->fields, "fieldsJson" => fn_jsonEncode($this->fields, "no"));
$_arr_tplData = array_merge($this->tplData, $_arr_tpl);
$this->obj_tpl->tplDisplay("custom_list.tpl", $_arr_tplData);
return array("alert" => "y200301");
}
开发者ID:richardcj,项目名称:baigoCMS,代码行数:37,代码来源:custom.class.php
示例2: sso_encode
/** 编码
* sso_encode function.
*
* @access public
* @param mixed $_str_json
* @return void
*/
function sso_encode($arr_data)
{
$_arr_json = array_merge($this->arr_data, $arr_data);
//合并数组
$_str_json = fn_jsonEncode($_arr_json, "encode");
$_arr_sso = array("act_post" => "encode", "data" => $_str_json);
$_arr_ssoData = array_merge($this->arr_data, $_arr_sso);
$_arr_get = fn_http(BG_SSO_URL . "?mod=code", $_arr_ssoData, "post");
//提交
return fn_jsonDecode($_arr_get["ret"], "no");
}
开发者ID:humor-zo,项目名称:baigoADS,代码行数:18,代码来源:sso.class.php
示例3: api_logout
function api_logout()
{
$this->app_check();
$_arr_userSubmit = $this->mdl_user->input_get_by("post");
if ($_arr_userSubmit["alert"] != "ok") {
$this->obj_api->halt_re($_arr_userSubmit);
}
$_arr_userRow = $this->mdl_user->mdl_read($_arr_userSubmit["user_str"], $_arr_userSubmit["user_by"]);
if ($_arr_userRow["alert"] != "y010102") {
$this->obj_api->halt_re($_arr_userRow);
}
if ($_arr_userRow["user_status"] == "disable") {
$_arr_return = array("alert" => "x010401");
$this->obj_api->halt_re($_arr_return);
}
unset($_arr_userRow["user_pass"], $_arr_userRow["user_mail"], $_arr_userRow["user_nick"], $_arr_userRow["user_note"], $_arr_userRow["user_rand"], $_arr_userRow["user_status"], $_arr_userRow["user_time"], $_arr_userRow["user_time_login"], $_arr_userRow["user_ip"]);
$_arr_code = $_arr_userRow;
$_arr_urlRows = array();
foreach ($this->appRows as $_key => $_value) {
$_tm_time = time();
$_arr_code["app_id"] = $_value["app_id"];
$_arr_code["app_key"] = $_value["app_key"];
//unset($_arr_code["alert"]);
$_str_src = fn_jsonEncode($_arr_code, "encode");
$_str_code = $this->obj_crypt->encrypt($_str_src, $_value["app_key"]);
if (stristr($_value["app_url_sync"], "?")) {
$_str_conn = "&";
} else {
$_str_conn = "?";
}
$_str_url = $_value["app_url_sync"] . $_str_conn . "mod=sync";
$_arr_data = array("act_get" => "logout", "app_id" => $_value["app_id"], "app_key" => $_value["app_key"], "time" => $_tm_time, "code" => $_str_code);
$_arr_data["signature"] = $this->obj_sign->sign_make($_arr_data);
$_arr_urlRows[] = urlencode($_str_url . "&" . http_build_query($_arr_data));
}
$_arr_return = array("alert" => "y100402", "urlRows" => $_arr_urlRows);
$this->obj_api->halt_re($_arr_return);
}
开发者ID:baigoStudio,项目名称:baigoSSO,代码行数:38,代码来源:sync.class.php
示例4: sync_encode
/** 编码
* sync_encode function.
*
* @access public
* @param mixed $arr_data
* @param mixed $str_key
* @return void
*/
function sync_encode($arr_data, $str_key)
{
unset($arr_data["alert"]);
$_str_src = fn_jsonEncode($arr_data, "encode");
$_str_code = fn_baigoEncode($_str_src, $str_key);
return $_str_code;
}
开发者ID:gorgee,项目名称:baigoADS,代码行数:15,代码来源:sync.class.php
示例5: api_add
/** api 创建验证
* api_add function.
*
* @access public
* @return void
*/
function api_add()
{
if (!fn_token("chk")) {
//令牌
return array("alert" => "x030102");
exit;
}
$_arr_adminName = validateStr(fn_post("admin_name"), 1, 30);
switch ($_arr_adminName["status"]) {
case "too_short":
return array("alert" => "x020201");
exit;
break;
case "too_long":
return array("alert" => "x020202");
exit;
break;
case "ok":
$this->adminSubmit["admin_name"] = $_arr_adminName["str"];
break;
}
//检验用户名是否重复
$_arr_adminRow = $this->mdl_read($this->adminSubmit["admin_name"], "admin_name", $this->adminSubmit["admin_id"]);
if ($_arr_adminRow["alert"] == "y020102") {
$this->adminSubmit["admin_id"] = $_arr_adminRow["admin_id"];
}
$this->adminSubmit["admin_status"] = "enable";
$this->adminSubmit["admin_pass"] = fn_post("admin_pass");
$_arr_adminAllow = array("user" => array("browse" => 1, "add" => 1, "edit" => 1, "del" => 1), "app" => array("browse" => 1, "add" => 1, "edit" => 1, "del" => 1), "log" => array("browse" => 1, "edit" => 1, "del" => 1), "admin" => array("browse" => 1, "add" => 1, "edit" => 1, "del" => 1), "opt" => array("db" => 1, "base" => 1, "reg" => 1));
$this->adminSubmit["admin_allow"] = fn_jsonEncode($_arr_adminAllow, "no");
$this->adminSubmit["alert"] = "ok";
return $this->adminSubmit;
}
开发者ID:richardcj,项目名称:baigoCMS,代码行数:39,代码来源:admin.class.php
示例6: api_del
/**
* api_del function.
*
* @access public
* @return void
*/
function api_del()
{
$this->app_check("post");
if (!isset($this->appAllow["user"]["del"])) {
$_arr_return = array("alert" => "x050309");
$_arr_logTarget[] = array("app_id" => $this->appRequest["app_id"]);
$_arr_logType = array("user", "del");
$this->log_do($_arr_logTarget, "app", $_arr_return, $_arr_logType);
$this->obj_api->halt_re($_arr_return);
}
$_arr_userIds = $this->mdl_user->input_ids_api();
$_arr_sign = array("act_post" => $GLOBALS["act_post"], "user_ids" => $_arr_userIds["str_userIds"]);
if (!$this->obj_sign->sign_check(array_merge($this->appRequest, $_arr_sign), $this->appRequest["signature"])) {
$_arr_return = array("alert" => "x050403");
$this->obj_api->halt_re($_arr_return);
}
if (!isset($this->appAllow["user"]["global"])) {
$_arr_search = array("app_id" => $this->appRequest["app_id"], "user_ids" => $_arr_userIds["user_ids"]);
$_arr_users = $this->mdl_belong->mdl_list(1000, 0, $_arr_search);
} else {
$_arr_users = $_arr_userIds;
}
$_arr_userDel = $this->mdl_user->mdl_del($_arr_users);
if ($_arr_userDel["alert"] == "y010104") {
foreach ($_arr_userIds["user_ids"] as $_key => $_value) {
$_arr_targets[] = array("user_id" => $_value);
$_str_targets = json_encode($_arr_targets);
}
$_arr_logData = array("log_targets" => $_str_targets, "log_target_type" => "user", "log_title" => $this->log["user"]["del"], "log_result" => $_str_result, "log_type" => "app");
$this->mdl_log->mdl_submit($_arr_logData, $this->appRequest["app_id"]);
}
$_tm_time = time();
$_str_src = fn_jsonEncode($_arr_userIds, "encode");
$_str_code = $this->obj_crypt->encrypt($_str_src, $this->appRow["app_key"]);
foreach ($this->appRows as $_key => $_value) {
$_arr_data = array("act_post" => "del", "code" => $this->obj_crypt->encrypt($_str_src, $_value["app_key"]), "time" => $_tm_time, "app_id" => $_value["app_id"], "app_key" => $_value["app_key"]);
$_arr_data["signature"] = $this->obj_sign->sign_make($_arr_data);
if (stristr($_value["app_url_notify"], "?")) {
$_str_conn = "&";
} else {
$_str_conn = "?";
}
if (stristr($_value["app_url_notify"], "?")) {
$_str_conn = "&";
} else {
$_str_conn = "?";
}
fn_http($_value["app_url_notify"] . $_str_conn . "mod=notify", $_arr_data, "post");
}
$this->obj_api->halt_re($_arr_userDel);
}
开发者ID:baigoStudio,项目名称:baigoSSO,代码行数:57,代码来源:user.class.php
示例7: halt_re
/** 返回结果
* halt_re function.
*
* @access public
* @param mixed $arr_re
* @return void
*/
function halt_re($arr_re, $is_encode = false, $is_jsonp = false)
{
if ($is_encode) {
$_str_return = fn_jsonEncode($arr_re, "encode");
} else {
$_str_return = json_encode($arr_re);
}
if ($is_jsonp) {
$_str_return = $this->jsonp_callback . "(" . $_str_return . ")";
}
exit($_str_return);
//输出错误信息
}
开发者ID:baigoStudio,项目名称:baigoSSO,代码行数:20,代码来源:notify.class.php
示例8: input_submit
function input_submit()
{
if (!fn_token("chk")) {
//令牌
return array("alert" => "x030102");
exit;
}
$this->callSubmit["call_id"] = fn_getSafe(fn_post("call_id"), "int", 0);
if ($this->callSubmit["call_id"] > 0) {
$_arr_callRow = $this->mdl_read($this->callSubmit["call_id"]);
if ($_arr_callRow["alert"] != "y170102") {
return $_arr_callRows;
exit;
}
}
$_arr_callName = validateStr(fn_post("call_name"), 1, 300);
switch ($_arr_callName["status"]) {
case "too_short":
return array("alert" => "x170201");
exit;
break;
case "too_long":
return array("alert" => "x170202");
exit;
break;
case "ok":
$this->callSubmit["call_name"] = $_arr_callName["str"];
break;
}
$_arr_callType = validateStr(fn_post("call_type"), 1, 0);
switch ($_arr_callType["status"]) {
case "too_short":
return array("alert" => "x170204");
exit;
break;
case "ok":
$this->callSubmit["call_type"] = $_arr_callType["str"];
break;
}
$_arr_callStatus = validateStr(fn_post("call_status"), 1, 0);
switch ($_arr_callStatus["status"]) {
case "too_short":
return array("alert" => "x170206");
exit;
break;
case "ok":
$this->callSubmit["call_status"] = $_arr_callStatus["str"];
break;
}
$this->callSubmit["call_file"] = fn_getSafe(fn_post("call_file"), "txt", "");
$this->callSubmit["call_attach"] = fn_getSafe(fn_post("call_attach"), "txt", "");
$this->callSubmit["call_cate_id"] = fn_getSafe(fn_post("call_cate_id"), "int", 0);
$this->callSubmit["call_spec_id"] = fn_getSafe(fn_post("call_spec_id"), "int", 0);
$this->callSubmit["call_cate_ids"] = fn_jsonEncode(fn_post("call_cate_ids"), "no");
$this->callSubmit["call_cate_excepts"] = fn_jsonEncode(fn_post("call_cate_excepts"), "no");
$this->callSubmit["call_mark_ids"] = fn_jsonEncode(fn_post("call_mark_ids"), "no");
$this->callSubmit["call_amount"] = fn_jsonEncode(fn_post("call_amount"), "no");
$this->callSubmit["alert"] = "ok";
return $this->callSubmit;
}
开发者ID:xiaodin1,项目名称:baigoCMS,代码行数:60,代码来源:call.class.php
示例9: api_logout
function api_logout()
{
$this->app_check("get");
if (!isset($this->appAllow["user"]["login"])) {
$_arr_return = array("alert" => "x050306");
$_arr_logTarget[] = array("app_id" => $this->appGet["app_id"]);
$_arr_logType = array("user", "get");
$this->log_do($_arr_logTarget, "app", $_arr_return, $_arr_logType);
$this->obj_sync->halt_re($_arr_return);
}
$_arr_userId = validateStr($this->appGet["user_id"], 1, 0, "str", "int");
switch ($_arr_userId["status"]) {
case "too_short":
$_arr_return = array("alert" => "x010217");
$this->obj_sync->halt_re($_arr_return);
break;
case "format_err":
$_arr_return = array("alert" => "x010218");
$this->obj_sync->halt_re($_arr_return);
break;
case "ok":
$_num_userId = $_arr_userId["str"];
break;
}
$_arr_userRow = $this->mdl_user->mdl_read($_num_userId);
if ($_arr_userRow["alert"] != "y010102") {
$this->obj_sync->halt_re($_arr_userRow);
}
if ($_arr_userRow["user_status"] != "enable") {
$_arr_return = array("alert" => "x010401");
$this->obj_api->halt_re($_arr_return);
}
unset($_arr_userRow["user_pass"], $_arr_userRow["user_mail"], $_arr_userRow["user_nick"], $_arr_userRow["user_note"], $_arr_userRow["user_rand"], $_arr_userRow["user_status"], $_arr_userRow["user_time"], $_arr_userRow["user_time_login"], $_arr_userRow["user_ip"]);
$_str_key = fn_rand(6);
$_arr_code = $_arr_userRow;
$_str_sync = "";
foreach ($this->appRows as $_key => $_value) {
$_tm_time = time();
$_str_rand = fn_rand();
$_str_sign = fn_baigoSignMk($_tm_time, $_str_rand);
$_arr_code["app_id"] = $_value["app_id"];
$_arr_code["app_key"] = $_value["app_key"];
$_str_code = $this->obj_sync->sync_encode($_arr_code, $_str_key);
if (stristr($_value["app_notice"], "?")) {
$_str_conn = "&";
} else {
$_str_conn = "?";
}
$_str_url = $_value["app_notice"] . $_str_conn . "act_get=logout&time=" . $_tm_time . "&random=" . $_str_rand . "&signature=" . $_str_sign . "&code=" . $_str_code . "&key=" . $_str_key;
$_str_sync .= "<script type=\"text/javascript\" src=\"" . $_str_url . "\"></script>";
}
$_arr_return = array("alert" => "y100402", "html" => base64_encode($_str_sync));
exit(fn_jsonEncode($_arr_return, "no"));
}
开发者ID:richardcj,项目名称:baigoCMS,代码行数:54,代码来源:sync.class.php
示例10: input_submit
/**
* input_submit function.
*
* @access public
* @return void
*/
function input_submit()
{
if (!fn_token("chk")) {
//令牌
return array("alert" => "x030102");
exit;
}
$this->adminSubmit["admin_id"] = fn_getSafe(fn_post("admin_id"), "int", 0);
if ($this->adminSubmit["admin_id"] > 0) {
$_arr_adminRow = $this->mdl_read($this->adminSubmit["admin_id"]);
if ($_arr_adminRow["alert"] != "y020102") {
return $_arr_adminRow;
exit;
}
}
$_arr_adminName = validateStr(fn_post("admin_name"), 1, 30, "str", "strDigit");
switch ($_arr_adminName["status"]) {
case "too_short":
return array("alert" => "x020201");
exit;
break;
case "too_long":
return array("alert" => "x020202");
exit;
break;
case "format_err":
return array("alert" => "x020203");
exit;
break;
case "ok":
$this->adminSubmit["admin_name"] = $_arr_adminName["str"];
break;
}
$_arr_adminMail = validateStr(fn_post("admin_mail"), 0, 900, "str", "email");
switch ($_arr_adminMail["status"]) {
case "too_long":
return array("alert" => "x020208");
exit;
break;
case "format_err":
return array("alert" => "x020209");
exit;
break;
case "ok":
$this->adminSubmit["admin_mail"] = $_arr_adminMail["str"];
break;
}
$_arr_adminNick = validateStr(fn_post("admin_nick"), 0, 30);
switch ($_arr_adminNick["status"]) {
case "too_long":
return array("alert" => "x020216");
exit;
break;
case "ok":
$this->adminSubmit["admin_nick"] = $_arr_adminNick["str"];
break;
}
$_arr_adminNote = validateStr(fn_post("admin_note"), 0, 30);
switch ($_arr_adminNote["status"]) {
case "too_long":
return array("alert" => "x020212");
exit;
break;
case "ok":
$this->adminSubmit["admin_note"] = $_arr_adminNote["str"];
break;
}
$_arr_adminStatus = validateStr(fn_post("admin_status"), 1, 0);
switch ($_arr_adminStatus["status"]) {
case "too_short":
return array("alert" => "x020213");
exit;
break;
case "ok":
$this->adminSubmit["admin_status"] = $_arr_adminStatus["str"];
break;
}
$this->adminSubmit["admin_allow_cate"] = fn_jsonEncode(fn_post("admin_allow_cate"), "no");
$this->adminSubmit["admin_allow_profile"] = fn_jsonEncode(fn_post("admin_allow_profile"), "no");
$this->adminSubmit["alert"] = "ok";
return $this->adminSubmit;
}
开发者ID:richardcj,项目名称:baigoCMS,代码行数:88,代码来源:admin.class.php
示例11: input_submit
function input_submit()
{
if (!fn_token("chk")) {
//令牌
return array("alert" => "x030102");
exit;
}
$this->groupSubmit["group_id"] = fn_getSafe(fn_post("group_id"), "int", 0);
if ($this->groupSubmit["group_id"]) {
$_arr_groupRow = $this->mdl_read($this->groupSubmit["group_id"]);
if ($_arr_groupRow["alert"] != "y040102") {
$this->obj_ajax->halt_alert($_arr_groupRow["alert"]);
}
}
$_arr_groupName = validateStr(fn_post("group_name"), 1, 30);
switch ($_arr_groupName["status"]) {
case "too_short":
return array("alert" => "x040201");
exit;
break;
case "too_long":
return array("alert" => "x040202");
exit;
break;
case "ok":
$this->groupSubmit["group_name"] = $_arr_groupName["str"];
break;
}
$_arr_groupRow = $this->mdl_read($this->groupSubmit["group_name"], "group_name", $this->groupSubmit["group_id"]);
if ($_arr_groupRow["alert"] == "y040102") {
return array("alert" => "x040203");
exit;
}
$_arr_groupNote = validateStr(fn_post("group_note"), 0, 30);
switch ($_arr_groupNote["status"]) {
case "too_long":
return array("alert" => "x040204");
exit;
break;
case "ok":
$this->groupSubmit["group_note"] = $_arr_groupNote["str"];
break;
}
$_arr_groupType = validateStr(fn_post("group_type"), 1, 0);
switch ($_arr_groupType["status"]) {
case "too_short":
return array("alert" => "x040205");
exit;
break;
case "ok":
$this->groupSubmit["group_type"] = $_arr_groupType["str"];
break;
}
$_arr_groupStatus = validateStr(fn_post("group_status"), 1, 0);
switch ($_arr_groupStatus["status"]) {
case "too_short":
return array("alert" => "x040207");
exit;
break;
case "ok":
$this->groupSubmit["group_status"] = $_arr_groupStatus["str"];
break;
}
$this->groupSubmit["group_allow"] = fn_jsonEncode(fn_post("group_allow"), "no");
$this->groupSubmit["alert"] = "ok";
return $this->groupSubmit;
}
开发者ID:xiaodin1,项目名称:baigoCMS,代码行数:67,代码来源:group.class.php
示例12: input_submit
//.........这里部分代码省略.........
break;
}
switch ($this->posiSubmit["posi_type"]) {
case "media":
$_arr_posiWidth = validateStr(fn_post("posi_width"), 1, 4);
switch ($_arr_posiWidth["status"]) {
case "too_short":
return array("alert" => "x040210");
exit;
break;
case "too_long":
return array("alert" => "x040211");
exit;
break;
case "ok":
$this->posiSubmit["posi_width"] = $_arr_posiWidth["str"];
break;
}
$_arr_posiHeight = validateStr(fn_post("posi_height"), 1, 4);
switch ($_arr_posiHeight["status"]) {
case "too_short":
return array("alert" => "x040212");
exit;
break;
case "too_long":
return array("alert" => "x040213");
exit;
break;
case "ok":
$this->posiSubmit["posi_height"] = $_arr_posiHeight["str"];
break;
}
break;
default:
$this->posiSubmit["posi_width"] = 0;
$this->posiSubmit["posi_height"] = 0;
break;
}
$_arr_posiStatus = validateStr(fn_post("posi_status"), 1, 0);
switch ($_arr_posiStatus["status"]) {
case "too_short":
return array("alert" => "x040207");
exit;
break;
case "ok":
$this->posiSubmit["posi_status"] = $_arr_posiStatus["str"];
break;
}
$_arr_posiScript = validateStr(fn_post("posi_script"), 1, 100);
switch ($_arr_posiScript["status"]) {
case "too_short":
return array("alert" => "x040215");
exit;
break;
case "ok":
$this->posiSubmit["posi_script"] = $_arr_posiScript["str"];
break;
}
$_arr_posiPlugin = validateStr(fn_post("posi_plugin"), 1, 100);
switch ($_arr_posiPlugin["status"]) {
case "too_short":
return array("alert" => "x040216");
exit;
break;
case "too_long":
return array("alert" => "x040217");
exit;
break;
case "ok":
$this->posiSubmit["posi_plugin"] = $_arr_posiPlugin["str"];
break;
}
$_arr_posiSelector = validateStr(fn_post("posi_selector"), 1, 100);
switch ($_arr_posiSelector["status"]) {
case "too_short":
return array("alert" => "x040218");
exit;
break;
case "too_long":
return array("alert" => "x040219");
exit;
break;
case "ok":
$this->posiSubmit["posi_selector"] = $_arr_posiSelector["str"];
break;
}
$_arr_posiIsPercent = validateStr(fn_post("posi_is_percent"), 1, 0);
switch ($_arr_posiIsPercent["status"]) {
case "too_short":
return array("alert" => "x040221");
exit;
break;
case "ok":
$this->posiSubmit["posi_is_percent"] = $_arr_posiIsPercent["str"];
break;
}
$this->posiSubmit["posi_opts"] = fn_jsonEncode(fn_post("posi_opts"), "encode");
$this->posiSubmit["alert"] = "ok";
return $this->posiSubmit;
}
开发者ID:humor-zo,项目名称:baigoADS,代码行数:101,代码来源:posi.class.php
示例13: api_encode
/** 编码
* api_encode function.
*
* @access public
* @param mixed $arr_data
* @param mixed $str_key
* @return void
*/
function api_encode($arr_data, $str_key, $method = "encode")
{
unset($arr_data["alert"]);
$_str_src = fn_jsonEncode($arr_data, $method);
$_str_code = fn_baigoEncode($_str_src, $str_key);
return $_str_code;
}
开发者ID:gorgee,项目名称:baigoADS,代码行数:15,代码来源:api.class.php
示例14: input_submit
function input_submit()
{
if (!fn_token("chk")) {
//令牌
return array("alert" => "x030102");
exit;
}
$this->customSubmit["custom_id"] = fn_getSafe(fn_post("custom_id"), "int", 0);
if ($this->customSubmit["custom_id"] > 0) {
$_arr_customRow = $this->mdl_read($this->customSubmit["custom_id"]);
if ($_arr_customRow["alert"] != "y200102") {
return $_arr_customRow;
exit;
}
}
$_arr_customName = validateStr(fn_post("custom_name"), 1, 90);
switch ($_arr_customName["status"]) {
case "too_short":
return array("alert" => "x200201");
exit;
break;
case "too_long":
return array("alert" => "x200202");
exit;
break;
case "ok":
$this->customSubmit["custom_name"] = $_arr_customName["str"];
break;
}
$_arr_customParentId = validateStr(fn_post("custom_parent_id"), 1, 0);
switch ($_arr_customParentId["status"]) {
case "too_short":
return array("alert" => "x200207");
exit;
break;
case "ok":
$this->customSubmit["custom_parent_id"] = $_arr_customParentId["str"];
break;
}
$_arr_customCateId = validateStr(fn_post("custom_cate_id"), 1, 0);
switch ($_arr_customCateId["status"]) {
case "too_short":
return array("alert" => "x200213");
exit;
break;
case "ok":
$this->customSubmit["custom_cate_id"] = $_arr_customCateId["str"];
break;
}
if ($this->customSubmit["custom_parent_id"] > 0 && $this->customSubmit["custom_parent_id"] == $this->customSubmit["custom_id"]) {
return array("alert" => "x200208");
exit;
}
$_arr_customRow = $this->mdl_read($this->customSubmit["custom_name"], "custom_name", $this->customSubmit["custom_id"]);
if ($_arr_customRow["alert"] == "y200102") {
return array("alert" => "x200203");
exit;
}
$_arr_customType = validateStr(fn_post("custom_type"), 1, 0);
switch ($_arr_customType["status"]) {
case "too_short":
return array("alert" => "x200211");
exit;
break;
case "ok":
$this->customSubmit["custom_type"] = $_arr_customType["str"];
break;
}
$_arr_customFormat = validateStr(fn_post("custom_format"), 1, 0);
switch ($_arr_customFormat["status"]) {
case "too_short":
return array("alert" => "x200205");
exit;
break;
case "ok":
$this->customSubmit["custom_format"] = $_arr_customFormat["str"];
break;
}
$_arr_customStatus = validateStr(fn_post("custom_status"), 1, 0);
switch ($_arr_customStatus["status"]) {
case "too_short":
return array("alert" => "x200206");
exit;
break;
case "ok":
$this->customSubmit["custom_status"] = $_arr_customStatus["str"];
break;
}
$this->customSubmit["custom_require"] = fn_getSafe(fn_post("custom_require"), "int", 0);
$_arr_customOpt = fn_post("custom_opt");
if ($this->customSubmit["custom_type"] == "radio" || $this->customSubmit["custom_type"] == "select") {
$this->customSubmit["custom_opt"] = fn_jsonEncode($_arr_customOpt[$this->customSubmit["custom_type"]], "encode");
} else {
$this->customSubmit["custom_opt"] = "";
}
$this->customSubmit["alert"] = "ok";
return $this->customSubmit;
}
开发者ID:xiaodin1,项目名称:baigoCMS,代码行数:98,代码来源:custom.class.php
示例15: ctl_form
function ctl_form()
{
$_num_posiId = fn_getSafe(fn_get("posi_id"), "int", 0);
if ($_num_posiId > 0) {
if (!isset($this->adminLogged["admin_allow"]["posi"]["edit"])) {
return array("alert" => "x040303");
exit;
}
$_arr_posiRow = $this->mdl_posi->mdl_read($_num_posiId);
if ($_arr_posiRow["alert"] != "y040102") {
return $_arr_posiRow;
exit;
}
} else {
if ($GLOBALS["act_get"] == "form") {
if (!isset($this->adminLogged["admin_allow"]["posi"]["add"])) {
return array("alert" => "x040302");
exit;
}
$_arr_posiRow = array("posi_id" => 0, "posi_name" => "", "posi_count" => 1, "posi_type" => "media", "posi_width" => "", "posi_height" => "", "posi_status" => "enable", "posi_script" => "", "posi_plugin" => "", "posi_selector" => "", "posi_opts" => array(), "posi_is_percent" => "enable", "posi_note" => "");
}
}
$_arr_scriptRows = $this->obj_dir->list_dir(BG_PATH_SCRIPT);
foreach ($_arr_scriptRows as $_key => $_value) {
if ($_value["type"] == "file") {
unset($_arr_scriptRows[$_key]);
} else {
$_str_config = file_get_contents(BG_PATH_SCRIPT . $_value["name"] . "/config.json");
$_arr_scriptRows[$_key]["config"] = fn_jsonDecode($_str_config, "no");
}
}
//print_r($_arr_scriptRows);
$_arr_tpl = array("posiRow" => $_arr_posiRow, "scriptRows" => $_arr_scriptRows, "scriptJSON" => fn_jsonEncode($_arr_scriptRows, "no"));
$_arr_tplData = array_merge($this->tplData, $_arr_tpl);
$this->obj_tpl->tplDisplay("posi_form.tpl", $_arr_tplData);
return array("alert" => "y040102");
}
开发者ID:gorgee,项目名称:baigoADS,代码行数:37,代码来源:posi.class.php
示例16: input_submit
//.........这里部分代码省略.........
if (!fn_token("chk")) {
//令牌
return array("alert" => "x030101");
exit;
}
$this->appSubmit["app_id"] = fn_getSafe(fn_post("app_id"), "int", 0);
if ($this->appSubmit["app_id"] > 0) {
//检查用户是否存在
$_arr_appRow = $this->mdl_read($this->appSubmit["app_id"]);
if ($_arr_appRow["alert"] != "y050102") {
return $_arr_appRow;
exit;
}
}
$_arr_appName = validateStr(fn_post("app_name"), 1, 30);
switch ($_arr_appName["status"]) {
case "too_short":
return array("alert" => "x050201");
exit;
break;
case "too_long":
return array("alert" => "x050202");
exit;
break;
case "ok":
$this->appSubmit["app_name"] = $_arr_appName["str"];
break;
}
$_arr_appNotice = validateStr(fn_post("app_notice"), 1, 3000);
switch ($_arr_appNotice["status"]) {
case "too_short":
return array("alert" => "x050207");
exit;
break;
case "too_long":
return array("alert" => "x050208");
exit;
break;
case "format_err":
return array("alert" => "x050209");
exit;
break;
case "ok":
$this->appSubmit["app_notice"] = $_arr_appNotice["str"];
break;
}
$_arr_appNote = validateStr(fn_post("app_note"), 0, 30);
switch ($_arr_appNote["status"]) {
case "too_long":
return array("alert" => "x050205");
exit;
break;
case "ok":
$this->appSubmit["app_note"] = $_arr_appNote["str"];
break;
}
$_arr_appStatus = validateStr(fn_post("app_status"), 1, 0);
switch ($_arr_appStatus["status"]) {
case "too_short":
return array("alert" => "x050206");
exit;
break;
case "ok":
$this->appSubmit["app_status"] = $_arr_appStatus["str"];
break;
}
$_arr_appIpAllow = validateStr(fn_post("app_ip_allow"), 0, 3000);
switch ($_arr_appIpAllow["status"]) {
case "too_long":
return array("alert" => "x050210");
exit;
break;
case "ok":
$this->appSubmit["app_ip_allow"] = $_arr_appIpAllow["str"];
break;
}
$_arr_appIpBad = validateStr(fn_post("app_ip_bad"), 0, 3000);
switch ($_arr_appIpBad["status"]) {
case "too_long":
return array("alert" => "x050211");
exit;
break;
case "ok":
$this->appSubmit["app_ip_bad"] = $_arr_appIpBad["str"];
break;
}
$_arr_appSync = validateStr(fn_post("app_sync"), 1, 0);
switch ($_arr_appSync["status"]) {
case "too_short":
return array("alert" => "x050218");
exit;
break;
case "ok":
$this->appSubmit["app_sync"] = $_arr_appSync["str"];
break;
}
$this->appSubmit["app_allow"] = fn_jsonEncode(fn_post("app_allow"), "no");
$this->appSubmit["alert"] = "ok";
return $this->appSubmit;
}
开发者ID:richardcj,项目名称:baigoCMS,代码行数:101,代码来源:app.class.php
-
jcmsalves/kotlin-playground: Kotlin Android samples/template project
阅读:1016|2022-08-13
-
bradtraversy/iweather: Ionic 3 mobile weather app
阅读:1648|2022-08-30
-
魔兽世界怀旧服已经开启两个多月了,但作为一个猎人玩家,抓到“断牙”,已经成为了一
阅读:1064|2022-11-06
-
JLPM22/MinecraftUnity: Simple Minecraft recreation made with Unity for education
阅读:458|2022-08-16
-
trulyspinach/UGUI-Material-Design-Icon: A vector image plugin for Unity3D GUI to
阅读:851|2022-08-18
-
1.progressbar进程控制条主要的属性:Max,Min,Step与Timer一起使用 while(pb1.Posi
阅读:637|2022-07-18
-
NLKNguyen/papercolor-theme: Light Dark Vim color schemes inspired by Google'
阅读:1145|2022-08-17
-
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:518|2022-08-16
-
相信不少果粉在对自己的设备进行某些操作时,都会碰到Respring,但这个 Respring 到底
阅读:388|2022-11-06
-
kikito/stateful.lua: Stateful classes for Lua
阅读:273|2022-08-16
|
请发表评论