Changeset 1839
- Timestamp:
- 08/20/2015 02:04:27 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-routes/routes/locale.php
r1837 r1839 14 14 * @param string $project_path Path of a project. 15 15 */ 16 public function get_locale_projects( $locale_slug, $set_slug = 'default', $project_path = 'waiting') {16 public function get_locale_projects( $locale_slug, $set_slug = 'default', $project_path = false ) { 17 17 global $gpdb; 18 18 … … 31 31 usort( $top_level_projects, array( $this, '_sort_reverse_name_callback' ) ); 32 32 33 // Filter out the Waiting Tab if the current user cannot validate strings 33 // Default to the Waiting or WordPress tabs 34 $default_project_tab = 'waiting'; 34 35 $user = GP::$user->current(); 35 36 if ( … … 39 40 GP::$plugins->wporg_rosetta_roles->is_global_administrator( $user->id ) || // Not a global admin 40 41 GP::$plugins->wporg_rosetta_roles->is_approver_for_locale( $user->id, $locale_slug ) // Doesn't have project-level access either 41 ) ) { // Add check to see if there are any waiting translations for this locale? 42 ) 43 // Add check to see if there are any waiting translations for this locale? 44 ) { 45 $default_project_tab = 'wp'; 46 } 47 48 // Filter out the Waiting Tab if the current user cannot validate strings 49 if ( 'waiting' != $default_project_tab ) { 42 50 foreach ( $top_level_projects as $i => $project ) { 43 51 if ( 'waiting' == $project->slug ) { … … 46 54 } 47 55 } 48 49 // Reset to default path of wp if the Waiting tab shouldn't be shown for this user. 50 $project_path = 'wp'; 51 } 56 } 57 58 $project_path = $project_path ?: $default_project_tab; 52 59 53 60 $project = GP::$project->by_path( $project_path );
Note: See TracChangeset
for help on using the changeset viewer.