Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
In recent days to see Ecshop source code, learned a lot of things. This journal records the steps for adding a new column (menu item) in the background to prepare for later use.
Step1 Add menu items
Open the/admin/includes/inc_menu.php file (the left menu of the background frame) and add the following line to the end:
1$modules[' 17_other_menu ' [' sns_list '] = ' sns_list.php?act=list ';
Ecshop The default Level menu item has 16 items, where the example starts from 17. Of course, this key can be arbitrarily taken, index.php file in the menu with the Ksort sort. "17_other_menu" represents a level menu, and "Sns_list" represents a level two menu. The value following the equal sign represents the page link that is open in the menu column.
Step2 Configuration Menu Language
Open/languages/zh_cn/admin/common.php file, add language
1$_lang[' 17_other_menu ' = ' other settings ';
2$_lang[' sns_list ' = ' SNS management ';
At this point, the Administrator (Admin user) log in to the background, you can see the newly added menu items. Because admin permission is "all". If you have multiple administrators in the background, such as Ecshop mall vendors, or other managers (other log-back accounts created by admin), you must assign them administrative privileges if they want to have the right to view the new menu added.
Step3 Add a new menu to the permissions list
Open the/languages/zh_cn/admin/priv_action.php file and add the following code below the "Level grouping for Rights management" comment line
1$_lang[' other_manager ' = ' other settings ';
The "Other_manager" here is the permission name of this level column, here and the column name "17_other_menu" to be consistent, also can take a name casually. Here to differentiate, there is no same as the menu name.
Then, add the permission name of the Level two column "Sns_list". At the end of this file you can add
1//Other Management
2$_lang[' sns_list ' = ' SNS management ';
This permission name is consistent with the level two dish names. Where are these two now?
Step4 the permissions on the first level menu and level two menu.
Open the database, see {pre}_admin_action table, add two rows of data. The following figure
The 1th column of data in the screenshot is action_id, which is the self-added primary key of the table. The 2nd column of data is parent_id, from Superior action_id. The 3rd column of data is the permission name (key) defined in Step3. In that case, the two rights are linked. Here, open the background "Administrator List", click on the "Assign Permissions" icon, you can see the step3 figure shown in the permission. With a background user tick submit, the user will be able to see the new menu item.
Writing an article is not easy, reproduced please give the author a feedback: http://www.icaigen.com/