diff --git a/module/block/control.php b/module/block/control.php index d5acc07136..cc3a3bca8e 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -289,7 +289,7 @@ class block extends control { if(!$this->selfCall) { - $lang = $this->get->lang; + $lang = str_replace('_', '-', $this->get->lang); $this->app->setClientLang($lang); $this->app->loadLang('common'); $this->app->loadLang('block'); @@ -586,8 +586,9 @@ class block extends control { $this->app->loadClass('pager', $static = true); $num = isset($this->params->num) ? $this->params->num : 0; + $type = isset($this->params->type) ? $this->params->type : ''; $pager = pager::init(0, $num , 1); - $this->view->productStats = $this->loadModel('product')->getStats('order_desc', $this->viewType != 'json' ? $pager : '', $this->params->type); + $this->view->productStats = $this->loadModel('product')->getStats('order_desc', $this->viewType != 'json' ? $pager : '', $type); } /** diff --git a/module/block/model.php b/module/block/model.php index 11076e5bc4..40abefa4b2 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -187,14 +187,6 @@ class blockModel extends model public function getListParams($module = '') { $params = new stdclass(); - - if($module == 'project' or $module == 'product') - { - $params->type['name'] = $this->lang->block->type; - $params->type['options'] = $this->lang->block->typeList->$module; - $params->type['control'] = 'select'; - } - $params = $this->onlyNumParams($module, $params); return json_encode($params); } @@ -375,7 +367,11 @@ class blockModel extends model */ public function getProductParams($module = '') { - return $this->getListParams($module); + $params->type['name'] = $this->lang->block->type; + $params->type['options'] = $this->lang->block->typeList->product; + $params->type['control'] = 'select'; + + return json_encode($this->onlyNumParams($module, $params)); } /** @@ -386,7 +382,11 @@ class blockModel extends model */ public function getProjectParams($module = '') { - return $this->getListParams($module); + $params->type['name'] = $this->lang->block->type; + $params->type['options'] = $this->lang->block->typeList->project; + $params->type['control'] = 'select'; + + return json_encode($this->onlyNumParams($module, $params)); } /**