Version 1.0.48

This commit is contained in:
ultimatemember
2015-02-10 02:05:27 +02:00
parent 5487c7b6d1
commit b4f313e8bc
21 changed files with 192 additions and 32 deletions
+3 -2
View File
@@ -67,7 +67,6 @@
$locale = get_option('WPLANG');
if ( !$locale ) return;
if ( file_exists( WP_LANG_DIR . '/plugins/ultimatemember-'.$locale.'.mo' ) ) return;
if ( !isset( $ultimatemember->available_languages[$locale] ) ) return;
$path = $ultimatemember->files->upload_basedir;
@@ -86,7 +85,9 @@
copy( $remote2_tmp, $path . 'ultimatemember-' . $locale . '.mo' );
unlink( $remote2_tmp );
exit( wp_redirect( remove_query_arg('um_adm_action') ) );
$url = remove_query_arg('um_adm_action', $ultimatemember->permalinks->get_current_url() );
$url = add_query_arg('update','language_updated',$url);
exit( wp_redirect($url) );
}
+61 -2
View File
@@ -50,7 +50,8 @@ class UM_Admin_Dashboard {
*** @load metabox stuff
***/
function on_load_page() {
global $ultimatemember;
wp_enqueue_script('common');
wp_enqueue_script('wp-lists');
wp_enqueue_script('postbox');
@@ -62,7 +63,33 @@ class UM_Admin_Dashboard {
add_meta_box('um-metaboxes-contentbox-1', __('Users Overview','ultimatemember'), array(&$this, 'users_overview'), $this->pagehook, 'normal', 'core');
add_meta_box('um-metaboxes-sidebox-1', __('Purge Temp Files','ultimatemember'), array(&$this, 'purge_temp'), $this->pagehook, 'side', 'core');
if ( $this->language_avaialable_not_installed() ) {
add_meta_box('um-metaboxes-sidebox-2', __('Language','ultimatemember'), array(&$this, 'dl_language'), $this->pagehook, 'side', 'core');
} else if ( $this->language_avaialable_installed() ) {
add_meta_box('um-metaboxes-sidebox-2', __('Language','ultimatemember'), array(&$this, 'up_language'), $this->pagehook, 'side', 'core');
} else if ( $this->language_not_available() ) {
add_meta_box('um-metaboxes-sidebox-2', __('Language','ultimatemember'), array(&$this, 'ct_language'), $this->pagehook, 'side', 'core');
}
}
function up_language() {
global $ultimatemember;
$locale = get_option('WPLANG');
include_once um_path . 'admin/templates/dashboard/language-update.php';
}
function dl_language() {
global $ultimatemember;
$locale = get_option('WPLANG');
include_once um_path . 'admin/templates/dashboard/language-download.php';
}
function ct_language() {
global $ultimatemember;
$locale = get_option('WPLANG');
include_once um_path . 'admin/templates/dashboard/language-contrib.php';
}
function users_overview() {
@@ -75,6 +102,38 @@ class UM_Admin_Dashboard {
include_once um_path . 'admin/templates/dashboard/purge.php';
}
/***
*** @language not available
***/
function language_not_available() {
$locale = get_option('WPLANG');
if ( $locale && !isset( $ultimatemember->available_languages[$locale] ) && !file_exists( WP_LANG_DIR . '/plugins/ultimatemember-' . $locale . '.mo' ) )
return true;
return false;
}
/***
*** @language available but not installed
***/
function language_avaialable_not_installed() {
global $ultimatemember;
$locale = get_option('WPLANG');
if ( $locale && isset( $ultimatemember->available_languages[$locale] ) && !file_exists( WP_LANG_DIR . '/plugins/ultimatemember-' . $locale . '.mo' ) )
return true;
return false;
}
/***
*** @language available and installed
***/
function language_avaialable_installed() {
global $ultimatemember;
$locale = get_option('WPLANG');
if ( $locale && isset( $ultimatemember->available_languages[$locale] ) && file_exists( WP_LANG_DIR . '/plugins/ultimatemember-' . $locale . '.mo' ) )
return true;
return false;
}
/***
*** @get a directory size
***/
+4 -1
View File
@@ -122,7 +122,10 @@ class UM_Admin_Metabox {
***/
function ui_on_off( $id, $default=0, $is_conditional=false, $cond1='', $cond1_show='', $cond1_hide='', $yes='', $no='' ) {
$meta = get_post_meta( get_the_ID(), $id, true );
$meta = (string)get_post_meta( get_the_ID(), $id, true );
if ( $meta === '0' && $default > 0 ) {
$default = $meta;
}
$yes = ( !empty( $yes ) ) ? $yes : __('Yes');
$no = ( !empty( $no ) ) ? $no : __('No');
+6
View File
@@ -27,7 +27,9 @@ class UM_Admin_Notices {
$path = str_replace('//','/',$path);
if ( !file_exists( $path ) ) {
$old = umask(0);
@mkdir( $path, 0777, true);
umask($old);
}
}
@@ -111,6 +113,10 @@ class UM_Admin_Notices {
$update = $_REQUEST['update'];
switch($update) {
case 'language_updated':
$messages[0]['content'] = __('Your translation files have been updated successfully.','ultimatemember');
break;
case 'purged_temp':
$messages[0]['content'] = __('Your temp uploads directory is now clean.','ultimatemember');
break;
+1 -1
View File
@@ -248,7 +248,7 @@ class UM_Admin_Users {
um_fetch_user( $user_id );
if ( um_user('account_status') == 'approved' ) {
$output = '<span class="um-admin-tag small ok">'.um_user('account_status_name').'</span>';
$output = '<span class="um-admin-tag small approved">'.um_user('account_status_name').'</span>';
} else {
$output = '<span class="um-admin-tag small pending">'.um_user('account_status_name').'</span>';
}