* @package doc * @link https://www.zentao.net */ namespace zin; $docContent = null; if(empty($docs)) { $emptyCreateBtn = $buildCreateBtn($type, $objectID, $lib, $moduleID, $templateParam, $buttonItems); $docContent = div ( setClass('table-empty-tip flex justify-center items-center'), span ( setClass('text-gray'), $lang->doc->noDoc ), $browseType != 'bySearch' && $libID && (common::hasPriv('doc', 'create') || (common::hasPriv('api', 'create') && !$apiLibID)) ? $emptyCreateBtn : null ); } else { jsVar('iconList', $config->doc->iconList); jsVar('draftText', $lang->doc->draft); jsVar('canViewDoc', common::hasPriv('doc', 'view')); jsVar('canCollect', common::hasPriv('doc', 'collect') && $libType && $libType != 'api'); jsVar('currentAccount', $app->user->account); $cols = array(); foreach($config->doc->dtable->fieldList as $colName => $col) { if($canExport && $colName == 'id') $col['type'] = 'checkID'; if(!in_array($colName, array('id', 'title', 'addedBy', 'addedDate', 'editedBy', 'editedDate', 'actions'))) continue; $cols[$colName] = $col; } $params = "objectID={$objectID}&libID={$libID}&moduleID={$moduleID}&browseType={$browseType}&orderBy={$orderBy}¶m={$param}&recTotal={recTotal}&recPerPage={recPerPage}&pageID={page}"; $tableData = initTableData($docs, $cols); $docContent = dtable ( set::userMap($users), set::cols($cols), set::data($tableData), set::checkable($canExport), set::onRenderCell(jsRaw('window.rendDocCell')), set::footPager( usePager ( array('linkCreator' => helper::createLink('doc', $app->rawMethod, $params)), ), ), ); }