function index() { $this->pagedata['statusId'] = $this->system->getConf('shopex.wss.enable'); if (!IN_AJAX) { foreach ($_GET as $k => $v) { if (substr($k, 0, 1) == '_' && strlen($k) > 1) { $setting[substr($k, 1)] = $v; } } if (constant('SAAS_MODE')) { $saas =& $this->system->loadModel('service/saas'); if ($shopinfo = $saas->native_svc('host.getinfo', array('host_id' => HOST_ID))) { if ($shopinfo['response_code'] > 0) { $this->pagedata['shop_service_info'] = $shopinfo['response_error']; } else { $this->pagedata['shop_service_info'] .= $shopinfo['service_name']; $this->pagedata['shop_service_info'] .= $shopinfo['status'] == 'tryout' ? __('(试用)') : ''; $this->pagedata['shop_service_info'] .= '[' . date('y/m/d', $shopinfo['add_time']) . '-' . date('y/m/d', $shopinfo['finish_time']) . ']'; } } } $titlename = $this->system->getConf('system.shopname'); $this->pagedata['title'] = $titlename . ' - Powered By ShopEx'; $this->pagedata['shopname'] = empty($titlename) ? __("点此设置商店名称") : $titlename; $this->pagedata['session_id'] = $this->system->sess_id; $this->pagedata['status_url'] = urlencode(PHP_SELF . '?ctl=default&act=status&sess_id=' . $this->system->sess_id); $this->pagedata['shopadmin_dir'] = '/' . SHOPADMIN_PATH . '/'; $this->pagedata['shop_base'] = $this->system->base_url(); $this->pagedata['uname'] = $this->system->op_name; $this->pagedata['shop_type_info'] = '1to1' == $this->system->getConf('system.b2c_shop_type') ? '批零店' : '加盟连锁店'; if (!function_exists('admin_menu_filter')) { require CORE_INCLUDE_DIR . '/shop/admin.menu_filter.php'; } $this->pagedata['menu'] =& admin_menu_filter($this->system, null); $this->_fetchM($this->pagedata['menu'], $menus, array()); $menus = array_values($menus); foreach ($menus as $i => $m) { foreach ($menus[$i]['key'] as $k => $v) { $mkey[] = array($k, $i); } unset($menus[$i]['key']); } $i = count($menus); foreach ($mlist as $k => $v) { $menus[$i] = $v; $mkey[] = array($k, $i); $i++; } $this->pagedata['guide'] = $this->system->getConf('system.guide'); $this->pagedata['scripts'] = find(dirname($_SERVER['SCRIPT_FILENAME']) . '/js_src', 'js'); $this->pagedata['mlist'] = array('menus' => &$menus, 'key' => &$mkey); $this->display('index.html'); } else { $this->system->error(401); } }
function page($view) { if (!isset($_GET['_ajax'])) { header('Location: index.php#' . $_SERVER['QUERY_STRING']); } if (defined('CUSTOM_CORE_DIR') && file_exists($cusview = CUSTOM_CORE_DIR . '/' . __ADMIN__ . '/view/' . $view)) { $view = 'file:' . realpath($cusview); } $this->pagedata['_PAGE_'] = $view; $this->pagedata['_inurl'] = ($p = strpos($_SERVER['REQUEST_URI'], '&_ajax=')) ? substr($_SERVER['REQUEST_URI'], 0, $p) : $_SERVER['REQUEST_URI']; //if($this->with_nav)$this->pagedata['_path_'] = $this->path; $_SESSION['message'] = ''; $output = $this->fetch('page.html'); if (!isset($this->workground)) { if ($p = strpos('/', $_GET['ctl'])) { $this->workground = substr($_GET['ctl'], 0, $p); } else { $this->workground = substr(get_class($this), 4); } } if ($_GET['_wg'] != $this->workground && $this->workground && !$_GET['_singlepage']) { if (!($in_store = array_flip(explode(',', $_GET['_ss']))) || !isset($in_store[$this->workground])) { $this->pagedata = array(); if (!function_exists('admin_menu_filter')) { require CORE_INCLUDE_DIR . '/shop/admin.menu_filter.php'; } $menus =& admin_menu_filter($this->system, $this->workground); $trees = array(); foreach ($menus as $k => $m) { if ($m['type'] == 'tree') { $o =& $this->system->loadModel($menus[$k]['model']); // $menus[$k] = array_merge($menus[$k], $o->treeOptions()); $trees[] = array('model' => $menus[$k]['model'], 'actions' => json_encode($menus[$k]['actions'])); //$menus[$k]['items'] = $o->getNodes(); unset($o, $opt); } } $this->pagedata = array('trees' => &$trees, 'menus' => &$menus, 'workground' => &$this->workground); $output .= '<!-----.sideContent-----' . $this->fetch('sidemenu.html') . '-----.sideContent----->'; } $output .= '<script>SideRender(\'' . $this->workground . '\');</script>'; } $this->_send($output); }