/trunk/includes/classes/OIDplusMenuUtils.class.php |
---|
129,7 → 129,12 |
$max_ent = 0; |
while ($row = $res->fetch_array()) { |
$max_ent++; |
if ($max_ent > 1000) break; // TODO: we need a solution for this!!! |
if ($max_ent > 1000) { // TODO: we need to find a solution for this!!! |
// Note: We cannot use id=oidplus:system, otherwise the lazy-load-tree breaks |
$children[] = array('id' => '', 'icon' => '', 'text' => _L('There are too many child items to display'), 'indent' => 0); |
break; |
} |
$obj = OIDplusObject::parse($row['id']); |
if (!$obj) continue; // e.g. object-type plugin disabled |
159,21 → 164,36 |
$child['children'] = $this->tree_populate($row['id'], $goto_path); |
$child['state'] = array("opened" => true); |
} else { |
$obj_children = $obj->getChildren(); |
// Variant 1: Fast, but does not check for hidden OIDs |
//$child_count = count($obj_children); |
/* |
$obj_children = $obj->getChildren(); |
$child['children'] = count($obj_children) > 0; |
*/ |
// variant 2 |
$child_count = 0; |
/* |
$obj_children = $obj->getChildren(); |
$child['children'] = false; |
foreach ($obj_children as $obj_test) { |
if (!$obj_test->userHasReadRights()) continue; |
$child_count++; |
$child['children'] = true; |
break; |
} |
*/ |
$child['children'] = $child_count > 0; |
// variant 3: A bit faster than variant 2 |
$child['children'] = false; |
$res2 = OIDplus::db()->query("select id from ###objects where parent = ?", array($obj->nodeId())); |
while ($row2 = $res2->fetch_array()) { |
$obj_test = OIDplusObject::parse($row2['id']); |
if (!$obj_test->userHasReadRights()) continue; |
$child['children'] = true; |
break; |
} |
} |
$children[] = $child; |
} |
/trunk/includes/classes/OIDplusObject.class.php |
---|
269,7 → 269,7 |
if (!$ra) { |
$res = OIDplus::db()->query("select oChild.id as child_id, oChild.ra_email as child_mail, oParent.ra_email as parent_mail from ###objects as oChild ". |
"left join ###objects as oParent on oChild.parent = oParent.id"); |
$res->naturalSortByField('oChild.id'); |
$res->naturalSortByField('child_id'); |
while ($row = $res->fetch_array()) { |
if (!OIDplus::authUtils()->isRaLoggedIn($row['parent_mail']) && OIDplus::authUtils()->isRaLoggedIn($row['child_mail'])) { |
$x = self::parse($row['child_id']); // can be NULL if namespace was disabled |
283,7 → 283,7 |
OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) or ". |
" (oParent.ra_email is null and ".OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) ", |
array($ra, $ra, $ra)); |
$res->naturalSortByField('oChild.id'); |
$res->naturalSortByField('child_id'); |
while ($row = $res->fetch_array()) { |
$x = self::parse($row['child_id']); // can be NULL if namespace was disabled |
if ($x) $out[] = $x; |
/trunk/plugins/viathinksoft/publicPages/000_objects/OIDplusPagePublicObjects.class.php |
---|
1249,8 → 1249,9 |
while ($row = $res->fetch_object()) { |
$max_ent++; |
if ($max_ent > 1000) { // TODO: we need to find a solution for this!!! |
$menu_entry = array('id' => 'oidplus:system', 'icon' => '', 'text' => _L('There are too many child items to display'), 'indent' => 0); |
$menu_entry = array('id' => '', 'icon' => '', 'text' => _L('There are too many child items to display'), 'indent' => 0); |
$menu_entries[] = $menu_entry; |
$stufen[] = $stufe; |
break; |
} |