WP Native Dashboard - Version 1.3.0

Version Description

Download this release

Release Info

Developer codestyling
Plugin Icon wp plugin WP Native Dashboard
Version 1.3.0
Comparing to
See all releases

Code changes from version 1.2.0 to 1.3.0

Files changed (3) hide show
  1. automattic.php +6 -6
  2. readme.txt +5 -2
  3. wp-native-dashboard.php +10 -4
automattic.php CHANGED
@@ -242,7 +242,7 @@ class wp_native_dashboard_automattic {
242
  $revision = 0;
243
  $langs = $installed;
244
  $url = 'http://svn.automattic.com/wordpress-i18n/';
245
- $response = wp_remote_get($url);
246
  $error = is_wp_error($response);
247
  if(!$error) {
248
  $lines = split("\n",$response['body']);
@@ -284,7 +284,7 @@ class wp_native_dashboard_automattic {
284
  $installed = wp_native_dashboard_collect_installed_languages();
285
  $url = "http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$this->tagged_version."/messages/";
286
  $url_root = "http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$this->root_tagged_version."/messages/";
287
- $response_mo = wp_remote_get($url);
288
  $found = false;
289
  $tagged = $this->tagged_version;
290
 
@@ -295,7 +295,7 @@ class wp_native_dashboard_automattic {
295
  if ($found === false) {
296
  $url = $url_root;
297
  $tagged = $this->root_tagged_version;
298
- $response_mo = wp_remote_get($url);
299
  if (!is_wp_error($response_mo)){
300
  if (preg_match("/href\s*=\s*\"".$lang."\.mo\"/", $response_mo['body']))
301
  $found = true;
@@ -424,7 +424,7 @@ class wp_native_dashboard_automattic {
424
  if (preg_match('/\/tags\/(\d+\.\d+|\d+\.\d+\.\d+)\/messages/', $_POST['file'], $h)) {
425
  $tagged = $h[1];
426
  }
427
- $response_mo = wp_remote_get("http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$tagged."/messages/".$file);
428
  if(!is_wp_error($response_mo)) {
429
  ob_start();
430
  if ( WP_Filesystem($credentials) && is_object($wp_filesystem) ) {
@@ -447,14 +447,14 @@ class wp_native_dashboard_automattic {
447
  if ($done) {
448
  global $wp_version;
449
  if (version_compare($wp_version, '2.8', '>=')) {
450
- $response_cities_mo = wp_remote_get("http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$tagged."/dist/wp-content/languages/continents-cities-".$file);
451
  if(!is_wp_error($response_cities_mo)) {
452
  $wp_filesystem->put_contents($dir.'continents-cities-'.$file, $response_cities_mo['body']);
453
  }
454
  }
455
  if (wp_native_dashboard_is_rtl_language($lang)) {
456
  $content = wp_native_dashboard_rtl_extension_file_content();
457
- $response_php = wp_remote_get("http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$tagged."/dist/wp-content/languages/".$lang.'.php');
458
  if(!is_wp_error($response_php)) { $content = $response_php['body']; }
459
  $wp_filesystem->put_contents($dir.$lang.'.php', $content);
460
  }
242
  $revision = 0;
243
  $langs = $installed;
244
  $url = 'http://svn.automattic.com/wordpress-i18n/';
245
+ $response = @wp_remote_get($url);
246
  $error = is_wp_error($response);
247
  if(!$error) {
248
  $lines = split("\n",$response['body']);
284
  $installed = wp_native_dashboard_collect_installed_languages();
285
  $url = "http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$this->tagged_version."/messages/";
286
  $url_root = "http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$this->root_tagged_version."/messages/";
287
+ $response_mo = @wp_remote_get($url);
288
  $found = false;
289
  $tagged = $this->tagged_version;
290
 
295
  if ($found === false) {
296
  $url = $url_root;
297
  $tagged = $this->root_tagged_version;
298
+ $response_mo = @wp_remote_get($url);
299
  if (!is_wp_error($response_mo)){
300
  if (preg_match("/href\s*=\s*\"".$lang."\.mo\"/", $response_mo['body']))
301
  $found = true;
424
  if (preg_match('/\/tags\/(\d+\.\d+|\d+\.\d+\.\d+)\/messages/', $_POST['file'], $h)) {
425
  $tagged = $h[1];
426
  }
427
+ $response_mo = @wp_remote_get("http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$tagged."/messages/".$file);
428
  if(!is_wp_error($response_mo)) {
429
  ob_start();
430
  if ( WP_Filesystem($credentials) && is_object($wp_filesystem) ) {
447
  if ($done) {
448
  global $wp_version;
449
  if (version_compare($wp_version, '2.8', '>=')) {
450
+ $response_cities_mo = @wp_remote_get("http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$tagged."/dist/wp-content/languages/continents-cities-".$file);
451
  if(!is_wp_error($response_cities_mo)) {
452
  $wp_filesystem->put_contents($dir.'continents-cities-'.$file, $response_cities_mo['body']);
453
  }
454
  }
455
  if (wp_native_dashboard_is_rtl_language($lang)) {
456
  $content = wp_native_dashboard_rtl_extension_file_content();
457
+ $response_php = @wp_remote_get("http://svn.automattic.com/wordpress-i18n/".$lang."/tags/".$tagged."/dist/wp-content/languages/".$lang.'.php');
458
  if(!is_wp_error($response_php)) { $content = $response_php['body']; }
459
  $wp_filesystem->put_contents($dir.$lang.'.php', $content);
460
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: codestyling
3
  Tags: wordpress, dashboard, multi-lingual, languages, backend, localization, plugin
4
  Requires at least: 2.7
5
- Tested up to: 2.9-rare
6
- Stable tag: 1.2.0
7
 
8
  Enables selection of administration language either by logon, dashboard quick switcher or user profile setting.
9
 
@@ -46,6 +46,9 @@ Please visit [the official website](http://www.code-styling.de/english/developme
46
 
47
  == Changelog ==
48
 
 
 
 
49
  = Version 1.2.0 =
50
  * missing language folder (US original version) denies download
51
  * accidentally empty language display, if no mo is installed (en_US is always inline)
2
  Contributors: codestyling
3
  Tags: wordpress, dashboard, multi-lingual, languages, backend, localization, plugin
4
  Requires at least: 2.7
5
+ Tested up to: 2.9
6
+ Stable tag: 1.3.0
7
 
8
  Enables selection of administration language either by logon, dashboard quick switcher or user profile setting.
9
 
46
 
47
  == Changelog ==
48
 
49
+ = Version 1.3.0 =
50
+ * several checks at PHP 5.3 or higher were missing and may stop some functions
51
+
52
  = Version 1.2.0 =
53
  * missing language folder (US original version) denies download
54
  * accidentally empty language display, if no mo is installed (en_US is always inline)
wp-native-dashboard.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.code-styling.de/english/development/wordpress-plugin-wp-
5
  Description: You can configure your blog working at administration with different languages depends on users choice and capabilities the admin has been enabled.
6
  Author: Heiko Rabe
7
  Author URI: http://www.code-styling.de/
8
- Version: 1.2.0
9
 
10
  License:
11
  ==============================================================================
@@ -64,7 +64,7 @@ function wp_native_dashboard_collect_installed_languages() {
64
  function wp_native_dashboard_get_name_of($locale) {
65
  global $wpnd_language_names;
66
  list($lang,) = explode('_', $locale);
67
- $name = $wpnd_language_names[$lang];
68
  return '<b>'.$name .'</b>&nbsp;<i>('.$locale.')</i>';
69
  }
70
 
@@ -134,7 +134,7 @@ class wp_native_dashboard {
134
 
135
  //display potential install errors
136
  function _display_version_errors() {
137
- if (($_GET['action'] == 'error_scrape') && ($_GET['plugin'] == plugin_basename(__FILE__) )) {
138
  $version_error = $this->_get_version_errors();
139
  if (count($version_error) != 0) {
140
  echo "<table>";
@@ -201,9 +201,13 @@ class wp_native_dashboard {
201
  function on_init() {
202
  //some modules need to be loaded here, because they have to support ajax or affect the login page :-)
203
  //load the login selector module if it has been enabled to provide language choise at login screen
204
- if ($this->options->enable_login_selector && (is_admin() || DOING_AJAX)) {
205
  require_once(dirname(__FILE__).'/loginselector.php');
206
  $this->loginselector = new wp_native_dashboard_loginselector();
 
 
 
 
207
  require_once(dirname(__FILE__).'/automattic.php');
208
  $this->automattic = new wp_native_dashboard_automattic($this->tagged_version, $this->root_tagged_version);
209
  $this->_load_translation_file();
@@ -327,6 +331,7 @@ class wp_native_dashboard {
327
  function on_print_metabox_automattic_i18n() {
328
  $color = '#21759B';
329
  $perc = 0.0;
 
330
  ?>
331
  <p><?php echo sprintf(__('A lot of languages should be provided by polyglott translation teams as download into your WordPress installation.','wp-native-dashboard'), $revision); ?></p>
332
  <p class="csp-read-more center"><?php _e('Available for download:', 'wp-native-dashboard'); ?> <a id="csp-check-repository" href="#svn"><?php _e('check repository &raquo;','wp-native-dashboard'); ?></a> <span><img src="images/loading.gif" class="ajax-feedback" title="" alt="" /></span></p>
@@ -346,6 +351,7 @@ class wp_native_dashboard {
346
  //executed to show the plugins complete admin page
347
  function on_show_page() {
348
  global $screen_layout_columns;
 
349
  ?>
350
  <div id="howto-metaboxes-general" class="wrap">
351
  <?php screen_icon('wp-native-dashboard'); ?>
5
  Description: You can configure your blog working at administration with different languages depends on users choice and capabilities the admin has been enabled.
6
  Author: Heiko Rabe
7
  Author URI: http://www.code-styling.de/
8
+ Version: 1.3.0
9
 
10
  License:
11
  ==============================================================================
64
  function wp_native_dashboard_get_name_of($locale) {
65
  global $wpnd_language_names;
66
  list($lang,) = explode('_', $locale);
67
+ $name = isset($wpnd_language_names[$lang]) ? $wpnd_language_names[$lang] : __('-n.a.-', 'wp-native-dashboard');
68
  return '<b>'.$name .'</b>&nbsp;<i>('.$locale.')</i>';
69
  }
70
 
134
 
135
  //display potential install errors
136
  function _display_version_errors() {
137
+ if (isset($_GET['action']) && isset($_GET['plugin']) && ($_GET['action'] == 'error_scrape') && ($_GET['plugin'] == plugin_basename(__FILE__) )) {
138
  $version_error = $this->_get_version_errors();
139
  if (count($version_error) != 0) {
140
  echo "<table>";
201
  function on_init() {
202
  //some modules need to be loaded here, because they have to support ajax or affect the login page :-)
203
  //load the login selector module if it has been enabled to provide language choise at login screen
204
+ if ($this->options->enable_login_selector && (is_admin() || defined('DOING_AJAX'))) {
205
  require_once(dirname(__FILE__).'/loginselector.php');
206
  $this->loginselector = new wp_native_dashboard_loginselector();
207
+ $this->_load_translation_file();
208
+ if (is_admin()) wp_enqueue_script('jquery');
209
+ }
210
+ if (($this->options->enable_login_selector || $this->options->enable_language_switcher) && (is_admin() || defined('DOING_AJAX'))) {
211
  require_once(dirname(__FILE__).'/automattic.php');
212
  $this->automattic = new wp_native_dashboard_automattic($this->tagged_version, $this->root_tagged_version);
213
  $this->_load_translation_file();
331
  function on_print_metabox_automattic_i18n() {
332
  $color = '#21759B';
333
  $perc = 0.0;
334
+ $revision = null;
335
  ?>
336
  <p><?php echo sprintf(__('A lot of languages should be provided by polyglott translation teams as download into your WordPress installation.','wp-native-dashboard'), $revision); ?></p>
337
  <p class="csp-read-more center"><?php _e('Available for download:', 'wp-native-dashboard'); ?> <a id="csp-check-repository" href="#svn"><?php _e('check repository &raquo;','wp-native-dashboard'); ?></a> <span><img src="images/loading.gif" class="ajax-feedback" title="" alt="" /></span></p>
351
  //executed to show the plugins complete admin page
352
  function on_show_page() {
353
  global $screen_layout_columns;
354
+ $data = null;
355
  ?>
356
  <div id="howto-metaboxes-general" class="wrap">
357
  <?php screen_icon('wp-native-dashboard'); ?>