Easy modification of website name-light E-commerce system (enterprise entry level B2C website), E-commerce system B2C
By modifying the website name, the system can be customized to any user, satisfying the user's feeling. This is a very clever and useful small function.
The procedure is as follows:
Introduce permission judgment (the Administrator has the permission to modify the website name)
<Chtml> <Bag id = sys> <we name = NodeID> a0 </we> </Bag> <! -- Topic node --> </chtml> <chtml file = "base/ac/checkAcl.htm"/> <! -- Import the permission check file -->
Read the website name file
<file id=site act=read method=str name=title>site/res/site_name.txt</file>
Determine permissions and decide not to display the "save" Function
<If x = "@ {sys: canDo}"> <div align = right x = true> <a href = "javascript: doSubmit ()" title = "Save the current modification! "> [Save] </a> </div> </if>
Submit the website name form
<Form action = "site_edit.chtml" method = post id = save name = save> <tr height = "28" class = bg0> <th width = "80" valign = "middle"> website name </td> <input name = "title" value = "@ {site: title} "size =" @ {int: @ {length: @ {site: title }}+ 12} "/> </td> </tr> </form>
Submit Time and Space Value Verification
DoSubmit = function () {var saves = document. forms ['save']; if (saves ['title']. value = "") {alert ("name cannot be blank! "); Return;} saves. submit ();}
Effect
Complete code
<Html> <title> modify website name: @ {site: title} </title> <link href = "@ {sys: path} base/css/system.css "rel =" stylesheet "type =" text/css "> <Script src =" @ {sys: path} base/js/AjaxBase. js "> </Script> <BODY leftMargin =" 0 "topMargin =" 0 "scroll =" no "MARGINWIDTH =" 0 "MARGINHEIGHT =" 0 "> <TABLE cellSpacing = 0 cellPadding = 0 width = "100%" border = 0> <TR vAlign = top> <TD style = "BACKGROUND-REPEAT: repeat-x "background =" @ {sys: path} images/Title2.g If "> <TABLE cellSpacing = 0 cellPadding = 0 width =" 100% "border = 0> <TR vAlign = top> <TD height = 32 style =" BACKGROUND-REPEAT: no-repeat "noWrap width =" 100% "class =" GAP1 "> <P style =" MARGIN-LEFT: 2px; MARGIN-RIGHT: 3px "> modify site name: @ {site: title }</P> </TD> </TR> </TABLE> </TD> <TD width = 10 class = "GAP1"> </TD> <chtml> <Bag id = sys> <we name = NodeID> a0 </we> </Bag> <! -- Topic node --> </chtml> <chtml file = "base/ac/checkAcl.htm"/> <! -- Introduce the permission check file --> <TD style = "BACKGROUND-REPEAT: repeat-x" vAlign = bottom width = "100%" background = "@ {sys: path} images/Title4.gif "> <chtml> <file id = site act = read method = str name = title> site/res/site_name.txt </file> <if x = "@ {sys: canDo} "> <div align = right x = true> <a href =" javascript: doSubmit () "title =" Save the current modification! "> [Save] </a> </div> </if> </chtml> </TD> </TR> </TABLE> <table width =" 99%" cellpadding = "0" cellspacing = "0" border = "1" bordercolor = "# b4b4b4" align = center> <form action = "site_edit.chtml" method = post id = save name = save> <tr height = "28" class = bg0> <th width = "80" valign = "middle"> website name </td> <input name =" title "value =" @ {site: title} "size =" @ {int: @ {length: @ {site: title }}+ 12} "/> </td> </tr> </form> </table> <br> </BODY> (File: base/access/site_edit.html) in
Light open e-commerce system (enterprise entry level B2C website)In the base/access/directory
Save the website name after submission
<! -- Permission judgment --> <if x = "@ {sys: canDo}" else = 1> <we x = true>... </we> <script> alert ("You do not have permission! "); History. back (); </script> </if>
Save the website name
<file value="@{pPage:title}">site/res/site_name.txt</file>
Save and return
<to>@{sys:face}base/access/site_edit.html</to>
Complete code
<Html> <chtml> <Bag id = sys> <we name = NodeID> a0 </we> </Bag> </chtml> <! -- Topic node --> <chtml file = "base/ac/checkAcl.htm"/> <! -- Import the permission check file --> <chtml> <! -- Permission judgment --> <if x = "@ {sys: canDo}" else = 1> <we x = true> <file value = "@ {pPage: title} "> site/res/site_name.txt </file> <to >@{ sys: face} base/access/site_edit.html </to> </we> <script> alert ("You do not have permission! "); History. back (); </script> </if> </chtml>
(File: base/access/site_edit.chtml) inLight open e-commerce system (enterprise entry level B2C website)In the base/access/directory
You can test it.
Download Easy Do IT resources
Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8818883
The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please note thatDownload the latest version