- Remove unused method and unit test of doc::getDocMenu.

This commit is contained in:
tianshujie
2023-12-08 14:32:41 +08:00
parent 84749428a6
commit d32408e6a8
2 changed files with 0 additions and 60 deletions
-33
View File
@@ -1148,39 +1148,6 @@ class docModel extends model
->fetchPairs();
}
/**
* Get doc menu.
*
* @param int $libID
* @param int $parent
* @access public
* @return array
*/
public function getDocMenu($libID, $parent, $orderBy = 'name_asc', $browseType = '')
{
if($libID == 0 and $browseType != 'collectedbyme') return array();
$modules = $this->dao->select('*')->from(TABLE_MODULE)
->where('1 = 1')
->beginIF($browseType != "collectedbyme")->andWhere('root')->eq($libID)->fi()
->beginIF($browseType == "collectedbyme")->andWhere('collector')->like("%,{$this->app->user->account},%")->fi()
->andWhere('type')->eq('doc')
->andWhere('parent')->eq($parent)
->andWhere('deleted')->eq(0)
->orderBy($orderBy)
->fetchAll('id');
$docCounts = $this->dao->select("module, count(id) as docCount")->from(TABLE_DOC)
->where('module')->in(array_keys($modules))
->andWhere('deleted')->eq(0)
->groupBy('module')
->fetchPairs();
foreach($modules as $moduleID => $module) $modules[$moduleID]->docCount = isset($docCounts[$moduleID]) ? $docCounts[$moduleID] : 0;
return $modules;
}
/**
* Extract css styles for tables created in kindeditor.
*