doc.pl

来自「使用perl和C写的基于Web的管理数据库表的程序」· PL 代码 · 共 99 行

PL
99
字号
# defined Plugins:## --- Things, to do, before WWWdb does any Action# PreDoAction()## --- Check-Routine for every field of the Table <Table># Check_<Table>_EveryField()## --- Check-Routine for field <Field> of the Table <Table># Check_<Table>_<Field>()## --- Conversion for fieldtype <FieldType> of db <Db> coming from form# <Db>_<FieldType>_Form2Db()## --- Conversion for fieldtype <FieldType> of db <Db> coming from db# <Db>_<FieldType>_Db2Form()## --- Do action for Button <Btn># (Pre|Post|My)Btn<Btn>()## --- Set up the navigation-column on the left side# (Pre|Post|My)FirstColumn()## --- Generate the header of the form# (Pre|Post|My)FormHeader()## --- Generate the header of the table# (Pre|Post|My)TableHeader($)## --- Generate the footer of the table# (Pre|Post|My)TableFooter()## --- Generate the footer of the page# (Pre|Post|My)FormFooter()# --- Things to do, before the HTML-form will be generated# --- Things to do, before the HTML-form will be generatedsub PreCreateForm(){   my @lCategories;   if (&GetField("id_doc") and       &GetField("id_doc") < 1000)   {      &SetField("id_system",  1);   }}sub PreBtnNew(){   my $iMaxObjId;   # generate a new object-id   $iMaxObjId = (&SQLSelectList(sprintf                                ("SELECT MAX(id_doc)                                  FROM wwwdb_doc                                  WHERE %s",                                 &GetField("id_system")?                                 "id_doc < 10000":                                 "id_doc >= 10000")))[0];   &SetField("id_doc", ($iMaxObjId?                        $iMaxObjId + 1:                        (&GetField("id_system")?                         1 : 10000)));}sub MyBtnView(){   &OkForm("",           (b(i18n("Preview of current entry")) .            br() x 2 .            table({-BORDER => 1},                  TR(td({-ALIGN  => "LEFT"},                        &GetField("text")))) .            br() x 2 .            i18n("Please use the back-button of your browser")),           "-");   &MyExit();}1;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?