本文整理汇总了PHP中kernel::router方法的典型用法代码示例。如果您正苦于以下问题:PHP kernel::router方法的具体用法?PHP kernel::router怎么用?PHP kernel::router使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kernel
的用法示例。
在下文中一共展示了kernel::router方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget_goods
/**
* 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_goods(&$setting, &$render)
{
$limit = intval($setting['limit']) > 0 ? intval($setting['limit']) : 6;
$goods =& app::get('b2c')->model('goods');
$goods->defaultCols = 'bn,name,cat_id,price,store,marketable,brand_id,weight,d_order,uptime,type_id';
$goods->appendCols = 'goods_id,thumbnail_pic,brief,mktprice,image_default_id';
$config = app::get('b2c')->getConf('site.save_price');
$data['onSelect'] = $setting['onSelect'] ? $setting['onSelect'] : 0;
$setting['max_length'] = $setting['max_length'] ? $setting['max_length'] : 35;
$setting['view'] = app::get('b2c')->getConf('gallery.default_view');
$imageDefault = app::get('image')->getConf('image.set');
$search =& app::get('b2c')->model('search');
$setting['str'] = $search->encode($filter);
$setting['restrict'] = $setting['restrict'] ? $setting['restrict'] : 'on';
$order = $setting['goods_orderby'] ? orderBy($setting['goods_orderby']) : null;
if ($setting['columNum'] > 1) {
for ($i = 0; $i < $setting['columNum']; $i++) {
parse_str($setting['adjunct']['items'][$i], $filter[$i]);
$filter[$i] = getFilter($filter[$i]);
$result['link'][$i - 1] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'gallery', 'act' => $setting['view'], 'args' => array($str_cat_id, $search->encode($filter[$i]), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)));
$result['goods'][] = $goods->getList(null, $filter[$i], 0, $limit, $order['sql']);
$result['defaultImage'] = $imageDefault['S']['default_image'];
unset($filter[$i]);
}
return $result;
} else {
parse_str($setting['adjunct']['items'][0], $filter);
$filter = getFilter($filter);
$result['link'] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_gallery', 'act' => $setting['view'], 'args' => array(implode(",", (array) $filter['cat_id']), $search->encode($filter), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)));
$result['goods'] = $goods->getList('*', $filter, 0, $limit, $order['sql']);
$result['defaultImage'] = $imageDefault['S']['default_image'];
return $result;
}
}
示例2: widget_rankinglist
/**
* 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_rankinglist(&$setting, &$smarty)
{
$limit = intval($setting['limit']) ? intval($setting['limit']) : 10;
$maxlength = intval($setting['maxlength']) ? intval($setting['maxlength']) : 55;
//$setting['fontStyle']=type_check2($setting['fontStyle']);
//$setting['fontStyle2']=type_check2($setting['fontStyle2']);
$order = array($setting['ranking'], 'DESC');
$viewer = app::get('b2c')->getConf('gallery.default_view');
$o = app::get('b2c')->model('goods');
$oSearch = app::get('b2c')->model('search');
$rk['view_w_count'] = 4;
$rk['view_count'] = 5;
$rk['buy_count'] = 6;
$rk['buy_w_count'] = 7;
$rk['comments_count'] = 8;
parse_str($setting['filter'], $filter);
$filter['marketable'] = 'true';
$filter['disabled'] = 'false';
$setting['link'] = kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_gallery', 'act' => 'index', 'full' => 1, array($filter['cat_id'], $oSearch->encode($filter), $rk[$setting['ranking']] ? $rk[$setting['ranking']] : 0)));
//$result=$o->getList("*",$filter,0,$limit,$c,$order);
if (!empty($setting['ranking'])) {
$result = $o->getList("*", $filter, 0, $limit, $order);
} else {
$result = $o->getList("*", $filter, 0, $limit);
}
return $result;
}
示例3: widget_goods_show
/**
* 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_goods_show(&$setting, &$render)
{
$o =& app::get('b2c')->model('goods');
$limit = intval($setting['limit']) > 0 ? intval($setting['limit']) : 6;
$orderby = $setting['goods_orderby'] ? $o->orderBy($setting['goods_orderby']) : null;
$filter = gs_getFilter($setting['g_filter']);
if (!is_array($filter['cat_id']) && $filter['cat_id']) {
$filter['cat_id'] = array($filter['cat_id']);
}
if (!$filter['cat_id']) {
unset($filter['cat_id']);
}
if ($filter['type_id'] && !is_array($filter['type_id'])) {
$filter['type_id'] = array($filter['type_id']);
}
if ($filter['pricefrom']) {
$filter['price'][0] = $filter['pricefrom'];
}
if ($filter['priceto']) {
if (!$filter['price'][0]) {
$filter['price'][0] = 0;
}
$filter['price'][1] = $filter['priceto'];
}
$result = $o->getList('*', $filter, 0, $limit, $orderby['sql']);
if ('on' == $setting['showMore']) {
$oSearch =& app::get('b2c')->model('search');
$act =& app::get('b2c')->getConf('gallery.default_view');
$result['link'] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'gallery', 'act' => $act, 'args' => array(implode(",", $filter['cat_id']), $oSearch->encode($filter), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)));
}
return $result;
}
示例4: getTreeList
function getTreeList($pid = 0, $listMark = 'all')
{
$var_pid = $pid;
$var_listMark = $listMark;
$a = kernel::database();
if ($listMark == 'all') {
$aCat = $a->select('SELECT cat_name,cat_id,o.parent_id AS pid,o.p_order,o.cat_path,o.is_leaf AS cls,o.type_id as type
FROM sdb_b2c_goods_cat o WHERE o.disabled=\'false\' ORDER BY o.cat_path,o.p_order,o.cat_id');
foreach ($aCat as $k => $row) {
if ($row['cat_path'] != '' && $row['cat_path'] != ',') {
$aCat[$k]['cat_path'] = substr($row['cat_path'], 1);
}
}
} else {
if ($pid === 0) {
$sqlWhere = '(parent_id IS NULL OR parent_id=' . intval($pid) . ')';
} else {
$sqlWhere = 'parent_id=' . intval($pid);
}
$sqlWhere .= " AND o.disabled='false'";
$aCat = $a->select('SELECT cat_name, cat_id, o.parent_id AS pid, o.p_order, o.cat_path, o.is_leaf AS cls,o.type_id, t.name AS type_name FROM sdb_b2c_goods_cat o
LEFT JOIN sdb_b2c_goods_type t ON o.type_id = t.type_id
WHERE ' . $sqlWhere . ' ORDER BY o.cat_path,o.p_order,o.cat_id');
foreach ($aCat as $k => $row) {
$aCat[$k]['pid'] = intval($aCat[$k]['pid']);
if ($row['cat_path'] == '' || $row['cat_path'] == ',') {
$aCat[$k]['step'] = 1;
} else {
$aCat[$k]['step'] = substr_count($row['cat_path'], ',') + 1;
}
$aCat[$k]['url'] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'gallery', 'act' => $render->app->getConf('gallery.default_view'), 'args' => array($aCat[$k]['cat_id']), null, $app->base_url()));
}
}
return $aCat;
}
示例5: theme_widget_nav
/**
* ShopEx licence
*
* @copyright Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
* @license http://ecos.shopex.cn/ ShopEx License
*/
function theme_widget_nav($setting, &$smarty)
{
define('IN_SHOP', true);
//当前的链接地址
$cur_url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$result = app::get('site')->model('menus')->select()->where('hidden = ?', 'false')->order('display_order ASC')->instance()->fetch_all();
//菜单链接
foreach ($result as $k => &$v) {
if (!empty($v['custom_url'])) {
$v['url'] = $v['custom_url'];
} else {
$v['url'] = kernel::router()->gen_url(array('app' => $v['app'], 'ctl' => $v['ctl'], 'act' => $v['act'], 'args' => $v['params'], 'full' => 1));
}
//菜单高亮
if (stripos($v['url'], $cur_url) && 'site_ctl_default' != get_class($smarty)) {
$v['hilight'] = true;
}
//首页菜单高亮
if ('site_ctl_default' == get_class($smarty) && $v['app'] == 'site' && $v['ctl'] == 'default') {
$v['hilight'] = true;
}
}
$setting['max_leng'] = $setting['max_leng'] ? $setting['max_leng'] : 7;
$setting['showinfo'] = $setting['showinfo'] ? $setting['showinfo'] : app::get('b2c')->_("更多");
return $result;
}
示例6: active_top_html
public function active_top_html()
{
/** 获取证书,企业号的验证 **/
$active_url = kernel::router()->app->base_url(1) . '/index.php?app=entermembercenter&ctl=register';
$render = kernel::single('base_render');
$render->pagedata['active_url'] = $active_url;
return $render->fetch('desktop_active_top.html', 'entermembercenter');
}
示例7: editor
public function editor()
{
$id = $this->_request->get_get('node_id');
$info = kernel::single('content_article_node')->get_node($id);
if (!$info['homepage']) {
die;
}
$this->pagedata['detail'] = $info;
$this->pagedata['shopadmin'] = kernel::router()->app->base_url(1);
$this->pagedata['theme'] = kernel::single('site_theme_base')->get_default();
$this->pagedata['site_url'] = app::get('site')->router()->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'i', 'arg0' => $info['node_id']));
$this->singlepage('admin/node/single/editor.html');
}
示例8: codecheck
public function codecheck()
{
//if ($_POST['auth_code'] && preg_match("/^\d{19}$/", substr($_POST['auth_code'], 1)))
if ($_POST['auth_code']) {
$code = kernel::single('desktop_cert_certcheck');
$result = $code->check_code($_POST['auth_code']);
if ($result['res'] == 'succ' && $result) {
$activation_arr = $_POST['auth_code'];
app::get('desktop')->setConf('activation_code', $activation_arr);
$objArr = kernel::servicelist("desktop.cert.succ");
foreach ($objArr as $obj) {
if (method_exists($obj, 'notify')) {
$obj->notify($result);
}
}
header('Location:' . kernel::router()->app->base_url(1));
exit;
} else {
switch ($result['msg']) {
case 'key_false_ac':
$auth_error_msg = '激活码类型不对!';
break;
case 'key_false_times':
$auth_error_msg = '失败:您已经连续6次提交失败,为了您的网店安全,请3小时后再次尝试|';
break;
case 'key_false_key':
$auth_error_msg = '无效的激活码,请您重新输入激活码以便正常使用。';
break;
case 'key_false_actived':
$auth_error_msg = '您的激活码已经失效,请您重新输入激活码以便正常使用。';
break;
case 'key_false_oem':
$auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
break;
case 'key_false_type_1':
$auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
break;
case 'key_false_type_2':
$auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
break;
case 'certificate_id_is_false':
$auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
break;
}
die($this->error_view($auth_error_msg));
}
header("Location: index.php");
exit;
}
}
示例9: logout
function logout($backurl = 'index.php')
{
$this->begin('javascript:Cookie.dispose("basicloginform_password");Cookie.dispose("basicloginform_autologin");
location="' . kernel::router()->app->base_url(1) . '"');
$this->user->login();
$this->user->logout();
$auth = pam_auth::instance(pam_account::get_account_type($this->app->app_id));
foreach (kernel::servicelist('passport') as $k => $passport) {
if ($auth->is_module_valid($k, $this->app->app_id)) {
$passport->loginout($auth, $backurl);
}
}
kernel::single('base_session')->destory();
$this->end('true', app::get('desktop')->_('已成功退出系统,正在转向...'));
/* $this->redirect('');*/
}
示例10: editor
public function editor()
{
$id = $this->_request->get_get('id');
$level = $this->_request->get_get('level');
$flag = $this->_request->get_get('flag');
$theme = $this->_request->get_get('theme') ? $this->_request->get_get('theme') : '';
header('Content-Type: text/html; charset=utf-8');
$this->path[] = array('text' => app::get('site')->_('挂件实例编辑'));
$this->pagedata['level'] = $level;
$this->pagedata['flag'] = $flag;
$this->pagedata['theme'] = $theme;
$this->pagedata['shopadmin'] = kernel::router()->app->base_url(1);
if ($id > 0) {
$this->pagedata['instance'] = app::get('site')->model('widgets_proinstance')->select()->where('widgets_id = ?', $id)->instance()->fetch_row();
$this->pagedata['theme'] = $this->pagedata['instance']['flag'];
}
return $this->singlepage('admin/widget/editor.html');
}
示例11: active
function active()
{
if ($_GET['ent_id'] && $_GET['ent_ac'] && $_GET['ent_sign'] && $_GET['ent_email']) {
//判断数据是否是中心过来的
if (md5($_GET['ent_id'] . $_GET['ent_ac'] . 'ShopEXUser') == $_GET['ent_sign']) {
//检测企业帐号是否正确
base_enterprise::set_version();
base_enterprise::set_token();
if (!base_enterprise::is_valid('json', $_GET['ent_id'])) {
header("Content-type: text/html; charset=utf-8");
$active_url = kernel::router()->app->base_url(1) . '/index.php?app=entermembercenter&ctl=register';
header('Location:' . $active_url);
exit;
} else {
$arr_enterprise = array('ent_id' => $_GET['ent_id'], 'ent_ac' => $_GET['ent_ac'], 'ent_email' => $_GET['ent_email']);
base_enterprise::set_enterprise_info($arr_enterprise);
if (!base_certificate::certi_id() || !base_certificate::token()) {
$flag = base_certificate::register();
}
if (!$flag) {
header("Content-type: text/html; charset=utf-8");
$active_url = kernel::router()->app->base_url(1) . '/index.php?app=entermembercenter&ctl=register';
header('Location:' . $active_url);
exit;
}
if (!base_shopnode::node_id() && base_certificate::certi_id() && base_certificate::token()) {
$obj_buildin = kernel::single('base_shell_buildin');
$obj_buildin->command_active_node_id('ceti_node_id');
}
}
}
} else {
header("Content-type: text/html; charset=utf-8");
$active_url = kernel::router()->app->base_url(1) . '/index.php?app=entermembercenter&ctl=register';
header('Location:' . $active_url);
exit;
}
$url = kernel::router()->gen_url(array(), 1);
$url = base64_encode($url);
$login_html = 'index.php?ctl=passport&act=index&url=' . $url;
header("Content-type: text/html; charset=utf-8");
header('Location:' . $login_html);
exit;
}
示例12: editor
public function editor()
{
$theme = $this->_request->get_get('theme');
$file = $this->_request->get_get('file');
header('Content-Type: text/html; charset=utf-8');
$this->path[] = array('text' => app::get('site')->_('模板可视化编辑'));
$this->pagedata['views'] = kernel::single('site_theme_base')->get_view($theme);
$this->pagedata['widgetsLib'] = kernel::single('site_theme_widget')->get_libs($theme);
$this->pagedata['list'] = kernel::single('site_theme_tmpl')->get_edit_list($theme);
$this->pagedata['types'] = kernel::single('site_theme_tmpl')->get_name();
$this->pagedata['theme'] = $theme;
$this->pagedata['view'] = $file;
$this->pagedata['viewname'] = kernel::single('site_theme_tmpl')->get_list_name($file);
$this->pagedata['shopadmin'] = kernel::router()->app->base_url(1);
$this->pagedata['site_url'] = app::get('site')->base_url(1);
$this->pagedata['pagehead_active'] = 'preview';
$this->pagedata['save_url'] = kernel::router()->app->base_url(1) . '?app=site&ctl=admin_theme_widget&act=do_preview';
$this->pagedata['preview_url'] = app::get('site')->base_url(1);
return $this->singlepage('admin/theme/widget/editor.html');
}
示例13: read
public function read()
{
$this->begin(kernel::router()->gen_url(array('app' => 'desktop', 'ctl' => 'rpcnotify', 'act' => 'index')));
$id = $_POST['id'];
$is_selected_all = $_POST['isSelectedAll'];
if (!$id && !$is_selected_all) {
$this->end(false, app::get('desktop')->_('操作失败'));
}
if ($id) {
foreach ((array) $id as $val) {
$data = array('status' => 'true', 'id' => $val);
$flag = app::get('base')->model('rpcnotify')->save($data);
if ($flag == false) {
break;
}
}
} else {
$data = array('status' => 'true');
$filter = array();
$flag = app::get('base')->model('rpcnotify')->update($data, $filter);
}
$this->end($flag, $flag ? app::get('desktop')->_('操作成功') : app::get('desktop')->_('操作失败'));
}
示例14: array
/**
* 根据条件获取商品信息
* @param array $filter (所有条件都可选)
* array(
'goodsId' => array(1,2)/1, //商品ID
'priceFrom' => 5, //价格区间(低)
'priceTo' => 100, //价格区间(高)
'typeId' => 2, //商品类型ID
'catId' => array(1,2)/1, //商品分类ID
'brandId' => array(1,2)/1, //商品品牌ID
'goodsOrderBy' => 1, //商品排序
'goodsNum' => 12, //总商品数(xo最多20)
),
*/
public function getGoodsList($filter, $platform = 'site')
{
if (isset($_COOKIE['MLV'])) {
if (!cachemgr::get('member_lv_disCount' . $_COOKIE['MLV'], $dis_count)) {
cachemgr::co_start();
$member_level = $_COOKIE['MLV'];
(array) ($arr = $this->app->model('member_lv')->getList('dis_count', array('member_lv_id' => $member_level)));
$dis_count = $arr[0]['dis_count'];
cachemgr::set('member_lv_disCount' . $_COOKIE['MLV'], $dis_count, cachemgr::co_end());
}
}
$objLvprice = $this->app->model('goods_lv_price');
$goods = $this->app->model('goods');
$objProduct = $this->app->model('products');
$objgoodscat = $this->app->model('goods_cat');
$config = $this->app->getConf('site.save_price');
$imageDefault = app::get('image')->getConf('image.set');
$search = $this->app->model('search');
$orderBy = $filter['goodsOrderBy'] ? $filter['goodsOrderBy'] : 0;
$order = $filter['goodsOrderBy'] ? $this->_getOrderBy($filter['goodsOrderBy'], false) : null;
$limit = intval($filter['goodsNum']) > 0 ? intval($filter['goodsNum']) : 6;
//$limit = ($limit > 20) ? 20 : $limit;
$result = array();
unset($filter['goodsOrderBy']);
unset($filter['goodsNum']);
$_filter = $this->_getFilter($filter);
$result['goodsMoreLink'] = kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_gallery', 'act' => 'index', 'args' => array(implode(",", (array) $filter['catId']), $search->encode($filter), $orderBy)));
$goodsList = $goods->getList('*', $_filter, 0, $limit, $order['sql']);
if (!empty($_filter['goods_id'])) {
$goods_temp = array();
foreach ($_filter['goods_id'] as $k => $v) {
foreach ($goodsList as $row) {
if ($v == $row['goods_id']) {
$goods_temp[$k] = $row;
}
}
}
unset($goodsList);
$goodsList = $goods_temp;
unset($goods_temp);
}
if (is_array($goodsList) && $goodsList) {
foreach ($goodsList as $key => $value) {
$gids[] = $value['goods_id'];
$catIds[] = intval($value['cat_id']);
}
}
if ($gids) {
if ($catIds) {
$catsData = $objgoodscat->getList('cat_id,cat_name', array('cat_id' => $catIds));
foreach ($catsData as $row) {
$goodsCats[$row['cat_id']] = $row['cat_name'];
}
}
if ($member_level) {
$lv_price_data = $objLvprice->getList('goods_id,price', array('goods_id' => $gids, 'level_id' => $member_level));
foreach ($lv_price_data as $row) {
$goodsLvPrice[$row['goods_id']] = $row['price'];
}
}
}
if (is_array($goodsList) && $goodsList) {
foreach ($goodsList as $pk => $pv) {
if (empty($pv['mktprice']) || $pv['mktprice'] == '0') {
$pv['mktprice'] = $objProduct->getRealMkt($pv['price']);
}
$pv['cat_name'] = $goodsCats[$pv['cat_id']];
// add for member price
#$lv_price = $objLvprice->getList('price',array('goods_id'=>$pv['goods_id'],'level_id'=>$member_level));
$lv_price[0] = $goodsLvPrice[$pv['goods_id']];
if (isset($dis_count)) {
if (is_array($lv_price) && count($lv_price) > 0) {
$lv_price = end($lv_price);
$pv['memprice'] = $lv_price['price'];
} else {
$pv['memprice'] = $pv['price'] * $dis_count;
}
if (intval($pv['price']) != 0) {
$pv['dis_count'] = (1 - $pv['memprice'] / $pv['price']) * 100;
} else {
$pv['dis_count'] = 0;
}
} else {
$pv['dis_count'] = 0;
$pv['memprice'] = false;
}
//.........这里部分代码省略.........
示例15: swf_upload
public function swf_upload()
{
$this->pagedata['ssid'] = kernel::single('base_session')->sess_id();
$this->pagedata['swf_loc'] = kernel::router()->app->res_url;
$this->pagedata['upload_max_filesize'] = kernel::single('wap_theme_install')->ini_get_size('upload_max_filesize');
$this->display('admin/theme/manage/swf_upload.html');
}