Example #1
0
<?php

/**
 * This file belongs to the YIT Plugin Framework.
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
$videobox = defined('YLC_PREMIUM') ? array() : array('name' => __('Upgrade to the PREMIUM VERSION', 'yith-live-chat'), 'type' => 'videobox', 'default' => array('plugin_name' => __('YITH Live Chat', 'yith-live-chat'), 'title_first_column' => __('Discover the Advanced Features', 'yith-live-chat'), 'description_first_column' => __('Upgrade to the PREMIUM VERSION of YITH Live Chat to benefit from all the features!', 'yith-live-chat'), 'video' => array('video_id' => '127461393', 'video_image_url' => YLC_ASSETS_URL . '/images/yith-live-chat.jpg', 'video_description' => __('YITH Live Chat', 'yith-live-chat')), 'title_second_column' => __('Get Support and Pro Features', 'yith-live-chat'), 'description_second_column' => __('By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product, and you will get one year of free updates and support through our platform available 24h/24.', 'yith-live-chat'), 'button' => array('href' => YITH_Live_Chat()->get_premium_landing_uri(), 'title' => 'Get Support and Pro Features')), 'id' => 'ylc_general_videobox');
return $videobox;
Example #2
0
 /**
  * Destroy Session
  *
  * @since   1.0.0
  * @return  void
  * @author  Alberto Ruggiero
  */
 public function destroy_session()
 {
     YITH_Live_Chat()->session->set('user_data', NULL);
     if (isset($_SESSION['yith_live_chat'])) {
         unset($_SESSION['yith_live_chat']);
     }
 }
Example #3
0
<?php

/**
 * This file belongs to the YIT Plugin Framework.
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
$firebase_url = '<a target="_blank" href="http://www.firebase.com">http://www.firebase.com</a>';
$defaults = YITH_Live_Chat()->defaults;
$vendor_only = !defined('YLC_PREMIUM') && !defined('YITH_WPV_PREMIUM') ? '' : array('name' => __('Show popup only in vendors\' pages', 'yith-live-chat'), 'desc' => __('Show the chat popup only in vendors\' pages and hide it in entire shop pages (You must have enabled the premium version of YITH WooCommerce Multi Vendor)', 'yith-live-chat'), 'id' => 'only-vendor-chat', 'type' => 'on-off', 'std' => $defaults['only-vendor-chat']);
return array('general' => array('home' => array(array('name' => __('YITH Live Chat: General Settings', 'yith-live-chat'), 'type' => 'title'), array('type' => 'close')), 'settings' => array(array('name' => __('Enable Live Chat', 'yith-live-chat'), 'desc' => __('Activate/Deactivate the live chat features. ', 'yith-live-chat'), 'id' => 'plugin-enable', 'type' => 'on-off', 'std' => $defaults['plugin-enable']), array('name' => __('Firebase App URL', 'yith-live-chat'), 'desc' => __('URL of your Firebase application. If you don\'t have one, get a free Firebase application here: ', 'yith-live-chat') . $firebase_url, 'id' => 'firebase-appurl', 'type' => 'custom-text', 'std' => $defaults['firebase-appurl'], 'custom_attributes' => array('required' => 'required', 'style' => 'width: 200px')), array('name' => __('Firebase App Secret', 'yith-live-chat'), 'desc' => __('It can be found under the "Secrets" menu in your Firebase app dashboard', 'yith-live-chat'), 'id' => 'firebase-appsecret', 'type' => 'text', 'std' => $defaults['firebase-appsecret'], 'custom_attributes' => array('required' => 'required', 'style' => 'width: 100%')), $vendor_only)));
Example #4
0
 /**
  * Get token
  *
  * @since   1.0.0
  * @return  array
  * @author  Alberto Ruggiero
  */
 function ylc_ajax_get_token()
 {
     $token = YITH_Live_Chat()->user_auth();
     return array('token' => $token);
 }
Example #5
0
 /**
  * Initialize Roles
  *
  * @since   1.0.0
  * @return  void
  * @author  Alberto Ruggiero
  */
 function ylc_roles()
 {
     YITH_Live_Chat()->ylc_operator_role('editor');
     //Administration role
     $admin_role = get_role('administrator');
     $admin_role->add_cap('answer_chat');
     //Chat Operator role
     $op_role = get_role('ylc_chat_op');
     $op_role->add_cap('answer_chat');
 }
 /**
  * Sets default options on database
  *
  * @since   1.1.0
  * @return  void
  * @author  Alberto ruggiero
  */
 function ylc_set_defaults()
 {
     $ylc_options_version = get_option('ylc_options_version');
     if (empty($ylc_options_version) || version_compare($ylc_options_version['number'], YLC_VERSION, '<') || $ylc_options_version['version'] == 'free' && defined('YLC_PREMIUM')) {
         $existing_options = get_option('yit_' . YITH_Live_Chat()->_options_name . '_options');
         $default_options = YITH_Live_Chat()->defaults;
         $options = empty($existing_options) ? $default_options : array_merge($default_options, $existing_options);
         update_option('yit_' . YITH_Live_Chat()->_options_name . '_options', $options);
         $ylc_options_version = array('number' => YLC_VERSION, 'version' => defined('YLC_PREMIUM') ? 'premium' : 'free');
         //update_option( 'ylc_options_version', $ylc_options_version );
     }
 }