protected function render($template, $args = array(), $engine = NULL, $headers = array()) { $action1 = $this->action('home/index', '首页'); $action2 = $this->action('product/index', '产品&服务'); $action3 = $this->action('solution/index', '解决方案'); $action4 = $this->action('service/index', '服务中心'); $action5 = $this->action('about/index', '关于我们'); $navigation = array($action1, $action2, $action3, $action4, $action5); $args['username'] = $this->request->session('username'); $args['global_permissions'] = $this->request->session('global_permissions'); $args['navi'] = $navigation; return parent::render($template, $args, $engine, $headers); }
protected function render($template, $args = array(), $engine = null, $headers = array()) { $this->merchant = $this->tool->model('merchant'); $merchant = $this->merchant->load($this->merchant->getCurrentMerchantID()); $this->request->session('bestpay_username', $merchant->name); $url = \Clips\site_url('user/logout', true); $uc_site = 'http://user.pinet.co/api/login?appid=4000&template=user&callback=' . \Clips\site_url('user/register', true); if ($merchant) { $head = $this->actions(array('home/index', 'Welcome to yibai'), array('user/orders', $merchant->name), array($url, 'Sign Out', 'external')); } else { $head = $this->actions(array('home/index', 'Welcome to yibai')); } $actions = $this->actions(array('admin/coupon/check")', 'Check Coupon'), array('admin/coupon/status")', 'Coupon Voucher Status'), array('admin/coupon/record', 'Checked Coupon Record')); $navigation = $this->actions(array('admin/coupon/check', 'Check Coupon'), array('admin/merchant/orders', 'Customers Management'), array('alert("Not Implemented yet!")', 'My Shop', 'client')); $args['navi'] = $navigation; $args['actions'] = $actions; $args['head'] = $head; return parent::render($template, $args, $engine, $headers); }
protected function render($template, $args = array(), $engine = null, $headers = array()) { // var_dump($_SESSION);die; $uc_site = 'http://user.pinet.co/api/login?appid=4000&template=user&callback=' . \Clips\site_url('user/register', true); $uid = $this->request->session('bestpay_username'); $user_id = $this->request->session('user_id'); $url = \Clips\site_url('user/logout', true); \Clips\context('jquery_init', <<<TEXT \t//==================================== \t// Initializing Sliders \t//==================================== \t//\t\$(".btn-default").on('click', function (e) { \t//\t\talert("Not Implemented yet!"); \t//\t}); \t//==================================== \t// Other Events \t//==================================== TEXT , true); if (isset($user_id)) { $actions = $this->actions(array('home/index', 'Welcome to yibai'), array('user/orders', $uid), array($url, 'Sign Out', 'external')); } else { $actions = $this->actions(array('home/index', 'Welcome to yibai'), array($uc_site, 'Login', 'external')); } $action1 = $this->action('home/index', 'Home'); $action2 = $this->action('mall/index', 'Mall'); $action3 = $this->action('coupon/index', 'Card Coupon'); $action4 = $this->action('car/index', 'Car'); $action5 = $this->action('people/index', 'People'); $navigation = array($action1, $action2, $action3, $action4, $action5); if (isset($uid)) { $carts = $this->actions(array('cart/index', 'Cart')); } else { $carts = $this->actions(array($uc_site, 'Login', 'external')); } $args['navi'] = $navigation; $args['actions'] = $actions; $args['cart'] = $carts; $my_order_url = \Clips\site_url('user/orders', true); $my_address = \Clips\site_url('user/my_address', true); $my_coupon = \Clips\site_url('user/my_coupon', true); $search_url = \Clips\site_url('search/search', true); // $key = $this->request->session('search_key'); // $args['key'] = $key; $args['search_url'] = $search_url; if (isset($uid)) { $args['my_bestpay'] = $this->actions(array($my_order_url, 'My order', 'external'), array($my_address, 'Delivery Address', 'external'), array($my_coupon, 'My Coupon', 'external')); } else { $args['my_bestpay'] = $this->actions(array($uc_site, 'My order', 'external'), array($uc_site, 'Delivery Address', 'external'), array($uc_site, 'My Coupon', 'external')); } $this->cart = $this->tool->model('cart'); if (isset($user_id)) { $args['cart'] = $this->cart->getCartCount($user_id); $args['cart']->jump_url = \Clips\site_url('order/confirm?spm=15gpk'); $args['cart']->post_url = \Clips\site_url('order/confirm?spm=16gtp'); $args['cart']->cart_count = count($this->cart->getProductsByCart($user_id)) - 1; $args['cart']->user_id = $user_id; } $args['productByCart'] = $this->cart->getProductsByCart($user_id); $count = count($this->cart->getProductsByCart($user_id)); for ($i = 0; $i < $count; $i++) { $args['productByCart'][$i]->cart_count = count($this->cart->getProductsByCart($user_id)) - 1; } return parent::render($template, $args, $engine, $headers); }