Changeset 3188801
- Timestamp:
- 11/14/2024 02:55:55 PM (17 months ago)
- Location:
- easyling
- Files:
-
- 1 deleted
- 4 edited
- 12 copied
-
tags/2.0 (copied) (copied from easyling/trunk)
-
tags/2.0/assets (copied) (copied from easyling/trunk/assets)
-
tags/2.0/assets/.DS_Store (deleted)
-
tags/2.0/assets/css/admin.css (copied) (copied from easyling/trunk/assets/css/admin.css)
-
tags/2.0/assets/js/admin-menu.js (copied) (copied from easyling/trunk/assets/js/admin-menu.js)
-
tags/2.0/assets/js/admin.js (copied) (copied from easyling/trunk/assets/js/admin.js)
-
tags/2.0/easyling.php (copied) (copied from easyling/trunk/easyling.php) (4 diffs)
-
tags/2.0/gpl-2.0.txt (copied) (copied from easyling/trunk/gpl-2.0.txt)
-
tags/2.0/inc (copied) (copied from easyling/trunk/inc)
-
tags/2.0/inc/admin.php (copied) (copied from easyling/trunk/inc/admin.php) (3 diffs)
-
tags/2.0/inc/frontend.php (copied) (copied from easyling/trunk/inc/frontend.php) (1 diff)
-
tags/2.0/inc/integration (copied) (copied from easyling/trunk/inc/integration)
-
tags/2.0/readme.txt (copied) (copied from easyling/trunk/readme.txt) (2 diffs)
-
trunk/easyling.php (modified) (4 diffs)
-
trunk/inc/admin.php (modified) (3 diffs)
-
trunk/inc/frontend.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easyling/tags/2.0/easyling.php
r3166604 r3188801 4 4 Plugin URI: https://www.easyling.com/ 5 5 Description: One-click website translation solution from Easyling. 6 Version: 1.96 Version: 2.0 7 7 Author: Easyling 8 8 Copyright: Easyling … … 41 41 */ 42 42 private $default_user_config = array( 43 'status' => 'enabled', 44 'project_code' => '', 45 'location_host' => 'app.easyling.com', 46 'custom_location_host' => '', 47 'publishing_mode' => 'js', 48 'prerender_key' => '', 49 'redirect_system_pages' => 'on', 50 'deployed' => 'on', 51 'translate_login_page' => 'off', 43 'status' => 'enabled', 44 'project_code' => '', 45 'location_host' => 'app.easyling.com', 46 'custom_location_host' => '', 47 'publishing_mode' => 'js', 48 'prerender_key' => '', 49 'redirect_system_pages' => 'on', 50 'deployed' => 'on', 51 'translate_login_page' => 'off', 52 'floating_language_selector' => '', 52 53 ); 53 54 … … 59 60 */ 60 61 private $user_config_options = array( 61 'status' => array( 'enabled', 'disabled' ), 62 'location_host' => array( 'app.easyling.com', 'eu.easyling.com', 'custom' ), 63 'publishing_mode' => array( 'js', 'proxy' ), 62 'status' => array( 'enabled', 'disabled' ), 63 'location_host' => array( 'app.easyling.com', 'eu.easyling.com', 'custom' ), 64 'publishing_mode' => array( 'js', 'proxy' ), 65 'floating_language_selector' => array( '', 'true', 'false' ), 64 66 ); 65 67 … … 78 80 private function __construct() { 79 81 $this->settings = array( 80 'version' => ' 1.9',82 'version' => '2.0', 81 83 'path' => plugin_dir_path( __FILE__ ), 82 84 'url' => plugin_dir_url( __FILE__ ), -
easyling/tags/2.0/inc/admin.php
r3166604 r3188801 115 115 'custom' => __( 'Other', 'easyling' ), 116 116 ); 117 $floating_language_selector_options = array( 118 '' => __( 'Default', 'easyling' ), 119 'true' => __( 'Hide', 'easyling' ), 120 'false' => __( 'Show', 'easyling' ), 121 ); 117 122 118 123 $should_save_user_config = ! empty( $_POST['easyling_nonce'] ) && wp_verify_nonce( $_POST['easyling_nonce'], 'easyling_save_settings' ); … … 134 139 if ( ! empty( $publishing_mode_options[ $publishing_mode ] ) ) { 135 140 easyling()->update_user_config( 'publishing_mode', $publishing_mode ); 141 } 142 143 $floating_language_selector = sanitize_text_field( $_POST['floating_language_selector'] ); 144 if ( isset( $floating_language_selector_options[ $floating_language_selector ] ) ) { 145 easyling()->update_user_config( 'floating_language_selector', $floating_language_selector ); 136 146 } 137 147 … … 264 274 </tr> 265 275 <tr> 276 <th><?php esc_html_e( 'Floating language selector', 'easyling' ) ?></th> 277 <td> 278 <select name="floating_language_selector"> 279 <?php foreach ( $floating_language_selector_options as $value => $name ) : ?> 280 <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $config['floating_language_selector'], $value ); ?>><?php echo esc_html( $name ) ?></option> 281 <?php endforeach; ?> 282 </select> 283 <p><?php esc_html_e( 'Override project settings for the floating sidebar language selector or choose "Default" to leave it as it is.', 'easyling' ) ?></p> 284 </td> 285 </tr> 286 <tr> 266 287 <th><?php esc_html_e( 'Redirect system pages', 'easyling' ) ?></th> 267 288 <td> -
easyling/tags/2.0/inc/frontend.php
r3098777 r3188801 111 111 if ( ! $this->is_wp_login_page() || ( 'on' === $translate_login_page ) ) { 112 112 113 add_action( 'init', function() use ( $is_prerender_app_request, $publishing_mode, $project_code, $location_host, $deployed ) {113 add_action( 'init', function() use ( $is_prerender_app_request, $publishing_mode, $project_code, $location_host, $deployed, $floating_language_selector ) { 114 114 if ( $is_prerender_app_request || ( 'js' === $publishing_mode ) ) { 115 115 $deployed_value = $deployed === 'on' ? 'true' : 'false'; 116 wp_enqueue_script( 'easyling-stub', "https://{$location_host}/client/{$project_code}/0/stub.js?deployed={$deployed_value}", array(), null, true ); 116 $floating_language_selector_param = ! empty( $floating_language_selector ) ? "&disableSelector={$floating_language_selector}" : ''; 117 wp_enqueue_script( 'easyling-stub', "https://{$location_host}/client/{$project_code}/0/stub.js?deployed={$deployed_value}{$floating_language_selector_param}", array(), null, true ); 117 118 } if ( 'proxy' === $publishing_mode ) { 118 119 wp_enqueue_script( 'easyling-language-selector', "https://{$location_host}/_el/ext/js/languageSelector.js?code={$project_code}", array(), null, true ); -
easyling/tags/2.0/readme.txt
r3166604 r3188801 4 4 Requires at least: 4.7 5 5 Tested up to: 6.4.1 6 Stable tag: 1.96 Stable tag: 2.0 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 44 44 45 45 == Changelog == 46 = 2.0 = 47 Release Date: November 14th, 2024 48 49 Enhancements: 50 51 * Control floating sidebar language selector visibility from the admin panel 52 46 53 = 1.9 = 47 54 Release Date: October 10th, 2024 -
easyling/trunk/easyling.php
r3166604 r3188801 4 4 Plugin URI: https://www.easyling.com/ 5 5 Description: One-click website translation solution from Easyling. 6 Version: 1.96 Version: 2.0 7 7 Author: Easyling 8 8 Copyright: Easyling … … 41 41 */ 42 42 private $default_user_config = array( 43 'status' => 'enabled', 44 'project_code' => '', 45 'location_host' => 'app.easyling.com', 46 'custom_location_host' => '', 47 'publishing_mode' => 'js', 48 'prerender_key' => '', 49 'redirect_system_pages' => 'on', 50 'deployed' => 'on', 51 'translate_login_page' => 'off', 43 'status' => 'enabled', 44 'project_code' => '', 45 'location_host' => 'app.easyling.com', 46 'custom_location_host' => '', 47 'publishing_mode' => 'js', 48 'prerender_key' => '', 49 'redirect_system_pages' => 'on', 50 'deployed' => 'on', 51 'translate_login_page' => 'off', 52 'floating_language_selector' => '', 52 53 ); 53 54 … … 59 60 */ 60 61 private $user_config_options = array( 61 'status' => array( 'enabled', 'disabled' ), 62 'location_host' => array( 'app.easyling.com', 'eu.easyling.com', 'custom' ), 63 'publishing_mode' => array( 'js', 'proxy' ), 62 'status' => array( 'enabled', 'disabled' ), 63 'location_host' => array( 'app.easyling.com', 'eu.easyling.com', 'custom' ), 64 'publishing_mode' => array( 'js', 'proxy' ), 65 'floating_language_selector' => array( '', 'true', 'false' ), 64 66 ); 65 67 … … 78 80 private function __construct() { 79 81 $this->settings = array( 80 'version' => ' 1.9',82 'version' => '2.0', 81 83 'path' => plugin_dir_path( __FILE__ ), 82 84 'url' => plugin_dir_url( __FILE__ ), -
easyling/trunk/inc/admin.php
r3166604 r3188801 115 115 'custom' => __( 'Other', 'easyling' ), 116 116 ); 117 $floating_language_selector_options = array( 118 '' => __( 'Default', 'easyling' ), 119 'true' => __( 'Hide', 'easyling' ), 120 'false' => __( 'Show', 'easyling' ), 121 ); 117 122 118 123 $should_save_user_config = ! empty( $_POST['easyling_nonce'] ) && wp_verify_nonce( $_POST['easyling_nonce'], 'easyling_save_settings' ); … … 134 139 if ( ! empty( $publishing_mode_options[ $publishing_mode ] ) ) { 135 140 easyling()->update_user_config( 'publishing_mode', $publishing_mode ); 141 } 142 143 $floating_language_selector = sanitize_text_field( $_POST['floating_language_selector'] ); 144 if ( isset( $floating_language_selector_options[ $floating_language_selector ] ) ) { 145 easyling()->update_user_config( 'floating_language_selector', $floating_language_selector ); 136 146 } 137 147 … … 264 274 </tr> 265 275 <tr> 276 <th><?php esc_html_e( 'Floating language selector', 'easyling' ) ?></th> 277 <td> 278 <select name="floating_language_selector"> 279 <?php foreach ( $floating_language_selector_options as $value => $name ) : ?> 280 <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $config['floating_language_selector'], $value ); ?>><?php echo esc_html( $name ) ?></option> 281 <?php endforeach; ?> 282 </select> 283 <p><?php esc_html_e( 'Override project settings for the floating sidebar language selector or choose "Default" to leave it as it is.', 'easyling' ) ?></p> 284 </td> 285 </tr> 286 <tr> 266 287 <th><?php esc_html_e( 'Redirect system pages', 'easyling' ) ?></th> 267 288 <td> -
easyling/trunk/inc/frontend.php
r3098777 r3188801 111 111 if ( ! $this->is_wp_login_page() || ( 'on' === $translate_login_page ) ) { 112 112 113 add_action( 'init', function() use ( $is_prerender_app_request, $publishing_mode, $project_code, $location_host, $deployed ) {113 add_action( 'init', function() use ( $is_prerender_app_request, $publishing_mode, $project_code, $location_host, $deployed, $floating_language_selector ) { 114 114 if ( $is_prerender_app_request || ( 'js' === $publishing_mode ) ) { 115 115 $deployed_value = $deployed === 'on' ? 'true' : 'false'; 116 wp_enqueue_script( 'easyling-stub', "https://{$location_host}/client/{$project_code}/0/stub.js?deployed={$deployed_value}", array(), null, true ); 116 $floating_language_selector_param = ! empty( $floating_language_selector ) ? "&disableSelector={$floating_language_selector}" : ''; 117 wp_enqueue_script( 'easyling-stub', "https://{$location_host}/client/{$project_code}/0/stub.js?deployed={$deployed_value}{$floating_language_selector_param}", array(), null, true ); 117 118 } if ( 'proxy' === $publishing_mode ) { 118 119 wp_enqueue_script( 'easyling-language-selector', "https://{$location_host}/_el/ext/js/languageSelector.js?code={$project_code}", array(), null, true ); -
easyling/trunk/readme.txt
r3166604 r3188801 4 4 Requires at least: 4.7 5 5 Tested up to: 6.4.1 6 Stable tag: 1.96 Stable tag: 2.0 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 44 44 45 45 == Changelog == 46 = 2.0 = 47 Release Date: November 14th, 2024 48 49 Enhancements: 50 51 * Control floating sidebar language selector visibility from the admin panel 52 46 53 = 1.9 = 47 54 Release Date: October 10th, 2024
Note: See TracChangeset
for help on using the changeset viewer.