If judges the tag instance, if tag instance
Light B2C e-commerce websitesDelete product instances
Column node and permission check file
<Chtml> <Bag id = sys> <we name = NodeID> a0.0 </we> </Bag> </chtml> <! -- Topic node --> <chtml file = "base/ac/checkAcl.htm"/> <! -- Import the permission check file -->
Permission judgment
<Chtml> <! -- Permission judgment --> <if x = "@ {sys: canDo} "else = 1> <we x = true> <call> act </call> <to >@{ sys: face }@{ sys: curpath+list.html? C =@{ show: catalog }</to> </we> <script> alert ("You do not have permission! "); History. back (); </script> </if> </chtml>
If @ {sys: canDo} = true, delete the statement and return to the list.
<we x=true><call>act</call><to>@{sys:face}@{sys:curPath}list.html?c=@{show:catalog}</to></we>
Otherwise (@ {sys: canDo} = false), the system prompts that the operation is not permitted and returns to the previous page.
<Script> alert ("You do not have permission! "); History. back (); </script>
Code for deleting a product
<chtml id=act onlycall><esql module=base id=show>select we_num,catalog from co_sale where we_id='@{pPage:myid}'</esql><file act=del>htm/images/@{show:we_num}/</file><ESql module=base act=edit>delete from co_sale where we_id='@{pPage:myid}'</ESql></chtml>
Complete code
<Html> <chtml> <Bag id = sys> <we name = NodeID> a0.0 </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> <call> act </call> <to >@{ sys: face }@{ sys: curpath+list.html? C =@{ show: catalog }</to> </we> <script> alert ("You do not have permission! "); History. back (); </script> </if> </chtml> Open the file in the site/eb directory of the B2C e-commerce website (site/eb/show_del.chtml). Open it and try it yourself.
Download and description of light platform Resources
Platform free download: http://download.csdn.net/detail/tx18/8381859
Latest Development Manual download: http://download.csdn.net/detail/tx18/8411089
Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585
The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please pay attention to the latestDevelopment Manual