Changeset 2015193
- Timestamp:
- 01/19/2019 05:40:22 AM (7 years ago)
- Location:
- cometchat/trunk
- Files:
-
- 6 added
- 4 edited
-
comet-admin.php (added)
-
comet-ready.php (added)
-
cometchat-go.php (added)
-
cometchat.php (modified) (3 diffs)
-
cometchatinstall.php (modified) (2 diffs)
-
css/comet-admin.css (added)
-
css/comet-ready.css (added)
-
images/docked_layout.png (modified) (previous)
-
js/admin.js (modified) (2 diffs)
-
js/comet-admin.js (added)
Legend:
- Unmodified
- Added
- Removed
-
cometchat/trunk/cometchat.php
r2008197 r2015193 41 41 global $cc_clientid; 42 42 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 } 63 62 64 63 return $cc_clientid; … … 71 70 */ 72 71 function addCometChatToWordPressMenu() { 73 add_menu_page( 'CometChat', 'CometChat', 'manage_options', 'cometchat/cometchat install.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' ); 74 73 } 75 74 … … 140 139 delete_option('ccintialaccess'); 141 140 delete_option('cc_clientid'); 141 delete_option('bp_group_sync'); 142 delete_option('show_friends'); 143 142 144 $path = ABSPATH.$cc_dir_name.'/'; 143 145 -
cometchat/trunk/cometchatinstall.php
r1999611 r2015193 60 60 $execute = $wpdb->get_row($guestsql); 61 61 } 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 }70 62 71 63 /** Initial access of CometChat Installation **/ … … 75 67 if(!empty($result) && !empty($result->option_value)){ 76 68 $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 ); 77 78 } 78 79 -
cometchat/trunk/js/admin.js
r2008215 r2015193 1 1 (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 $el14 .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);29 2 30 3 var show_friends; … … 33 6 jQuery(document).ready(function() { 34 7 jQuery('#save').on('click', function(e) { 8 console.log('clicked'); 35 9 show_friends = jQuery("input.show_friends[type=checkbox]:checked").val(); 36 10 if(show_friends == '' || show_friends == undefined){
Note: See TracChangeset
for help on using the changeset viewer.