<?php
/**
 * Copyright (C) OEmarry All rights reserved.
 * <E-Mail：service@phpcoo.com>
 * Url http://www.phpcoo.com
 *     http://www.oephp.com
 *     http://www.oemarry.com
 * Update 2016.07.18
 */
//权限值
function init_power_white_list() {
    //白名单
    return array(
        "index_run", "index_main", "index_upload", "index_getroleadmin", "index_getsubadmin", "index_logout", "index_getnews",
        "user_selectshop", "user_check", "shop_select", "shop_check", "myads_check", "setting_testmail", "setting_checkSmsBalance",
		"setting_testsms", "setting_smssdk2key", "templet_select", "zone_check",
    );
}
//define("OE_POWER_WHITE_LIST", $oe_power_white_list);
function init_roles_elements() {
    $view_name = "查看";
    $add_name = "添加";
    $edit_name = "编辑";
    $del_name = "删除";
	$roles_elements = array();

    /*-------------------- base Begin ---------------------*/
	$roles_elements[] = array(
		'mod'=>'menu_base', //模块
		'name'=>'基础模块(头部导航)↓', //头部菜单模块
	);

    $roles_elements[] = array(
        'mod'=>'mod_setting',
        'name'=>'系统设置(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'setting',
        'name'=>'系统设置',
        'base'=>array(
        ),
        'other'=>array(
            'setting_base'=>array(
                "text"=>"站点设置",
                "allows"=>"setting_run,setting_savebase",
            ),
            'setting_upload'=>array(
                "text"=>"上传设置",
                "allows"=>"setting_upload,setting_saveupload",
            ),
            'setting_global'=>array(
                "text"=>"全局设置",
                "allows"=>"setting_global,setting_saveglobal",
            ),
            'setting_page'=>array(
                "text"=>"分页设置",
                "allows"=>"setting_page,setting_savepage",
            ),
            'setting_footer'=>array(
                "text"=>"页面底部设置",
                "allows"=>"setting_footer,setting_savefooter",
            ),
            'setting_sms'=>array(
                "text"=>"手机短信接口",
                "allows"=>"setting_sms,setting_savesms",
            ),
            'setting_mail'=>array(
                "text"=>"邮件接口",
                "allows"=>"setting_mail,setting_savemail",
            ),
            'setting_oelove'=>array(
                "text"=>"OElove整合",
                "allows"=>"setting_oelove,setting_saveoelove",
            ),
            'setting_clearcache'=>array(
                "text"=>"清除页面缓存",
                "allows"=>"setting_clearcache",
            ),
            'setting_updatecache'=>array(
                "text"=>"更新数据缓存",
                "allows"=>"setting_updatecache",
            ),
			'setting_wap'=>array(
                "text"=>"手机版设置",
                "allows"=>"setting_wap,setting_savewap,setting_wapabout,setting_savewapabout,setting_wapcontact,setting_savewapcontact,setting_wappayment,setting_savewappayment,setting_wapclause,setting_savewapclause",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'friendlink',
        'name'=>'友情链接',
        'base'=>array(
            'friendlink_view'=>array(
                "text"=>$view_name,
                "allows"=>"friendlink_run",
            ),
            'friendlink_add'=>array(
                "text"=>$add_name,
                "allows"=>"friendlink_add,friendlink_saveadd",
            ),
            'friendlink_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"friendlink_edit,friendlink_saveedit,friendlink_update",
            ),
            'friendlink_del'=>array(
                "text"=>$del_name,
                "allows"=>"friendlink_del",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'htmllabel',
        'name'=>'自定义HTML标签',
        'base'=>array(
            'htmllabel_view'=>array(
                "text"=>$view_name,
                "allows"=>"htmllabel_run",
            ),
            'htmllabel_add'=>array(
                "text"=>$add_name,
                "allows"=>"htmllabel_add,htmllabel_saveadd",
            ),
            'htmllabel_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"htmllabel_edit,htmllabel_saveedit",
            ),
            'htmllabel_del'=>array(
                "text"=>$del_name,
                "allows"=>"htmllabel_del",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'item',
        'name'=>'参数选项',
        'base'=>array(
            'item_view'=>array(
                "text"=>$view_name,
                "allows"=>"item_run",
            ),
            'item_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"item_edit,item_saveedit",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'seo',
        'name'=>'SEO设置',
        'base'=>array(
            'seo_view'=>array(
                "text"=>$view_name,
                "allows"=>"seo_run",
            ),
            'seo_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"seo_edit,seo_saveedit,seo_update",
            ),

        ),
    );
    $roles_elements[] = array(
        'mod'=>'indexmenu',
        'name'=>'前台自定义导航',
        'base'=>array(
            'indexmenu_view'=>array(
                "text"=>$view_name,
                "allows"=>"indexmenu_run",
            ),
            'indexmenu_add'=>array(
                "text"=>$add_name,
                "allows"=>"indexmenu_add,indexmenu_saveadd",
            ),
            'indexmenu_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"indexmenu_edit,indexmenu_saveedit,indexmenu_update",
            ),
            'indexmenu_del'=>array(
                "text"=>$del_name,
                "allows"=>"indexmenu_del",
            ),
        ),
    );


    $roles_elements[] = array(
        'mod'=>'mod_admin',
        'name'=>'帐号管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'admin',
        'name'=>'系统用户',
        'base'=>array(
            'admin_view'=>array(
                "text"=>$view_name,
                "allows"=>"admin_run",
            ),
            'admin_add'=>array(
                "text"=>$add_name,
                "allows"=>"admin_add,admin_saveadd",
            ),
            'admin_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"admin_edit,admin_saveedit",
            ),
            'admin_del'=>array(
                "text"=>$del_name,
                "allows"=>"admin_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'roles',
        'name'=>'角色权限',
        'base'=>array(
            'roles_view'=>array(
                "text"=>$view_name,
                "allows"=>"roles_run",
            ),
            'roles_add'=>array(
                "text"=>$add_name,
                "allows"=>"roles_add,roles_saveadd",
            ),
            'roles_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"roles_edit,roles_saveedit",
            ),
            'roles_del'=>array(
                "text"=>$del_name,
                "allows"=>"roles_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'my',
        'name'=>'我的帐号',
        'base'=>array(
            'my_view'=>array(
                "text"=>$view_name,
                "allows"=>"my_run",
            ),
        ),
        'other'=>array(
            "my_editinfo"=>array(
                "text"=>"修改资料",
                "allows"=>"my_editinfo,my_saveinfo"
            ),
            "my_editpass"=>array(
                "text"=>"修改密码",
                "allows"=>"my_editpass,my_savepass"
            ),
            "my_power"=>array(
                "text"=>"查看我的权限",
                "allows"=>"my_power"
            ),
            "my_subordinate"=>array(
                "text"=>"查看我的下属",
                "allows"=>"my_subordinate"
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'mod_area',
        'name'=>'地区管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'area',
        'name'=>'省/市/区',
        'base'=>array(
            'area_view'=>array(
                "text"=>$view_name,
                "allows"=>"area_run",
            ),
            'area_add'=>array(
                "text"=>$add_name,
                "allows"=>"area_add,area_saveadd",
            ),
            'area_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"area_edit,area_saveedit,area_update",
            ),
            'area_del'=>array(
                "text"=>$del_name,
                "allows"=>"area_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'city',
        'name'=>'地区分站',
        'base'=>array(
            'city_view'=>array(
                "text"=>$view_name,
                "allows"=>"city_run",
            ),
            'city_add'=>array(
                "text"=>$add_name,
                "allows"=>"city_add,city_saveadd",
            ),
            'city_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"city_edit,city_saveedit,city_update",
            ),
            'city_del'=>array(
                "text"=>$del_name,
                "allows"=>"city_del",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'mod_sdk',
        'name'=>'接口设置(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'paysdk',
        'name'=>'支付接口',
        'base'=>array(
            'paysdk_view'=>array(
                "text"=>$view_name,
                "allows"=>"paysdk_run",
            ),
            'paysdk_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"paysdk_edit,paysdk_saveedit",
            ),
        ),
    );


    $roles_elements[] = array(
        'mod'=>'mod_skin',
        'name'=>'风格界面(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'skin',
        'name'=>'前台主题风格',
        'base'=>array(
            'skin_view'=>array(
                "text"=>$view_name,
                "allows"=>"skin_run",
            ),
            'skin_del'=>array(
                "text"=>$del_name,
                "allows"=>"skin_del",
            ),
        ),
        'other'=>array(
            'skin_usetpl'=>array(
                "text"=>"切换风格",
                "allows"=>"skin_usetpl",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'templet',
        'name'=>'前台模板文件',
        'base'=>array(
            'templet_view'=>array(
                "text"=>$view_name,
                "allows"=>"templet_run",
            ),
            'templet_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"templet_edit,templet_saveedit",
            ),
            'templet_del'=>array(
                "text"=>$del_name,
                "allows"=>"templet_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'shopskin',
        'name'=>'店铺风格',
        'base'=>array(
            'shopskin_view'=>array(
                "text"=>$view_name,
                "allows"=>"shopskin_run",
            ),
            'shopskin_add'=>array(
                "text"=>$edit_name,
                "allows"=>"shopskin_add,shopskin_saveadd",
            ),
            'shopskin_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"shopskin_edit,shopskin_saveedit",
            ),
            'shopskin_del'=>array(
                "text"=>$del_name,
                "allows"=>"shopskin_del",
            ),
        ),
    );
    /*-------------------- base End ---------------------*/


    /*-------------------- user Begin ---------------------*/
    $roles_elements[] = array(
        'mod'=>'menu_user', //模块
        'name'=>'会员模块(头部导航)↓', //头部菜单模块
    );
    $roles_elements[] = array(
        'mod'=>'mod_user',
        'name'=>'会员管理(左边一级菜单)→↓', //一级菜单
    );

    $roles_elements[] = array(
        'mod'=>'user',
        'name'=>'会员管理',
        'base'=>array(
            'user_view'=>array(
                "text"=>$view_name,
                "allows"=>"user_run",
            ),
            'user_add'=>array(
                "text"=>$add_name,
                "allows"=>"user_add,user_saveadd",
            ),
            'user_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"user_edit,user_saveedit,user_update",
            ),
            'user_del'=>array(
                "text"=>$del_name,
                "allows"=>"user_del",
            ),
        ),
        'other'=>array(
            'user_login'=>array(
                "text"=>"登录会员",
                "allows"=>"user_loginuser",
            ),
        ),
    );
    /*-------------------- user End ---------------------*/

    /*-------------------- shop Begin ---------------------*/
    $roles_elements[] = array(
        'mod'=>'menu_shop', //模块
        'name'=>'商家模块(头部导航)↓', //头部菜单模块
    );


    $roles_elements[] = array(
        'mod'=>'mod_shop',
        'name'=>'店铺管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'shoplevel',
        'name'=>'店铺等级',
        'base'=>array(
            'shoplevel_view'=>array(
                "text"=>$view_name,
                "allows"=>"shoplevel_run",
            ),
            'shoplevel_add'=>array(
                "text"=>$add_name,
                "allows"=>"shoplevel_add,shoplevel_saveadd",
            ),
            'shoplevel_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"shoplevel_edit,shoplevel_saveedit,shoplevel_update",
            ),
            'shoplevel_del'=>array(
                "text"=>$del_name,
                "allows"=>"shoplevel_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'shopcat',
        'name'=>'店铺分类',
        'base'=>array(
            'shopcat_view'=>array(
                "text"=>$view_name,
                "allows"=>"shopcat_run",
            ),
            'shopcat_add'=>array(
                "text"=>$add_name,
                "allows"=>"shopcat_add,shopcat_saveadd",
            ),
            'shopcat_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"shopcat_edit,shopcat_saveedit,shopcat_update",
            ),
            'shopcat_del'=>array(
                "text"=>$del_name,
                "allows"=>"shopcat_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'shop',
        'name'=>'店铺管理',
        'base'=>array(
            'shop_view'=>array(
                "text"=>$view_name,
                "allows"=>"shop_run",
            ),
            'shop_add'=>array(
                "text"=>$add_name,
                "allows"=>"shop_add,shop_saveadd",
            ),
            'shop_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"shop_edit,shop_saveedit,shop_update",
            ),
            'shop_del'=>array(
                "text"=>$del_name,
                "allows"=>"shop_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'shopbespoke',
        'name'=>'店铺预约',
        'base'=>array(
            'shopbespoke_view'=>array(
                "text"=>$view_name,
                "allows"=>"shopbespoke_run",
            ),
            'shopbespoke_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"shopbespoke_edit,shopbespoke_saveedit",
            ),
            'shopbespoke_del'=>array(
                "text"=>$del_name,
                "allows"=>"shopbespoke_del",
            ),
        ),
    );


    $roles_elements[] = array(
        'mod'=>'mod_goods',
        'name'=>'商品管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'goodscat',
        'name'=>'商品分类',
        'base'=>array(
            'goodscat_view'=>array(
                "text"=>$view_name,
                "allows"=>"goodscat_run",
            ),
            'goodscat_add'=>array(
                "text"=>$add_name,
                "allows"=>"goodscat_add,goodscat_saveadd",
            ),
            'goodscat_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"goodscat_edit,goodscat_saveedit,goodscat_update",
            ),
            'goodscat_del'=>array(
                "text"=>$del_name,
                "allows"=>"goodscat_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'goods',
        'name'=>'商品管理',
        'base'=>array(
            'goods_view'=>array(
                "text"=>$view_name,
                "allows"=>"goods_run",
            ),
            'goods_add'=>array(
                "text"=>$add_name,
                "allows"=>"goods_add,goods_saveadd",
            ),
            'goods_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"goods_edit,goods_saveedit,goods_update",
            ),
            'goods_del'=>array(
                "text"=>$del_name,
                "allows"=>"goods_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'goodsbespoke',
        'name'=>'商品预约',
        'base'=>array(
            'goodsbespoke_view'=>array(
                "text"=>$view_name,
                "allows"=>"goodsbespoke_run",
            ),
            'goodsbespoke_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"goodsbespoke_edit,goodsbespoke_saveedit",
            ),
            'goodsbespoke_del'=>array(
                "text"=>$del_name,
                "allows"=>"goodsbespoke_del",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'mod_activity',
        'name'=>'活动管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'activitycat',
        'name'=>'活动分类',
        'base'=>array(
            'activitycat_view'=>array(
                "text"=>$view_name,
                "allows"=>"activitycat_run",
            ),
            'activitycat_add'=>array(
                "text"=>$add_name,
                "allows"=>"activitycat_add,activitycat_saveadd",
            ),
            'activitycat_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"activitycat_edit,activitycat_saveedit,activitycat_update",
            ),
            'activitycat_del'=>array(
                "text"=>$del_name,
                "allows"=>"activitycat_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'activity',
        'name'=>'活动管理',
        'base'=>array(
            'activity_view'=>array(
                "text"=>$view_name,
                "allows"=>"activity_run",
            ),
            'activity_add'=>array(
                "text"=>$add_name,
                "allows"=>"activity_add,activity_saveadd",
            ),
            'activity_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"activity_edit,activity_saveedit,activity_update",
            ),
            'activity_del'=>array(
                "text"=>$del_name,
                "allows"=>"activity_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'activitybespoke',
        'name'=>'活动预约',
        'base'=>array(
            'activitybespoke_view'=>array(
                "text"=>$view_name,
                "allows"=>"activitybespoke_run",
            ),
            'activitybespoke_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"activitybespoke_edit,activitybespoke_saveedit",
            ),
            'activitybespoke_del'=>array(
                "text"=>$del_name,
                "allows"=>"activitybespoke_del",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'mod_coupon',
        'name'=>'优惠券管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'couponcat',
        'name'=>'优惠券分类',
        'base'=>array(
            'couponcat_view'=>array(
                "text"=>$view_name,
                "allows"=>"couponcat_run",
            ),
            'couponcat_add'=>array(
                "text"=>$add_name,
                "allows"=>"couponcat_add,couponcat_saveadd",
            ),
            'couponcat_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"couponcat_edit,couponcat_saveedit,couponcat_update",
            ),
            'couponcat_del'=>array(
                "text"=>$del_name,
                "allows"=>"couponcat_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'coupon',
        'name'=>'优惠券',
        'base'=>array(
            'coupon_view'=>array(
                "text"=>$view_name,
                "allows"=>"coupon_run",
            ),
            'coupon_add'=>array(
                "text"=>$add_name,
                "allows"=>"coupon_add,coupon_saveadd",
            ),
            'coupon_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"coupon_edit,coupon_saveedit,coupon_update",
            ),
            'coupon_del'=>array(
                "text"=>$del_name,
                "allows"=>"coupon_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'couponcode',
        'name'=>'优惠券码',
        'base'=>array(
            'couponcode_view'=>array(
                "text"=>$view_name,
                "allows"=>"couponcode_run",
            ),
            'couponcode_del'=>array(
                "text"=>$del_name,
                "allows"=>"couponcode_del",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'mod_gallery',
        'name'=>'图库相册(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'gallerycat',
        'name'=>'相册分类',
        'base'=>array(
            'gallerycat_view'=>array(
                "text"=>$view_name,
                "allows"=>"gallerycat_run",
            ),
            'gallerycat_add'=>array(
                "text"=>$add_name,
                "allows"=>"gallerycat_add,gallerycat_saveadd",
            ),
            'gallerycat_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"gallerycat_edit,gallerycat_saveedit,gallerycat_update",
            ),
            'gallerycat_del'=>array(
                "text"=>$del_name,
                "allows"=>"gallerycat_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'gallery',
        'name'=>'相册管理',
        'base'=>array(
            'gallery_view'=>array(
                "text"=>$view_name,
                "allows"=>"gallery_run",
            ),
            'gallery_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"gallery_edit,gallery_saveedit,gallery_update",
            ),
            'gallery_del'=>array(
                "text"=>$del_name,
                "allows"=>"gallery_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'photo',
        'name'=>'相册图片',
        'base'=>array(
            'photo_view'=>array(
                "text"=>$view_name,
                "allows"=>"photo_run",
            ),
            'photo_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"photo_edit,photo_saveedit,photo_update",
            ),
            'photo_del'=>array(
                "text"=>$del_name,
                "allows"=>"photo_del",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'mod_dianping',
        'name'=>'点评管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'shopcomment',
        'name'=>'店铺点评',
        'base'=>array(
            'shopcomment_view'=>array(
                "text"=>$view_name,
                "allows"=>"shopcomment_run",
            ),
            'shopcomment_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"shopcomment_edit,shopcomment_saveedit,shopcomment_update",
            ),
            'shopcomment_del'=>array(
                "text"=>$del_name,
                "allows"=>"shopcomment_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'shopreply',
        'name'=>'店铺点评回复',
        'base'=>array(
            'shopreply_view'=>array(
                "text"=>$view_name,
                "allows"=>"shopreply_run",
            ),
            'shopreply_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"shopreply_edit,shopreply_saveedit,shopreply_update",
            ),
            'shopreply_del'=>array(
                "text"=>$del_name,
                "allows"=>"shopreply_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'shopwords',
        'name'=>'店铺留言',
        'base'=>array(
            'shopwords_view'=>array(
                "text"=>$view_name,
                "allows"=>"shopwords_run",
            ),
            'shopwords_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"shopwords_edit,shopwords_saveedit,shopwords_update",
            ),
            'shopwords_del'=>array(
                "text"=>$del_name,
                "allows"=>"shopwords_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'goodscomment',
        'name'=>'商品点评',
        'base'=>array(
            'goodscomment_view'=>array(
                "text"=>$view_name,
                "allows"=>"goodscomment_run",
            ),
            'goodscomment_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"goodscomment_edit,goodscomment_saveedit,goodscomment_update",
            ),
            'goodscomment_del'=>array(
                "text"=>$del_name,
                "allows"=>"goodscomment_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'goodsreply',
        'name'=>'商品点评回复',
        'base'=>array(
            'goodsreply_view'=>array(
                "text"=>$view_name,
                "allows"=>"goodsreply_run",
            ),
            'goodsreply_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"goodsreply_edit,goodsreply_saveedit,goodsreply_update",
            ),
            'goodsreply_del'=>array(
                "text"=>$del_name,
                "allows"=>"goodsreply_del",
            ),
        ),
    );
    /*-------------------- shop End ---------------------*/

    /*-------------------- order Begin ---------------------*/
    $roles_elements[] = array(
        'mod'=>'menu_order', //模块
        'name'=>'订单模块(头部导航)↓', //头部菜单模块
    );
    $roles_elements[] = array(
        'mod'=>'mod_order',
        'name'=>'订单管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'order',
        'name'=>'订单管理',
        'base'=>array(
            'order_view'=>array(
                "text"=>$view_name,
                "allows"=>"order_run,order_view",
            ),
            'order_del'=>array(
                "text"=>$del_name,
                "allows"=>"order_del",
            ),
			'order_cancel'=>array(
                "text"=>"取消购物订单",
                "allows"=>"order_cancel",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'mod_cart',
        'name'=>'购物车(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'cart',
        'name'=>'购物车',
        'base'=>array(
            'cart_view'=>array(
                "text"=>$view_name,
                "allows"=>"cart_run",
            ),
            'cart_del'=>array(
                "text"=>$del_name,
                "allows"=>"cart_del",
            ),
        ),
    );
    /*-------------------- order End ---------------------*/


    /*-------------------- content Begin ---------------------*/
    $roles_elements[] = array(
        'mod'=>'menu_content', //模块
        'name'=>'内容模块(头部导航)↓', //头部菜单模块
    );


    $roles_elements[] = array(
        'mod'=>'mod_article',
        'name'=>'文章管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'articlecat',
        'name'=>'文章分类',
        'base'=>array(
            'articlecat_view'=>array(
                "text"=>$view_name,
                "allows"=>"articlecat_run",
            ),
            'articlecat_add'=>array(
                "text"=>$add_name,
                "allows"=>"articlecat_add,articlecat_saveadd",
            ),
            'articlecat_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"articlecat_edit,articlecat_saveedit,articlecat_update",
            ),
            'articlecat_del'=>array(
                "text"=>$del_name,
                "allows"=>"articlecat_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'article',
        'name'=>'文章资讯',
        'base'=>array(
            'article_view'=>array(
                "text"=>$view_name,
                "allows"=>"article_run",
            ),
            'article_add'=>array(
                "text"=>$add_name,
                "allows"=>"article_add,article_saveadd",
            ),
            'article_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"article_edit,article_saveedit,article_update",
            ),
            'article_del'=>array(
                "text"=>$del_name,
                "allows"=>"article_del",
            ),
        ),
    );


    $roles_elements[] = array(
        'mod'=>'mod_sale',
        'name'=>'营销管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'smstpl',
        'name'=>'短信模板',
        'base'=>array(
            'smstpl_view'=>array(
                "text"=>$view_name,
                "allows"=>"smstpl_run",
            ),
            'smstpl_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"smstpl_edit,smstpl_saveedit",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'mailtpl',
        'name'=>'邮件模板',
        'base'=>array(
            'mailtpl_view'=>array(
                "text"=>$view_name,
                "allows"=>"mailtpl_run",
            ),
            'mailtpl_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"mailtpl_edit,mailtpl_saveedit",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'msg',
        'name'=>'站内消息',
        'base'=>array(
            'msg_view'=>array(
                "text"=>$view_name,
                "allows"=>"msg_run,msg_view",
            ),
            'msg_del'=>array(
                "text"=>$del_name,
                "allows"=>"msg_del",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'mod_ads',
        'name'=>'广告管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'zone',
        'name'=>'广告版位',
        'base'=>array(
            'zone_view'=>array(
                "text"=>$view_name,
                "allows"=>"zone_run",
            ),
            'zone_add'=>array(
                "text"=>$add_name,
                "allows"=>"zone_add,zone_saveadd",
            ),
            'zone_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"zone_edit,zone_saveedit",
            ),
            'zone_del'=>array(
                "text"=>$del_name,
                "allows"=>"zone_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'myads',
        'name'=>'广告图',
        'base'=>array(
            'myads_view'=>array(
                "text"=>$view_name,
                "allows"=>"myads_run",
            ),
            'myads_add'=>array(
                "text"=>$add_name,
                "allows"=>"myads_add,myads_saveadd",
            ),
            'myads_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"myads_edit,myads_saveedit",
            ),
            'myads_del'=>array(
                "text"=>$del_name,
                "allows"=>"myads_del",
            ),
        ),
    );

    $roles_elements[] = array(
        'mod'=>'mod_about',
        'name'=>'单页管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'aboutcat',
        'name'=>'单页分类',
        'base'=>array(
            'aboutcat_view'=>array(
                "text"=>$view_name,
                "allows"=>"aboutcat_run",
            ),
            'aboutcat_add'=>array(
                "text"=>$add_name,
                "allows"=>"aboutcat_add,aboutcat_saveadd",
            ),
            'aboutcat_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"aboutcat_edit,aboutcat_saveedit,aboutcat_update",
            ),
            'zone_del'=>array(
                "text"=>$del_name,
                "allows"=>"aboutcat_del",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'about',
        'name'=>'单页内容',
        'base'=>array(
            'about_view'=>array(
                "text"=>$view_name,
                "allows"=>"about_run",
            ),
            'about_add'=>array(
                "text"=>$add_name,
                "allows"=>"about_add,about_saveadd",
            ),
            'about_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"about_edit,about_saveedit,about_update",
            ),
            'about_del'=>array(
                "text"=>$del_name,
                "allows"=>"about_del",
            ),
        ),
    );
    /*-------------------- content End ---------------------*/


    /*-------------------- business Begin ---------------------*/
    $roles_elements[] = array(
        'mod'=>'menu_business', //模块
        'name'=>'业务模块(头部导航)↓', //头部菜单模块
    );


    $roles_elements[] = array(
        'mod'=>'mod_finance',
        'name'=>'财务管理(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'payorder',
        'name'=>'在线支付记录',
        'base'=>array(
            'payorder_view'=>array(
                "text"=>$view_name,
                "allows"=>"payorder_run",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'shopvip',
        'name'=>'店铺升级记录',
        'base'=>array(
            'shopvip_view'=>array(
                "text"=>$view_name,
                "allows"=>"shopvip_run",
            ),
        ),
        'other'=>array(
            'shopvip_vip'=>array(
                "text"=>"购买店铺等级",
                "allows"=>"shopvip_vip,shopvip_buy"
            ),
            'shopvip_edit'=>array(
                "text"=>"修改店铺等级",
                "allows"=>"shop_edit"
            ),
            'shopvip_cancel'=>array(
                "text"=>"取消店铺等级",
                "allows"=>"shopvip_cancel"
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'money',
        'name'=>'帐户余额',
        'base'=>array(
            'money_view'=>array(
                "text"=>$view_name,
                "allows"=>"money_run",
            ),
            'money_add'=>array(
                "text"=>$add_name,
                "allows"=>"money_add,money_saveadd",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'withdraw',
        'name'=>'提现管理',
        'base'=>array(
            'withdraw_view'=>array(
                "text"=>$view_name,
                "allows"=>"withdraw_run,withdraw_view",
            ),
            'withdraw_edit'=>array(
                "text"=>$edit_name,
                "allows"=>"withdraw_edit,withdraw_saveedit",
            ),
            'withdraw_del'=>array(
                "text"=>$del_name,
                "allows"=>"withdraw_del",
            ),
        ),
    );
	$roles_elements[] = array(
        'mod'=>'ordersettle',
        'name'=>'订单结算',
        'base'=>array(
            'ordersettle_view'=>array(
                "text"=>$view_name,
                "allows"=>"ordersettle_run,ordersettle_view",
            ),
            'ordersettle_settle'=>array(
                "text"=>"购物订单结算",
                "allows"=>"ordersettle_settle",
            ),
        ),
    );



    $roles_elements[] = array(
        'mod'=>'mod_report',
        'name'=>'报表分析(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'reportuser',
        'name'=>'会员报表',
        'base'=>array(
            'reportuser_view'=>array(
                "text"=>$view_name,
                "allows"=>"reportuser_run,reportuser_moremonths",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'reportshop',
        'name'=>'商家报表',
        'base'=>array(
            'reportshop_view'=>array(
                "text"=>$view_name,
                "allows"=>"reportshop_run,reportshop_moremonths",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'reportpay',
        'name'=>'在线支付报表',
        'base'=>array(
            'reportpay_view'=>array(
                "text"=>$view_name,
                "allows"=>"reportpay_run,reportpay_moremonths",
            ),
        ),
    );
    /*-------------------- content End ---------------------*/


    /*-------------------- other Begin ---------------------*/
    $roles_elements[] = array(
        'mod'=>'menu_other', //模块
        'name'=>'其他模块(头部导航)↓', //头部菜单模块
    );


    $roles_elements[] = array(
        'mod'=>'mod_log',
        'name'=>'系统日志(左边一级菜单)→↓', //一级菜单
    );
    $roles_elements[] = array(
        'mod'=>'logadmin',
        'name'=>'管理日志',
        'base'=>array(
            'logadmin_view'=>array(
                "text"=>$view_name,
                "allows"=>"logadmin_run",
            ),
            'logadmin_del'=>array(
                "text"=>$del_name,
                "allows"=>"logadmin_del,logadmin_delall",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'loguser',
        'name'=>'会员日志',
        'base'=>array(
            'loguser_view'=>array(
                "text"=>$view_name,
                "allows"=>"loguser_run",
            ),
            'loguser_del'=>array(
                "text"=>$del_name,
                "allows"=>"loguser_del,loguser_delall",
            ),
        ),
    );
    $roles_elements[] = array(
        'mod'=>'logshop',
        'name'=>'商家日志',
        'base'=>array(
            'logshop_view'=>array(
                "text"=>$view_name,
                "allows"=>"logshop_run",
            ),
            'logshop_del'=>array(
                "text"=>$del_name,
                "allows"=>"logshop_del,logshop_delall",
            ),
        ),
    );
    /*-------------------- other End ---------------------*/
    return $roles_elements;
}
?>