Changeset 2493592
- Timestamp:
- 03/11/2021 08:06:20 PM (5 years ago)
- Location:
- anonymous-restricted-content/trunk
- Files:
-
- 8 edited
-
README.txt (modified) (2 diffs)
-
admin/class-arc-admin.php (modified) (2 diffs)
-
admin/js/arc-admin.js (modified) (1 diff)
-
anonymous-restricted-content.php (modified) (2 diffs)
-
languages/anonymous-restricted-content-uk.po (modified) (1 diff)
-
languages/arc.pot (modified) (1 diff)
-
public/class-arc-public.php (modified) (1 diff)
-
public/js/arc-public.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
anonymous-restricted-content/trunk/README.txt
r2464550 r2493592 3 3 Tags: restricted access, block content, content control, access control, restrict anonymous, hide content, limited access, permission, private 4 4 Requires at least: 4.6 5 Tested up to: 5. 66 Stable tag: 1.5. 25 Tested up to: 5.7 6 Stable tag: 1.5.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 76 76 77 77 == Changelog == 78 = 1.5.3 = 79 * JS scripts included into translations 80 * Tested up to WP 5.7 81 78 82 = 1.5.2 = 79 83 * Started work on plugin translation -
anonymous-restricted-content/trunk/admin/class-arc-admin.php
r2464550 r2493592 68 68 */ 69 69 public function enqueue_scripts() { 70 // wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/arc-admin.js', array( 'jquery' ), $this->version, false );71 72 70 73 71 if ( !is_plugin_active('classic-editor/classic-editor.php') ) { 74 72 wp_enqueue_script( 75 $this->plugin_name,73 'arc-admin.js', 76 74 plugin_dir_url( __FILE__ ) . 'js/arc-admin.js', 77 75 array( 'wp-element', 'wp-components', 'wp-i18n', 'wp-plugins', 'wp-edit-post' ), // Dependencies, defined above. … … 79 77 true 80 78 ); 79 80 wp_localize_script( 'arc-admin.js', 'ArcLStrings', $this->get_language_strings() ); 81 82 // if(get_current_screen()->base == 'post'){ 83 // 84 // global $post; 85 // 86 // $is_post_restricted = ( get_post_meta($post->ID, 'arc_restricted_post', true) && (bool) get_post_meta($post->ID, 'arc_restricted_post', true) === true ) ? true : false; 87 // 88 // $js_arc_vars = array( 89 // 'arc_checked' => $is_post_restricted, 90 // 'post_id' => $post->ID 91 // ); 92 // wp_add_inline_script( 'arc-admin.js', 'const arc_vars = ' . json_encode( $js_arc_vars ), 'before' ); 93 // } 81 94 } 82 83 if(get_current_screen()->base == 'post'){ 84 85 global $post; 86 87 $is_post_restricted = ( get_post_meta($post->ID, 'arc_restricted_post', true) && (bool) get_post_meta($post->ID, 'arc_restricted_post', true) === true ) ? true : false; 88 89 $localize = array( 90 'arc_checked' => $is_post_restricted, 91 'post_id' => $post->ID 92 ); 93 94 wp_localize_script( $this->plugin_name, 'arc_vars', $localize); 95 } 95 } 96 97 /** 98 * translations strings for JS scripts 99 * 100 * @since 1.5.2 101 */ 102 private function get_language_strings() { 103 $strings = array( 104 'RestrictedForAnonymousUsers' => __( 'Restricted for anonymous users', 'anonymous-restricted-content' ), 105 ); 106 107 return $strings; 96 108 } 97 109 -
anonymous-restricted-content/trunk/admin/js/arc-admin.js
r2260252 r2493592 31 31 el( 32 32 CheckboxControl, { 33 label: 'Restricted for anonymous users',33 label: ArcLStrings.RestrictedForAnonymousUsers, 34 34 checked: props.metaFieldValue, 35 35 id: 'arc_checkbox', -
anonymous-restricted-content/trunk/anonymous-restricted-content.php
r2464550 r2493592 11 11 * Plugin URI: https://wordpress.org/plugins/anonymous-restricted-content/ 12 12 * Description: Restrict access to selected content (posts/pages/categories) for NOT LOGGED IN users. 13 * Version: 1.5. 213 * Version: 1.5.3 14 14 * Author: Taras Sych 15 15 * Author URI: https://wordpress.org/plugins/anonymous-restricted-content// … … 28 28 * Currently plugin version. 29 29 */ 30 define( 'ARC_VERSION', '1.5. 2' );30 define( 'ARC_VERSION', '1.5.3' ); 31 31 define( 'ARC_PACKAGE_NAME', 'ARC' ); 32 32 -
anonymous-restricted-content/trunk/languages/anonymous-restricted-content-uk.po
r2464551 r2493592 125 125 #: admin/class-arc-admin.php:238 126 126 msgid "Anonymous Restricted Content" 127 msgstr " Обмеження доступу без авторизації"127 msgstr "Anonymous Restricted Content" -
anonymous-restricted-content/trunk/languages/arc.pot
r1898412 r2493592 1 # Copyright (C) 2021 Taras Sych 2 # This file is distributed under the same license as the Anonymous Restricted Content plugin. 3 msgid "" 4 msgstr "" 5 "Project-Id-Version: Anonymous Restricted Content 1.5.3\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/anonymous-restricted-content\n" 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 8 "Language-Team: LANGUAGE <LL@li.org>\n" 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2021-03-11T19:58:14+00:00\n" 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.4.0\n" 15 "X-Domain: anonymous-restricted-content\n" 16 17 #. Plugin Name of the plugin 18 #: admin/class-arc-admin.php:309 19 msgid "Anonymous Restricted Content" 20 msgstr "" 21 22 #. Plugin URI of the plugin 23 msgid "https://wordpress.org/plugins/anonymous-restricted-content/" 24 msgstr "" 25 26 #. Description of the plugin 27 msgid "Restrict access to selected content (posts/pages/categories) for NOT LOGGED IN users." 28 msgstr "" 29 30 #. Author of the plugin 31 msgid "Taras Sych" 32 msgstr "" 33 34 #. Author URI of the plugin 35 msgid "https://wordpress.org/plugins/anonymous-restricted-content//" 36 msgstr "" 37 38 #: admin/class-arc-admin.php:104 39 msgid "Restricted for anonymous users" 40 msgstr "" 41 42 #: admin/class-arc-admin.php:121 43 msgid "Restricted for anonymouse users" 44 msgstr "" 45 46 #: admin/class-arc-admin.php:156 47 msgid "Redirect Options" 48 msgstr "" 49 50 #: admin/class-arc-admin.php:163 51 msgid "Redirect URL:" 52 msgstr "" 53 54 #: admin/class-arc-admin.php:175 55 msgid "Login Screen:" 56 msgstr "" 57 58 #: admin/class-arc-admin.php:182 59 msgid "Login screen message:" 60 msgstr "" 61 62 #: admin/class-arc-admin.php:194 63 msgid "AJAX Alternative:" 64 msgstr "" 65 66 #: admin/class-arc-admin.php:201 67 msgid "AJAX Login:" 68 msgstr "" 69 70 #: admin/class-arc-admin.php:274 71 msgid "Anonymous users, who are restricted to access content, can be redirected to the URL you provide below." 72 msgstr "" 73 74 #: admin/class-arc-admin.php:275 75 msgid "Leave Redirect URL empty to force anonymous users to login (redirect to Wordpress Login page)." 76 msgstr "" 77 78 #: admin/class-arc-admin.php:285 79 msgid "Message to be shown on the login screen, for users who trying to access restricted content and forced to login." 80 msgstr "" 81 82 #: admin/class-arc-admin.php:286 83 msgid "Defaul message: \"This content was restricted from anonymous access. Please, login first:\"" 84 msgstr "" 85 86 #: admin/class-arc-admin.php:296 87 msgid "Turn ON this option to prevent users redirects to the WP login page." 88 msgstr "" 89 90 #: admin/class-arc-admin.php:297 91 msgid "And use AJAX login form in floating popup instead." 92 msgstr "" 93 94 #: admin/class-arc-admin.php:298 95 msgid "This feature should prevent issues with \"loop login screen redirects\" in case of other plugin integration conflicts." 96 msgstr "" 97 98 #: admin/class-arc-admin.php:310 99 #: public/class-arc-public.php:85 100 msgid "Restricted Content" 101 msgstr "" 102 103 #: admin/class-arc-admin.php:374 104 msgid "Restr" 105 msgstr "" 106 107 #: admin/class-arc-admin.php:403 108 msgid "Restrict for Anonymous" 109 msgstr "" 110 111 #: admin/class-arc-admin.php:430 112 msgid "Settings" 113 msgstr "" 114 115 #: public/class-arc-public.php:83 116 msgid "Sending user info, please wait..." 117 msgstr "" 118 119 #: public/class-arc-public.php:84 120 msgid "Log In failed. Try again later." 121 msgstr "" 122 123 #: public/class-arc-public.php:86 124 msgid "Please log in to get access:" 125 msgstr "" 126 127 #: public/class-arc-public.php:87 128 msgid "Username:" 129 msgstr "" 130 131 #: public/class-arc-public.php:88 132 msgid "Password:" 133 msgstr "" 134 135 #: public/class-arc-public.php:89 136 msgid "Log In" 137 msgstr "" 138 139 #: public/class-arc-public.php:90 140 msgid "Go Back" 141 msgstr "" 142 143 #: public/class-arc-public.php:304 144 msgid "Login successful." 145 msgstr "" 146 147 #: public/class-arc-public.php:306 148 msgid "Login failed." 149 msgstr "" 150 151 #: public/class-arc-public.php:331 152 msgid "This content was restricted from anonymous access. Please, login first:" 153 msgstr "" -
anonymous-restricted-content/trunk/public/class-arc-public.php
r2464550 r2493592 70 70 public function enqueue_scripts() { 71 71 72 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/arc-public.js', array( 'jquery' ), $this->version, false ); 73 } 74 75 72 wp_enqueue_script( 'arc-public.js', plugin_dir_url( __FILE__ ) . 'js/arc-public.js', array( 'jquery' ), $this->version, false ); 73 wp_localize_script( 'arc-public.js', 'ArcPubLStrings', $this->get_language_strings() ); 74 } 75 76 /** 77 * translations strings for JS scripts 78 * 79 * @since 1.5.2 80 */ 81 private function get_language_strings() { 82 $strings = array( 83 'SendingUserInfo' => __( 'Sending user info, please wait...', 'anonymous-restricted-content' ), 84 'LogInFailed' => __( 'Log In failed. Try again later.', 'anonymous-restricted-content' ), 85 'RestrictedContent' => __( 'Restricted Content', 'anonymous-restricted-content' ), 86 'PleaseLogIn' => __( 'Please log in to get access:', 'anonymous-restricted-content' ), 87 'Username' => __( 'Username:', 'anonymous-restricted-content' ), 88 'Password' => __( 'Password:', 'anonymous-restricted-content' ), 89 'LogIn' => __( 'Log In', 'anonymous-restricted-content' ), 90 'GoBack' => __( 'Go Back', 'anonymous-restricted-content' ), 91 ); 92 93 return $strings; 94 } 76 95 77 96 /** -
anonymous-restricted-content/trunk/public/js/arc-public.js
r2459127 r2493592 18 18 e.preventDefault(); 19 19 20 $("#arc-ajax-login-status-text", loginForm).html( 'Sending user info, please wait...');20 $("#arc-ajax-login-status-text", loginForm).html(ArcPubLStrings.SendingUserInfo); 21 21 $("#arc-ajax-login-submit-btn", loginForm).prop( "disabled", true ); 22 22 … … 39 39 loginContainer.remove(); 40 40 41 window.location.reload(false); 41 window.location.reload(false); 42 42 43 43 } else if ( data.error == true ) { … … 46 46 }, 47 47 error: function(){ 48 $("#arc-ajax-login-status-text", loginForm).html( 'Log In failed. Try again later.');48 $("#arc-ajax-login-status-text", loginForm).html(ArcPubLStrings.LogInFailed); 49 49 $("#arc-ajax-login-submit-btn", loginForm).prop( "disabled", false ); 50 50 } … … 54 54 }); 55 55 56 jQuery('<h5/>').html( 'Restricted Content').appendTo(loginForm);57 jQuery('<p/>').html( 'Please log in to get access:').appendTo(loginForm);58 jQuery('<label/>', { for: 'arc-ajax-login-username-input'}).html( 'Username:').appendTo(loginForm);56 jQuery('<h5/>').html(ArcPubLStrings.RestrictedContent).appendTo(loginForm); 57 jQuery('<p/>').html(ArcPubLStrings.PleaseLogIn).appendTo(loginForm); 58 jQuery('<label/>', { for: 'arc-ajax-login-username-input'}).html(ArcPubLStrings.Username).appendTo(loginForm); 59 59 jQuery('<input/>', { "type": 'text', id: 'arc-ajax-login-username-input'}).appendTo(loginForm); 60 jQuery('<label/>', { for: 'arc-ajax-login-password-input'}).html( 'Password:').appendTo(loginForm);60 jQuery('<label/>', { for: 'arc-ajax-login-password-input'}).html(ArcPubLStrings.Password).appendTo(loginForm); 61 61 jQuery('<input/>', { "type": 'password', id: 'arc-ajax-login-password-input'}).appendTo(loginForm); 62 62 jQuery('<p/>', { id: 'arc-ajax-login-status-text'}).appendTo(loginForm); 63 jQuery('<input/>', { "type": 'submit', "class": "submit_button", "value": "Log In", id: 'arc-ajax-login-submit-btn'}).appendTo(loginForm);63 jQuery('<input/>', { "type": 'submit', "class": "submit_button", "value": ArcPubLStrings.LogIn, id: 'arc-ajax-login-submit-btn'}).appendTo(loginForm); 64 64 jQuery('<p/>').appendTo(loginForm); 65 65 jQuery('<input/>', { "type": 'button', 66 66 "class": "cancel_button", 67 "value": "Go Back",67 "value": ArcPubLStrings.GoBack, 68 68 "id": 'arc-login-go-back-btn', 69 69 "click": function() {
Note: See TracChangeset
for help on using the changeset viewer.