]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/credits.php
Wordpress 3.2.1-scripts
[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 $parent_file = 'index.php';
14
15 add_contextual_help($current_screen,
16         '<p>' . __('Each name or handle is a link to that person&#8217;s profile in the WordPress.org community directory.') . '</p>' .
17         '<p>' . __('You can register your own profile at <a href="http://wordpress.org/support/register.php" target="_blank">this link</a> to start contributing.') . '</p>' .
18         '<p>' . __('WordPress always needs more people to report bugs, patch bugs, test betas, work on UI design, translate strings, write documentation, and add questions/answers/suggestions to the Support Forums. Join in!') . '</p>' .
19         '<p><strong>' . __('For more information:') . '</strong></p>' .
20         '<p>' . __('<a href="http://codex.wordpress.org/Contributing_to_WordPress" target="_blank">Documentation on Contributing to WordPress</a>') . '</p>' .
21         '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
22 );
23
24 add_action( 'admin_head', '_wp_credits_add_css' );
25 function _wp_credits_add_css() { ?>
26 <style type="text/css">
27 div.wrap { max-width: 750px }
28 h3.wp-people-group, p.wp-credits-list { clear: both; }
29 ul.compact { margin-bottom: 0 }
30
31 <?php if ( is_rtl() ) { ?>
32 ul.wp-people-group { margin-bottom: 30px; float: right; clear: both; }
33 li.wp-person { float: right; height: 70px; width: 220px; margin-left: 10px; }
34 li.wp-person img.gravatar { float: right; margin-left: 10px; margin-bottom: 10px; }
35 <?php } else { ?>
36 li.wp-person { float: left; margin-right: 10px; }
37 li.wp-person img.gravatar { float: left; margin-right: 10px; margin-bottom: 10px; }
38 <?php } ?>
39 li.wp-person img.gravatar { width: 60px; height: 60px; }
40 ul.compact li.wp-person img.gravatar { width: 30px; height: 30px; }
41 li.wp-person { height: 70px; width: 220px; }
42 ul.compact li.wp-person { height: 40px; width: auto; white-space: nowrap }
43 li.wp-person a.web { font-size: 16px; text-decoration: none; }
44 </style>
45 <?php }
46
47 function wp_credits() {
48         global $wp_version;
49         $locale = get_locale();
50
51         $results = get_site_transient( 'wordpress_credits_' . $locale );
52
53         if ( ! is_array( $results ) ) {
54                 $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.0/?version=$wp_version&locale=$locale" );
55
56                 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
57                         return false;
58
59                 $results = maybe_unserialize( wp_remote_retrieve_body( $response ) );
60
61                 if ( ! is_array( $results ) )
62                         return false;
63
64                 set_site_transient( 'wordpress_credits_' . $locale, $results, 86400 ); // One day
65         }
66
67         return $results;
68 }
69
70 function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {
71         $display_name = '<a href="' . esc_url( sprintf( $profiles, $username ) ) . '">' . esc_html( $display_name ) . '</a>';
72 }
73
74 function _wp_credits_build_object_link( &$data ) {
75         $data = '<a href="' . esc_url( $data[1] ) . '">' . $data[0] . '</a>';
76 }
77
78 include( './admin-header.php' );
79 ?>
80 <div class="wrap">
81 <?php screen_icon(); ?>
82 <h2><?php _e( 'WordPress Credits' ); ?></h2>
83
84 <?php
85
86 $credits = wp_credits();
87
88 if ( ! $credits ) {
89         echo '<p>' . 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>.' ),
90                 'http://wordpress.org/about/',
91                 /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
92                 __( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
93         include( './admin-footer.php' );
94         exit;
95 }
96
97 echo '<p>' . __( 'WordPress is created by a worldwide team of passionate individuals. We couldn&#8217;t possibly list them all, but here some of the most influential people currently involved with the project:' ) . "</p>\n";
98
99 $gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
100
101 foreach ( $credits['groups'] as $group_slug => $group_data ) {
102         if ( $group_data['name'] ) {
103                 if ( 'Translators' == $group_data['name'] ) {
104                         // Considered a special slug in the API response. (Also, will never be returned for en_US.)
105                         $title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
106                 } elseif ( isset( $group_data['placeholders'] ) ) {
107                         $title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
108                 } else {
109                         $title = translate( $group_data['name'] );
110                 }
111
112                 echo '<h3 class="wp-people-group">' . $title . "</h3>\n";
113         }
114
115         if ( ! empty( $group_data['shuffle'] ) )
116                 shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
117
118         switch ( $group_data['type'] ) {
119                 case 'list' :
120                         array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
121                         echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
122                         break;
123                 case 'libraries' :
124                         array_walk( $group_data['data'], '_wp_credits_build_object_link' );
125                         echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
126                         break;
127                 default:
128                         $compact = 'compact' == $group_data['type'];
129                         $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
130                         echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
131                         foreach ( $group_data['data'] as $person_data ) {
132                                 echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
133                                 echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
134                                 $size = 'compact' == $group_data['type'] ? '30' : '60';
135                                 echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
136                                 echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
137                                 if ( ! $compact )
138                                         echo '<br /><span class="title">' . translate( $person_data[3] ) . "</span>\n";
139                                 echo "</li>\n";
140                         }
141                         echo "</ul>\n";
142                 break;
143         }
144 }
145
146 ?>
147 <p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
148         /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
149         __( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ); ?></p>
150
151 </div>
152 <?php
153
154 include( './admin-footer.php' );
155
156 return;
157
158 // These are strings returned by the API that we want to be translatable
159 __( 'Project Leaders' );
160 __( 'Extended Core Team' );
161 __( 'Recent Rockstars' );
162 __( 'Core Contributors to WordPress %s' );
163 __( 'Cofounder, Project Lead' );
164 __( 'Lead Developer' );
165 __( 'User Experience Lead' );
166 __( 'Core Committer' );
167 __( 'Guest Committer' );
168 __( 'Developer' );
169 __( 'Designer' );
170 __( 'XML-RPC' );
171 __( 'Internationalization' );
172 __( 'External Libraries' );
173 __( 'Icon Design' );
174 __( 'Blue Color Scheme' );
175
176 ?>