moduleName。*/ /* If the original module name of the request is set, assign it to $this->moduleName. */ if(isset($this->app->rawModule)) { $this->moduleName = $this->app->rawModule; } else { $this->moduleName = $this->app->getModuleName(); } } /** * 设置方法名。 * Set the $methodName property. * * @access public * @return void */ public function setMethodName() { /* 如果设置了请求的原始方法名,则把其赋值给$this->methodName。*/ /* If the original method name of the request is set, assign it to $this->methodName. */ if(isset($this->app->rawMethod)) { $this->methodName = $this->app->rawMethod; } else { $this->methodName = $this->app->getMethodName(); } } /** * 如果设置了请求的原始模块名和方法名,则去掉module参数,以便分页功能生成原始请求的URL而不是转换后的工作流URL。 * If the original module name and method name of the request are set, the module parameter is removed so that * the paging function generates the URL of the original request instead of the converted workflow URL. * * @access public * @return void */ public function setParams($params = array()) { if(isset($this->app->rawParams)) { parent::setParams($this->app->rawParams); } else { parent::setParams(); } /* If the original module name and method name of the request are set, the module parameter is removed. */ if($this->app->isFlow) unset($this->params['module']); } /** * Show pager. * * @param string $align * @param string $type * @param int $maxRecPerPage * @access public * @return void */ public function show($align = 'right', $type = 'full', $maxRecPerPage = 0) { if($type == 'pagerjs') { $this->setParams(); $params = $this->params; foreach($params as $key => $value) { if(strtolower($key) == 'recperpage') $params[$key] = '{recPerPage}'; if(strtolower($key) == 'pageid') $params[$key] = '{page}'; } if($this->recTotal == 0) { echo "
" . $this->lang->pager->noRecord . '
'; } else { $pageSizeOptions = ''; if($maxRecPerPage) { /* Set record per page. */ for($i = 5; $i <= 50; $i += 5) $options[] = $i; $options = array_merge($options, array(100, 200, 500, 1000, 2000)); $pageSizeOptions = 'data-page-size-options="'; foreach($options as $option) { $pageSizeOptions .= "$option,"; if($option >= $maxRecPerPage) { $pageSizeOptions = trim($pageSizeOptions, ',') . '"'; break; } } } global $app, $lang; $appendApp = ''; $moduleName = $this->moduleName; if(isset($lang->navGroup->{$moduleName}) and $lang->navGroup->{$moduleName} != $app->tab) $appendApp = "#app={$app->tab}"; echo ""; } } else { parent::show($align, $type); } } }