This commit is contained in:
liumengyi
2022-06-24 09:05:46 +08:00
parent 0b0f026964
commit 48532553f2
2 changed files with 20 additions and 8 deletions
+8 -2
View File
@@ -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);
+12 -6
View File
@@ -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 = "<div class='btn-group'>";
$html .= html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=card"), "<i class='icon icon-cards-view'></i>", '', "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"), "<i class='icon icon-bars'></i>", '', "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"), "<i class='icon icon-cards-view'></i>", '', "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"), "<i class='icon icon-bars'></i>", '', "title={$this->lang->doc->browseTypeList['list']} class='btn btn-icon" . ($viewType == 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'");
$html .= "</div>";
return $html;