Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/chaty/views/admin
File: channels-section.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Contact form leads
[2] Fix | Delete
*
[3] Fix | Delete
* @author : Premio <contact@premio.io>
[4] Fix | Delete
* @license : GPL2
[5] Fix | Delete
* */
[6] Fix | Delete
[7] Fix | Delete
if (defined('ABSPATH') === false) {
[8] Fix | Delete
exit;
[9] Fix | Delete
}
[10] Fix | Delete
?>
[11] Fix | Delete
<div style="display: none">
[12] Fix | Delete
<?php
[13] Fix | Delete
$embeddedMessage = "";
[14] Fix | Delete
$settings = [
[15] Fix | Delete
'media_buttons' => false,
[16] Fix | Delete
'wpautop' => false,
[17] Fix | Delete
'drag_drop_upload' => false,
[18] Fix | Delete
'textarea_name' => 'chat_editor_channel',
[19] Fix | Delete
'textarea_rows' => 4,
[20] Fix | Delete
'quicktags' => false,
[21] Fix | Delete
'tinymce' => [
[22] Fix | Delete
'toolbar1' => 'bold, italic, underline',
[23] Fix | Delete
'toolbar2' => '',
[24] Fix | Delete
'toolbar3' => '',
[25] Fix | Delete
],
[26] Fix | Delete
];
[27] Fix | Delete
wp_editor($embeddedMessage, "chat_editor_channel", $settings);
[28] Fix | Delete
?>
[29] Fix | Delete
</div>
[30] Fix | Delete
[31] Fix | Delete
<section class="section one chaty-setting-form" xmlns="http://www.w3.org/1999/html">
[32] Fix | Delete
<?php
[33] Fix | Delete
$chtWidgetTitle = get_option("cht_widget_title");
[34] Fix | Delete
$chtWidgetTitle = empty($chtWidgetTitle) ? "Widget-1" : $chtWidgetTitle;
[35] Fix | Delete
if (isset($_GET['widget_title']) && empty(!$_GET['widget_title'])) {
[36] Fix | Delete
$chtWidgetTitle = filter_input(INPUT_GET, 'widget_title');
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
?>
[40] Fix | Delete
<div class="chaty-input mb-10">
[41] Fix | Delete
<label class="font-primary text-cht-gray-150 text-base block mb-3" for="cht_widget_title"><?php esc_html_e('Name', 'chaty'); ?></label>
[42] Fix | Delete
<input class="w-full sm:w-96" id="cht_widget_title" type="text" name="cht_widget_title" value="<?php echo esc_attr($chtWidgetTitle) ?>">
[43] Fix | Delete
</div>
[44] Fix | Delete
<?php
[45] Fix | Delete
// } ?>
[46] Fix | Delete
<?php
[47] Fix | Delete
$socialApp = $icons = get_option('cht_numb_slug', false);
[48] Fix | Delete
$addChatway = is_plugin_active('chatway-live-chat/chatway.php') ? true : false;
[49] Fix | Delete
$isChatwayAdded = get_option('cht_is_chatway_added', false);
[50] Fix | Delete
[51] Fix | Delete
$socialApp = ($socialApp == false) ? "whatsapp" : $socialApp;
[52] Fix | Delete
$socialApp = trim($socialApp, ",");
[53] Fix | Delete
$socialApp = explode(",", $socialApp);
[54] Fix | Delete
$socialApp = array_unique($socialApp);
[55] Fix | Delete
if((isset($_GET['chaty_action']) && $_GET['chaty_action'] == 'add_chatway') || ($addChatway && !$isChatwayAdded)) {
[56] Fix | Delete
if(!in_array('Chatway', $socialApp)) {
[57] Fix | Delete
array_unshift($socialApp, "Chatway");
[58] Fix | Delete
}
[59] Fix | Delete
}
[60] Fix | Delete
$imageUrl = plugin_dir_url("")."chaty/admin/assets/images/chaty-default.png";
[61] Fix | Delete
?>
[62] Fix | Delete
<input type="hidden" id="default_image" value="<?php echo esc_url($imageUrl) ?>" />
[63] Fix | Delete
<div class="channels-icons flex max-w-full flex-wrap" id="channel-list">
[64] Fix | Delete
<?php if ($this->socials) :
[65] Fix | Delete
foreach ($this->socials as $key => $social) :
[66] Fix | Delete
$value = get_option('cht_social'.'_'.$social['slug']);
[67] Fix | Delete
$activeClass = '';
[68] Fix | Delete
foreach ($socialApp as $keySoc) :
[69] Fix | Delete
if ($keySoc == $social['slug']) {
[70] Fix | Delete
$activeClass = 'active';
[71] Fix | Delete
}
[72] Fix | Delete
endforeach;
[73] Fix | Delete
$customClass = in_array($social['slug'], array("Link", "Custom_Link", "Custom_Link_3", "Custom_Link_4", "Custom_Link_5", "Custom_Link_6"))?"custom-link":"";
[74] Fix | Delete
?>
[75] Fix | Delete
<div class="icon cursor-pointer icon-sm chat-channel-<?php echo esc_attr($social['slug']); ?> <?php echo esc_attr($activeClass) ?> <?php echo esc_attr($customClass) ?>" data-social="<?php echo esc_attr($social['slug']); ?>" data-label="<?php echo esc_attr($social['title']); ?>">
[76] Fix | Delete
<span class="icon-box">
[77] Fix | Delete
<?php echo $social['svg']; ?>
[78] Fix | Delete
</span>
[79] Fix | Delete
<span class="channel-title"><?php echo esc_html($social['title']); ?></span>
[80] Fix | Delete
</div>
[81] Fix | Delete
<?php endforeach; ?>
[82] Fix | Delete
<?php endif; ?>
[83] Fix | Delete
</div>
[84] Fix | Delete
<div class="custom-channel-button flex items-center gap-2.5">
[85] Fix | Delete
<a href="#" class="custom-channel-link">
[86] Fix | Delete
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" svg-inline="" focusable="false" tabindex="-1"><path d="M15.833 1.75H4.167A2.417 2.417 0 001.75 4.167v11.666a2.417 2.417 0 002.417 2.417h11.666a2.417 2.417 0 002.417-2.417V4.167a2.417 2.417 0 00-2.417-2.417zM10 6.667v6.666" stroke="#83A1B7" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M6.667 10h6.666" stroke="#83A1B7" stroke-width="1.67" stroke-linecap="round" stroke-linejoin="round"></path></svg>
[87] Fix | Delete
<?php esc_html_e('Custom Channel', 'chaty'); ?>
[88] Fix | Delete
</a>
[89] Fix | Delete
<a href="#" id="add-chatyway" class="add-chatyway-btn inline-flex font-primary items-center gap-0.5 py-1 px-2.5 border border-solid text-center justify-center !border-[#0446de] rounded-lg !text-[#0446de] hover:text-[#0446de] hover:bg-[#edf3f6]">
[90] Fix | Delete
<svg class="h-5 w-auto" width="20" height="24" viewBox="0 0 20 24" fill="none" xmlns="http://www.w3.org/2000/svg" svg-inline="" role="presentation" focusable="false" tabindex="-1"><path d="M7.367 22.703l1.638-2.863L10.19 21.7s-.754-.134-1.44.194c-.687.328-1.384.81-1.384.81z" fill="#0038A5"></path><path d="M6.193 21.342a.97.97 0 00-.712-.564l-3.894-.72A1.94 1.94 0 010 18.153V6.534c0-1.43.7-2.77 1.876-3.585L4.39 1.205A4.606 4.606 0 017.798.45l8.982 1.548A3.879 3.879 0 0120 5.821v8.8c0 1.043-.42 2.04-1.163 2.77l-3.199 3.138a5.091 5.091 0 01-4.603 1.349l-1.858-.387a.97.97 0 00-.906.286l-.782.836a.485.485 0 01-.798-.137l-.498-1.134z" fill="#0446DE"></path><path d="M4.264 4.353a3.152 3.152 0 00-3.78 3.089v9.924a1.94 1.94 0 001.587 1.907l3.858.714a.97.97 0 01.719.582l.346.832c.105.253.44.303.615.094l.668-.801a.97.97 0 01.818-.346l3.067.232a2.667 2.667 0 002.868-2.659V8.126a1.94 1.94 0 00-1.553-1.9L4.264 4.352z" fill="#0038A5"></path><path d="M4.055 4.34a1.94 1.94 0 00-2.309 1.905v10.204a1.94 1.94 0 001.662 1.92l2.646.383a.97.97 0 01.739.546l.371.789a.364.364 0 00.614.098l.56-.65a.97.97 0 01.874-.327l3.601.521a1.94 1.94 0 002.217-1.92V8.07a1.94 1.94 0 00-1.57-1.904L4.055 4.34z" fill="#fff"></path><path d="M10.91 14.59L5.31 13.61c-.407-.072-.738.254-.58.636.511 1.242 1.94 3.195 4.473 2.544.522-.134 1.701-.812 2.034-1.715.083-.226-.092-.442-.329-.484z" fill="#0446DE"></path><ellipse cx="5.503" cy="9.962" rx=".993" ry="1.702" transform="rotate(-4.903 5.503 9.962)" fill="#0446DE"></ellipse><ellipse cx="10.749" cy="10.931" rx=".993" ry="1.702" transform="rotate(-4.903 10.749 10.93)" fill="#0446DE"></ellipse></svg>
[91] Fix | Delete
Add Live Chat
[92] Fix | Delete
</a>
[93] Fix | Delete
<div class="manage--chatway">
[94] Fix | Delete
<a href="<?php echo admin_url("plugin-install.php?s=chatway&tab=search&type=author") ?>" target="_blank" class="plugin-add--chatyway inline-flex font-primary items-center gap-0.5 py-1 px-2.5 border border-solid text-center justify-center !border-[#0446de] rounded-lg !text-[#0446de] hover:text-[#0446de] hover:bg-[#edf3f6]">
[95] Fix | Delete
<svg class="h-5 w-auto" width="20" height="24" viewBox="0 0 20 24" fill="none" xmlns="http://www.w3.org/2000/svg" svg-inline="" role="presentation" focusable="false" tabindex="-1"><path d="M7.367 22.703l1.638-2.863L10.19 21.7s-.754-.134-1.44.194c-.687.328-1.384.81-1.384.81z" fill="#0038A5"></path><path d="M6.193 21.342a.97.97 0 00-.712-.564l-3.894-.72A1.94 1.94 0 010 18.153V6.534c0-1.43.7-2.77 1.876-3.585L4.39 1.205A4.606 4.606 0 017.798.45l8.982 1.548A3.879 3.879 0 0120 5.821v8.8c0 1.043-.42 2.04-1.163 2.77l-3.199 3.138a5.091 5.091 0 01-4.603 1.349l-1.858-.387a.97.97 0 00-.906.286l-.782.836a.485.485 0 01-.798-.137l-.498-1.134z" fill="#0446DE"></path><path d="M4.264 4.353a3.152 3.152 0 00-3.78 3.089v9.924a1.94 1.94 0 001.587 1.907l3.858.714a.97.97 0 01.719.582l.346.832c.105.253.44.303.615.094l.668-.801a.97.97 0 01.818-.346l3.067.232a2.667 2.667 0 002.868-2.659V8.126a1.94 1.94 0 00-1.553-1.9L4.264 4.352z" fill="#0038A5"></path><path d="M4.055 4.34a1.94 1.94 0 00-2.309 1.905v10.204a1.94 1.94 0 001.662 1.92l2.646.383a.97.97 0 01.739.546l.371.789a.364.364 0 00.614.098l.56-.65a.97.97 0 01.874-.327l3.601.521a1.94 1.94 0 002.217-1.92V8.07a1.94 1.94 0 00-1.57-1.904L4.055 4.34z" fill="#fff"></path><path d="M10.91 14.59L5.31 13.61c-.407-.072-.738.254-.58.636.511 1.242 1.94 3.195 4.473 2.544.522-.134 1.701-.812 2.034-1.715.083-.226-.092-.442-.329-.484z" fill="#0446DE"></path><ellipse cx="5.503" cy="9.962" rx=".993" ry="1.702" transform="rotate(-4.903 5.503 9.962)" fill="#0446DE"></ellipse><ellipse cx="10.749" cy="10.931" rx=".993" ry="1.702" transform="rotate(-4.903 10.749 10.93)" fill="#0446DE"></ellipse></svg>
[96] Fix | Delete
Add Live Chat
[97] Fix | Delete
</a>
[98] Fix | Delete
<a href="<?php echo admin_url("admin.php?page=chatway") ?>" target="_blank" class="plugin-manage--chatway inline-flex font-primary items-center gap-0.5 py-1 px-2.5 border border-solid text-center justify-center !border-[#0446de] rounded-lg !text-[#0446de] hover:text-[#0446de] hover:bg-[#edf3f6]">
[99] Fix | Delete
<svg class="h-5 w-auto" width="20" height="24" viewBox="0 0 20 24" fill="none" xmlns="http://www.w3.org/2000/svg" svg-inline="" role="presentation" focusable="false" tabindex="-1"><path d="M7.367 22.703l1.638-2.863L10.19 21.7s-.754-.134-1.44.194c-.687.328-1.384.81-1.384.81z" fill="#0038A5"></path><path d="M6.193 21.342a.97.97 0 00-.712-.564l-3.894-.72A1.94 1.94 0 010 18.153V6.534c0-1.43.7-2.77 1.876-3.585L4.39 1.205A4.606 4.606 0 017.798.45l8.982 1.548A3.879 3.879 0 0120 5.821v8.8c0 1.043-.42 2.04-1.163 2.77l-3.199 3.138a5.091 5.091 0 01-4.603 1.349l-1.858-.387a.97.97 0 00-.906.286l-.782.836a.485.485 0 01-.798-.137l-.498-1.134z" fill="#0446DE"></path><path d="M4.264 4.353a3.152 3.152 0 00-3.78 3.089v9.924a1.94 1.94 0 001.587 1.907l3.858.714a.97.97 0 01.719.582l.346.832c.105.253.44.303.615.094l.668-.801a.97.97 0 01.818-.346l3.067.232a2.667 2.667 0 002.868-2.659V8.126a1.94 1.94 0 00-1.553-1.9L4.264 4.352z" fill="#0038A5"></path><path d="M4.055 4.34a1.94 1.94 0 00-2.309 1.905v10.204a1.94 1.94 0 001.662 1.92l2.646.383a.97.97 0 01.739.546l.371.789a.364.364 0 00.614.098l.56-.65a.97.97 0 01.874-.327l3.601.521a1.94 1.94 0 002.217-1.92V8.07a1.94 1.94 0 00-1.57-1.904L4.055 4.34z" fill="#fff"></path><path d="M10.91 14.59L5.31 13.61c-.407-.072-.738.254-.58.636.511 1.242 1.94 3.195 4.473 2.544.522-.134 1.701-.812 2.034-1.715.083-.226-.092-.442-.329-.484z" fill="#0446DE"></path><ellipse cx="5.503" cy="9.962" rx=".993" ry="1.702" transform="rotate(-4.903 5.503 9.962)" fill="#0446DE"></ellipse><ellipse cx="10.749" cy="10.931" rx=".993" ry="1.702" transform="rotate(-4.903 10.749 10.93)" fill="#0446DE"></ellipse></svg>
[100] Fix | Delete
Manage Live Chat
[101] Fix | Delete
</a>
[102] Fix | Delete
</div>
[103] Fix | Delete
</div>
[104] Fix | Delete
[105] Fix | Delete
<input type="hidden" class="add_slug" name="cht_numb_slug" placeholder="test" value="<?php echo esc_attr(get_option('cht_numb_slug')); ?>" id="cht_numb_slug" >
[106] Fix | Delete
[107] Fix | Delete
<?php include plugin_dir_path(__FILE__) . "chatway-notice.php"; ?>
[108] Fix | Delete
[109] Fix | Delete
<div class="channels-selected mt-5">
[110] Fix | Delete
<div class="channel-empty-state relative <?php echo esc_attr(count($this->socials) == 0?"active":"") ?>"">
[111] Fix | Delete
<img class="-left-3 sm:-left-5 md:-left-8 relative" src="<?php echo esc_url(CHT_PLUGIN_URL."admin/assets/images/empty-state-star.png") ?>"/>
[112] Fix | Delete
<p class="absolute top-4 left-0 text-base text-cht-gray-150 w-52 text-center opacity-60"><?php esc_html_e('So many channels to choose from...', 'chaty'); ?></p>
[113] Fix | Delete
</div>
[114] Fix | Delete
<ul id="channels-selected-list" class="channels-selected-list channels-selected">
[115] Fix | Delete
<?php if ($this->socials) {
[116] Fix | Delete
foreach ($socialApp as $keySoc) {
[117] Fix | Delete
foreach ($this->socials as $key => $social) {
[118] Fix | Delete
if ($social['slug'] != $keySoc) {
[119] Fix | Delete
// compare social media slug
[120] Fix | Delete
continue;
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
// get setting for media if already saved
[124] Fix | Delete
if($social['slug'] == "Chatway") {
[125] Fix | Delete
include plugin_dir_path(__FILE__) . "chatway-setting.php";
[126] Fix | Delete
} else {
[127] Fix | Delete
include plugin_dir_path(__FILE__) . "channel.php";
[128] Fix | Delete
}
[129] Fix | Delete
?>
[130] Fix | Delete
<?php } ?>
[131] Fix | Delete
<?php } ?>
[132] Fix | Delete
<?php }; ?>
[133] Fix | Delete
<?php
[134] Fix | Delete
$proClass = "free";
[135] Fix | Delete
$text = get_option("cht_close_button_text");
[136] Fix | Delete
$text = wp_strip_all_tags(($text === false) ? "Hide" : $text);
[137] Fix | Delete
?>
[138] Fix | Delete
<!-- close setting strat -->
[139] Fix | Delete
<li class="chaty-cls-setting" data-id="" id="chaty-social-close">
[140] Fix | Delete
<div class="channels-selected__item pro 1 available flex items-start space-x-3 ml-4">
[141] Fix | Delete
<div class="chaty-default-settings">
[142] Fix | Delete
<div class="move-icon hidden">
[143] Fix | Delete
<img src="<?php echo esc_url(CHT_PLUGIN_URL."admin/assets/images/move-icon.png") ?>" style="opacity:0"; />
[144] Fix | Delete
</div>
[145] Fix | Delete
<div class="icon icon-md active" data-label="close">
[146] Fix | Delete
<span id="image_data_close">
[147] Fix | Delete
<svg viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg"><ellipse cx="26" cy="26" rx="26" ry="26" fill="#A886CD"></ellipse><rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(18.35 15.6599) scale(0.998038 1.00196) rotate(45)" fill="white"></rect><rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(37.5056 18.422) scale(0.998038 1.00196) rotate(135)" fill="white"></rect></svg>
[148] Fix | Delete
</span>
[149] Fix | Delete
<span class="default_image_close" style="display: none;">
[150] Fix | Delete
<svg viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg"><ellipse cx="26" cy="26" rx="26" ry="26" fill="#A886CD"></ellipse><rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(18.35 15.6599) scale(0.998038 1.00196) rotate(45)" fill="white"></rect><rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(37.5056 18.422) scale(0.998038 1.00196) rotate(135)" fill="white"></rect></svg>
[151] Fix | Delete
</span>
[152] Fix | Delete
</div>
[153] Fix | Delete
</div>
[154] Fix | Delete
<div>
[155] Fix | Delete
<div class="channels__input-box cls-btn-settings active">
[156] Fix | Delete
<input type="text" class="channels__input close-button-text" name="cht_close_button_text" value="<?php echo esc_attr((wp_unslash($text))) ?>" >
[157] Fix | Delete
</div>
[158] Fix | Delete
<div class="input-example cls-btn-settings active font-primary text-cht-gray-150 text-base mt-1">
[159] Fix | Delete
<?php esc_html_e('On hover Close button text', 'chaty'); ?>
[160] Fix | Delete
</div>
[161] Fix | Delete
</div>
[162] Fix | Delete
</div>
[163] Fix | Delete
</li>
[164] Fix | Delete
<!-- close setting end -->
[165] Fix | Delete
</ul>
[166] Fix | Delete
[167] Fix | Delete
<div class="channels-selected__item disabled" style="opacity: 0; display: none;"></div>
[168] Fix | Delete
[169] Fix | Delete
<input type="hidden" id="is_pro_plugin" value="0" />
[170] Fix | Delete
</div>
[171] Fix | Delete
</section>
[172] Fix | Delete
[173] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function