Changeset 7174
- Timestamp:
- 04/28/2018 10:23:54 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/admin/network/class-locale-associations-view.php
r6558 r7174 38 38 <div class="wrap"> 39 39 <h1><?php echo esc_html( $this->get_title() ); ?></h1> 40 40 <p><?php _e( 'Manage the locale association for localized sites. Without an association the site’s front end is not available.', 'rosetta' ); ?></p> 41 <p><a href="#add-new-associations"><?php _e( 'Add New Association', 'rosetta' ); ?></a> | <a href="#existing-associations"><?php _e( 'Existing Associations', 'rosetta' ); ?></a> | <a href="#sites-without-locale-association"><?php _e( 'Sites Without Locale Association', 'rosetta' ); ?></a></p> 42 <hr/> 41 43 <?php 42 44 $this->render_message(); 43 45 $this->render_form(); 44 46 $this->render_table(); 47 $this->render_sites_without_locale(); 45 48 ?> 46 49 </div> … … 103 106 private function render_form() { 104 107 ?> 105 <h2 ><?php _e( 'Add New Association', 'rosetta' ); ?></h2>108 <h2 id="add-new-associations"><?php _e( 'Add New Association', 'rosetta' ); ?> <a href="#wpbody-content"><small>↑</small></a></h2> 106 109 <form action="" method="post"> 107 110 <?php wp_nonce_field( 'add-association' ); ?> … … 110 113 <p> 111 114 <label for="locale"><?php _e( 'Locale:', 'rosetta' ); ?></label> 112 <input type="text" id="locale" name="locale" />115 <input type="text" id="locale" name="locale" class="code" /> 113 116 114 117 <label for="subdomain"><?php _e( 'Subdomain:', 'rosetta' ); ?></label> 115 <input type="text" id="subdomain" name="subdomain" />118 <input type="text" id="subdomain" name="subdomain" class="code" /> 116 119 </p> 117 120 118 <p >121 <p class="submit"> 119 122 <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Add New Association', 'rosetta' ); ?>" /> 120 123 </p> … … 128 131 private function render_table() { 129 132 ?> 130 <h2 ><?php _e( 'Existing Associations', 'rosetta' ); ?></h2>133 <h2 id="existing-associations"><?php _e( 'Existing Associations', 'rosetta' ); ?> <a href="#wpbody-content"><small>↑</small></a></h2> 131 134 <table class="widefat striped"> 132 135 <thead> … … 182 185 <?php 183 186 } 187 188 /** 189 * Renders a list of sites without a locale association. 190 */ 191 public function render_sites_without_locale() { 192 ?> 193 <h2 id="sites-without-locale-association"><?php _e( 'Sites Without Locale Association', 'rosetta' ); ?> <a href="#wpbody-content"><small>↑</small></a></h2> 194 <?php 195 $domains_with_locale = wp_list_pluck( $this->page->get_associations(), 'subdomain' ); 196 array_walk( $domains_with_locale, function( &$domain ) { 197 $domain = "$domain.wordpress.org"; 198 } ); 199 200 $sites = get_sites( [ 201 'network_id' => get_current_network_id(), 202 'path' => '/', 203 'number' => '', // All. 204 'domain__not_in' => $domains_with_locale 205 ] ); 206 207 if ( $sites ) { 208 echo '<ul>'; 209 foreach ( $sites as $site ) { 210 printf( 211 '<li><a href="%s">%s (%s)</a></li>', 212 esc_url( $site->home ), 213 esc_html( $site->blogname ), 214 esc_html( $site->domain . $site->path ) 215 ); 216 } 217 echo '</ul>'; 218 } else { 219 echo '—'; 220 } 221 } 184 222 }
Note: See TracChangeset
for help on using the changeset viewer.