Commit ce79c0b3 authored by Rich Gerdes's avatar Rich Gerdes Committed by Rich Gerdes
Browse files

Issue #3176710 by richgerdes: Comm100 module files shouldn't be capitalized

parent 15bc1d06
Loading
Loading
Loading
Loading

Comm100.admin.inc

deleted100644 → 0
+0 −316
Original line number Diff line number Diff line
<?php
/**
 * @file
 * Comm100 Live Chat module admin panel.
 */

/**
 * Comm100 form.
 */
function Comm100_live_chat_settings_form($form_state) {
  $comm100 = Comm100::getInstance();
  $comm100->includeAdminJs();
  $comm100->includeAdminCss();
  $form['comm100_form_link']['email'] = array(
    '#type' => 'hidden',
    '#value' => array(variable_get('comm100_email')),
    '#attributes' => array('id' => 'txt_email'),
  );
  $form['comm100_form_link']['password'] = array(
    '#type' => 'hidden',
    '#value' => array(variable_get('comm100_password')),
    '#attributes' => array('id' => 'txt_password'),
  );
  $form['comm100_form_link']['plan_id'] = array(
    '#type' => 'hidden',
    '#value' => array(variable_get('comm100_codeplanid')),
    '#attributes' => array('id' => 'txt_plan_id'),
  );
  $form['comm100_form_link']['plan_type'] = array(
    '#type' => 'hidden',
    '#value' => array(variable_get('comm100_codeplantype')),
    '#attributes' => array('id' => 'txt_plan_type'),
  );
  $form['comm100_form_link']['site_id'] = array(
    '#type' => 'hidden',
    '#value' => array(variable_get('comm100_siteid')),
    '#attributes' => array('id' => 'txt_site_id'),
  );
  $form['comm100_form_link']['actiontype'] = array(
    '#type' => 'hidden',
    '#value' => array(variable_get('comm100_actiontype')),
    '#attributes' => array('id' => 'txt_actiontype'),
  );
  $form['comm100_form_link']['txtCurrentStep'] = array(
    '#type' => 'hidden',
    '#default_value' => '1',
    '#attributes' => array('id' => 'txtCurrentStep'),
  );
  $form['comm100_form_link']['base_url'] = array(
    '#type' => 'hidden',
    '#value' => array(base_path()),
    '#attributes' => array('id' => 'base_url'),
  );
  $form['comm100_form_link']['plugin_version'] = array(
    '#type' => 'hidden',
    '#default_value' => '2.0.2',
    '#attributes' => array('id' => 'txt_plugin_version'),
  );
  $form['comm100_form_link']['plugin_check_url'] = array(
    '#type' => 'hidden',
	'#value' => array('http://' .$_SERVER['HTTP_HOST']. base_path(). 'sites/all/modules/comm100_live_chat/images/comm100_logo.gif'),
    '#attributes' => array('id' => 'txt_plugin_check_url'),
  );
  $form['comm100_form_link']['postdatatype'] = array(
    '#type' => 'hidden',
    '#attributes' => array('id' => 'txt_postdatatype'),
  );
  $form['comm100_form_link']['cpanel_domain'] = array(
    '#type' => 'hidden',
	'#value' => array(variable_get('comm100_cpanel_domain')),
	'#attributes' => array('id' => 'txt_cpanel_domain'),
  );
  $form['comm100_form_link']['main_chatserver_domain'] = array(
  	'#type' => 'hidden',
	'#value' => array(variable_get('comm100_main_chatserver_domain')),
  	'#attributes' => array('id' => 'txt_main_chatserver_domain'),
  );
  $form['comm100_form_link']['standby_chatserver_domain'] = array(
	'#type' => 'hidden',
	'#value' => array(variable_get('comm100_standby_chatserver_domain')),
	'#attributes' => array('id' => 'txt_standby_chatserver_domain'),
  );
  if ($comm100->isInstalled()) {
    $form['comm100livechat_expire'] = array(
      '#type' => 'item',
      '#collapsible' => FALSE,
      '#prefix' => '<div id="comm100livechat_expire" class="installed_pending">',
      '#suffix' => '</div>',
      '#style' => 'margin:0;',
    );
    $form['comm100livechat_expire']['comm100livechat_expire_message'] = array(
      '#type' => 'item',
      '#id' => 'comm100livechat_expire_message',
      '#markup' => t('<p class="expired">The free trial of Comm100 Live Chat has already expired. Click <a href="https://hosted.comm100.com/adminmanage/login.aspx" id="billinglink" target="_blank">here</a> to subscribe the service.</p>'),
      '#collapsible' => FALSE,
    );
    $form['comm100livechat_guide0']['comm100_guide_message'] = array(
      '#type' => 'item',
      '#id' => 'comm100_guide_message',
      '#markup' => t('<div class="messages installed_ok">Congratulations! Comm100 Live Chat is installed on your website successfully.</div>'),
      '#collapsible' => FALSE,
    );
    $form['comm100livechat_guide'] = array(
      '#type' => 'fieldset',
      '#collapsible' => FALSE,
      '#prefix' => '<div id="comm100livechat_guide">',
      '#suffix' => '</div>',
    );
    $form['comm100livechat_guide']['chat_with_visitor'] = array(
      '#type' => 'item',
      '#markup' => '<div id="comm100_logo"></div>',
    );
    $form['comm100livechat_guide']['static_chat_button_code'] = array(
      '#type' => 'item',
      '#id' => 'comm100_button_code_area',
      '#markup' => t('<h3 class="header2">Install Live Chat</h3><p>To install Live Chat on your webpages, please <strong>paste the following code to your template</strong>:</p>
            <textarea id="chat_button_code" readonly="readonly" onclick="this.select();" cols="100" rows="12" style="border:1px solid #a9a9a9" >
<!--Begin Comm100 Live Chat Code-->
<div id="comm100-button-{codeplanid}"></div>
<script type="text/javascript">
  var Comm100API=Comm100API||{};(function(t){function e(e){var a=document.createElement("script"),c=document.getElementsByTagName("script")[0];a.type="text/javascript",a.async=!0,a.src=e+t.site_id,c.parentNode.insertBefore(a,c)}t.chat_buttons=t.chat_buttons||[],t.chat_buttons.push({code_plan:{format_codeplanid},div_id:"comm100-button-{codeplanid}"}),t.site_id={siteid},t.main_code_plan={format_codeplanid},e("https://vue.comm100.com/livechat.ashx?siteId="),setTimeout(function(){t.loaded||e("https://standby.comm100vue.com/livechat.ashx?siteId=")},5e3)})(Comm100API||{})
</script>
<!--End Comm100 Live Chat Code-->
            </textarea><p id="tutorial">Need help? Read more in <a href="http://www.comm100.com/livechat/KnowledgeBase/How-to-put-Comm100-Live-Chat-on-a-fix-position-of-a-Drupal-site-_A5000272.aspx?id=5000272" target="_blank">Comm100 Live Chat Drupal integration tutorial</a>.</p>'),
    );
    $form['comm100livechat_guide']['comm100_guide'] = array(
      '#type' => 'item',
      '#markup' => t('<h3 class="header2">Chat with customers</h3><p id="startchat">Get Live Chat Online and start chatting with your customers!</p>
		                    <div class="linkbtn"><a href="https://hosted.comm100.com/livechat/visitormonitor.aspx" id="getonline" target="_blank" class="button">Get Online & Chat</a> or&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.comm100.com/livechat/download.aspx" target="_blank" class="button">Download Apps</a></div>
		                    <div class="customize" >Want to customize your Live Chat? <a href="https://hosted.comm100.com/LiveChatFunc/CodePlan/ChatButton.aspx?ifEditPlan=true&codePlanId=" id="customizelink" target="_blank">Click here</a>.
		                    <br />If you need any assistance, please don\'t hesitate to <a href="http://www.comm100.com/company/contact.aspx" target="_blank">contact us</a>.</div>
		                    <p id="linkaccount" >Linked Comm100 Account: <strong></strong>&nbsp;&nbsp;&nbsp;&nbsp;<a name="op" type="input" id="btn_unlink" href="javascript:submitComm100Form_UnLink();">Reset</a></p>'),
    );
    $form['comm100livechat_guide']['ajax_message'] = array(
      '#type' => 'item',
      '#markup' => '<p class="ajax_message"></p>',
    );
  }
  if ($comm100->isInstalled() == FALSE) {
    $form['comm100livechat_login'] = array(
      '#type' => 'fieldset',
      '#collapsible' => FALSE,
      '#prefix' => '<div id="comm100livechat_login">',
      '#suffix' => '</div>',
    );
    $form['comm100livechat_login']['sign_into'] = array(
      '#type' => 'item',
      '#markup' => '<div id="comm100_logo"></div><h3 class="header">Link up to Comm100 account</h3>',
    );
    $form['comm100livechat_login']['login_email'] = array(
      '#id' => 'login_email',
      '#type' => 'textfield',
      '#title' => t('Email'),
      '#default_value' => '',
      '#size' => 30,
      '#maxlength' => 100,
      '#required' => FALSE,
    );
    $form['comm100livechat_login']['login_password'] = array(
      '#id' => 'login_password',
      '#type' => 'password',
      '#title' => t('Password'),
      '#size' => 30,
      '#maxlength' => 70,
      '#required' => FALSE,
    );
    $form['comm100livechat_login']['forgetpassword'] = array(
      '#type' => 'item',
      '#markup' => t('<div class="forget" ><a href="http://www.comm100.com/secure/ForgotPassword.aspx" target="_blank">Forgot your password?</a></div>'),
    );
    $form['comm100livechat_login']['ajax_message'] = array(
      '#type' => 'item',
      '#markup' => '<p class="ajax_message"></p>',
    );
    $form['comm100livechat_login']['login_line'] = array(
      '#type' => 'item',
      '#markup' => '<div class="line">&nbsp</div>',
    );
    $form['comm100livechat_login']['not_have_account'] = array(
      '#type' => 'item',
      '#markup' => '<div class="nothaveaccount">I\'m new to Comm100.<br /><a class="link" href="javascript:setStepShow(2);">Create one account now!</a></div>',
    );
    $form['comm100livechat_login']['link_btn'] = array(
      '#type' => 'item',
      '#markup' => '<div class="linkbutton"><input type="button" class="form-submit" value="Link Up" name="op" id="login_submit" onclick="comm100_plugin.sites();"></div>',
    );
    $form['comm100livechat_site_and_plan'] = array(
      '#type' => 'fieldset',
      '#collapsible' => FALSE,
      '#prefix' => '<div id="comm100livechat_site_and_plan" style="display:none">',
      '#suffix' => '</div>',
    );
    $form['comm100livechat_site_and_plan']['link_to_drupal'] = array(
      '#type' => 'item',
      '#markup' => '<div id="comm100_logo"></div><h3 id="link_title" class="header">Link up to Comm100 account</h3>',
    );
    $form['comm100livechat_site_and_plan']['site'] = array(
      '#type' => 'item',
      '#markup' => '<label for="comm100_sites_select">Site</label><select id="comm100_sites_select" name="site" class="form-select" style="margin-top:5px; max-width: 320px;"></select>',
    );
    $form['comm100livechat_site_and_plan']['codeplan'] = array(
      '#type' => 'item',
      '#markup' => '<label for="comm100_codeplans_select">Code plan</label><select id="comm100_codeplans_select" name="codeplan" class="form-select" style="margin-top:5px; max-width: 320px;"></select>',
    );
    $form['comm100livechat_site_and_plan']['preViewImgBox'] = array(
      '#type' => 'item',
      '#id' => 'preViewImgBox',
      '#markup' => t('<label style="margin-left: 40px;">Preview</label><table id="preViewImgs" style="border:0; width:400px;">
                  <tr><td style="border-right:0;"><img style="padding-left: 40px; max-width:320px;max-height:140px;" id="imgOnline" class="imgForOnline" src="" alt="" /><br /><span style="margin-left: 40px;">When Operators Online</span></td>
                  <td style="border-right:0;"><img style="max-width:320px;max-height:140px;" id="imgOffline" class="imgForOffline" src="" alt="" /><br /><span >When Operators Offline</span></td></tr></table>
                  <div id="preViewTextButton"><p id="lblOnlineText" style="position: relative; margin-left: 20px; height: 72px; "></p></div><p id="preViewMonitor" ></p>'),
    );
    $form['comm100livechat_site_and_plan']['ajax_message'] = array(
      '#type' => 'item',
      '#markup' => '<p class="ajax_message"></p>',
    );
    $form['comm100livechat_site_and_plan']['link_btn'] = array(
      '#type' => 'item',
      '#markup' => '<div id="button_area" class="linkbutton2"><input type="button" class="form-submit" value="Link Up" name="op" id="save_account" onclick="onComm100Save();"></div>',
    );
    $form['comm100livechat_register'] = array(
      '#type' => 'fieldset',
      '#collapsible' => FALSE,
      '#prefix' => '<div id="comm100livechat_register" style="display:none">',
      '#suffix' => '</div>',
    );
    $form['comm100livechat_register']['create_account'] = array(
      '#type' => 'item',
      '#markup' => '<div id="comm100_logo"></div><h3 class="header">Create a Comm100 Account</h3>',
    );
    global $user;
    $form['comm100livechat_register']['register_name'] = array(
      '#id' => 'register_name',
      '#type' => 'textfield',
      '#title' => t('Name'),
      '#default_value' => $user->name,
      '#size' => 30,
      '#maxlength' => 32,
      '#required' => FALSE,
    );
    $form['comm100livechat_register']['register_email'] = array(
      '#id' => 'register_email',
      '#type' => 'textfield',
      '#title' => t('Email'),
      '#default_value' => $user->mail,
      '#size' => 30,
      '#maxlength' => 70,
      '#required' => FALSE,
    );
    $form['comm100livechat_register']['register_password'] = array(
      '#id' => 'register_password',
      '#type' => 'password',
      '#title' => t('Password'),
      '#size' => 30,
      '#maxlength' => 70,
      '#required' => FALSE,
    );
    $form['comm100livechat_register']['register_verification_code'] = array(
      '#type' => 'hidden',
      '#attributes' => array('id' => 'register_verification_code'),
    );
    $form['comm100livechat_register']['register_phone'] = array(
      '#type' => 'hidden',
      '#attributes' => array('id' => 'register_phone'),
    );
    $form['comm100livechat_register']['register_website'] = array(
      '#type' => 'hidden',
      '#attributes' => array('id' => 'register_website'),
    );
    $form['comm100livechat_register']['register_ip'] = array(
      '#type' => 'hidden',
      '#attributes' => array('id' => 'register_ip'),
    );
    $form['comm100livechat_register']['statement'] = array(
      '#type' => 'item',
      '#markup' => t('By clicking "Create Account", you agree to our <br /><a href="https://hosted.comm100.com/Admin/help/Comm100-Agreement.htm" target="_blank">Service Agreement</a> and <a href="http://www.comm100.com/privacy/" target="_blank"> Privacy Policy</a>.'),
    );
    $form['comm100livechat_register']['ajax_message'] = array(
      '#type' => 'item',
      '#markup' => '<p class="ajax_message"></p>',
    );
    $form['comm100livechat_register']['register_line'] = array(
      '#type' => 'item',
      '#markup' => '<div class="line2">&nbsp</div>',
    );
    $form['comm100livechat_register']['have_account'] = array(
      '#type' => 'item',
      '#markup' => '<div class="haveaccount">I already have a Comm100 account.<br /><a class="link" href="javascript:setStepShow(1);">Link up to my account!</a></div>',
    );
    $form['comm100livechat_register']['register_btn'] = array(
      '#type' => 'item',
      '#markup' => '<div class="linkbutton"><input type="button" class="form-submit" value="Create Account" name="register" id="register_submit" onclick="comm100_plugin.register();"></div>',
    );
  }
  return system_settings_form($form);
}
/**
 * Form validation.
 */
function Comm100_live_chat_settings_form_validate($form, &$data) {
  $comm100 = Comm100::getInstance();
  if (isset($data['input']) && isset($data['input']['postdatatype']) && $data['input']['postdatatype'] === 'unlink') {
    $comm100->resetSettings();
  }
  elseif (isset($data['input']) && isset($data['input']['postdatatype']) && $data['input']['postdatatype'] === 'link') {
    variable_set('comm100_siteid', $data['input']['site_id']);
    variable_set('comm100_codeplanid', $data['input']['plan_id']);
    variable_set('comm100_codeplantype', $data['input']['plan_type']);
    variable_set('comm100_email', $data['input']['email']);
    variable_set('comm100_password', $data['input']['password']);
    variable_set('comm100_actiontype', $data['input']['actiontype']);
	  variable_set('comm100_cpanel_domain', $data['input']['cpanel_domain']);
	  variable_set('comm100_main_chatserver_domain', $data['input']['main_chatserver_domain']);
	  variable_set('comm100_standby_chatserver_domain', $data['input']['standby_chatserver_domain']);
  }
}

Comm100.info

deleted100644 → 0
+0 −4
Original line number Diff line number Diff line
name = "Comm100 Live Chat"
version = "2.0.2"
description = "Comm100 Live Chat for Drupal 8."
core = "8.x"
+0 −0

File moved.

+0 −0

File moved.