By modifying the site name can be customized to any user system, to meet the user's sense of possession, is very clever and useful small function.
The procedure is as follows:
Introduction of permissions Judgment (administrators have permission to modify site names)
<chtml><bag id=sys><we name=nodeid>a0</we></bag><!--Column node--></chtml> <chtml file= "base/ac/checkacl.htm"/><!--introduce permission check file--
Read the site name file
<file id=site act=read method=str name=title>site/res/site_name.txt</file>
Determine permissions, decide not to display the "Save" function
<if x= "@{sys:cando}" ><div align=right x=true><a href= "Javascript:dosubmit ()" title= "Save current changes! ">[Save]</a> </div></if>
submit a form for the site name
<form action= "site_edit.chtml" Method=post id=save name=save><tr height= "class=bg0><th width=" 80 " valign= "Middle" > Site name </td><td><input name= "title" Value= "@{site:title}" size= "@{int:@{length:@{ SITE:TITLE}}+12} "/></td></tr></form>
Commit time-space value check
Dosubmit = function () {var saves = document.forms[' save '];if (saves[' title '].value== ' ") {alert (" Name cannot be empty! "); return;} Saves.submit ();}
effect
Full Code
(file: base/access/site_edit.html) in the Light Open e-commerce system (Enterprise entry-level business website) under the base/access/ directorySave Site name after submission
<!--permission to judge--><if x= "@{sys:cando}" Else=1><we X=true>...</we><script>alert ("You don't have permission! "); History.back ();</script></if>
Save Site name
<file value= "@{ppage:title}" >site/res/site_name.txt</file>
return after saving
<to>@{sys:face}base/access/site_edit.html</to>
Full code
(file: base/access/site_edit.chtml) in the Light Open e-commerce system (Enterprise entry-level business website) under the base/access/directory
We can actually test it.Easy to download resources for Internet development Platform
Development example: Light Open e-commerce website , free download: http://download.csdn.net/detail/tx18/8818883
Light open platform will be upgraded to provide you with more powerful and easy features, please pay attention to Download the latest version
Easily modify the name of the website---e-commerce system (Enterprise entry-level business website)