예제 #1
0
/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.cn/ ShopEx License
 */
function theme_widget_items_category(&$setting)
{
    // 判断是否首页
    if (route::currentRouteName() == 'topc') {
        $returnData['isindex'] = true;
    }
    if (false && base_kvstore::instance('topc_category')->fetch('category_ex_vertical_widget.data', $cat_list)) {
        return $cat_list;
    }
    $returnData['data'] = app::get('topc')->rpcCall('category.cat.get.list', array('fields' => 'cat_id,cat_name'));
    return $returnData;
}
예제 #2
0
 public function handle($request, Clousure $next)
 {
     $routeAs = route::currentRouteName();
     $currentPermission = shopAuth::getSellerPermission();
     //$currentPermission = false 表示为店主不用判断权限
     //获取当前用户的路由权限
     if ($currentPermission && !in_array($routeAs, $currentPermission)) {
         if (request::ajax()) {
             return response::json(array('error' => true, 'message' => '无操作权限'));
         } else {
             return redirect::action('topshop_ctl_index@nopermission');
         }
     }
     return $next($request);
 }
예제 #3
0
/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.cn/ ShopEx License
 */
function theme_widget_index_category(&$setting)
{
    // 判断是否首页
    $A = route::currentRouteName();
    //var_dump($_SERVER);
    if (route::currentRouteName() == 'topc' || $_SERVER["ORIG_PATH_INFO"] == "/index.php/trading" || $_SERVER["DOCUMENT_URI"] == "/index.php/trading") {
        $returnData['isindex'] = true;
    }
    if (false && base_kvstore::instance('topc_category')->fetch('category_ex_vertical_widget.data', $cat_list)) {
        return $cat_list;
    }
    $returnData['data'] = app::get('topc')->rpcCall('category.cat.get.list', array('fields' => 'cat_id,cat_name'));
    //var_dump($returnData);
    return $returnData;
}