diff --git a/admin/css/qtranslate_configuration.css b/admin/css/qtranslate_configuration.css index dd342bc3..332ef8bb 100644 --- a/admin/css/qtranslate_configuration.css +++ b/admin/css/qtranslate_configuration.css @@ -55,7 +55,10 @@ } .qtranxs-deprecated { - font-weight: bold; + opacity: 0.7; +} + +.qtranxs-deprecated-warning { color: darkorange; } diff --git a/admin/qtx_admin.php b/admin/qtx_admin.php index 5f396f70..3ffd7a68 100644 --- a/admin/qtx_admin.php +++ b/admin/qtx_admin.php @@ -145,13 +145,21 @@ function qtranxf_admin_init() { if ( current_user_can( 'manage_options' ) ) { add_action( 'admin_notices', 'qtranxf_admin_notices_config' ); - } - if ( current_user_can( 'manage_options' ) && qtranxf_admin_is_config_page() - // TODO run this only if one of the forms or actions submitted --> && !empty($_POST) - ) { - require_once( QTRANSLATE_DIR . '/admin/qtx_admin_options_update.php' ); - qtranxf_edit_config(); + if ( qtranxf_admin_is_config_page() ) { + // TODO run this only if one of the forms or actions submitted --> && !empty($_POST) + require_once( QTRANSLATE_DIR . '/admin/qtx_admin_options_update.php' ); + qtranxf_edit_config(); + } + + // Check for deprecated options. + if ( isset( $q_config['use_strftime'] ) && ( $q_config['use_strftime'] ) == QTX_STRFTIME_OVERRIDE || $q_config['use_strftime'] == QTX_DATE_OVERRIDE ) { + $options_link = admin_url( 'options-general.php?page=qtranslate-xt#advanced' ); + $options_desc = __( 'advanced settings', 'qtranslate' ); + $warning = sprintf( __( 'The value set for option "%s" is deprecated, it will not be supported in the future. Go to the %s to update it.', 'qtranslate' ), + __( 'Date / Time Conversion', 'qtranslate' ), $options_link, $options_desc ); + qtranxf_add_warning( $warning ); + } } $next_thanks = get_option( 'qtranslate_next_thanks' ); diff --git a/admin/qtx_admin_settings.php b/admin/qtx_admin_settings.php index c010a0eb..0f0fb812 100644 --- a/admin/qtx_admin_settings.php +++ b/admin/qtx_admin_settings.php @@ -561,17 +561,19 @@ private function add_advanced_section() { /> - + "> /> + /> - + "> /> + @@ -782,12 +784,11 @@ class="qtranxs_explanation"> - + ' . __( 'Deprecated', 'qtranslate' ) . '' ); - } + class="qtranxs_explanation ">' ); printf( __( 'Additional custom JSON-encoded configuration of %s for all admin pages. It is processed after all files from option "%s" are loaded, providing opportunity to add or to override configuration tokens as necessary.', 'qtranslate' ), 'qTranslate‑XT', __( 'Configuration Files', 'qtranslate' ) ); ?> "use_strftime" option +define( 'QTX_DATE_WP', 0 ); +define( 'QTX_STRFTIME_OVERRIDE', 1 ); // TODO: deprecate strftime format +define( 'QTX_DATE_OVERRIDE', 2 ); // deprecated +define( 'QTX_DATE', 3 ); // default format at first activation - not consistent with default date/time values +define( 'QTX_STRFTIME', 4 ); // deprecated define( 'QTX_FILTER_OPTIONS_ALL', 0 ); define( 'QTX_FILTER_OPTIONS_LIST', 1 ); @@ -85,7 +85,7 @@ function qtranxf_set_default_options( &$ops ) { $ops['front']['int'] = array( 'url_mode' => QTX_URL_PATH, // sets default url mode - 'use_strftime' => QTX_DATE, // strftime usage (backward compability) + 'use_strftime' => QTX_DATE, // strftime usage (backward compatibility) 'filter_options_mode' => QTX_FILTER_OPTIONS_ALL, 'language_name_case' => 0 //Camel Case ); @@ -297,6 +297,7 @@ function qtranxf_default_not_available() { /** * Date Configuration + * @todo Deprecate strftime format * @since 3.3 */ function qtranxf_default_date_format() { @@ -342,6 +343,7 @@ function qtranxf_default_date_format() { /** * Time Configuration + * @todo Deprecate strftime format * @since 3.3 */ function qtranxf_default_time_format() {