function img($params) { if (is_string($params)) { $params = array('src' => $params); } if (empty($params['app'])) { throw new \InvalidArgumentException('img tag missing app argument. detail:' . $params['src']); } $app = app::get($params['app']); $app_id = $app->app_id; if (!isset($this->_imgbundle[$app_id])) { $bundleinfo = array(); //base_kvstore::instance('imgbundle')->fetch('imgbundle_' . $app_id, $bundleinfo); $this->_imgbundle[$app_id] = (array) $bundleinfo; } if (is_array($this->_imgbundle[$app_id]['info']) && array_key_exists($params['src'], $this->_imgbundle[$app_id]['info'])) { $img_info = $this->_imgbundle[$app_id]['info'][$params['src']]; $params['lib'] = kernel::base_url(1) . '/images/' . $this->_imgbundle[$app_id]['bundleimg'] . '?' . $this->_imgbundle[$app_id]['mtime']; $params['src'] = app::get('base')->res_url . '/images/transparent.gif'; $style = "background-image:url({$params['lib']});background-position:0 {$img_info[0]}px;width:{$img_info[1]}px;height:{$img_info[2]}px"; $params['style'] = $params['style'] ? $params['style'] . ';' . $style : $style; $params['class'] = $params['class'] ? 'imgbundle ' . $params['class'] : 'imgbundle'; } else { $params['src'] = $app->res_url . '/images/' . $params['src']; } unset($params['lib']); return utils::buildTag($params, 'img'); }
/** * * @auther ShopEx UED Jxwinter * @date 2011-11-18 * @copyright Copyright (c) 2005-2012 ShopEx Technologies Inc. (http://www.shopex.cn) * */ function theme_widget_ad_slide(&$setting, &$system) { $setting['allimg'] = ""; $setting['allurl'] = ""; if ($system->theme) { $theme_dir = kernel::base_url() . '/themes/' . $smarty->theme; } else { $theme_dir = kernel::base_url() . '/themes/' . app::get('site')->getConf('current_theme'); } if (!$setting['pic']) { foreach ($setting['img'] as $value) { $setting['allimg'] .= $rvalue . "|"; $setting['allurl'] .= urlencode($value["url"]) . "|"; } } else { foreach ($setting['pic'] as $key => $value) { if ($value['link']) { if ($value["url"]) { $value["linktarget"] = $value["url"]; } $setting['allimg'] .= $rvalue . "|"; $setting['allurl'] .= urlencode($value["linktarget"]) . "|"; $setting['pic'][$key]['link'] = str_replace('%THEME%', $theme_dir, $value['link']); } } } return $setting; }
/** * 构造方法 * @param null * @return boolean */ public function __construct($app) { parent::__construct($app); // $this->notify_url = kernel::openapi_url('openapi.ectools_payment/parse/weixin/weixin_payment_plugin_wxpay_server', 'callback'); $this->notify_url = kernel::base_url(1) . '/index.php/openapi/weixin/wxpay'; #test // $this->notify_url = kernel::base_url(1).'/index.php/wap/paycenter-wxpay.html'; if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->notify_url, $matches)) { $this->notify_url = str_replace('http://', '', $this->notify_url); $this->notify_url = preg_replace("|/+|", "/", $this->notify_url); $this->notify_url = "http://" . $this->notify_url; } else { $this->notify_url = str_replace('https://', '', $this->notify_url); $this->notify_url = preg_replace("|/+|", "/", $this->notify_url); $this->notify_url = "https://" . $this->notify_url; } $this->callback_url = kernel::openapi_url('openapi.ectools_payment/parse/weixin/weixin_payment_plugin_wxpay', 'callback'); if (preg_match("/^(http):\\/\\/?([^\\/]+)/i", $this->callback_url, $matches)) { $this->callback_url = str_replace('http://', '', $this->callback_url); $this->callback_url = preg_replace("|/+|", "/", $this->callback_url); $this->callback_url = "http://" . $this->callback_url; } else { $this->callback_url = str_replace('https://', '', $this->callback_url); $this->callback_url = preg_replace("|/+|", "/", $this->callback_url); $this->callback_url = "https://" . $this->callback_url; } // $this->submit_url = $this->gateway; // $this->submit_method = 'GET'; $this->submit_charset = 'UTF-8'; $this->signtype = 'sha1'; }
/** * 头部 */ function function_header() { $ret = '<base href="' . kernel::base_url(1) . '"/>'; $path = app::get('site')->res_url; $debug_css = defined('DEBUG_CSS') && constant('DEBUG_CSS'); $debug_js = defined('DEBUG_JS') && constant('DEBUG_JS'); $css_mini = $debug_css ? '' : '_mini'; $cssver = kernel::single('base_component_ui')->getVer($debug_css); $jsver = kernel::single('base_component_ui')->getVer($debug_js); if (!defined("DONOTUSE_CSSFRAMEWORK") || !constant('DONOTUSE_CSSFRAMEWORK')) { $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/typical.css' . $cssver . '" />'; } $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/widgets_edit.css' . $cssver . '" />'; $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'site', 'pdir' => 'js_mini')); $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'b2c', 'pdir' => 'js_mini')); if ($debug_js) { $ret .= '<script src="' . $path . '/js/mootools.js?' . $jsver . '"></script> <script src="' . $path . '/js/moomore.js' . $jsver . '"></script> <script src="' . $path . '/js/jstools.js' . $jsver . '"></script> <script src="' . $path . '/js/switchable.js' . $jsver . '"></script> <script src="' . $path . '/js/dragdropplus.js' . $jsver . '"></script> <script src="' . $path . '/js/shopwidgets.js' . $jsver . '"></script>'; } else { $ret .= '<script src="' . $path . '/js_mini/moo.min.js' . $jsver . '"></script> <script src="' . $path . '/js_mini/ui.min.js' . $jsver . '"></script> <script src="' . $path . '/js_mini/shopwidgets.min.js' . $jsver . '"></script>'; } foreach (kernel::serviceList('site_theme_view_helper') as $service) { if (method_exists($service, 'function_header')) { $ret .= $service->function_header(); } } return $ret; }
function post_login() { $url = $this->gen_url(array('app' => 'b2c', 'ctl' => 'site_member', 'act' => 'index')); $userPassport = kernel::single('b2c_user_passport'); $member_id = $userPassport->userObject->get_member_id(); if ($member_id) { $b2c_members_model = app::get('b2c')->model('members'); $member_point_model = app::get('b2c')->model('member_point'); $member_data = $b2c_members_model->getList('member_lv_id,experience,point', array('member_id' => $member_id)); if (!$member_data) { $this->splash('failed', null, app::get('b2c')->_('数据异常,请联系客服')); } $member_data = $member_data[0]; $member_data['order_num'] = app::get('b2c')->model('orders')->count(array('member_id' => $member_id)); if (app::get('b2c')->getConf('site.level_switch') == 1 && $member_data['experience']) { $member_data['member_lv_id'] = $b2c_members_model->member_lv_chk($member_data['member_lv_id'], $member_data['experience']); } if (app::get('b2c')->getConf('site.level_switch') == 0 && $member_data['point']) { $member_data['member_lv_id'] = $member_point_model->member_lv_chk($member_id, $member_data['member_lv_id'], $member_data['point']); } $b2c_members_model->update($member_data, array('member_id' => $member_id)); #$userPassport->userObject->set_member_session($member_id); $this->bind_member($member_id); app::get('b2c')->model('cart_objects')->setCartNum(); $url = $userPassport->get_next_page(); if (!$url) { $url = $this->gen_url(array('app' => 'b2c', 'ctl' => 'site_member', 'act' => 'index')); } $this->splash('success', $url); } else { $this->splash('failed', kernel::base_url(1), app::get('b2c')->_('参数错误')); } }
/** * 头部 */ function function_header() { $ret = '<base href="' . kernel::base_url(1) . '"/>'; $path = app::get('site')->res_url; $css_min = defined('DEBUG_CSS') && constant('DEBUG_CSS') ? '' : '_min'; $css_mini = $css_min ? '_mini' : ''; $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_min . '/framework.css" type="text/css" />'; $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/widgets_edit.css" type="text/css" />'; $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'site')); if (defined('DEBUG_JS') && constant('DEBUG_JS')) { $ret .= '<script src="' . $path . '/js/mootools.js?' . time() . '"></script> <script src="' . $path . '/js/moomore.js?' . time() . '"></script> <script src="' . $path . '/js/jstools.js?' . time() . '"></script> <script src="' . $path . '/js/coms/switchable.js?' . time() . '"></script> <script src="' . $path . '/js/dragdropplus.js?' . time() . '"></script> <script src="' . $path . '/js/shopwidgets.js?' . time() . '"></script>'; } else { $ret .= '<script src="' . $path . '/js_mini/moo_min.js"></script> <script src="' . $path . '/js_mini/switchable_min.js"></script> <script src="' . $path . '/js_mini/shopwidgets_min.js"></script>'; } foreach (kernel::serviceList('site_theme_view_helper') as $service) { if (method_exists($service, 'function_header')) { $ret .= $service->function_header(); } } return $ret; }
function add() { if (empty($this->license_id)) { $result = array('rsp' => 'fail', 'err_msg' => '授权证书无效'); return $result; } $shopname = app::get('site')->getConf('site.name'); $host_url = kernel::base_url(1); $params['method'] = 'denglu.site.add'; $params['license_id'] = $this->license_id; $params['entid'] = $this->entid; $params['name'] = $shopname; $params['url'] = $host_url; $params['token_url'] = $host_url . '/index.php/trust-callback.html'; $params['webtype'] = $this->webtype; $params['timestamp'] = time(); $params['sign_method'] = 'md5'; $params['v'] = '1.0'; $make_sign = kernel::single('openid_sign')->get_ce_sign($params, $this->license_key); $params['sign'] = $make_sign; $this->net = kernel::single('base_httpclient'); $result = $this->net->post($this->commit_url, $params); $result = json_decode($result, true); if ($result['rsp'] == 'succ') { app::get('openid')->setConf('appid', $result['data']['appid']); app::get('openid')->setConf('appkey', $result['data']['appkey']); } return $result; }
function flush() { $base_url = kernel::base_url(); foreach ($this->db->select('select queue_id from sdb_base_queue limit ' . $this->limit) as $r) { $this->runtask($r['queue_id']); } }
public function install() { $ident = $this->_request->get_get('ident'); $downObj = kernel::single('site_utility_download'); $task_info = $downObj->get_task($ident); if (empty($task_info)) { $this->_error(); } $file = $downObj->get_work_dir() . '/' . $ident . '/' . $task_info['name']; $msg = __('无法找到安装文件'); if (is_file($file)) { $fileInfo['tmp_name'] = $file; $fileInfo['name'] = time(); $fileInfo['error'] = '0'; $fileInfo['size'] = filesize($file); $themeInstallObj = kernel::single('site_theme_install'); $res = $themeInstallObj->install($fileInfo, $msg); } if ($res) { $img = kernel::base_url(1) . '/themes/' . $res['theme'] . '/preview.jpg'; $this->pagedata['img'] = '<img src="' . $img . '" />'; $this->pagedata['msg'] = __('模板安装成功,您可以在模板列表中启用它。'); } else { $this->pagedata['msg'] = $msg; } $this->singlepage('admin/download/result.html'); }
function index() { $mobileshop_url = $this->app->getConf('mobileshop.url'); $mobileshop_token = $this->app->getConf('mobileshop.token'); if (!empty($mobileshop_url)) { $wlshop = app::get('b2c')->model('shop'); $node_ids = $wlshop->getList('node_id', array('node_type' => 'shopex_wmall', 'status' => 'bind')); foreach ($node_ids as $value) { if (!empty($value['node_id'])) { $node_id = $value['node_id']; } } $callinfo['node_id'] = $node_id; $callinfo['shop_url'] = kernel::base_url(1) . kernel::url_prefix() . "/"; $callinfo['shop_license'] = base_certificate::get('certificate_id'); $callinfo['shop_node'] = base_shopnode::node_id('b2c'); $callinfo['shop_name'] = app::get('site')->getConf('site.name'); $callinfo['type'] = '1'; $callinfo['sign'] = $this->get_sign($callinfo, $mobileshop_token); $this->pagedata['ifseturl'] = 1; $this->pagedata['node_id'] = $callinfo['node_id']; $this->pagedata['type'] = $callinfo['type']; $this->pagedata['shop_license'] = $callinfo['shop_license']; $this->pagedata['shop_node'] = $callinfo['shop_node']; $this->pagedata['shop_url'] = $callinfo['shop_url']; $this->pagedata['shop_name'] = $callinfo['shop_name']; $this->pagedata['sign'] = $callinfo['sign']; $this->pagedata['mobileshop_url'] = $mobileshop_url; } else { $this->pagedata['ifseturl'] = 0; } $this->page('admin/index.html'); }
public function function_wapfooter($params, &$smarty) { $footers = $smarty->pagedata['footers']; if (is_array($footers)) { foreach ($footers as $footer) { $html .= $footer; } } else { $html .= $footers; } $html .= app::get('wap')->getConf('wap.foot_edit'); $obj = kernel::service('site_footer_copyright'); if (is_object($obj) && method_exists($obj, 'get')) { $html .= $obj->get(); } else { if (!defined('WITHOUT_POWERED') || !constant('WITHOUT_POWERED')) { $html .= ecos_cactus('wap', 'wapcopyr', $html); } } if (isset($_COOKIE['wap']['preview']) && $_COOKIE['wap']['preview'] == 'true') { $base_dir = kernel::base_url(); $remove_cookie = "\$.fn.cookie('wap[preview]','',{path:'" . $base_dir . "/'});\$(document.body).removeClass('set-margin-body');"; $set_window = '$("body").addClass("set-margin-body");moveTo(0,0);resizeTo(screen.availWidth,screen.availHeight);'; $html .= '<style>body.set-margin-body{margin-top:36px;}#_theme_preview_tip_ {width:100%; position: absolute; left: 0; top: 0; background: #FCE2BC; height: 25px; line-height: 25px; padding: 5px 0; border-bottom: 1px solid #FF9900;box-shadow: 0 2px 5px #CCCCCC; }#_theme_preview_tip_ span.msg { float: left; _display: inline;zoom:1;line-height: 25px;margin-left:10px;padding:0; }#_theme_preview_tip_ a.btn {vertical-align:middle; color:#333;float: right; margin:0 10px; }</style><div id="_theme_preview_tip_"><span class="msg">' . app::get('site')->_('目前正在预览模式') . '</span><a href="javascript:void(0);" class="btn" onclick="' . $remove_cookie . 'location.reload();"><span><span>' . app::get('site')->_('退出预览') . '</span></span></a></div>'; $html .= '<script>' . $set_window . '$(window).on("unload",function(){' . $remove_cookie . '});</script>'; } $html .= $smarty->fetch('footer.html', app::get('wap')->app_id); $icp = app::get('site')->getConf('system.site_icp'); if ($icp) { $html .= '<div style="text-align: center;">' . $icp . '</div>'; } return $html; }
function index() { if (defined('APP_SITE_INDEX_MAXAGE') && APP_SITE_INDEX_MAXAGE > 1) { $this->set_max_age(APP_SITE_INDEX_MAXAGE); } //todo: 首页max-age设定 if (kernel::single('site_theme_base')->theme_exists()) { $obj = kernel::service('site_index_seo'); if (is_object($obj) && method_exists($obj, 'title')) { $title = $obj->title(); } else { $title = app::get('site')->getConf('site.name') ? app::get('site')->getConf('site.name') : app::get('site')->getConf('page.default_title'); } if (is_object($obj) && method_exists($obj, 'keywords')) { $keywords = $obj->keywords(); } else { $keywords = app::get('site')->getConf('page.default_keywords') ? app::get('site')->getConf('page.default_keywords') : $title; } if (is_object($obj) && method_exists($obj, 'description')) { $description = $obj->description(); } else { $description = app::get('site')->getConf('page.default_description') ? app::get('site')->getConf('page.default_description') : $title; } $this->pagedata['headers'][] = '<title>' . htmlspecialchars($title) . '</title>'; $this->pagedata['headers'][] = '<meta name="keywords" content="' . htmlspecialchars($keywords) . '" />'; $this->pagedata['headers'][] = '<meta name="description" content="' . htmlspecialchars($description) . '" />'; $this->pagedata['headers'][] = "<link rel='icon' href='{$this->app->res_url}/favicon.ico' type='image/x-icon' />"; $this->pagedata['headers'][] = "<link rel='shortcut icon' href='{$this->app}->res_url/favicon.ico' type='image/x-icon' />"; $GLOBALS['runtime']['path'][] = array('title' => app::get('b2c')->_('首页'), 'link' => kernel::base_url(1)); $this->set_tmpl('index'); $this->page('index.html'); } else { $this->display('splash/install_template.html'); } }
function function_wapheader() { $ret = '<base href="' . kernel::base_url(1) . '"/>'; $path = app::get('wap')->res_full_url; $css_mini = defined('DEBUG_CSS') && constant('DEBUG_CSS') ? '' : '_mini'; $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/widgets_edit.css" type="text/css" />'; $ret .= '<link rel="stylesheet" href="' . $path . '/css' . $css_mini . '/styles.css" type="text/css" />'; $ret .= kernel::single('base_component_ui')->lang_script(array('src' => 'lang.js', 'app' => 'site')); if (defined('DEBUG_JS') && constant('DEBUG_JS')) { $ret .= '<script src="' . $path . '/js/mootools.js?' . time() . '"></script> <script src="' . $path . '/js/moomore.js?' . time() . '"></script> <script src="' . $path . '/js/jstools.js?' . time() . '"></script> <script src="' . $path . '/js/switchable.js?' . time() . '"></script> <script src="' . $path . '/js/dragdropplus.js?' . time() . '"></script> <script src="' . $path . '/js/shopwidgets.js?' . time() . '"></script>'; } else { $ret .= '<script src="' . $path . '/js_mini/moo.min.js"></script> <script src="' . $path . '/js_mini/ui.min.js"></script> <script src="' . $path . '/js_mini/shopwidgets.min.js"></script>'; } //$ret.='<script src="'.$path.'/js_mini/patch.js"></script>'; if ($theme_info = app::get('wap')->getConf('wap.theme_' . app::get('wap')->getConf('current_theme') . '_color')) { $theme_color_href = kernel::base_url(1) . '/wap_themes/' . app::get('wap')->getConf('current_theme') . '/' . $theme_info; $ret .= "<script>\n window.addEvent('domready',function(){\n new Element('link',{href:'" . $theme_color_href . "',type:'text/css',rel:'stylesheet'}).inject(document.head);\n });\n </script>"; } return $ret; }
public function column_preview($row) { $dir = WAP_THEME_DIR . '/' . $row[$this->col_prefix . 'theme']; if (is_dir($dir)) { $current_theme = kernel::single('wap_theme_base')->get_default(); $current_sytle = kernel::single('wap_theme_base')->get_theme_style($row[$this->col_prefix . 'theme']); $preview = $current_sytle['preview'] ? $current_sytle['preview'] : 'preview.jpg'; $_tm = $row[$this->col_prefix . 'theme']; $_active = $_tm == $current_theme; if ($_active) { $style_addon = "border:2px solid #6888C8; border-bottom:none"; $style_addon2 = "border-color:#6888C8;"; } $theme_url = defined('THEMES_IMG_URL') ? THEMES_IMG_URL : kernel::base_url(1) . '/wap_themes'; $_html = sprintf('<div onmouseover="$(this).set(\'detail\',$(this).getParent(\'.row\').getElement(\'.btn-detail-open\').get(\'detail\'));" style="border:2px solid #E4EAF1; width: 120px; height: 140px;cursor:pointer;text-align:center;overflow:hidden; background:#fff;' . $style_addon . '"><img onload="$(this).zoomImg (120,136);" src="%s" id="%s" style="float:none"></div>', $theme_url . "/" . $row[$this->col_prefix . 'theme'] . '/' . $preview . '?' . time(), $row[$this->col_prefix . 'theme'] . '_img'); $_html .= '<div style="width:120px;line-height:20px; background:#E4EAF1; border:2px solid #E4EAF1;' . $style_addon2 . '">'; if ($_active) { $_html .= '<div class="t-c" style="font-weight:bold; color:#fff; background:#6888C8; ">' . app::get('wap')->_('已启用') . '</div>'; } else { $_html .= '<div class="t-c" style=""><a style="color:#000" href="index.php?app=wap&ctl=admin_theme_manage&act=set_default&theme=' . $_tm . '&finder_id=' . $_GET['_finder']['finder_id'] . '">' . app::get('wap')->_('启用此模板') . '</a></div>'; } $_html .= '</div>'; return $_html; } else { return '<div>' . app::get('wap')->_('模板目录已被移除') . '</div>'; } }
function function_footer($params, &$smarty) { if (app::get('openid')->is_actived()) { $smarty->pagedata['openid_open'] = 'true'; $Certid = base_certificate::get('certificate_id'); $smarty->pagedata['cert_id'] = $Certid; $smarty->pagedata['openid_lg_url'] = kernel::base_url(1); } else { $smarty->pagedata['openid_open'] = 'false'; } $smarty->pagedata['login_type'] = app::get('b2c')->getConf('site.login_type'); $smarty->pagedata['app'] = app::get('b2c')->getConf('site.login_type'); if ($smarty->app->app_id != 'b2c') { $shop['url']['region'] = app::get('site')->router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_tools', 'act' => 'selRegion')); $shop['url']['placeholder'] = app::get('b2c')->res_url . '/images/imglazyload.gif'; $smarty->pagedata['shopDefine'] = json_encode($shop); } foreach (kernel::servicelist('b2c.footer.shop.set.extends') as $obj) { if (method_exists($obj, 'header_shop_set_extends')) { $obj->header_shop_set_extends($smarty->pagedata['shopDefine']); } } $html = $smarty->fetch('site/common/footer.html', app::get('b2c')->app_id); return $html; }
public function column_editbutton($row) { $callback_url = urlencode(kernel::openapi_url('openapi.b2c.callback.shoprelation', 'callback', array('shop_id' => $row['shop_id']))); $api_url = kernel::base_url(1) . kernel::url_prefix() . '/api'; $obj_user = kernel::single('desktop_user'); $user_id = $obj_user->user_data['user_id']; $user_name = $obj_user->user_data['name']; $api_v = $this->app->getConf("api.local.version"); $str_operation = ""; if ($row['status'] == 'unbind') { $str_operation = '<a href="index.php?app=b2c&ctl=admin_shoprelation&act=showEdit&p[0]=' . $row['shop_id'] . '" target="_blank">' . app::get('b2c')->_('编辑') . '</a>'; if ($str_operation) { $str_operation .= ' <a href="javascript:void(0);" onclick="new Request({evalScripts:true,url:\'index.php?ctl=shoprelation&act=index&p[0]=apply&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '&p[4]=' . $user_id . '&p[5]=' . $user_name . '&p[6]=' . $api_v . '\'}).get();">' . app::get('b2c')->_('申请绑定') . '</a>'; } else { $str_operation .= '<a href="javascript:void(0);" onclick="new Request({evalScripts:true,url:\'index.php?ctl=shoprelation&act=index&p[0]=apply&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '&p[4]=' . $user_id . '&p[5]=' . $user_name . '&p[6]=' . $api_v . '\'}).get();">' . app::get('b2c')->_('申请绑定') . '</a>'; } } else { $str_operation = ''; if ($str_operation) { $str_operation .= ' <a href="javascript:void(0);" onclick="new Request({evalScripts:true,url:\'index.php?ctl=shoprelation&act=index&p[0]=accept&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '&p[4]=' . $user_id . '&p[5]=' . $user_name . '&p[6]=' . $api_v . '\'}).get();">' . app::get('b2c')->_('解除绑定') . '</a>'; } else { $str_operation .= '<a href="javascript:void(0);" onclick="new Request({evalScripts:true,url:\'index.php?ctl=shoprelation&act=index&p[0]=accept&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '&p[4]=' . $user_id . '&p[5]=' . $user_name . '&p[6]=' . $api_v . '\'}).get();">' . app::get('b2c')->_('解除绑定') . '</a>'; } } return $str_operation; }
static function send_to_center($app_id, $data = null, $method = 'node.reg') { $app_info = app::get($app_id)->define(); $obj_app = app::get($app_id); // 生成参数... $api_data = array('certi_app' => $method, 'certificate_id' => base_certificate::certi_id(), 'node_type' => 'ecos.' . $app_id, 'url' => kernel::base_url(true), 'version' => $app_info['version'], 'channel_ver' => $app_info['api_ver'], 'api_ver' => '1.2', 'format' => 'json', 'api_url' => kernel::base_url(1) . kernel::url_prefix() . '/api'); //更新时,多带个参数 if ($method == 'node.update') { $api_data['node_id'] = base_shopnode::node_id($app_id); } ksort($api_data); foreach ($api_data as $key => $value) { $str .= $value; } $api_data['certi_ac'] = strtoupper(md5($str . base_certificate::token())); $http = kernel::single('base_httpclient'); $http->set_timeout(6); $result = $http->post(LICENSE_CENTER_V, $api_data); $result = json_decode($result, true); if ($result['res'] == 'succ') { return self::set_node_id($result['info'], $app_id); } else { return false; } }
/** * 监督订单处理事件 * @param string 处理的事件名称 * @param array 被监督订单的sdf数据 */ public function get_orderinfo($event_type, $order_data) { if ($order_data) { $app_stats = app::get('stats'); if ($this->judge_app_install($app_stats)) { $url = kernel::base_url(); $str = $order_data['shipping']; if (strstr($str, app::get('b2c')->_("货到付款"))) { $shipment = 'cash'; } else { $shipment = 'nomal'; } $info_v = array('_member_id' => $order_data['member_id'], '_member' => $order_data['uname'], '_order_id' => $order_data['order_id'], '_ship_status' => $order_data['ship_status'], '_status' => $order_data['pay_status'], '_u_make' => $order_data['is_frontend'] ? 'font' : 'back', '_num' => $order_data['itemnum'], '_goods_url' => $order_data['goods_url'], '_goods_id' => $order_data['goods_id'], '_total' => $order_data['total_amount'], '_goods_name' => $order_data['goods_name'], '_thumbnail_pic' => $order_data['thumbnail_pic']); if (!$order_data['is_frontend']) { $info_v['from'] = 'Admin'; } $obj_service_storager = kernel::service("stats_data_storager"); //$keys = array_search('b2c:stats_listener:get_orderinfo', $this->arr_listener); foreach ($this->arr_listener as $key => $listener_info) { if (array_key_exists('b2c:stats_listener:get_orderinfo', $listener_info)) { $listener_key = $key; } } if ($listener_key) { $obj_service_storager->save($this->arr_listener_keys[$listener_key], $info_v); } } } }
public function show($run_id) { /* $oXHProf = $this->app->model('xhprof'); $this->pagedata["data"] = $oXHProf->read_data($run_id); $this->display("/admin/show_data.html");*/ echo "<iframe src='" . kernel::base_url(1) . "/app/serveradm/vendor/xhprof_html/index.php?run=" . $run_id . "&source=xhprof' width='100%' height='100%'></iframe>"; }
private function write_lock_code() { $lock_code = md5(microtime()) . md5(print_r($_SERVER, 1)); file_put_contents($this->lockfile(), $this->lockcode_prefix . $lock_code); $path = kernel::base_url(); $path = $path ? $path : '/'; return setcookie('_ecos_setup_lockcode', $lock_code, null, $path); }
/** * 绑定公众账号生成微信访问的URL地址 * * @return url */ public function get_weixin_url($eid) { if (!$eid) { $eid = time(); } $base_url = kernel::base_url(1) . '/index.php/openapi/weixin/api?eid=' . $eid; return $base_url; }
function index() { $this->pagedata['conf'] = base_setup_config::deploy_info(); $this->pagedata['enterprise_url'] = SHOP_USER_ENTERPRISE; $this->pagedata['callback_url'] = base64_encode(kernel::router()->app->base_url(1) . 'index.php?app=entermembercenter&ctl=register&act=active'); $output = $this->fetch('register.html'); echo str_replace('%BASE_URL%', kernel::base_url(1), $output); }
public function index() { if (defined('APP_SITE_INDEX_MAXAGE') && APP_SITE_INDEX_MAXAGE > 1) { $this->set_max_age(APP_SITE_INDEX_MAXAGE); } $GLOBALS['runtime']['path'][] = array('title' => app::get('topm')->_('首页〉'), 'link' => kernel::base_url(1)); $this->setLayoutFlag('index'); return $this->page(); }
function index() { $pagedata['conf'] = base_setup_config::deploy_info(); $pagedata['enterprise_url'] = config::get('link.shop_user_enterprise'); //$pagedata['callback_url'] = base64_encode(app::get('desktop')->base_url(1).'?app=entermembercenter&ctl=register&act=active'); $pagedata['callback_url'] = base64_encode(url::route('shopadmin', ['app' => 'entermembercenter', 'ctl' => 'register', 'act' => 'active'])); $output = view::make('entermembercenter/register.html', $pagedata)->render(); return str_replace('%BASE_URL%', kernel::base_url(1), $output); }
public function set_cookie($name, $value, $expire = false, $path = null) { if (!$this->cookie_path) { $this->cookie_path = kernel::base_url() . '/'; } $this->cookie_life = $this->cookie_life > 0 ? $this->cookie_life : 315360000; $expire = $expire === false ? time() + $this->cookie_life : $expire; setcookie($name, $value, $expire, $this->cookie_path); $_COOKIE[$name] = $value; }
public function get_varys() { $varys['HOST'] = kernel::base_url(true); //host信息 $varys['REWRITE'] = defined('WITH_REWRITE') ? WITH_REWRITE : ''; //是否有rewirte支持 $varys['LANG'] = defined('LANG') ? LANG : ''; //语言环境 return $varys; }
public function column_fullstyles($row) { $styles = kernel::single('site_theme_base')->get_theme_styles($row[$this->col_prefix . 'theme']); $render = app::get('site')->render(); $render->pagedata['styles'] = $styles; $render->pagedata['theme'] = $row[$this->col_prefix . 'theme']; $render->pagedata['preview_prefix'] = kernel::base_url(1) . '/themes/' . $row[$this->col_prefix . 'theme']; $render->pagedata['current'] = kernel::single('site_theme_base')->get_theme_style($row[$this->col_prefix . 'theme']); return $render->fetch('admin/theme/manage/style.html'); }
public function index() { //默认读取一下themes文件夹,获取文件夹内已有模板@lujy kernel::single('wap_theme_install')->check_install(); $theme_preview = kernel::base_url(1) . strrchr(THEME_DIR, '/'); $default_theme = kernel::single('wap_theme_base')->get_default(); $o_themes = app::get('wap')->model('themes')->getList('*', array('theme' => $default_theme)); $this->pagedata['wap_url'] = app::get('wap')->base_url(1); if ($o_themes) { $this->pagedata['current_theme'] = $o_themes[0]; /** 获取当前模版的信息 **/ $current_sytle = kernel::single('wap_theme_base')->get_theme_style($o_themes[0]['theme']); $preview = $current_sytle['preview'] ? $current_sytle['preview'] : 'preview.jpg'; $this->pagedata['current']['is_themme_bk'] = kernel::single('wap_theme_file')->is_themme_bk($o_themes[0]['theme'], 'theme_bak.xml'); $src = kernel::single('wap_theme_file')->get_src($o_themes[0]['theme'], $preview); $preview_prefix = kernel::single('wap_theme_file')->preview_prefix($o_themes[0]['theme']); $this->pagedata['current_theme_preview_img'] = $src; $styles = kernel::single('wap_theme_base')->get_theme_styles($o_themes[0]['theme']); foreach ($styles as $key => $style) { $style['preview'] = kernel::single('wap_theme_file')->get_src($o_themes[0]['theme'], $style['preview']); $preview_prefix = kernel::single('wap_theme_file')->preview_prefix($o_themes[0]['theme']); $styles[$key] = $style; } $this->pagedata['styles'] = $styles; $this->pagedata['preview_prefix'] = $preview_prefix; $this->pagedata['current'] = $current_sytle; $this->pagedata['current']['active_color'] = $current_sytle['color']; //设置编辑默认页面 $defaultIndexFile = kernel::single('wap_theme_tmpl')->get_default('index', $default_theme); $nodefaultindex = $this->app->model('themes_tmpl')->getList('tmpl_path', array('theme' => $default_theme, 'tmpl_type' => 'index')); $this->pagedata['current']['default_index_file'] = $defaultIndexFile ? $defaultIndexFile : $nodefaultindex[0]['tmpl_path']; } /** 获取所有已安装的模版 **/ $all_themes = app::get('wap')->model('themes')->getList('*', array('is_used' => 'false')); foreach ($all_themes as $k => $arr_theme) { $arr_style = kernel::single('wap_theme_base')->get_theme_style($arr_theme['theme']); $preview = $arr_style['preview'] ? $arr_style['preview'] : 'preview.jpg'; $all_themes[$k]['is_themme_bk'] = kernel::single('wap_theme_file')->is_themme_bk($arr_theme['theme'], 'theme_bak.xml'); $src = kernel::single('wap_theme_file')->get_src($arr_theme['theme'], $preview); $preview_prefix = kernel::single('wap_theme_file')->preview_prefix($arr_theme['theme']); $all_themes[$k]['preview'] = $src; $styles = kernel::single('wap_theme_base')->get_theme_styles($arr_theme['theme']); foreach ($styles as $key => $style) { $style['preview'] = kernel::single('wap_theme_file')->get_src($o_themes[0]['theme'], $style['preview']); $preview_prefix = kernel::single('wap_theme_file')->preview_prefix($o_themes[0]['theme']); $styles[$key] = $style; } $all_themes[$k]['styles'] = $styles; $all_themes[$k]['preview_prefix'] = $preview_prefix; $all_themes[$k]['active_color'] = $arr_style['color']; } $this->pagedata['all_themes'] = $all_themes; $this->page('admin/theme/manage/index.html'); //$this->finder('wap_mdl_themes',array('title'=>app::get('wap')->_('模板管理'), 'actions'=>$actions,'use_buildin_recycle'=>false)); }
/** * ShopEx licence * * @copyright Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn) * @license http://ecos.shopex.com/license/gpl GPL License */ function widget_ad_pic(&$setting, &$app) { return $setting; $output = $app->model('system/frontend'); if ($output->theme) { $theme_dir = kernel::base_url() . 'themes/' . $output->theme; } else { $theme_dir = kernel::base_url() . 'themes/' . $app->getConf('system.ui.current_theme'); } $setting['ad_pic'] = str_replace('%THEME%', $theme_dir, $setting['ad_pic']); }
function index() { $this->pagedata['project_name'] = 'API 测试工具'; $this->pagedata['token'] = base_certificate::token(); #$this->pagedata['api_url'] = '/ec_app/index.php/api'; $api_url = preg_replace('/\\/diyapi(\\/?)$/', '/api', $_SERVER['REQUEST_URI']); $this->pagedata['api_url'] = $api_url; $this->pagedata['base_url_full'] = kernel::base_url('full'); $this->pagedata['new_api_url'] = app::get('site')->router()->gen_url(array('app' => 'webtool', 'ctl' => 'site_index', 'act' => 'index')); $this->display('default.html'); }