当前位置: 首页>>代码示例>>PHP>>正文


PHP asset::create_edit方法代码示例

本文整理汇总了PHP中asset::create_edit方法的典型用法代码示例。如果您正苦于以下问题:PHP asset::create_edit方法的具体用法?PHP asset::create_edit怎么用?PHP asset::create_edit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在asset的用法示例。


在下文中一共展示了asset::create_edit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: asset_process_session_request


//.........这里部分代码省略.........
                $skey = $tview;
            } else {
                $skey = "request";
            }
            if (isset($_SESSION["_" . $tfolder][$skey][$req_key])) {
                $t["sqlvars"][$req_key] = $_SESSION["_" . $tfolder][$skey][$req_key];
            }
            if (isset($_SESSION[$req_key])) {
                $t["sqlvars"][$req_key] = $_SESSION[$req_key];
            }
            if (isset($_REQUEST[$req_key])) {
                $t["sqlvars"][$req_key] = $_REQUEST[$req_key];
                $_SESSION["_" . $tfolder][$skey][$req_key] = $_REQUEST[$req_key];
            }
            if (!isset($t["sqlvars"][$req_key]) and empty($t["sqlvarsnoquote"][$req_key])) {
                $t["sqlwhere"][$key] = "1=1";
            }
        }
    }
    if (!isset($_SESSION[$tname][$tview]["group"])) {
        $_SESSION[$tname][$tview]["group"] = $t["group"];
    }
    if (!isset($_SESSION[$tname][$tview]["groupby"])) {
        $_SESSION[$tname][$tview]["groupby"] = $t["groupby"];
    }
    if (isset($_REQUEST["group"])) {
        if ($_SESSION[$tname][$tview]["groupby"] == "") {
            $_SESSION[$tname][$tview]["groupby"] = $t["orderby"];
            $_SESSION[$tname][$tview]["group"] = $t["order"];
        } else {
            $_SESSION[$tname][$tview]["groupby"] = "";
            $_SESSION[$tname][$tview]["group"] = "";
        }
    }
    if (!isset($_REQUEST["plain"])) {
        $t["groupby"] = $_SESSION[$tname][$tview]["groupby"];
        $t["group"] = $_SESSION[$tname][$tview]["group"];
    } else {
        $t["groupby"] = "";
        $t["group"] = "";
    }
    if ($t["groupby"] != "" and isset($t["fields"][$t["groupby"]])) {
        $field = $t["fields"][$t["groupby"]];
        $field["WIDTH"] = 0;
        unset($t["fields"][$t["groupby"]]);
        unset($t["fields_query"][$t["groupby"]]);
        $t["fields"] = array_merge(array($t["groupby"] => $field), $t["fields"]);
        $t["fields_query"] = array_unique(array_merge(array($t["groupby"]), $t["fields_query"]));
    }
    _asset_process_pages($t["maxdatasets"]);
    if (!isset($t["views"][$tview]["NOSQLORDER"])) {
        $t["sqlorder"] = ($t["groupby"] != "" ? $t["groupby"] . " " . $t["group"] . "," : "") . $t["orderby"] . " " . $t["order"];
    }
    if (!isset($t["views"][$tview]["NOSQLLIMIT"]) and empty($_REQUEST["print_all"]) and (empty($_REQUEST["export"]) or !empty($_REQUEST["limit"]))) {
        $t["sqllimit"] = array(($t["page"] - 1) * $t["limit"], $t["limit"]);
    }
    if (!empty($_REQUEST["iframe"]) and isset($_REQUEST["session_remove_request"])) {
        $t["sqllimit"] = array();
    }
    // offline reading
    if (!empty($t["sqlvars"]["item"]) and $t["views"][$tview]["SCHEMA_MODE"] == "edit" and $t["maxdatasets"] == 0) {
        sys_warning("{t}Item(s) not found or access denied.{/t}");
    }
    if ($t["maxdatasets"] != 0) {
        _asset_get_rows();
    }
    if ((!empty($_REQUEST["form_submit_create"]) or !empty($_REQUEST["form_submit_edit"])) and $t["rights"]["write"] and $t["schema_mode"] != "") {
        $mode = $t["schema_mode"] == "edit" ? "edit" : "create";
        list($t["errors"], $defaults, $form_ids, $saved_ids) = asset::create_edit($tfolder, $tview, $mode);
        foreach ($t["limits"] as $key => $val) {
            if (in_array($val, $form_ids)) {
                unset($t["limits"][$key]);
            }
        }
        if (count($t["errors"]) == 0) {
            $t["limits"] = range(0, $t["limit"] - 1);
            if (!empty($_REQUEST["form_submit_return"])) {
                $arr = array_pop(array_slice($_SESSION["history"], -2, 1));
                if (empty($arr[2])) {
                    $arr[2] = "default";
                }
                sys_redirect("index.php?view=" . $arr[2] . "&" . sys::$urladdon);
            }
            if (!empty($_REQUEST["form_submit_go_edit"])) {
                $items = "";
                foreach ($saved_ids as $id) {
                    $items .= "&item[]=" . rawurlencode($id);
                }
                sys_redirect("index.php?view=edit" . $items . "&" . sys::$urladdon);
            }
        }
        foreach ($defaults as $id => $field) {
            foreach ($field as $field_name => $value) {
                $t["fields"][$field_name]["SIMPLE_DEFAULTS"][$id] = $value;
                $t["fields"][$field_name]["SIMPLE_DEFAULT"] = "";
            }
        }
    }
    sys::$smarty->assign_by_ref("t", $t);
}
开发者ID:drognisep,项目名称:Simple-Groupware,代码行数:101,代码来源:funcs.php


注:本文中的asset::create_edit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。