本文整理汇总了PHP中utils::http_build_query方法的典型用法代码示例。如果您正苦于以下问题:PHP utils::http_build_query方法的具体用法?PHP utils::http_build_query怎么用?PHP utils::http_build_query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils::http_build_query方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: work
function work($full_object_name)
{
$this->url = 'index.php?';
ecos_desktop_finder_make_get($this->name);
$query = utils::http_build_query($_GET);
$this->url = $this->url . $query;
$this->object_name = $full_object_name;
list($object_app, $object_name) = ecos_desktop_finder_split_model($full_object_name);
$service_list = array();
foreach (kernel::servicelist('desktop_finder.' . $this->object_name) as $name => $object) {
$service_list[$name] = $object;
}
foreach (kernel::servicelist('desktop_finder.' . $this->object_name . '.' . $this->finder_aliasname) as $name => $object) {
$service_list[$name] = $object;
}
foreach ($service_list as $name => $object) {
$tmpobj = $object;
foreach (get_class_methods($tmpobj) as $method) {
switch (substr($method, 0, 7)) {
case 'column_':
$this->addon_columns[] = array(&$tmpobj, $method);
break;
case 'detail_':
if (!$this->alertpage_finder) {
//如果是弹出页finder,则去详细查看按钮
$this->detail_pages[$method] = array(&$tmpobj, $method);
}
break;
}
}
$this->service_object[] =& $tmpobj;
if (method_exists($tmpobj, 'row_style')) {
$this->row_style_func[] =& $tmpobj;
}
unset($tmpobj);
$i++;
}
/**
* 对额外添加的column和detail的修改
*/
$obj_addon_cols = kernel::servicelist('desktop_finder_column_modifier.' . $this->object_name . '.' . $this->finder_aliasname);
if ($obj_addon_cols) {
foreach ($obj_addon_cols as $obj) {
$obj->columns_modifier($this->addon_columns);
}
}
$obj_addon_detail_cols = kernel::servicelist('desktop_finder_detail_modifier.' . $this->object_name . '.' . $this->finder_aliasname);
if ($obj_addon_detail_cols) {
foreach ($obj_addon_detail_cols as $obj) {
$obj->detail_columns_modifier($this->detail_pages);
}
}
/** end **/
$this->object = app::get($object_app)->model($object_name);
$this->has_tag = $this->object->has_tag;
$this->dbschema = $this->object->schema;
$this->main();
}
示例2: gen_url
function gen_url($params = array(), $full = false)
{
$params = utils::http_build_query($params);
if ($params) {
return $this->app->base_url($full) . 'index.php?' . $params;
} else {
return $this->app->base_url($full);
}
}
示例3: page
function page($page = '')
{
$get_params = $_GET;
unset($get_params['menu']);
$this->pagedata['_QUERY_STRING'] = utils::http_build_query($get_params);
$this->pagedata['_PAGE_'] = $page;
if (true) {
$this->pagedata['_ACTIONS_'] = array('inbox' => app::get('desktop')->_('事务'), 'account' => app::get('desktop')->_('账号'), 'status' => app::get('desktop')->_('状态'));
}
parent::display('flow/page.html');
}
示例4: gen_url
function gen_url($params = array(), $full = false)
{
if ($params['router']) {
return app::get($params['router'])->router()->gen_url($params, $full);
}
$params = utils::http_build_query($params);
if ($params) {
return $this->app->base_url($full) . 'index.php?' . $params;
} else {
return $this->app->base_url($full);
}
}
示例5: get_work_menu
function get_work_menu()
{
$aWorkground = app::get('desktop')->model('menus')->getList('menu_id,app_id,menu_title,menu_path,menu_type,workground,menu_group,target', array('menu_type' => 'workground', 'disabled' => 'false', 'display' => 'true'));
$aMenu = app::get('desktop')->model('menus')->getList('menu_id,app_id,menu_title,menu_path,menu_type,workground,menu_group,addon,target', array('menu_type' => 'menu', 'disabled' => 'false', 'display' => 'true'));
if ($this->is_super()) {
foreach ($aWorkground as $value) {
$tmp[$value['workground']] = $value;
}
$aData['workground'] = $tmp;
//
$allkey_workground = array_keys($aData['workground']);
//
unset($tmp);
foreach ($aMenu as $value) {
if ($value['menu_title']) {
$value['menu_title'] = app::get('b2c')->_($value['menu_title']);
}
if ($value['menu_group']) {
$value['menu_group'] = app::get('b2c')->_($value['menu_group']);
}
$group = $value['menu_group'] ? $value['menu_group'] : 'nogroup';
$tmp[$value['workground']][$group][] = $value;
}
$aData['menu'] = $tmp;
} else {
$group = $this->group();
$meuns = app::get('desktop')->model('menus');
$data = array();
$data_menus = array();
foreach ($group as $key => $val) {
$aTmp = $meuns->workgroup($val);
foreach ($meuns->get_menu($val) as $v) {
$group = $v['menu_group'] ? $v['menu_group'] : 'nogroup';
if (!@in_array($v, $data_menus[$aTmp[0]['workground']][$group])) {
$data_menus[$aTmp[0]['workground']][$group][] = $v;
}
}
foreach ($aTmp as $val) {
$data[$val['workground']] = $val;
}
}
$aData['workground'] = $data;
//
$allkey_workground = array_keys($aData['workground']);
//
$aData['menu'] = $data_menus;
}
foreach ((array) $aData['menu'] as $k1 => $group) {
if (!in_array($k1, (array) $allkey_workground)) {
break;
}
$menu_default = current(current($aData['menu'][$k1]));
$__query = '';
if ($menu_default['addon']) {
$__params = unserialize($menu_default['addon']);
if (is_array($__params['url_params'])) {
$__query = '&' . utils::http_build_query($__params['url_params']);
}
}
if ($__query) {
$menu_default['menu_path'] = $menu_default['menu_path'] . $__query;
}
$aData['workground'][$k1]['menu_path'] = $aData['workground'][$k1]['menu_path'] ? $aData['workground'][$k1]['menu_path'] : $menu_default['menu_path'];
$aData['workground'][$k1]['target'] = $aData['workground'][$k1]['target'] ? $aData['workground'][$k1]['target'] : $menu_default['target'];
//ksort($aData['menu'][$k1]);
foreach ($group as $k2 => $menus) {
if (!$menus) {
unset($aData['menu'][$k1][$k2]);
continue;
}
foreach ($menus as $k3 => $menu) {
$query = '';
if ($menu['addon']) {
$params = unserialize($menu['addon']);
if (is_array($params['url_params'])) {
$query = '&' . utils::http_build_query($params['url_params']);
}
}
$menu['menu_path'] = $menu['menu_path'] . $query;
$aData['menu'][$k1][$k2][$k3] = $menu;
}
}
}
return $aData;
}
示例6: menu
function menu($get, $defaultWorkground)
{
$menu_type = 'menu';
$workground = '';
$aper = array();
$this->user = vmc::singleton('desktop_user');
if ($this->user->is_super()) {
$pers = $this->getList('permission', array('menu_type' => 'permission', 'disabled' => 'false'));
foreach ($pers as $val) {
$aper[] = $val['permission'];
}
} else {
$group = $this->user->group();
foreach ($group as $v) {
#$data = $this->dump($v);
$aper[] = $v;
}
}
$menu_path = "app=" . $get['app'] . "&ctl=" . $get['ctl'] . "&act=" . $get['act'];
$aData = $this->getList('*', array('menu_type' => 'menu', 'menu_path' => $menu_path));
if (count($aData) == 0) {
$aPanel = $this->getList('*', array('menu_type' => 'adminpanel', 'menu_path' => $menu_path));
if (count($aPanel) == 0) {
if ($defaultWorkground) {
$workground = $defaultWorkground;
} else {
return null;
}
} else {
$menu_title = $aPanel[0]['menu_title'];
$adminpanel_wg = $this->adminpanel($aper);
return $adminpanel_wg;
}
}
if (count($aData) > 1) {
foreach ($aData as $k => $row) {
$addon = unserialize($row['addon']);
$flag = true;
foreach ((array) $addon['url_params'] as $field => $val) {
if ($get[$field] != $val) {
$flag = false;
break;
}
}
if ($flag) {
$workground = $aData[$k]['workground'];
}
}
} elseif (count($aData) == 1) {
$workground = $aData[0]['workground'];
} else {
# $menu_type = 'workground';
}
$menu = $this->getList('*', array('menu_type' => $menu_type, 'workground' => $workground, 'display' => 'true', 'permission' => $aper));
$menu_group = array();
$data_menu = array();
foreach ($menu as $val) {
if ($val['menu_group']) {
$menu_group[] = $val['menu_group'];
}
}
$menu_group = array_unique($menu_group);
$tmp = array();
$tmp['menugroup'] = '';
foreach ($menu_group as $key_ => $value) {
$data_menu[$key_]['menugroup'] = $value;
foreach ($menu as $res) {
if ($res['menu_title']) {
$res['menu_title'] = $res['menu_title'];
}
$url_params = unserialize($res['addon']);
if (count($url_params['url_params']) > 0) {
$query = '&' . utils::http_build_query($url_params['url_params']);
$res['menu_path'] = $res['menu_path'] . $query;
}
if (!$res['menu_group']) {
$tmp['menu'][$res['menu_id']] = $res;
} else {
//$res['menu_group'] = ($res['menu_group']);
if ($res['menu_group'] == $value) {
$data_menu[$key_]['menu'][] = $res;
}
}
}
}
$data_menu['nogroup'] = $tmp;
return $data_menu;
}
示例7: _header
public function _header($subheader = '')
{
$render = $this->render;
//$render->pagedata['inputhtml'] = $this->toinput($this->params);
$render->pagedata['subheader'] = $subheader;
$query = $_GET;
unset($query['page']);
$query = utils::http_build_query($query);
$render->pagedata['query'] = $query;
//$this->html_header = $render->fetch('finder/view/header.html');
}
示例8: access_url
private function access_url($token)
{
$headers = array('oauth_consumer_key' => $this->oauth_consumer_key, 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_timestamp' => time(), 'oauth_nonce' => md5(microtime()), 'oauth_version' => '1.0', 'oauth_token' => $token['oauth_token']);
$headers['oauth_signature'] = $this->to_signature_key('GET', $this->access_token_url, $headers, $this->oauth_consumer_secret . '&' . $token['oauth_token_secret']);
return $this->access_token_url . '?' . utils::http_build_query($headers);
}
示例9: input_goods_select
function input_goods_select($params)
{
$return_url = $params['return_url'] ? $params['return_url'] : 'index.php?app=desktop&ctl=editor&act=object_rows';
$callback = $params['callback'] ? $params['callback'] : '';
$init = $params['data']['init'] ? $params['data']['init'] : '';
$params['breakpoint'] = isset($params['breakpoint']) ? $params['breakpoint'] : 20;
$object = $params['object'];
if (strpos($params['object'], '@') !== false) {
list($object, $app_id) = explode('@', $params['object']);
$params['object'] = $object;
} elseif ($params['app']) {
$app_id = $params['app'];
} else {
$app_id = $this->app->app_id;
}
$app = app::get($app_id);
$o = $app->model($object);
$render = new base_render(app::get('b2c'));
$ui = new base_component_ui($app);
$dbschema = $o->get_schema();
$params['app_id'] = $app_id;
if (isset($params['filter'])) {
if (!is_array($params['filter'])) {
parse_str($params['filter'], $params['filter']);
}
}
$params['domid'] = substr(md5(uniqid()), 0, 6);
$key = $params['key'] ? $params['key'] : $dbschema['idColumn'];
$textcol = $params['textcol'] ? $params['textcol'] : $dbschema['textColumn'];
//显示列 可以多列显示 不完全修改 。。。。。。。
$textcol = explode(',', $textcol);
$_textcol = $textcol;
$textcol = $textcol[0];
$tmp_filter = $params['filter'] ? $params['filter'] : null;
$count = $o->count($tmp_filter);
if ($count <= $params['breakpoint'] && !$params['multiple'] && $params['select'] != 'checkbox') {
if (strpos($textcol, '@') === false) {
$list = $o->getList($key . ',' . $textcol, $tmp_filter);
if (!$list[0]) {
$type = array();
}
foreach ($list as $row) {
$label = $row[$textcol];
if (!$label && method_exists($o, 'title_modifier')) {
$label = $o->title_modifier($row[$key]);
}
$type[$row[$key]] = $label;
}
} else {
list($name, $table, $app_id) = explode('@', $textcol);
$app = $app_id ? app::get($app_id) : $app;
$mdl = $app->model($table);
$list = $o->getList($key, $tmp_filter);
foreach ($list as $row) {
$tmp_row = $mdl->getList($name, array($mdl->idColumn => $row[$key]), 0, 1);
$label = $tmp_row[0][$name];
if (!$label && method_exists($o, 'title_modifier')) {
$label = $o->title_modifier($row[$key]);
}
$type[$row[$key]] = $label;
}
}
$tmp_params['name'] = $params['name'];
$tmp_params['value'] = $params['value'];
$tmp_params['type'] = $type;
if ($callback) {
$tmp_params['onchange'] = $callback . '(this)';
}
$str_filter = $ui->input($tmp_params);
unset($tmp_params);
return $str_filter;
}
$params['idcol'] = $keycol['keycol'] = $key;
$params['textcol'] = implode(',', $_textcol);
$params['_textcol'] = $_textcol;
unset($params['app']);
if ($params['data']) {
$_params = (array) $params['data'];
unset($params['data']);
$params = array_merge($params, $_params);
}
if (is_array($params['items'])) {
foreach ($params['items'] as $key => $item) {
$items[$key] = $item[$params['idcol']];
}
}
$params['return_url'] = urlencode($params['return_url']);
$vars = $params;
$vars['items'] = $items;
$object = utils::http_build_query($vars);
$url = 'index.php?app=b2c&ctl=admin_goods&act=finder_goods_select';
$render->pagedata['string'] = $string;
$render->pagedata['url'] = $url;
$render->pagedata['return_url'] = $return_url;
$render->pagedata['id'] = $id;
$render->pagedata['params'] = $params;
$render->pagedata['object'] = $object;
$render->pagedata['callback'] = $callback;
$render->pagedata['init'] = $init;
$render->pagedata['value'] = $params['value'];
//.........这里部分代码省略.........
示例10: login
/**
* 登录调用的方法
* @param array $params 认证传递的参数,包含认证类型,跳转地址等
*/
function login($params)
{
kernel::single('site_controller')->RemoveXSS($params['module']);
//过滤xss攻击
$auth = pam_auth::instance($params['type']);
$auth->set_appid($params['appid']);
try {
class_exists($params['module']);
} catch (Exception $e) {
kernel::single('site_router')->http_status('p404');
}
if ($params['module']) {
if (class_exists($params['module']) && ($passport_module = kernel::single($params['module']))) {
if ($passport_module instanceof pam_interface_passport) {
$module_uid = $passport_module->login($auth, $auth_data);
if ($module_uid) {
$auth_data['account_type'] = $params['type'];
$auth->account()->update($params['module'], $module_uid, $auth_data);
}
$log = array('event_time' => time(), 'event_type' => $auth->type, 'event_data' => base_request::get_remote_addr() . ':' . $auth_data['log_data'] . ':' . $_SERVER['HTTP_REFERER']);
app::get('pam')->model('log')->insert($log);
if (!$module_uid) {
$_SESSION['last_error'] = $auth_data['log_data'];
}
$_SESSION['type'] = $auth->type;
$_SESSION['login_time'] = time();
$params['member_id'] = $_SESSION['account'][$params['type']];
$params['uname'] = $_POST['uname'];
/*foreach(kernel::servicelist('pam_login_listener') as $service)
{
$service->listener_login($params);
}*/
if ($params['redirect'] && $module_uid) {
$service = kernel::service('callback_infomation');
if (is_object($service)) {
if (method_exists($service, 'get_callback_infomation') && $module_uid) {
$data = $service->get_callback_infomation($module_uid, $params['type']);
if (!$data) {
$url = '';
} else {
$url = '?' . utils::http_build_query($data);
}
}
}
}
if ($_COOKIE['autologin'] > 0) {
kernel::single('base_session')->set_cookie_expires($_COOKIE['autologin']);
//如果自动登录,设置cookie过期时间,单位:分
}
if ($_SESSION['callback'] && !$module_uid) {
$callback_url = $_SESSION['callback'];
unset($_SESSION['callback']);
header('Location:' . urldecode($callback_url));
exit;
} else {
header('Location:' . base64_decode(str_replace('%2F', '/', urldecode($params['redirect']))) . $url);
exit;
}
}
} else {
}
}
}
示例11: detail_basic
//.........这里部分代码省略.........
}
$objMath = kernel::single('ectools_math');
$render->pagedata['order']['pmt_amount'] = $objMath->number_plus(array($render->pagedata['order']['pmt_goods'], $render->pagedata['order']['pmt_order']));
if ($render->pagedata['order']['pmt_amount'] > 0) {
if (isset($aOrder['order_pmt']) && $aOrder['order_pmt']) {
foreach ($aOrder['order_pmt'] as $arr_pmts) {
if ($arr_pmts['pmt_type']) {
switch ($arr_pmts['pmt_type']) {
case 'order':
case 'coupon':
$obj_save_rules = $this->app->model('sales_rule_order');
break;
case 'goods':
$obj_save_rules = $this->app->model('sales_rule_goods');
break;
default:
break;
}
}
$arr_save_rules = $obj_save_rules->dump($arr_pmts['pmt_id']);
$render->pagedata['order']['use_pmt'] .= $arr_save_rules['name'] . ', ';
}
if (strpos($render->pagedata['order']['use_pmt'], ', ') !== false) {
$render->pagedata['order']['use_pmt'] = substr($render->pagedata['order']['use_pmt'], 0, strlen($render->pagedata['order']['use_pmt']) - 2);
}
}
}
// 判断是否使用了推广服务
$is_bklinks = 'false';
$obj_input_helpers = kernel::servicelist("html_input");
if (isset($obj_input_helpers) && $obj_input_helpers) {
foreach ($obj_input_helpers as $obj_bdlink_input_helper) {
if (get_class($obj_bdlink_input_helper) == 'bdlink_input_helper') {
$is_bklinks = 'true';
}
}
}
$render->pagedata['is_bklinks'] = $is_bklinks;
/** 是否开启配送时间的限制 */
$this->pagedata['site_checkout_receivermore_open'] = $this->app->getConf('site.checkout.receivermore.open');
// 得到订单的优惠方案
$arr_pmt_lists = array();
$arr_order_items = array();
$arr_gift_items = array();
$arr_extends_items = array();
$this->get_pmt_lists($aOrder, $arr_pmt_lists);
$this->get_goods_detail($aOrder, $arr_order_items, $arr_gift_items, $arr_extends_items);
$render->pagedata['goodsItems'] = $arr_order_items;
$render->pagedata['giftItems'] = $arr_gift_items;
$render->pagedata['arr_extends_items'] = $arr_extends_items;
$render->pagedata['order']['pmt_list'] = $arr_pmt_lists;
$obj_action_button = kernel::servicelist('b2c_order.b2c_finder_orders');
$arr_obj_action_button = array();
if ($obj_action_button) {
foreach ($obj_action_button as $object) {
if (!is_object($object)) {
continue;
}
if (method_exists($object, 'get_order')) {
$index = $object->get_order();
} else {
$index = 10;
}
while (true) {
if (!isset($arr_obj_action_button[$index])) {
break;
}
$index++;
}
$arr_obj_action_button[$index] = $object;
}
}
ksort($arr_obj_action_button);
if ($arr_obj_action_button) {
$render->pagedata['action_buttons'] = array();
$render->pagedata['ext_action_buttons'] = array();
foreach ($arr_obj_action_button as $obj) {
$obj->is_display($this->odr_action_buttons);
$render->pagedata['action_buttons'] = $obj->get_buttons($render->pagedata['order'], $this->odr_action_is_all_disable);
$render->pagedata['ext_action_buttons'] = $obj->get_extension_buttons($render->pagedata['order']);
}
}
// 添加 html 埋点
foreach (kernel::servicelist('b2c.order_add_html') as $services) {
if (is_object($services)) {
if (method_exists($services, 'fetchHtml')) {
$services->fetchHtml($render, $order_id, 'admin/invoice_detail.html');
}
}
}
// 判断是否安装物流单跟踪服务
//物流跟踪安装并且开启
$logisticst = app::get('b2c')->getConf('system.order.tracking');
$logisticst_service = kernel::service('b2c_change_orderloglist');
if (isset($logisticst) && $logisticst == 'true' && $logisticst_service) {
$render->pagedata['services']['logisticstrack'] = $logisticst_service;
}
$render->pagedata['services']['logisticstrack_url'] = 'index.php?' . utils::http_build_query(array('app' => 'b2c', 'ctl' => 'admin_order', 'act' => 'index', 'action' => 'detail', 'finderview' => 'detail_delivery', '_finder' => array('finder_id' => $_GET['finder_id']), 'finder_name' => $_GET['finder_id'], 'finder_id' => $_GET['finder_id'], 'id' => $order_id));
return $render->fetch('admin/order/order_detail.html');
}
示例12: column_editbutton
/**
* finder操作按钮的方法实现
* @param array dump数据库该行的信息
* @return string 操作链接的html信息
*/
public function column_editbutton($row)
{
//判断是否对接OCS
$obj_b2c_shop = app::get('b2c')->model('shop');
//ajx 添加ecos.ocs接口
$node_type = array('ecos.ome', 'ecos.ocs');
$cnt = $obj_b2c_shop->count(array('status' => 'bind', 'node_type|in' => $node_type));
if ($cnt > 0) {
return '';
}
$render = $this->app->render();
$arr = array('app' => $_GET['app'], 'ctl' => $_GET['ctl'], 'act' => $_GET['act'], 'action' => 'detail', 'finder_name' => $_GET['_finder']['finder_id'], 'finder_id' => $_GET['_finder']['finder_id'], 'finderview' => 'detail_basic');
$link = 'index.php?' . utils::http_build_query($arr) . '&id=' . $row['return_id'] . '&_finder[finder_id]=' . $_GET['_finder']['finder_id'];
$status_audit = array('id' => 'x-return-status_' . $row['return_id'] . '_2', 'href' => "index.php?app=aftersales&ctl=admin_returnproduct&act=save", 'target' => 'request::{url:\'' . $link . '&status=2\',data:\'return_id=' . $row['return_id'] . '&status=2\'}', 'comment' => 'false', 'label' => app::get('aftersales')->_('审核中'));
$status_accept = array('id' => 'x-return-status_' . $row['return_id'] . '_3', 'href' => "index.php?app=aftersales&ctl=admin_returnproduct&act=save", 'target' => 'request::{url:\'' . $link . '&status=3\',data:\'return_id=' . $row['return_id'] . '&status=3\'}', 'comment' => 'true', 'label' => app::get('aftersales')->_('接受申请'));
$status_finish = array('id' => 'x-return-status_' . $row['return_id'] . '_4', 'href' => "index.php?app=aftersales&ctl=admin_returnproduct&act=save", 'target' => 'request::{url:\'' . $link . '&status=4\',data:\'return_id=' . $row['return_id'] . '&status=4\'}', 'comment' => 'true', 'label' => app::get('aftersales')->_('完成'));
$status_reduce = array('id' => 'x-return-status_' . $row['return_id'] . '_5', 'href' => "index.php?app=aftersales&ctl=admin_returnproduct&act=save", 'target' => 'request::{url:\'' . $link . '&status=5\',data:\'return_id=' . $row['return_id'] . '&status=5\'}', 'comment' => 'true', 'label' => app::get('aftersales')->_('拒绝'));
if ($row['status'] == 1) {
$arr_links = array($status_audit, $status_accept, $status_finish, $status_reduce);
$can_process_flag = true;
} elseif ($row['status'] == 2) {
$arr_links = array($status_accept, $status_finish, $status_reduce);
$can_process_flag = true;
} elseif ($row['status'] == 3) {
$arr_links = array($status_finish, $status_reduce);
$can_process_flag = true;
} elseif ($row['status'] == 4) {
$arr_links = array();
$can_process_flag = false;
} elseif ($row['status'] == 5) {
$arr_links = array();
$can_process_flag = false;
}
$render->pagedata['arr_links'] = $arr_links;
$render->pagedata['can_process'] = $can_process_flag;
return $render->fetch('admin/actions.html');
}
示例13: input_object
//.........这里部分代码省略.........
$mdl = $app->model($table);
$list = $o->getList($key, $tmp_filter);
foreach ($list as $row) {
$tmp_row = $mdl->getList($name, array($mdl->idColumn => $row[$key]), 0, 1);
$label = $tmp_row[0][$name];
if (!$label && method_exists($o, 'title_modifier')) {
$label = $o->title_modifier($row[$key]);
}
$type[$row[$key]] = $label;
}
}
$tmp_params['name'] = $params['name'];
$tmp_params['value'] = $params['value'];
$tmp_params['type'] = $type;
if ($callback) {
$tmp_params['onchange'] = $callback . '(this)';
}
$str_filter = $ui->input($tmp_params);
unset($tmp_params);
return $str_filter;
}
$params['idcol'] = $keycol['keycol'] = $key;
$params['textcol'] = implode(',', $_textcol);
$params['_textcol'] = $_textcol;
if ($params['value']) {
if (strpos($params['view'], ':') !== false) {
list($view_app, $view) = explode(':', $params['view']);
$params['view_app'] = $view_app;
$params['view'] = $view;
}
if (is_string($params['value'])) {
$params['value'] = explode(',', $params['value']);
}
$params['items'] =& $o->getList('*', array($key => $params['value']), 0, -1);
//过滤不存在的值
//某些数据被添加后 可能原表数据已删除,但此处value中还存在。
$_params_items_row_key = array();
foreach ($params['items'] as $k => $_params_items_row) {
$_params_items_row_key[] = $_params_items_row[$key];
if ($extend) {
$params['items'][$k]['extend'] = $extend[$_params_items_row[$key]];
}
}
$params['value'] = implode(',', $_params_items_row_key);
}
if (isset($params['multiple']) && $params['multiple']) {
if (isset($params['items']) && count($params['items'])) {
$params['display_datarow'] = 'true';
}
$render->pagedata['_input'] = $params;
return $render->fetch('finder/input.html');
} else {
if ($params['value'] && $params['select'] != 'checkbox') {
$string = $params['items'][0][$textcol];
} else {
$string = $params['emptytext'] ? $params['emptytext'] : app::get('desktop')->_('请选择...');
}
$str_app = $params['app'];
unset($params['app']);
if ($params['data']) {
$_params = (array) $params['data'];
unset($params['data']);
$params = array_merge($params, $_params);
}
if ($params['select'] == 'checkbox') {
if ($params['default_id']) {
$params['domid'] = $params['default_id'];
}
$params['type'] = 'checkbox';
} else {
$id = "handle_" . $params['domid'];
$params['type'] = 'radio';
$getdata = '&singleselect=radio';
}
if (is_array($params['items'])) {
foreach ($params['items'] as $key => $item) {
$items[$key] = $item[$params['idcol']];
$params['items'][$key]['extend'] = $params['extend'][$key];
}
}
$params['return_url'] = urlencode($return_url);
$vars = $params;
$vars['items'] = $items;
$getobject = array('obj_filter' => $vars['obj_filter'], 'filter' => $vars['filter'], 'name' => $vars['name'], 'object' => $vars['object']);
$getobject = utils::http_build_query($getobject);
$object = utils::http_build_query($vars);
//$url = 'index.php?app=desktop&act=alertpages&goto='.urlencode('index.php?app=desktop&ctl=editor&act=finder_common&app_id='.$app_id.'&'.$object.$getdata);
$url = 'index.php?app=desktop&act=alertpages&goto=' . urlencode('index.php?app=desktop&ctl=editor&act=finder_common&app_id=' . $app_id . '&' . $getobject . $getdata);
$render->pagedata['string'] = $string;
$render->pagedata['url'] = $url;
$render->pagedata['app'] = 'app=' . $str_app;
$render->pagedata['return_url'] = $return_url;
$render->pagedata['id'] = $id;
$render->pagedata['params'] = $params;
$render->pagedata['object'] = $object;
$render->pagedata['callback'] = $callback;
$render->pagedata['init'] = $init;
return $render->fetch('finder/input_radio.html');
}
}
示例14: column_editbutton
public function column_editbutton($row)
{
$render = $this->app->render();
$arr = array('app' => $_GET['app'], 'act' => $_GET['act'], 'action' => 'detail', 'id' => $_GET['id'], 'finder_name' => $_GET['_finder']['finder_id']);
/** 得到订单操作按钮的详细情形 **/
$obj_order = $this->app->model('orders');
$arr_order = $obj_order->dump($row['order_id']);
$arr_order['flow'] = array('refund' => $this->app->getConf('order.flow.refund'), 'consign' => $this->app->getConf('order.flow.consign'), 'reship' => $this->app->getConf('order.flow.reship'), 'payed' => $this->app->getConf('order.flow.payed'));
$actionbutton = kernel::single('b2c_order_actionbutton');
$actions = $actionbutton->get_buttons($arr_order, $this->odr_action_is_all_disable);
$extends_actions = $actionbutton->get_extension_buttons($arr_order);
//$all_actions = array_merge($actions['sequence'],$actions['re_sequence'],$extends_actions);
/** 结束 **/
/** 根据状态,判定显示与否 **/
if ($actions['sequence']) {
foreach ($actions['sequence'] as $key => $buttons) {
if ($buttons['disable']) {
unset($actions['sequence'][$key]);
}
}
}
if ($actions['re_sequence']) {
foreach ($actions['re_sequence'] as $key => $buttons) {
if ($buttons['disable']) {
unset($actions['re_sequence'][$key]);
}
}
}
if ($extends_actions) {
foreach ($extends_actions as $key => $buttons) {
if ($buttons['disable']) {
unset($extends_actions[$key]);
}
}
}
/** 结束 **/
/** 订单编辑按钮 **/
if ($arr_order['pay_status'] == '0' && !$arr_order['ship_status'] && $arr_order['status'] == 'active') {
$order_edit_disable = false;
} else {
$order_edit_disable = true;
}
/** 结束 **/
// 判定是否绑定ome或者其他后端店铺
$obj_b2c_shop = $this->app->model('shop');
//ajx ecos.ocs
$node_type = array('ecos.ome', 'ecos.ocs');
$cnt = $obj_b2c_shop->count(array('status' => 'bind', 'node_type|in' => $node_type));
if ($cnt > 0) {
$order_edit_disable = true;
}
/** 订单分组操作链接 **/
if (!$order_edit_disable) {
$arr_link['info']['edit'] = array('href' => 'index.php?app=' . $_GET['app'] . '&ctl=admin_order&act=showEdit&p[0]=' . $row['order_id'] . '&finder_id=' . $_GET['_finder']['finder_id'], 'label' => '订单编辑', 'target' => '_blank', 'disable' => $order_edit_disable);
}
if ($actions['sequence']) {
foreach ($actions['sequence'] as $key => $link) {
$pre = $link['flow'] ? 'go' : 'do';
$arr_link['sequence'][$key] = array('href' => 'javascript:void(0);', 'submit' => 'index.php?app=' . $link['app'] . '&ctl=admin_order&act=' . $pre . $link['act'] . '&p[0]=' . $row['order_id'], 'label' => $link['label'], 'target' => $link['confirm'] ? 'confirm' : 'dialog::{title:\'' . $link['label'] . ':' . $row['order_id'] . '\',width:800,height:420}', 'disable' => $link['disable'], 'confirm' => $link['confirm']);
}
}
if ($actions['re_sequence']) {
foreach ($actions['re_sequence'] as $key => $link) {
$pre = $link['flow'] ? 'go' : 'do';
$arr_link['re_sequence'][$key] = array('href' => 'javascript:void(0);', 'submit' => 'index.php?app=' . $link['app'] . '&ctl=admin_order&act=' . $pre . $link['act'] . '&p[0]=' . $row['order_id'], 'label' => $link['label'], 'target' => $link['confirm'] ? 'confirm' : 'dialog::{title:\'' . $link['label'] . ':' . $row['order_id'] . '\',width:800,height:420}', 'disable' => $link['disable'], 'confirm' => $link['confirm']);
}
}
if ($extends_actions) {
foreach ($extends_actions as $key => $link) {
$pre = $link['flow'] ? 'go' : 'do';
$arr_link['extends'][$key] = array('href' => 'javascript:void(0);', 'submit' => 'index.php?app=' . $link['app'] . '&ctl=admin_order&act=' . $pre . $link['act'] . '&p[0]=' . $row['order_id'], 'label' => $link['label'], 'target' => $link['confirm'] ? 'confirm' : 'dialog::{title:\'' . $link['label'] . ':' . $row['order_id'] . '\',width:800,height:420}', 'disable' => $link['disable'], 'confirm' => $link['confirm']);
}
}
$arr_link['finder']['remark'] = array('href' => 'javascript:void(0);', 'submit' => 'index.php?' . utils::http_build_query($arr) . '&ctl=admin_order&finderview=detail_mark&id=' . $row['order_id'] . '&_finder[finder_id]=' . $_GET['_finder']['finder_id'], 'label' => '订单备注', 'target' => 'tab', 'disable' => true);
/** 结束 **/
/** 对所有链接的修改 **/
$obj_editbuttons = kernel::servicelist('b2c_order.b2c_order_editbutton_modify');
$arr_obj_editbutton = array();
if ($obj_editbuttons) {
foreach ($obj_editbuttons as $object) {
if (!is_object($object)) {
continue;
}
if (method_exists($object, 'get_order')) {
$index = $object->get_order();
} else {
$index = 10;
}
while (true) {
if (!isset($arr_obj_editbutton[$index])) {
break;
}
$index++;
}
$arr_obj_editbutton[$index] = $object;
}
}
ksort($arr_obj_editbutton);
if ($arr_obj_editbutton) {
foreach ($arr_obj_editbutton as $obj) {
//.........这里部分代码省略.........
示例15: login
/**
* 登录调用的方法.
*
* @param array $params 认证传递的参数,包含认证类型,跳转地址等
*/
public function login($params)
{
$params['module'] = utils::_filter_input($params['module']);
//过滤xss攻击
$auth = pam_auth::instance($params['type']);
$auth->set_appid($params['appid']);
if (!class_exists($params['module'])) {
vmc::singleton('site_router')->http_status(500);
}
if ($params['module']) {
if (class_exists($params['module']) && ($passport_module = vmc::singleton($params['module']))) {
if ($passport_module instanceof pam_interface_passport) {
$module_uid = $passport_module->login($auth, $auth_data);
if ($module_uid) {
$auth_data['account_type'] = $params['type'];
$auth->account()->update($params['module'], $module_uid, $auth_data);
}
$log = array('event_time' => time(), 'event_type' => $auth->type, 'event_data' => base_request::get_remote_addr() . ':' . $auth_data['log_data'] . ':' . $_SERVER['HTTP_REFERER']);
app::get('pam')->model('log_desktop')->insert($log);
if (!$module_uid) {
$_SESSION['last_error'] = $auth_data['log_data'];
}
$_SESSION['type'] = $auth->type;
$_SESSION['login_time'] = time();
$params['member_id'] = $_SESSION['account'][$params['type']];
$params['uname'] = $_POST['uname'];
foreach (vmc::servicelist('pam_login_listener') as $service) {
$service->listener_login($params);
}
if ($params['redirect'] && $module_uid) {
$service = vmc::service('callback_infomation');
if (is_object($service)) {
if (method_exists($service, 'get_callback_infomation') && $module_uid) {
$data = $service->get_callback_infomation($module_uid, $params['type']);
if (!$data) {
$url = '';
} else {
$url = '?' . utils::http_build_query($data);
}
}
}
}
if ($_COOKIE['autologin'] > 0) {
vmc::singleton('base_session')->set_cookie_expires($_COOKIE['autologin']);
//如果自动登录,设置cookie过期时间,单位:分
}
if ($_COOKIE['S']['SIGN']['AUTO'] > 0) {
$minutes = 10 * 24 * 60;
vmc::singleton('base_session')->set_cookie_expires($minutes);
}
if ($_SESSION['callback'] && !$module_uid) {
$callback_url = $_SESSION['callback'];
unset($_SESSION['callback']);
header('Location:' . urldecode($callback_url));
exit;
} else {
$url = base64_decode(str_replace('%2F', '/', urldecode($params['redirect']))) . $url;
if (!$url) {
foreach (vmc::$url_app_map as $key => $value) {
$app = current($value);
if ($app == 'desktop') {
$url = $key;
}
}
}
header('Location: ' . $url);
exit;
}
}
} else {
}
}
}