Changeset 2721992
- Timestamp:
- 05/11/2022 01:05:21 PM (4 years ago)
- Location:
- melibo-chatbot
- Files:
-
- 33 added
- 7 edited
-
tags/1.4.3 (added)
-
tags/1.4.3/admin (added)
-
tags/1.4.3/admin/MeliboAjaxFunctions.class.php (added)
-
tags/1.4.3/admin/MeliboChatbot.class.php (added)
-
tags/1.4.3/admin/MeliboTranslation.class.php (added)
-
tags/1.4.3/admin/MeliboValidation.class.php (added)
-
tags/1.4.3/admin/MeliboView.class.php (added)
-
tags/1.4.3/admin/inc (added)
-
tags/1.4.3/admin/inc/img (added)
-
tags/1.4.3/admin/inc/img/academy_blog_article.png (added)
-
tags/1.4.3/admin/inc/img/academy_knowledge.png (added)
-
tags/1.4.3/admin/inc/img/first_steps_1.png (added)
-
tags/1.4.3/admin/inc/img/first_steps_2.png (added)
-
tags/1.4.3/admin/inc/img/first_steps_3.png (added)
-
tags/1.4.3/admin/inc/img/first_steps_4.png (added)
-
tags/1.4.3/admin/inc/img/first_steps_5.png (added)
-
tags/1.4.3/admin/inc/img/first_steps_6.png (added)
-
tags/1.4.3/admin/inc/img/logo_transparent128x128.png (added)
-
tags/1.4.3/admin/inc/js (added)
-
tags/1.4.3/admin/inc/js/admin.js (added)
-
tags/1.4.3/admin/inc/notice.php (added)
-
tags/1.4.3/admin/inc/styles (added)
-
tags/1.4.3/admin/inc/styles/admin.css (added)
-
tags/1.4.3/admin/inc/styles/collapse.css (added)
-
tags/1.4.3/admin/inc/styles/notice.css (added)
-
tags/1.4.3/includes (added)
-
tags/1.4.3/includes/notice.php (added)
-
tags/1.4.3/languages (added)
-
tags/1.4.3/languages/melibo-chatbot-de_DE.mo (added)
-
tags/1.4.3/languages/melibo-chatbot-de_DE.po (added)
-
tags/1.4.3/melibo-chatbot.php (added)
-
tags/1.4.3/readme.txt (added)
-
tags/1.4.3/uninstall.php (added)
-
trunk/admin/MeliboChatbot.class.php (modified) (4 diffs)
-
trunk/admin/MeliboView.class.php (modified) (1 diff)
-
trunk/admin/inc/js/admin.js (modified) (1 diff)
-
trunk/languages/melibo-chatbot-de_DE.mo (modified) (previous)
-
trunk/languages/melibo-chatbot-de_DE.po (modified) (6 diffs)
-
trunk/melibo-chatbot.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
melibo-chatbot/trunk/admin/MeliboChatbot.class.php
r2721797 r2721992 30 30 31 31 public function initSettings() { 32 add_settings_section('melibo_general_section', __('General', MeliboChatbot::PLUGIN_NAME), null, 'melibo-settings-page'); 33 add_settings_section('melibo_environment_section', __('Environment', MeliboChatbot::PLUGIN_NAME), null, 'melibo-settings-page'); 34 32 $this->initSections(); 33 35 34 $this->initApiKeyField(); 36 35 $this->initEnvironmentIDField(); 37 36 $this->initSelectPagesForEnvironmentChatbotField(); 38 37 $this->initActivationField(); 38 $this->initExcludedPages(); 39 } 40 41 private function initSections() { 42 add_settings_section('melibo_general_section', __('General', MeliboChatbot::PLUGIN_NAME), null, 'melibo-settings-page'); 43 add_settings_section('melibo_environment_section', __('Environment', MeliboChatbot::PLUGIN_NAME), null, 'melibo-settings-page'); 39 44 } 40 45 … … 104 109 ); 105 110 register_setting('meliboplugin', 'melibo_activate', array($this->meliboValidationClass, 'activateValidation')); 111 } 112 113 private function initExcludedPages() { 114 add_settings_field( 115 'melibo_excluded_pages', 116 __('excluded pages', MeliboChatbot::PLUGIN_NAME), 117 array($this, 'checkboxPageListHTML'), 118 'melibo-settings-page', 119 'melibo_general_section', 120 array( 121 'id' => 'melibo_excluded_pages', 122 'name' => 'melibo_excluded_pages', 123 'info' => sprintf('%s <u>%s</u> %s', 124 __('Select the pages you do', MeliboChatbot::PLUGIN_NAME), 125 __('not', MeliboChatbot::PLUGIN_NAME), 126 __('want your chatbot to appear on.', MeliboChatbot::PLUGIN_NAME)), 127 'multiple' => true 128 ) 129 ); 130 register_setting('meliboplugin', 'melibo_excluded_pages'); 106 131 } 107 132 … … 162 187 163 188 public function showChatbot($content) { 164 global $post; 165 $environmentChatbotPageIDArray = get_option('melibo_environment_select_pages'); 166 167 if(get_option('melibo_activate', '1') AND (is_page() OR is_front_page() OR is_single())) { 189 $activated = $this->isChatbotActivated(); 190 $showOnPage = $this->showOnPage(); 191 $isExcludedPage = $this->isExcludedPage(); 192 $isEnvironmentPage = $this->isEnvironmentPage(); 193 194 if($activated AND $showOnPage) { 195 if($isExcludedPage) { 196 return true; 197 } 198 168 199 wp_enqueue_script('cdn-melibo-chatbot', $this->CDN_URL); 169 if($ environmentChatbotPageIDArray AND count($environmentChatbotPageIDArray) > 0 AND in_array($post->ID, $environmentChatbotPageIDArray)) { ?>200 if($isEnvironmentPage) { ?> 170 201 <melibo-webchat api-key="<?php echo esc_attr(get_option('melibo_api_key')); ?>" 171 202 environment-id="<?php echo esc_attr(get_option('melibo_environment_id')); ?>"></melibo-webchat> … … 178 209 } 179 210 211 private function isChatbotActivated() { 212 return get_option('melibo_activate', '1'); 213 } 214 215 private function showOnPage() { 216 return (is_page() OR is_front_page() OR is_single()); 217 } 218 219 private function isExcludedPage() { 220 global $post; 221 $exludedPages = get_option('melibo_excluded_pages'); 222 return is_array($exludedPages) AND in_array($post->ID, $exludedPages); 223 } 224 225 private function isEnvironmentPage() { 226 global $post; 227 $environmentPages = get_option('melibo_environment_select_pages'); 228 return is_array($environmentPages) AND in_array($post->ID, $environmentPages); 229 } 230 180 231 public function addSettingsLink($links) { 181 232 -
melibo-chatbot/trunk/admin/MeliboView.class.php
r2721825 r2721992 260 260 </select> 261 261 <?php if(isset($args['info']) == true) { ?> 262 <p><?php echo esc_attr($args['info']); ?></p>262 <p><?php echo $args['info']; ?></p> 263 263 <?php } 264 264 } -
melibo-chatbot/trunk/admin/inc/js/admin.js
r2721797 r2721992 1 1 jQuery(function ($) { 2 2 // multiple select with AJAX search 3 $('#melibo_environment_select_pages ').select2({3 $('#melibo_environment_select_pages, #melibo_excluded_pages').select2({ 4 4 ajax: { 5 5 url: ajaxurl, // AJAX URL is predefined in WordPress admin -
melibo-chatbot/trunk/languages/melibo-chatbot-de_DE.po
r2721825 r2721992 2 2 msgstr "" 3 3 "Project-Id-Version: \n" 4 "POT-Creation-Date: 2022-05-11 1 0:54+0200\n"5 "PO-Revision-Date: 2022-05-11 1 0:54+0200\n"4 "POT-Creation-Date: 2022-05-11 14:55+0200\n" 5 "PO-Revision-Date: 2022-05-11 14:56+0200\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 17 17 "X-Poedit-SearchPath-0: .\n" 18 18 19 #: admin/MeliboChatbot.class.php: 3219 #: admin/MeliboChatbot.class.php:42 20 20 msgid "General" 21 21 msgstr "Allgemein" 22 22 23 #: admin/MeliboChatbot.class.php: 3323 #: admin/MeliboChatbot.class.php:43 24 24 msgid "Environment" 25 25 msgstr "Environment" 26 26 27 #: admin/MeliboChatbot.class.php:4 427 #: admin/MeliboChatbot.class.php:49 28 28 msgid "API Key" 29 29 msgstr "API Key" 30 30 31 #: admin/MeliboChatbot.class.php:5 031 #: admin/MeliboChatbot.class.php:55 32 32 msgid "" 33 33 "You can find the API key for your chatbot in your melibo account under " … … 39 39 "sehen." 40 40 41 #: admin/MeliboChatbot.class.php: 57admin/MeliboValidation.class.php:3441 #: admin/MeliboChatbot.class.php:62 admin/MeliboValidation.class.php:34 42 42 msgid "The API key must not contain any spaces." 43 43 msgstr "Der API-Key darf keine Leerzeichen enthalten." 44 44 45 #: admin/MeliboChatbot.class.php:6 445 #: admin/MeliboChatbot.class.php:69 46 46 msgid "Environment ID" 47 47 msgstr "Environment ID" 48 48 49 #: admin/MeliboChatbot.class.php:7 049 #: admin/MeliboChatbot.class.php:75 50 50 msgid "" 51 51 "You can optionally use the Environment ID if you want to use different chat " … … 60 60 "unterschiedlichen Auftritt geben." 61 61 62 #: admin/MeliboChatbot.class.php: 7962 #: admin/MeliboChatbot.class.php:84 63 63 msgid "page selection" 64 64 msgstr "Seitenauswahl" 65 65 66 #: admin/MeliboChatbot.class.php: 8666 #: admin/MeliboChatbot.class.php:91 67 67 msgid "Select the pages you want your chatbot to appear on." 68 68 msgstr "Wähle die Seiten aus, auf denen dein Chatbot erscheinen soll." 69 69 70 #: admin/MeliboChatbot.class.php: 9670 #: admin/MeliboChatbot.class.php:101 71 71 msgid "Activate chatbot" 72 72 msgstr "Chatbot aktivieren" 73 73 74 #: admin/MeliboChatbot.class.php:10 274 #: admin/MeliboChatbot.class.php:107 75 75 msgid "" 76 76 "As soon as you tick the box here and click on \"Save changes\", your melibo " … … 80 80 "klickst, wird dein melibo Chatbot auf deiner Website erscheinen." 81 81 82 #: admin/MeliboChatbot.class.php:135 82 #: admin/MeliboChatbot.class.php:116 83 msgid "excluded pages" 84 msgstr "ausgeschlossene Seiten" 85 86 #: admin/MeliboChatbot.class.php:124 87 msgid "Select the pages you do" 88 msgstr "Wähle die Seiten aus, auf denen dein Chatbot" 89 90 #: admin/MeliboChatbot.class.php:125 91 msgid "not" 92 msgstr "nicht" 93 94 #: admin/MeliboChatbot.class.php:126 95 msgid "want your chatbot to appear on." 96 msgstr "erscheinen soll." 97 98 #: admin/MeliboChatbot.class.php:160 83 99 msgid "melibo Settings" 84 100 msgstr "melibo Einstellungen" 85 101 86 #: admin/MeliboChatbot.class.php: 188admin/MeliboView.class.php:30102 #: admin/MeliboChatbot.class.php:239 admin/MeliboView.class.php:30 87 103 msgid "Settings" 88 104 msgstr "Einstellungen" … … 374 390 msgstr "Jetzt beginnen!" 375 391 392 #~ msgid "Select the pages you do not want your chatbot to appear on." 393 #~ msgstr "Wähle die Seiten aus, auf denen dein Chatbot nicht erscheinen soll." 394 376 395 #~ msgid "Add" 377 396 #~ msgstr "Hinzufügen" -
melibo-chatbot/trunk/melibo-chatbot.php
r2721825 r2721992 4 4 * Plugin Name: melibo Chatbot 5 5 * Description: add your melibo chatbot to your WordPress for free 6 * Version: 1.4. 26 * Version: 1.4.3 7 7 * Author: Melibo 8 8 * Author URI: www.melibo.de … … 10 10 * Domain Path: /languages/ 11 11 */ 12 define( 'MELIBO_VERSION', '1.4. 2');12 define( 'MELIBO_VERSION', '1.4.3'); 13 13 14 14 require_once( plugin_dir_path( __FILE__ ) . '/admin/MeliboTranslation.class.php' ); -
melibo-chatbot/trunk/readme.txt
r2721825 r2721992 3 3 Tags: chat, live chat, chatbot, support, livechat, bot, melibo, Helpdesk, E-Commerce, messenger, AI, widget, 4 4 Tested up to: 5.9.2 5 Stable tag: 1.4. 25 Stable tag: 1.4.3 6 6 License: GPLv2 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 180 180 181 181 - Add Page selection info Text 182 183 = 1.4.3 = 184 185 - Disable chatbot on specific sites
Note: See TracChangeset
for help on using the changeset viewer.