mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-17 05:33:36 +09:00
Version 1.0.48
This commit is contained in:
@@ -54,10 +54,20 @@
|
||||
line-height: 34px;
|
||||
}
|
||||
.um-admin-tag.small {font-size: 13px;height:28px;line-height: 28px;display:inline;padding: 4px 10px;background: transparent;color: #666;border-radius:0;}
|
||||
.um-admin-tag.ok {border-left: 2px solid #93ba37}
|
||||
.um-admin-tag.approved {border-left: 2px solid #7ACF58}
|
||||
.um-admin-tag.pending {border-left: 2px solid #b76767}
|
||||
|
||||
.um-admin-txtspace {margin: 0 0 0 10px;}
|
||||
|
||||
.um-adm-ico {font-size: 20px;margin-top: 5px;display:inline-block;color:#3ba1da}
|
||||
.um-adm-ico {
|
||||
font-size: 20px;
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
margin-top: 5px;
|
||||
display: inline-block;
|
||||
color: #7ACF58;
|
||||
}
|
||||
|
||||
.um-adm-ico.inactive {color: #b76767}
|
||||
|
||||
.um-adm-ico.pointer {cursor: pointer}
|
||||
@@ -3,7 +3,7 @@
|
||||
}
|
||||
|
||||
.wrap a.red,
|
||||
.wrap span.red {color:#A00}
|
||||
.wrap span.red {color:#b76767}
|
||||
|
||||
.wrap span.ok {color:#7ACF58}
|
||||
|
||||
|
||||
@@ -115,9 +115,11 @@ body.um-admin-modal-open {
|
||||
margin: 0 0 8px 0 !important;
|
||||
padding: 0!important;
|
||||
font-size: 13px;
|
||||
color: #888;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.um-admin-metabox label strong {color: #222}
|
||||
|
||||
.um-admin-metabox input[type=text]:disabled{
|
||||
opacity: 0.7 !important;
|
||||
color: #aaa !important;
|
||||
|
||||
@@ -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) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
***/
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<p><?php printf(__('Ultimate Member is not yet available in your language: <strong>%1$s</strong>.','ultimatemember'), $locale); ?></p>
|
||||
|
||||
<p><?php _e('If you want to contribute this translation to the plugin, please add it on our <a href="https://ultimatemember.com/forums/"><forums</a>.','ultimatemember'); ?></p>
|
||||
@@ -0,0 +1,3 @@
|
||||
<p><?php printf(__('Ultimate Member is available in your language: <strong>%1$s (%2$s)</strong>.','ultimatemember'), $ultimatemember->available_languages[$locale], $locale); ?></p>
|
||||
|
||||
<p><a href="<?php echo add_query_arg( 'um_adm_action', 'um_language_downloader' ); ?>" class="button"><?php _e('Download Translation','ultimatemember'); ?></a></p>
|
||||
@@ -0,0 +1,3 @@
|
||||
<p><?php printf(__('You are currently using Ultimate Member in your language: <strong>%1$s (%2$s)</strong>.','ultimatemember'), $ultimatemember->available_languages[$locale], $locale); ?></p>
|
||||
|
||||
<p><a href="<?php echo add_query_arg( 'um_adm_action', 'um_language_downloader' ); ?>" class="button"><?php _e('Force Update Translation','ultimatemember'); ?></a></p>
|
||||
Reference in New Issue
Block a user