diff --git a/config/filter.php b/config/filter.php index f35c2f8ac3..836bb2e2e7 100644 --- a/config/filter.php +++ b/config/filter.php @@ -203,6 +203,7 @@ $filter->block->main->get['blockTitle'] = 'reg::any'; $filter->block->main->get['entry'] = 'code'; $filter->block->main->get['lang'] = 'reg::lang'; $filter->block->main->get['mode'] = 'code'; +$filter->block->main->get['dashboard'] = 'code'; $filter->block->main->get['param'] = 'reg::base64'; $filter->block->main->get['sso'] = 'reg::base64'; diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index d3fe92955d..0701eeebb5 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -65,6 +65,7 @@ class baseHelper /* 设置$appName和$moduleName。Set appName and moduleName. */ global $app, $config; $programID = $programID ? $programID : $app->session->program; + if(strpos($moduleName, '.') !== false) { list($appName, $moduleName) = explode('.', $moduleName); diff --git a/module/block/control.php b/module/block/control.php index c9fe7aa843..7b1c957c65 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -64,7 +64,8 @@ class block extends control } elseif(isset($this->lang->block->moduleList[$module])) { - $module == 'program' ? $this->get->set('mode', 'getprogramlist') : $this->get->set('mode', 'getblocklist'); + $this->get->set('mode', 'getblocklist'); + if($module == 'program') $this->get->set('dashboard', 'program'); $this->view->blocks = $this->fetch('block', 'main', "module=$module&id=$id"); $this->view->module = $module; } @@ -410,10 +411,10 @@ class block extends control $mode = strtolower($this->get->mode); - if($mode == 'getblocklist' || $mode == 'getprogramlist') + if($mode == 'getblocklist') { - $type = $mode == 'getblocklist' ? '' : 'program'; - $blocks = $this->block->getAvailableBlocks($module, $type); + $dashboard = $this->get->dashboard; + $blocks = $this->block->getAvailableBlocks($module, $dashboard); if(!$this->selfCall) { echo $blocks; diff --git a/module/block/model.php b/module/block/model.php index c3219e2b3c..df11cfcb06 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -250,10 +250,10 @@ class blockModel extends model * @access public * @return string */ - public function getAvailableBlocks($module = '', $type = '') + public function getAvailableBlocks($module = '', $dashboard = '') { $blocks = $this->lang->block->availableBlocks; - if($type == 'program') + if($dashboard == 'program') { $programID = $this->session->program; $program = $this->loadModel('project')->getByID($programID);