]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/credits.php
cdc84c7c6989a621a407c4c21012bd0c00441593
[autoinstalls/wordpress.git] / wp-admin / credits.php
1 <?php
2 /**
3  * Credits administration panel.
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 /** WordPress Administration Bootstrap */
10 require_once( './admin.php' );
11
12 $title = __( 'Credits' );
13
14 function wp_credits() {
15         global $wp_version;
16         $locale = get_locale();
17
18         $results = get_site_transient( 'wordpress_credits_' . $locale );
19
20         if ( ! is_array( $results ) ) {
21                 $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.0/?version=$wp_version&locale=$locale" );
22
23                 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
24                         return false;
25
26                 $results = maybe_unserialize( wp_remote_retrieve_body( $response ) );
27
28                 if ( ! is_array( $results ) )
29                         return false;
30
31                 set_site_transient( 'wordpress_credits_' . $locale, $results, 86400 ); // One day
32         }
33
34         return $results;
35 }
36
37 function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {
38         $display_name = '<a href="' . esc_url( sprintf( $profiles, $username ) ) . '">' . esc_html( $display_name ) . '</a>';
39 }
40
41 function _wp_credits_build_object_link( &$data ) {
42         $data = '<a href="' . esc_url( $data[1] ) . '">' . $data[0] . '</a>';
43 }
44
45 list( $display_version ) = explode( '-', $wp_version );
46
47 include( './admin-header.php' );
48 ?>
49 <div class="wrap about-wrap">
50
51 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
52
53 <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! Using WordPress %s will improve your looks, personality, and web publishing experience. Okay, just the last one, but still. :)' ), $display_version ); ?></div>
54
55 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
56
57 <h2 class="nav-tab-wrapper">
58         <a href="about.php" class="nav-tab">
59                 <?php _e( 'What&#8217;s New' ); ?>
60         </a><a href="credits.php" class="nav-tab nav-tab-active">
61                 <?php _e( 'Credits' ); ?>
62         </a><a href="freedoms.php" class="nav-tab">
63                 <?php _e( 'Freedoms' ); ?>
64         </a>
65 </h2>
66
67 <?php
68
69 $credits = wp_credits();
70
71 if ( ! $credits ) {
72         echo '<p class="about-description">' . sprintf( __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
73                 'http://wordpress.org/about/',
74                 /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
75                 __( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
76         include( './admin-footer.php' );
77         exit;
78 }
79
80 echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
81
82 $gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
83
84 foreach ( $credits['groups'] as $group_slug => $group_data ) {
85         if ( $group_data['name'] ) {
86                 if ( 'Translators' == $group_data['name'] ) {
87                         // Considered a special slug in the API response. (Also, will never be returned for en_US.)
88                         $title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
89                 } elseif ( isset( $group_data['placeholders'] ) ) {
90                         $title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
91                 } else {
92                         $title = translate( $group_data['name'] );
93                 }
94
95                 echo '<h4 class="wp-people-group">' . $title . "</h4>\n";
96         }
97
98         if ( ! empty( $group_data['shuffle'] ) )
99                 shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
100
101         switch ( $group_data['type'] ) {
102                 case 'list' :
103                         array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
104                         echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
105                         break;
106                 case 'libraries' :
107                         array_walk( $group_data['data'], '_wp_credits_build_object_link' );
108                         echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
109                         break;
110                 default:
111                         $compact = 'compact' == $group_data['type'];
112                         $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
113                         echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
114                         foreach ( $group_data['data'] as $person_data ) {
115                                 echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
116                                 echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
117                                 $size = 'compact' == $group_data['type'] ? '30' : '60';
118                                 echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
119                                 echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
120                                 if ( ! $compact )
121                                         echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
122                                 echo "</li>\n";
123                         }
124                         echo "</ul>\n";
125                 break;
126         }
127 }
128
129 ?>
130 <p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
131         /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
132         __( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ); ?></p>
133
134 </div>
135 <?php
136
137 include( './admin-footer.php' );
138
139 return;
140
141 // These are strings returned by the API that we want to be translatable
142 __( 'Project Leaders' );
143 __( 'Extended Core Team' );
144 __( 'Core Developers' );
145 __( 'Recent Rockstars' );
146 __( 'Core Contributors to WordPress %s' );
147 __( 'Contributing Developers' );
148 __( 'Cofounder, Project Lead' );
149 __( 'Lead Developer' );
150 __( 'User Experience Lead' );
151 __( 'Core Developer' );
152 __( 'Core Committer' );
153 __( 'Guest Committer' );
154 __( 'Developer' );
155 __( 'Designer' );
156 __( 'XML-RPC' );
157 __( 'Internationalization' );
158 __( 'External Libraries' );
159 __( 'Icon Design' );
160
161 ?>