ECShop中,和後臺選單相關的檔案有兩個:
·選單項:admin\includes\inc_menu.php
·選單文字:languages\zh_cn\admin\common.php
所以,要修改選單主要也就是修改這兩個檔案了。
理論基礎
1).選單項管理
inc_menu.php檔案用於管理選單數量、顯示順序、連結等,該檔案內容形如:
程式程式碼
$modules['02_cat_and_goods']['01_goods_list'] = 'goods.php?act=list'; // 商品列表
$modules['02_cat_and_goods']['02_goods_add'] = 'goods.php?act=add'; // 新增商品
$modules['02_cat_and_goods']['03_category_list'] = 'category.php?act=list';
$modules['02_cat_and_goods']['05_comment_manage'] = 'comment_manage.php?act=list';
$modules['02_cat_and_goods']['06_goods_brand_list'] = 'brand.php?act=list';
$modules['02_cat_and_goods']['08_goods_type'] = 'goods_type.php?act=manage';
$modules['02_cat_and_goods']['11_goods_trash'] = 'goods.php?act=trash'; // 商品回收站
$modules['02_cat_and_goods']['12_batch_pic'] = 'picture_batch.php';
$modules['02_cat_and_goods']['13_batch_add'] = 'goods_batch.php?act=add'; // 商品批量上傳
$modules['02_cat_and_goods']['14_goods_export'] = 'goods_export.php?act=goods_export';
$modules['02_cat_and_goods']['15_batch_edit'] = 'goods_batch.php?act=select'; // 商品批量修改
$modules['02_cat_and_goods']['16_goods_script'] = 'gen_goods_script.php?act=setup';
$modules['02_cat_and_goods']['17_tag_manage'] = 'tag_manage.php?act=list';
$modules['02_cat_and_goods']['50_virtual_card_list'] = 'goods.php?act=list&extension_code=virtual_card';
$modules['02_cat_and_goods']['51_virtual_card_add'] = 'goods.php?act=add&extension_code=virtual_card';
$modules['02_cat_and_goods']['52_virtual_card_change'] = 'virtual_card.php?act=change';
$modules['02_cat_and_goods']['goods_auto'] = 'goods_auto.php?act=list';
$modules['03_promotion']['02_snatch_list'] = 'snatch.php?act=list';
$modules['03_promotion']['04_bonustype_list'] = 'bonus.php?act=list';
$modules['03_promotion']['06_pack_list'] = 'pack.php?act=list';
$modules['03_promotion']['07_card_list'] = 'card.php?act=list';
$modules['03_promotion']['08_group_buy'] = 'group_buy.php?act=list';
$modules['03_promotion']['09_topic'] = 'topic.php?act=list';
$modules['03_promotion']['10_auction'] = 'auction.php?act=list';
$modules['03_promotion']['12_favourable'] = 'favourable.php?act=list';
$modules['03_promotion']['13_wholesale'] = 'wholesale.php?act=list';
$modules['03_promotion']['14_package_list'] = 'package.php?act=list';
//$modules['03_promotion']['ebao_commend'] = 'ebao_commend.php?act=list';
$modules['03_promotion']['15_exchange_goods'] = 'exchange_goods.php?act=list';
$modules['02_cat_and_goods']['02_goods_add'] = 'goods.php?act=add'; // 新增商品
$modules['02_cat_and_goods']['03_category_list'] = 'category.php?act=list';
$modules['02_cat_and_goods']['05_comment_manage'] = 'comment_manage.php?act=list';
$modules['02_cat_and_goods']['06_goods_brand_list'] = 'brand.php?act=list';
$modules['02_cat_and_goods']['08_goods_type'] = 'goods_type.php?act=manage';
$modules['02_cat_and_goods']['11_goods_trash'] = 'goods.php?act=trash'; // 商品回收站
$modules['02_cat_and_goods']['12_batch_pic'] = 'picture_batch.php';
$modules['02_cat_and_goods']['13_batch_add'] = 'goods_batch.php?act=add'; // 商品批量上傳
$modules['02_cat_and_goods']['14_goods_export'] = 'goods_export.php?act=goods_export';
$modules['02_cat_and_goods']['15_batch_edit'] = 'goods_batch.php?act=select'; // 商品批量修改
$modules['02_cat_and_goods']['16_goods_script'] = 'gen_goods_script.php?act=setup';
$modules['02_cat_and_goods']['17_tag_manage'] = 'tag_manage.php?act=list';
$modules['02_cat_and_goods']['50_virtual_card_list'] = 'goods.php?act=list&extension_code=virtual_card';
$modules['02_cat_and_goods']['51_virtual_card_add'] = 'goods.php?act=add&extension_code=virtual_card';
$modules['02_cat_and_goods']['52_virtual_card_change'] = 'virtual_card.php?act=change';
$modules['02_cat_and_goods']['goods_auto'] = 'goods_auto.php?act=list';
$modules['03_promotion']['02_snatch_list'] = 'snatch.php?act=list';
$modules['03_promotion']['04_bonustype_list'] = 'bonus.php?act=list';
$modules['03_promotion']['06_pack_list'] = 'pack.php?act=list';
$modules['03_promotion']['07_card_list'] = 'card.php?act=list';
$modules['03_promotion']['08_group_buy'] = 'group_buy.php?act=list';
$modules['03_promotion']['09_topic'] = 'topic.php?act=list';
$modules['03_promotion']['10_auction'] = 'auction.php?act=list';
$modules['03_promotion']['12_favourable'] = 'favourable.php?act=list';
$modules['03_promotion']['13_wholesale'] = 'wholesale.php?act=list';
$modules['03_promotion']['14_package_list'] = 'package.php?act=list';
//$modules['03_promotion']['ebao_commend'] = 'ebao_commend.php?act=list';
$modules['03_promotion']['15_exchange_goods'] = 'exchange_goods.php?act=list';
做程式的應該都知道這是一個二維陣列,格式如下:
程式程式碼
$modules['一級分類']['二級分類']='連結地址';
它們在頁面上的顯示順序測試發現是以分類名稱進行排序的!
2).選單文字管理
細心的可能問了,那選單的文字呢?總不能就顯示01_goods_list、02_goods_add這類文字吧,這就要用到common.php檔案了。由於我們大都用簡體中文,所以修改languages\zh_cn\admin\common.php檔案就可以了,如果你要用繁體中文,那就修改languages\zh_tw\admin\common.php,其他依此類推。該檔案內容形如:
程式程式碼
/* 選單分類部分 */
$_LANG['02_cat_and_goods'] = '商品管理';
$_LANG['03_promotion'] = '促銷管理';
$_LANG['04_order'] = '訂單管理';
$_LANG['05_banner'] = '廣告管理';
$_LANG['06_stats'] = '報表統計';
$_LANG['07_content'] = '文章管理';
$_LANG['08_members'] = '會員管理';
$_LANG['09_others'] = '雜項管理';
$_LANG['10_priv_admin'] = '許可權管理';
$_LANG['11_system'] = '系統設定';
$_LANG['12_template'] = '模板管理';
$_LANG['13_backup'] = '資料庫管理';
$_LANG['14_sms'] = '簡訊管理';
$_LANG['15_rec'] = '推薦管理';
$_LANG['16_email_manage'] = '郵件群發管理';
/* 商品管理 */
$_LANG['01_goods_list'] = '商品列表';
$_LANG['02_goods_add'] = '新增新商品';
$_LANG['03_category_list'] = '商品分類';
$_LANG['04_category_add'] = '新增分類';
$_LANG['05_comment_manage'] = '使用者評論';
$_LANG['06_goods_brand_list'] = '商品品牌';
$_LANG['07_brand_add'] = '新增品牌';
$_LANG['08_goods_type'] = '商品型別';
$_LANG['09_attribute_list'] = '商品屬性';
$_LANG['10_attribute_add'] = '新增屬性';
$_LANG['11_goods_trash'] = '商品回收站';
$_LANG['12_batch_pic'] = '圖片批量處理';
$_LANG['13_batch_add'] = '商品批量上傳';
$_LANG['15_batch_edit'] = '商品批量修改';
$_LANG['16_goods_script'] = '生成商品程式碼';
$_LANG['17_tag_manage'] = '標籤管理';
$_LANG['18_product_list'] = '貨品列表';
$_LANG['52_attribute_add'] = '編輯屬性';
$_LANG['53_suppliers_goods'] = '供貨商商品管理';
$_LANG['02_cat_and_goods'] = '商品管理';
$_LANG['03_promotion'] = '促銷管理';
$_LANG['04_order'] = '訂單管理';
$_LANG['05_banner'] = '廣告管理';
$_LANG['06_stats'] = '報表統計';
$_LANG['07_content'] = '文章管理';
$_LANG['08_members'] = '會員管理';
$_LANG['09_others'] = '雜項管理';
$_LANG['10_priv_admin'] = '許可權管理';
$_LANG['11_system'] = '系統設定';
$_LANG['12_template'] = '模板管理';
$_LANG['13_backup'] = '資料庫管理';
$_LANG['14_sms'] = '簡訊管理';
$_LANG['15_rec'] = '推薦管理';
$_LANG['16_email_manage'] = '郵件群發管理';
/* 商品管理 */
$_LANG['01_goods_list'] = '商品列表';
$_LANG['02_goods_add'] = '新增新商品';
$_LANG['03_category_list'] = '商品分類';
$_LANG['04_category_add'] = '新增分類';
$_LANG['05_comment_manage'] = '使用者評論';
$_LANG['06_goods_brand_list'] = '商品品牌';
$_LANG['07_brand_add'] = '新增品牌';
$_LANG['08_goods_type'] = '商品型別';
$_LANG['09_attribute_list'] = '商品屬性';
$_LANG['10_attribute_add'] = '新增屬性';
$_LANG['11_goods_trash'] = '商品回收站';
$_LANG['12_batch_pic'] = '圖片批量處理';
$_LANG['13_batch_add'] = '商品批量上傳';
$_LANG['15_batch_edit'] = '商品批量修改';
$_LANG['16_goods_script'] = '生成商品程式碼';
$_LANG['17_tag_manage'] = '標籤管理';
$_LANG['18_product_list'] = '貨品列表';
$_LANG['52_attribute_add'] = '編輯屬性';
$_LANG['53_suppliers_goods'] = '供貨商商品管理';
其格式如下:
程式程式碼
$_LANG['一級分類或二級分類'] = '顯示文字';
實戰管理選單修改
開啟inc_menu.php,找到:
程式程式碼
$modules['07_content']['03_article_list'] = 'article.php?act=list';
$modules['07_content']['02_articlecat_list'] = 'articlecat.php?act=list';
$modules['07_content']['vote_list'] = 'vote.php?act=list';
$modules['07_content']['article_auto'] = 'article_auto.php?act=list';
//$modules['07_content']['shop_help'] = 'shophelp.php?act=list_cat';
//$modules['07_content']['shop_info'] = 'shopinfo.php?act=list';
$modules['07_content']['02_articlecat_list'] = 'articlecat.php?act=list';
$modules['07_content']['vote_list'] = 'vote.php?act=list';
$modules['07_content']['article_auto'] = 'article_auto.php?act=list';
//$modules['07_content']['shop_help'] = 'shophelp.php?act=list_cat';
//$modules['07_content']['shop_info'] = 'shopinfo.php?act=list';
修改如下:
程式程式碼
$modules['07_content']['01_article_add'] = 'article.php?act=add';
$modules['07_content']['02_article_list'] = 'article.php?act=list';
$modules['07_content']['03_articlecat_list'] = 'articlecat.php?act=list';
$modules['07_content']['vote_list'] = 'vote.php?act=list';
$modules['07_content']['article_auto'] = 'article_auto.php?act=list';
//$modules['07_content']['shop_help'] = 'shophelp.php?act=list_cat';
//$modules['07_content']['shop_info'] = 'shopinfo.php?act=list';
$modules['07_content']['02_article_list'] = 'article.php?act=list';
$modules['07_content']['03_articlecat_list'] = 'articlecat.php?act=list';
$modules['07_content']['vote_list'] = 'vote.php?act=list';
$modules['07_content']['article_auto'] = 'article_auto.php?act=list';
//$modules['07_content']['shop_help'] = 'shophelp.php?act=list_cat';
//$modules['07_content']['shop_info'] = 'shopinfo.php?act=list';
開啟common.php,找到:
程式程式碼
$_LANG['02_articlecat_list'] = '文章分類';
$_LANG['articlecat_add'] = '新增文章分類';
$_LANG['03_article_list'] = '文章列表';
$_LANG['article_add'] = '新增新文章';
$_LANG['shop_article'] = '網店文章';
$_LANG['shop_info'] = '網店資訊';
$_LANG['shop_help'] = '網店幫助';
$_LANG['vote_list'] = '線上調查';
$_LANG['articlecat_add'] = '新增文章分類';
$_LANG['03_article_list'] = '文章列表';
$_LANG['article_add'] = '新增新文章';
$_LANG['shop_article'] = '網店文章';
$_LANG['shop_info'] = '網店資訊';
$_LANG['shop_help'] = '網店幫助';
$_LANG['vote_list'] = '線上調查';
修改如下:
程式程式碼
/* 文章管理 */
$_LANG['03_articlecat_list'] = '文章分類';
$_LANG['articlecat_add'] = '新增文章分類';
$_LANG['02_article_list'] = '文章列表';
$_LANG['01_article_add'] = '新增新文章';
$_LANG['shop_article'] = '網店文章';
$_LANG['shop_info'] = '網店資訊';
$_LANG['shop_help'] = '網店幫助';
$_LANG['vote_list'] = '線上調查';
$_LANG['03_articlecat_list'] = '文章分類';
$_LANG['articlecat_add'] = '新增文章分類';
$_LANG['02_article_list'] = '文章列表';
$_LANG['01_article_add'] = '新增新文章';
$_LANG['shop_article'] = '網店文章';
$_LANG['shop_info'] = '網店資訊';
$_LANG['shop_help'] = '網店幫助';
$_LANG['vote_list'] = '線上調查';
儲存後,重新整理頁面,你會看到加了"新增新文章'"選單,並且順序也改變了。