define("ROOT_PATH", ''); include_once './includes/common.inc.php'; include_once './classes/album_content.inc.php'; include_once './classes/group.inc.php'; include_once './modules/pic_managment/interface.inc.php'; include_once './includes/functions.inc.php'; include_once './languages/' . $userdata['user_lang'] . '/lang_main.php'; include_once './includes/template.inc.php'; session_start(); $add_to_contentgroups = get_contentgroups_data_where_perm('id,name', 'add_to_group'); if (!is_array($add_to_contentgroups)) { die('You dont have perms to add content to any contentgroup'); } $smarty->assign('add_to_contentgroups', $add_to_contentgroups); $cats = get_cats_data_where_perm('id,name', 'content_add'); $add_to_cats = get_cats_string($cats); if (!is_array($add_to_cats)) { die('You dont have perms to add content to any categorie'); } $smarty->assign('add_to_cats', $add_to_cats); if (isset($content_to_add)) { $place = 0; foreach ($content_to_add as $value) { add_content(basename($value), $value, "", $new_content_cat, $place, $new_content_group); $place++; } } $dir = $config_vars['default_upload_dir']; if ($HTTP_POST_VARS['moveup'] == "up") { $temp = $HTTP_SESSION_VARS['files'][$HTTP_POST_VARS['id'] - 1]; $HTTP_SESSION_VARS['files'][$HTTP_POST_VARS['id'] - 1] = $HTTP_SESSION_VARS['files'][$HTTP_POST_VARS['id']];
$child_cat_infos[$i]['name'] = htmlspecialchars($child_cats[$i]->get_name()); $child_cat_infos[$i]['description'] = htmlspecialchars($child_cats[$i]->get_description()); $child_cat_infos[$i]['content_amount'] = $child_cats[$i]->get_content_amount(); $child_cat_infos[$i]['content_child_amount'] = $child_cats[$i]->get_child_content_amount() - $child_cat_infos[$i]['content_amount']; $child_cat_infos[$i]['current_rating'] = $child_cats[$i]->get_current_rating(); $child_cat_infos[$i]['remove_from_group'] = $child_cats[$i]->check_perm('remove_from_group'); $child_cat_infos[$i]['delete'] = $child_cats[$i]->check_perm('delete'); $child_cat_infos[$i]['edit'] = $child_cats[$i]->check_perm('edit'); $child_cat_infos[$i]['catgroup_id'] = $child_cats[$i]->get_catgroup_id(); $child_cat_infos[$i]['comments_amount'] = $child_cats[$i]->get_child_comments_amount(); } // in edit mode check on which cats user has rights to remove cat if ($HTTP_GET_VARS['mode'] == 'edit') { $smarty->assign('allow_cat_remove', check_cat_action_allowed($category->get_catgroup_id(), $userdata['user_id'], 'cat_remove')); $add_to_cats_unparsed = get_cats_data_where_perm('id,name', 'cat_add'); $add_to_cats = get_cats_string($add_to_cats_unparsed); $smarty->assign('add_to_cats', $add_to_cats); } $smarty->assign('child_cat_infos', $child_cat_infos); $smarty->assign('number_of_child_cats', $i); } else { //no child cats $smarty->assign('number_of_child_cats', 0); } // check is user is allowed to add a child cat $smarty->assign('allow_cat_add', check_cat_action_allowed($category->get_catgroup_id(), $userdata['user_id'], 'cat_add')); if ($HTTP_GET_VARS['mode'] == 'edit') { $smarty->assign('mode', 'edit'); $add_to_catgroups = get_catgroups_data_where_perm('id,name', 'add_to_group'); $smarty->assign('add_to_catgroups', $add_to_catgroups); // get contentgroups where user has add rights