本文整理汇总了PHP中Browser::getChildren方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::getChildren方法的具体用法?PHP Browser::getChildren怎么用?PHP Browser::getChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser::getChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getChildren
public function getChildren($p)
{
$p['showFoldersContent'] = true;
if (@$p['from'] == 'calendar') {
$p['fl'] = 'id,cid,date,date_end,status,template_id,name,cls';
}
/* set default folder to root on fulltext search, otherwise facets will not be displayed for empty path */
if (!empty($p['query']) && (empty($p['path']) || $p['path'] == '/')) {
$p['path'] = '/' . $this->getRootFolderId();
}
/**/
$rez = parent::getChildren($p);
return $rez;
}
示例2: getChildren
public function getChildren($p)
{
$p['from'] = 'tree';
$rez = parent::getChildren($p);
$sql = 'SELECT count(*) `has_childs`
FROM tree
WHERE pid = $1
AND dstatus = 0' . (empty($p['showFoldersContent']) ? ' AND `template_id` IN (0' . implode(',', Config::get('folder_templates')) . ')' : '');
foreach ($rez['data'] as &$d) {
if (!isset($d['loaded'])) {
if (is_numeric($d['nid'])) {
$res = DB\dbQuery($sql, $d['nid']) or die(DB\dbQueryError());
if ($r = $res->fetch_assoc()) {
$d['has_childs'] = !empty($r['has_childs']);
}
$res->close();
}
$d['loaded'] = empty($d['has_childs']);
}
}
return $rez['data'];
}