* [story #68938, doing] add helper to create command in view api-ajaxGetHome.

This commit is contained in:
sunhao
2024-11-12 10:23:56 +08:00
committed by 刘刚
parent 2ca54401e6
commit a54f0ee3b7
+15
View File
@@ -17,3 +17,18 @@ $canCreateLib = hasPriv('api', 'createLib');
$canEditLib = hasPriv('api', 'editLib');
$canDeleteLib = hasPriv('api', 'deleteLib');
$showLibAction = $isNolink ? ($canEditLib || $canDeleteLib) : $canCreateLib;
/* Create load home command statement. */
$createCommand = function(array $args) use($pager, $type, $unclosed, $notempty)
{
$args = array_merge(array('type' => $type, 'unclosed' => $unclosed, 'notempty' => $notempty, 'recPerPage' => $pager->recPerPage, 'pageID' => $pager->pageID), $args);
$parts = array('loadHome');
$parts[] = $args['type'];
$params = array();
if($args['notempty']) $params[] = 'notempty';
if($args['unclosed']) $params[] = 'unclosed';
$parts[] = implode('_', $params);
$parts[] = $args['recPerPage'];
$parts[] = $args['pageID'];
return implode('/', $parts);
};