diff --git a/module/api/control.php b/module/api/control.php index f078d23bdf..99dd6072c4 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -73,11 +73,11 @@ class api extends control if($libs) $this->lang->modulePageNav = $this->generateLibsDropMenu($libs, $libID, $release); $this->setMenu($libID, $moduleID); - if($apiID == 0) $this->lang->TRActions = ' ' . $this->lang->api->search . '' . $this->lang->TRActions; + $this->lang->TRActions = ' ' . $this->lang->api->search . '' . $this->lang->TRActions; /* Build the search form. */ $queryID = $param == 'bySearch' ? (int)$queryID : 0; - $actionURL = $this->createLink('api', 'index', "libID=$libID&moduleID=$moduleID&apiID=$apiID&version=$version&release=$release&appendLib=$appendLib&queryID=myQueryID¶m=bySearch"); + $actionURL = $this->createLink('api', 'index', "libID=$libID&moduleID=0&apiID=0&version=0&release=0&appendLib=0&queryID=myQueryID¶m=bySearch"); $this->api->buildSearchForm($lib,$queryID, $actionURL); if($param == 'bySearch') diff --git a/module/doc/control.php b/module/doc/control.php index c5a6b07dc4..8f20746715 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -904,10 +904,12 @@ class doc extends control * @param int $recTotal * @param int $recPerPage * @param int $pageID + * @param string $searchTitle + * * @access public * @return void */ - public function showFiles($type, $objectID, $viewType = '', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function showFiles($type, $objectID, $viewType = '', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $searchTitle = '') { if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'card'; setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true); @@ -923,8 +925,12 @@ class doc extends control $table = $this->config->objectTables[$type]; $object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch(); + if(!empty($_POST)) $searchTitle = $this->post->title; + if(empty($_POST) and !empty($searchTitle)) $this->post->title = $searchTitle; + $this->lang->TRActions = $this->doc->buildCollectButton4Doc(); - $this->lang->TRActions .= $this->doc->buildBrowseSwitch($type, $objectID, $viewType); + $this->lang->TRActions .= $this->doc->buildBrowseSwitch($type, $objectID, $viewType, $orderBy, $recTotal, $recPerPage, $pageID, $searchTitle); + if($this->app->tab == 'doc') $this->app->rawMethod = $type; /* Load pager. */ $this->app->loadClass('pager', $static = true); diff --git a/module/doc/model.php b/module/doc/model.php index d7bfe00c74..355551f50f 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2215,17 +2215,23 @@ class docModel extends model /** * Build browse switch button. * - * @param int $type - * @param int $objectID - * @param int $viewType + * @param int $type + * @param int $objectID + * @param int $viewType + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID + * @param string $searchTitle + * * @access public * @return void */ - public function buildBrowseSwitch($type, $objectID, $viewType) + public function buildBrowseSwitch($type, $objectID, $viewType, $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $searchTitle = '') { $html = "
"; - $html .= html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=card"), "", '', "title={$this->lang->doc->browseTypeList['grid']} class='btn btn-icon" . ($viewType != 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'"); - $html .= html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=list"), "", '', "title={$this->lang->doc->browseTypeList['list']} class='btn btn-icon" . ($viewType == 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'"); + $html .= html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=card&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&searchTitle=$searchTitle"), "", '', "title={$this->lang->doc->browseTypeList['grid']} class='btn btn-icon" . ($viewType != 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'"); + $html .= html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=list&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&searchTitle=$searchTitle"), "", '', "title={$this->lang->doc->browseTypeList['list']} class='btn btn-icon" . ($viewType == 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'"); $html .= "
"; return $html;