Пример #1
0
    echo _MD_XOONIPS_INDEX_FORBIDDEN;
    echo '</div>';
    xoops_footer();
    exit;
}
// get index tree structure
include_once 'include/gentree.php';
$indexes = genIndexTree0($xnpsid);
$is_moderator = xnp_is_moderator($xnpsid, $uid);
if ($is_moderator && $get_vals['puid'] > 0) {
    $puid = $get_vals['puid'];
} else {
    $puid = $uid;
}
if ($is_moderator) {
    filterMyIndex($indexes, $xnpsid, $puid);
}
if ($get_vals['edit']) {
    filterEditableIndex($indexes, $xnpsid, $uid, $puid, $get_vals['edit_public'] && !empty($_SESSION['xoonips_old_uid']));
}
if ($get_vals['private_only']) {
    filterPrivateIndex($indexes, $puid);
}
$indexes = genIndexTree1($indexes);
// get number of items under nodes (by index).
// use special function.
$itemCounts = array();
$result = xnp_get_item_count_group_by_index($xnpsid, $itemCounts);
$ct = count($indexes);
for ($i = 0; $i < $ct; $i++) {
    // can't change value in foreach
/** get Index tree for moderator
 *  not contain other's private index, and not contain group-index of group which he does not belong.
 * @param $xnpsid XNPSID
 * @return tree Empty array in error.
 */
function genMyIndexTree($xnpsid, $uid)
{
    $indexes = genIndexTree0($xnpsid);
    filterMyIndex($indexes, $xnpsid, $uid);
    return genIndexTree1($indexes);
}