CONTROL_APP::ctl_form PHP Method

ctl_form() public method

*============编辑管理员界面============ 返回提示
public ctl_form ( )
    function ctl_form()
    {
        $_num_appId = fn_getSafe(fn_get("app_id"), "int", 0);
        if ($_num_appId > 0) {
            if (!isset($this->adminLogged["admin_allow"]["app"]["edit"]) && !$this->is_super) {
                return array("alert" => "x050303");
            }
            $_arr_appRow = $this->mdl_app->mdl_read($_num_appId);
            if ($_arr_appRow["alert"] != "y050102") {
                return $_arr_appRow;
            }
        } else {
            if (!isset($this->adminLogged["admin_allow"]["app"]["add"]) && !$this->is_super) {
                return array("alert" => "x050302");
            }
            $_arr_appRow = array("app_id" => 0, "app_name" => "", "app_url_notify" => "", "app_url_sync" => "", "app_ip_allow" => "", "app_ip_bad" => "", "app_note" => "", "app_status" => "enable", "app_sync" => "off");
        }
        $this->tplData["appRow"] = $_arr_appRow;
        //管理员信息
        $this->obj_tpl->tplDisplay("app_form.tpl", $this->tplData);
        return array("alert" => "y050102");
    }

Usage Example

Example #1
0
include_once BG_PATH_CONTROL_ADMIN . "ctl/app.class.php";
//载入应用控制器
$ctl_app = new CONTROL_APP();
//初始化应用
switch ($GLOBALS["act_get"]) {
    case "show":
        //显示
        $arr_appRow = $ctl_app->ctl_show();
        if ($arr_appRow["alert"] != "y190102") {
            header("Location: " . BG_URL_ADMIN . "ctl.php?mod=alert&act_get=show&alert=" . $arr_appRow["alert"]);
            exit;
        }
        break;
    case "form":
        //创建、编辑表单
        $arr_appRow = $ctl_app->ctl_form();
        if ($arr_appRow["alert"] != "y190102") {
            header("Location: " . BG_URL_ADMIN . "ctl.php?mod=alert&act_get=show&alert=" . $arr_appRow["alert"]);
            exit;
        }
        break;
    case "belong":
        //用户授权
        $arr_appRow = $ctl_app->ctl_belong();
        if ($arr_appRow["alert"] != "y190302") {
            header("Location: " . BG_URL_ADMIN . "ctl.php?mod=alert&act_get=show&alert=" . $arr_appRow["alert"]);
            exit;
        }
        break;
    default:
        //列出