Navigation Menu

Skip to content

Commit

Permalink
Avoid duplicating code: use user_get_all_accessible_projects api
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Oct 18, 2014
1 parent 4bc2b79 commit 69163d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions changelog_page.php
Expand Up @@ -154,12 +154,7 @@ function print_project_header_changelog ( $p_project_name ) {
}

if( ALL_PROJECTS == $t_project_id ) {
$t_topprojects = $t_project_ids = user_get_accessible_projects( $t_user_id );
foreach ( $t_topprojects as $t_project ) {
$t_project_ids = array_merge( $t_project_ids, user_get_all_accessible_subprojects( $t_user_id, $t_project ) );
}

$t_project_ids_to_check = array_unique( $t_project_ids );
$t_project_ids_to_check = user_get_all_accessible_projects( $t_user_id, ALL_PROJECTS );
$t_project_ids = array();

foreach ( $t_project_ids_to_check as $t_project_id ) {
Expand Down
7 changes: 1 addition & 6 deletions roadmap_page.php
Expand Up @@ -153,12 +153,7 @@ function print_project_header_roadmap( $p_project_name ) {
}

if( ALL_PROJECTS == $t_project_id ) {
$t_topprojects = $t_project_ids = user_get_accessible_projects( $t_user_id );
foreach ( $t_topprojects as $t_project ) {
$t_project_ids = array_merge( $t_project_ids, user_get_all_accessible_subprojects( $t_user_id, $t_project ) );
}

$t_project_ids_to_check = array_unique( $t_project_ids );
$t_project_ids_to_check = user_get_all_accessible_projects( $t_user_id, ALL_PROJECTS );
$t_project_ids = array();

foreach ( $t_project_ids_to_check as $t_project_id ) {
Expand Down

0 comments on commit 69163d2

Please sign in to comment.