Plugin Directory

Changeset 2015193


Ignore:
Timestamp:
01/19/2019 05:40:22 AM (7 years ago)
Author:
cometchat
Message:

updated plugin user interface

Location:
cometchat/trunk
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • cometchat/trunk/cometchat.php

    r2008197 r2015193  
    4141    global $cc_clientid;
    4242
    43   $cc_clientid_temp = get_option('cc_clientid');
    44 
    45   if (!empty($cc_clientid_temp)) {
    46     $cc_clientid = $cc_clientid_temp;
    47   } else {
    48 
    49     $accessKey = 'flGBNxeq8Mgu5bynUhS5w3S2CJ7dfo3latMTxDNa';
    50     $cc_license_key = get_option('cc_license_key');
    51     if(!empty($cc_license_key)){
    52         $url = "https://secure.cometchat.com/api-software/subscription?accessKey=".$accessKey;
    53         $url .= "&licenseKey=".$cc_license_key;
    54         $response = wp_remote_get( $url );
    55           $body = wp_remote_retrieve_body( $response );
    56     }
    57     $licenseinfo = !empty($body) ? json_decode($body): '';
    58     $cc_clientid = (!empty($licenseinfo) && is_object($licenseinfo) && property_exists($licenseinfo, 'success') && $licenseinfo->success == 1 && property_exists($licenseinfo, 'cloud') && $licenseinfo->cloud != 0) ? $licenseinfo->cloud : 0;
    59 
    60     add_option('cc_clientid',$cc_clientid,'','no');
    61   }
    62 
     43    $cc_clientid_temp = get_option('cc_clientid');
     44
     45    if (!empty($cc_clientid_temp)) {
     46        $cc_clientid = $cc_clientid_temp;
     47    } else {
     48
     49        $accessKey = 'flGBNxeq8Mgu5bynUhS5w3S2CJ7dfo3latMTxDNa';
     50        $cc_license_key = get_option('cc_license_key');
     51        if(!empty($cc_license_key)){
     52            $url = "https://secure.cometchat.com/api-software/subscription?accessKey=".$accessKey;
     53            $url .= "&licenseKey=".$cc_license_key;
     54            $response = wp_remote_get( $url );
     55            $body = wp_remote_retrieve_body( $response );
     56        }
     57        $licenseinfo = !empty($body) ? json_decode($body): '';
     58        $cc_clientid = (!empty($licenseinfo) && is_object($licenseinfo) && property_exists($licenseinfo, 'success') && $licenseinfo->success == 1 && property_exists($licenseinfo, 'cloud') && $licenseinfo->cloud != 0) ? $licenseinfo->cloud : 0;
     59
     60        add_option('cc_clientid',$cc_clientid,'','no');
     61    }
    6362
    6463    return $cc_clientid;
     
    7170*/
    7271function addCometChatToWordPressMenu() {
    73     add_menu_page( 'CometChat', 'CometChat', 'manage_options', 'cometchat/cometchatinstall.php', '', plugins_url( '/images/cometchat.png', __FILE__ ), '75' );
     72    add_menu_page( 'CometChat', 'CometChat', 'manage_options', 'cometchat/cometchat-go.php', '', plugins_url( '/images/cometchat.png', __FILE__ ), '75' );
    7473}
    7574
     
    140139    delete_option('ccintialaccess');
    141140    delete_option('cc_clientid');
     141    delete_option('bp_group_sync');
     142    delete_option('show_friends');
     143
    142144    $path = ABSPATH.$cc_dir_name.'/';
    143145
  • cometchat/trunk/cometchatinstall.php

    r1999611 r2015193  
    6060        $execute = $wpdb->get_row($guestsql);
    6161    }
    62     if(is_plugin_active('buddypress/bp-loader.php')){
    63         update_option('show_friends', 'true');
    64         curlRequestToCometChatAPI('updateUserListSetting', array(
    65                 'setting_key' => 'show_friends',
    66                 'setting_value' => 'true'
    67             )
    68         );
    69     }
    7062
    7163    /** Initial access of CometChat Installation **/
     
    7567    if(!empty($result) && !empty($result->option_value)){
    7668        $ccintialaccess = $result->option_value;
     69    }
     70
     71    if(empty($ccintialaccess) && is_plugin_active('buddypress/bp-loader.php')){
     72        update_option('show_friends', 'true');
     73        curlRequestToCometChatAPI('updateUserListSetting', array(
     74                'setting_key' => 'show_friends',
     75                'setting_value' => 'true'
     76            )
     77        );
    7778    }
    7879
  • cometchat/trunk/js/admin.js

    r2008215 r2015193  
    11(function($) {
    2     $(document).on('show.bs.tab', '.nav-tabs-responsive [data-toggle="tab"]', function(e) {
    3         var $target = $(e.target);
    4         var $tabs = $target.closest('.nav-tabs-responsive');
    5         var $current = $target.closest('li');
    6         var $parent = $current.closest('li.dropdown');
    7 
    8         $current = $parent.length > 0 ? $parent : $current;
    9         var $next = $current.next();
    10         var $prev = $current.prev();
    11 
    12         var updateDropdownMenu = function($el, position){
    13             $el
    14             .find('.dropdown-menu')
    15             .removeClass('pull-xs-left pull-xs-center pull-xs-right')
    16             .addClass( 'pull-xs-' + position );
    17         };
    18 
    19         $tabs.find('>li').removeClass('next prev');
    20         $prev.addClass('prev');
    21         $next.addClass('next');
    22 
    23         updateDropdownMenu( $prev, 'left' );
    24         updateDropdownMenu( $current, 'center' );
    25         updateDropdownMenu( $next, 'right' );
    26     });
    27 
    28 })(jQuery);
    292
    303var show_friends;
     
    336jQuery(document).ready(function() {
    347    jQuery('#save').on('click', function(e) {
     8        console.log('clicked');
    359        show_friends = jQuery("input.show_friends[type=checkbox]:checked").val();
    3610        if(show_friends == '' || show_friends == undefined){
Note: See TracChangeset for help on using the changeset viewer.