/**
  * Arguments
  * array('chat' => & $chat)
  * */
 public function telegram($params)
 {
     $conf = (include 'extension/telegram/settings/settings.ini.php');
     $url = 'http://api.telegram.org/bot' . $conf['telegramBot'] . '/sendMessage?parse_mode=Markdown';
     $chat = $params['chat'];
     foreach ($conf['receivers'] as $receiver) {
         $internalurl = $url . "&chat_id=" . preg_replace('/[^0-9.]+/', '', $receiver['chatid']);
         $text = "``` Nova solicitação de suporte via chat - ";
         $text = isset($chat->nick) ? $text . $chat->nick : $text;
         $text = isset($chat->email) ? $text . " ( " . $chat->email . " )" : $text;
         $text .= "```";
         if (isset($receiver['operator'])) {
             $veryfyEmail = sha1(sha1($receiver['operator'] . $secretHash) . $secretHash);
             $link = erLhcoreClassXMP::getBaseHost();
             $link .= $_SERVER['HTTP_HOST'];
             $link .= erLhcoreClassDesign::baseurl('chat/accept') . '/';
             $link .= erLhcoreClassModelChatAccept::generateAcceptLink($chat) . '/';
             $link .= $veryfyEmail . '/' . $receiver['operator'];
             $text .= "\n" . $link;
         }
         $text .= "```";
         $internalurl .= "&text=" . urlencode($text);
         file_get_contents($internalurl);
     }
 }
 public function getModuleTranslations()
 {
     /**
      * Get's executed before permissions check. It can redirect to frontpage throw permission exception etc
      * */
     erLhcoreClassChatEventDispatcher::getInstance()->dispatch('feature.can_use_forms', array());
     return array('path' => array('url' => erLhcoreClassDesign::baseurl('form/index'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('browseoffer/index', 'Form')), 'permission_delete' => array('module' => 'lhform', 'function' => 'delete_fm'), 'permission' => array('module' => 'lhform', 'function' => 'manage_fm'), 'name' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/browserofferinvitation', 'Forms list'));
 }
 public function getModuleTranslations()
 {
     $metaData = array('path' => array('url' => erLhcoreClassDesign::baseurl('browseoffer/index'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('browseoffer/index', 'Browse offers')), 'permission_delete' => array('module' => 'lhbrowseoffer', 'function' => 'manage_bo'), 'permission' => array('module' => 'lhbrowseoffer', 'function' => 'manage_bo'), 'name' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/browserofferinvitation', 'Browser offer invitations'));
     /**
      * Get's executed before permissions check. It can redirect to frontpage throw permission exception etc
      * */
     erLhcoreClassChatEventDispatcher::getInstance()->dispatch('feature.can_use_browse_offers', array('object_meta_data' => &$metaData));
     return $metaData;
 }
 public function getModuleTranslations()
 {
     $metaData = array('path' => array('url' => erLhcoreClassDesign::baseurl('restapi/index'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('theme/index', 'Rest API')), 'permission_delete' => array('module' => 'lhrestapi', 'function' => 'use_admin'), 'permission' => array('module' => 'lhrestapi', 'function' => 'use_admin'), 'name' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/product', 'API Key'));
     /**
      * Get's executed before permissions check. It can redirect to frontpage throw permission exception etc
      * */
     erLhcoreClassChatEventDispatcher::getInstance()->dispatch('feature.can_use_product', array('object_meta_data' => &$metaData));
     return $metaData;
 }
 public function __get($var)
 {
     switch ($var) {
         case 'has_file':
             return $this->has_file = $this->file_name != '';
             break;
         case 'file_path_server':
             return $this->file_path_server = 'var/' . $this->file_path . $this->file_name;
             break;
         case 'file_path_dir':
             return $this->file_path_server = 'var/' . $this->file_path;
             break;
         case 'pdftoimg_path':
             return $this->pdftoimg_path = 'var/' . $this->file_path . 'img/';
             break;
         case 'pdf_file_path_server':
             return $this->pdf_file_path_server = 'var/' . $this->file_path . $this->pdf_file;
             break;
         case 'file_name_upload_pdf':
             $nameParts = explode('.', $this->file_name_upload);
             array_pop($nameParts);
             return $this->file_name_upload_pdf = implode('.', $nameParts) . '.pdf';
             break;
         case 'pages_pdf':
             $this->pages_pdf = array();
             if ($this->pages_pdf_count) {
                 $links = array();
                 $i = 1;
                 while ($i <= $this->pages_pdf_count) {
                     $links[] = $this->pdftoimg_path . $this->id . '-' . $i . '.png';
                     $i++;
                 }
                 $this->pages_pdf = $links;
             }
             return $this->pages_pdf;
             break;
         case 'pdftoimg_url_path':
             return $this->pdftoimg_url_path = erLhcoreClassSystem::instance()->wwwDir() . '/var/' . $this->file_path . 'img/';
             break;
         case 'pages_pdf_url':
             $this->pages_pdf_url = array();
             if ($this->pages_pdf_count) {
                 $baseDir = erLhcoreClassSystem::instance()->wwwDir();
                 foreach ($this->pages_pdf as $img) {
                     $this->pages_pdf_url[] = $baseDir . '/' . $img;
                 }
             }
             return $this->pages_pdf_url;
             break;
         case 'book_data':
             return array('baseImagesDesgin' => erLhcoreClassDesign::design('images/BookReader/images') . '/', 'baseImg' => $this->id . '-', 'numLeafs' => $this->pages_pdf_count, 'bookTitle' => $this->name, 'urlPath' => $this->pdftoimg_url_path);
             break;
         default:
             break;
     }
 }
 public static function validateSurvey(erLhAbstractModelSurveyItem &$surveyItem, erLhAbstractModelSurvey $survey)
 {
     include erLhcoreClassDesign::designtpl('lhsurvey/forms/fields_names.tpl.php');
     $definition = array();
     for ($i = 0; $i < 16; $i++) {
         foreach ($sortOptions as $keyOption => $sortOption) {
             if ($survey->{$keyOption . '_pos'} == $i && $survey->{$keyOption . '_enabled'}) {
                 if ($sortOption['type'] == 'stars') {
                     $definition[$sortOption['field'] . 'Evaluate'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 1, 'max_range' => $survey->{$sortOption}['field']));
                 } elseif ($sortOption['type'] == 'question') {
                     $definition[$sortOption['field'] . 'Question'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
                 } elseif ($sortOption['type'] == 'question_options') {
                     $definition[$sortOption['field'] . 'EvaluateOption'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 1));
                 }
             }
         }
     }
     $form = new ezcInputForm(INPUT_POST, $definition);
     $Errors = array();
     for ($i = 0; $i < 16; $i++) {
         foreach ($sortOptions as $keyOption => $sortOption) {
             if ($survey->{$keyOption . '_pos'} == $i && $survey->{$keyOption . '_enabled'}) {
                 if ($sortOption['type'] == 'stars') {
                     if (!$form->hasValidData($sortOption['field'] . 'Evaluate')) {
                         if ($survey->{$keyOption . '_req'} == 1) {
                             $Errors[] = '"' . htmlspecialchars(trim($survey->{$keyOption . '_title'})) . '" : ' . erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'is required');
                         }
                     } else {
                         $surveyItem->{$sortOption['field']} = $form->{$sortOption['field'] . 'Evaluate'};
                     }
                 } elseif ($sortOption['type'] == 'question') {
                     if (!$form->hasValidData($sortOption['field'] . 'Question') || $form->{$sortOption['field'] . 'Question'} == '' && $survey->{$keyOption . '_req'} == 1) {
                         // @todo Make possible to choose field type in the future
                         $Errors[] = '"' . htmlspecialchars(trim($survey->{$keyOption})) . '" : ' . erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'is required');
                     } else {
                         $surveyItem->{$sortOption['field']} = $form->{$sortOption['field'] . 'Question'};
                     }
                 } elseif ($sortOption['type'] == 'question_options') {
                     if (!$form->hasValidData($sortOption['field'] . 'EvaluateOption')) {
                         if ($survey->{$keyOption . '_req'} == 1) {
                             $Errors[] = '"' . htmlspecialchars(trim($survey->{$sortOption['field']})) . '" : ' . erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'is required');
                         }
                     } else {
                         $surveyItem->{$sortOption['field']} = $form->{$sortOption['field'] . 'EvaluateOption'};
                     }
                 }
             }
         }
     }
     erLhcoreClassChatEventDispatcher::getInstance()->dispatch('survey.validate', array('survey' => &$survey, 'survey_item' => &$surveyItem, 'errors' => &$Errors));
     return $Errors;
 }
 public function getFormattedContent()
 {
     $dataCollected = array();
     foreach ($this->content_array as $nameAttr => $contentArray) {
         if (isset($contentArray['definition']['type']) && $contentArray['definition']['type'] == 'file') {
             $dataCollected[] = $contentArray['definition']['name_literal'] . " - " . erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurldirect('user/login') . '/(r)/' . rawurlencode(base64_encode('form/download/' . $this->id . '/' . $nameAttr));
         } elseif (isset($contentArray['definition']['type']) && $contentArray['definition']['type'] == 'checkbox') {
             $dataCollected[] = $contentArray['definition']['name_literal'] . " - " . ($contentArray['value'] == 1 ? 'Y' : 'N');
         } else {
             $dataCollected[] = $contentArray['definition']['name_literal'] . " - " . $contentArray['value'];
         }
     }
     return implode("\n", $dataCollected);
 }
 public static function chatListExportXLS($chats)
 {
     include 'lib/core/lhform/PHPExcel.php';
     $objPHPExcel = new PHPExcel();
     $objPHPExcel->setActiveSheetIndex(0);
     $objPHPExcel->getActiveSheet()->getStyle('A1:AW1')->getFont()->setBold(true);
     $objPHPExcel->getActiveSheet()->setTitle('Report');
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 1, "ID");
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'Visitor Name'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(2, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'E-mail'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(3, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'Phone'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(4, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'Country'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(5, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'City'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(6, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'IP'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(7, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'Operator'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(8, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'Department'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(9, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'Date'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(10, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'Mail send'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(11, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'Referrer'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(12, 1, erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatexport', 'Link'));
     $attributes = array('id', 'nick', 'email', 'phone', 'country_name', 'city', 'ip', 'user', 'department');
     $i = 2;
     foreach ($chats as $item) {
         foreach ($attributes as $key => $attr) {
             $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($key, $i, (string) $item->{$attr});
         }
         $key++;
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($key, $i, date(erLhcoreClassModule::$dateFormat, $item->time));
         $key++;
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($key, $i, $item->mail_send == 1 ? 'Yes' : 'No');
         $key++;
         if ($item->session_referrer != '') {
             $referer = parse_url($item->session_referrer);
             if (isset($referer['host'])) {
                 $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($key, $i, $referer['host']);
             }
         }
         $key++;
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($key, $i, "URL");
         $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($key, $i)->getHyperlink()->setUrl(erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login') . '/(r)/' . rawurlencode(base64_encode('chat/single/' . $item->id)));
         $i++;
     }
     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
     // We'll be outputting an excel file
     header('Content-type: application/vnd.ms-excel');
     // It will be called file.xls
     header('Content-Disposition: attachment; filename="report.xlsx"');
     // Write file to the browser
     $objWriter->save('php://output');
 }
示例#9
0
 public function fillDataByChat($chat)
 {
     $this->getConfig();
     $messages = array_reverse(erLhcoreClassModelmsg::getList(array('limit' => 5000, 'sort' => 'id DESC', 'filter' => array('chat_id' => $chat->id))));
     $messagesContent = '';
     foreach ($messages as $msg) {
         if ($msg->user_id == -1) {
             $messagesContent .= date(erLhcoreClassModule::$dateDateHourFormat, $msg->time) . ' ' . erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmin', 'System assistant') . ': ' . htmlspecialchars($msg->msg) . "\n";
         } else {
             $messagesContent .= date(erLhcoreClassModule::$dateDateHourFormat, $msg->time) . ' ' . ($msg->user_id == 0 ? htmlspecialchars($chat->nick) : htmlspecialchars($msg->name_support)) . ': ' . htmlspecialchars($msg->msg) . "\n";
         }
     }
     $data = array('name' => $chat->nick, 'email' => $chat->email, 'subject' => str_replace(array('{referrer}', '{nick}', '{email}', '{country_code}', '{country_name}', '{city}', '{user_tz_identifier}'), array($chat->referrer, $chat->nick, $chat->email, $chat->country_code, $chat->country_name, $chat->city, $chat->user_tz_identifier), $this->configData['subject']), 'message' => str_replace(array('{time_created_front}', '{additional_data}', '{id}', '{url}', '{referrer}', '{messages}', '{remarks}', '{nick}', '{email}', '{country_code}', '{country_name}', '{city}', '{user_tz_identifier}'), array(date(erLhcoreClassModule::$dateDateHourFormat, $chat->time), $chat->additional_data, $chat->id, (erLhcoreClassSystem::$httpsMode == true ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login') . '/(r)/' . rawurlencode(base64_encode('chat/single/' . $chat->id)), $chat->referrer, $messagesContent, $chat->remarks, $chat->nick, $chat->email, $chat->country_code, $chat->country_name, $chat->city, $chat->user_tz_identifier), $this->configData['message']), 'ip' => $chat->ip);
     return $data;
 }
 /**
  * Arguments
  * array('chat' => & $chat)
  * */
 public function sevabot($params)
 {
     $settings = (include 'extension/sevabot/settings/settings.ini.php');
     // Format message content
     $chat = $params['chat'];
     $messages = array_reverse(erLhcoreClassModelmsg::getList(array('limit' => 5, 'sort' => 'id DESC', 'filter' => array('chat_id' => $chat->id))));
     $messagesContent = '';
     foreach ($messages as $msg) {
         if ($msg->user_id == -1) {
             $messagesContent .= date(erLhcoreClassModule::$dateDateHourFormat, $msg->time) . ' ' . erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmin', 'System assistant') . ': ' . htmlspecialchars($msg->msg) . "\n";
         } else {
             $messagesContent .= date(erLhcoreClassModule::$dateDateHourFormat, $msg->time) . ' ' . ($msg->user_id == 0 ? htmlspecialchars($chat->nick) : htmlspecialchars($msg->name_support)) . ': ' . htmlspecialchars($msg->msg) . "\n";
         }
     }
     $cfgSite = erConfigClassLhConfig::getInstance();
     $secretHash = $cfgSite->getSetting('site', 'secrethash');
     $chatDataItems = $settings['chat'];
     if (isset($settings['chat_dep'][$chat->dep_id]) && !empty($settings['chat_dep'][$chat->dep_id])) {
         $chatDataItems = array_merge($chatDataItems, $settings['chat_dep'][$chat->dep_id]);
     }
     // Global notifications
     foreach ($chatDataItems as $chatData) {
         $veryfyEmail = sha1(sha1($chatData['email'] . $secretHash) . $secretHash);
         $msgParsed = str_replace(array('{messages}', '{url_accept}', '{chat_id}', '{user_name}'), array($messagesContent, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept') . '/' . erLhcoreClassModelChatAccept::generateAcceptLink($chat) . '/' . $veryfyEmail . '/' . $chatData['email'], $chat->id, $chat->user_name), $settings['msg']);
         $md5 = md5($chatData['chat_id'] . $msgParsed . $settings['sevabot_secret']);
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $settings['url']);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_TIMEOUT, 5);
         curl_setopt($ch, CURLOPT_POST, true);
         curl_setopt($ch, CURLOPT_POSTFIELDS, array('md5' => $md5, 'msg' => $msgParsed, 'chat' => $chatData['chat_id']));
         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
         @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
         // Some hostings produces wargning...
         $content = curl_exec($ch);
         if ($content != 'OK') {
             erLhcoreClassLog::write(print_r($content, true));
         }
     }
 }
<?php

/**
 * There can be some error message if offline form is disabled
 * */
$errors = array('Offline form is disabled');
include erLhcoreClassDesign::designtpl('lhkernel/validation_error.tpl.php');
示例#12
0
<li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php 
echo htmlspecialchars($UserData->name), ' ', htmlspecialchars($UserData->surname);
?>
 <span class="caret"></span></a>
    <ul class="dropdown-menu" role="menu">
        <li><a href="<?php 
echo erLhcoreClassDesign::baseurl('user/account');
?>
" title="<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'Account');
?>
"><i class="glyphicon glyphicon-user"></i> <?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'Account');
?>
</a></li>
        <li><a href="<?php 
echo erLhcoreClassDesign::baseurl('user/logout');
?>
" title="<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'Logout');
?>
"><i class="glyphicon glyphicon-log-out"></i> <?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'Logout');
?>
</a></li>
    </ul>
</li>
 <?php 
unset($currentUser);
unset($UserData);
示例#13
0
    var id_position =  '/(position)/'+$('#PositionID').val();
	var textStatus = $('#id_status_text').val();
	var top = '/(top)/'+($('#id_top_text').val() == '' ? 300 : $('#id_top_text').val());
	var topposition = '/(units)/'+$('#UnitsTop').val();
	var widthwidget = '/(width)/'+($('#id_width_text').val() == '' ? 300 : $('#id_width_text').val());
	var heightwidget = '/(height)/'+($('#id_height_text').val() == '' ? 300 : $('#id_height_text').val());
	var chat_height = '/(chat_height)/'+($('#id_chat_height').val() == '' ? 220 : $('#id_chat_height').val());	
	var show_content = ($('#ShowContent').is(':checked') ? '/(sc)/true' : '');
	var show_min = ($('#ShowContentMinimized').is(':checked')? '/(scm)/true' : '');
	var dis_min = ($('#DisableMiminize').is(':checked')? '/(dmn)/true' : '');
	var id_disable_responsive = $('#id_disable_responsive').is(':checked') ? '/(noresponse)/true' : '';
	var id_theme = $('#ThemeID').val() > 0 ? '/(theme)/'+$('#ThemeID').val() : '';
	
    var script = '<script type="text/javascript">'+"\nvar LHCChatboxOptions = {hashchatbox:'empty',identifier:'default',status_text:'"+textStatus+"'};\n"+
      '(function() {'+"\n"+
        'var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;'+"\n"+
        'po.src = \''+$('#HttpMode').val()+'//<?php 
echo $_SERVER['HTTP_HOST'];
echo erLhcoreClassDesign::baseurldirect();
?>
'+siteAccess+'chatbox/getstatus'+id_position+top+id_disable_responsive+topposition+widthwidget+id_theme+heightwidget+chat_height+show_content+show_min+dis_min+"';\n"+
        'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);'+"\n"+
      '})();'+"\n"+
    '</scr'+'ipt>';
    $('#HMLTContent').text(script);
};
$('#LocaleID,#PositionID,#HttpMode,#id_status_text,#UnitsTop,#id_top_text,#id_width_text,#id_height_text,#ThemeID,#id_disable_responsive,#id_chat_height,#ShowContent,#ShowContentMinimized,#DisableMiminize').change(function(){
    generateEmbedCode();
});
generateEmbedCode();
</script>
示例#14
0
<?php

$faq = new erLhcoreClassModelFaq();
$response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('faq.new', array('faq' => $faq));
$tpl = erLhcoreClassTemplate::getInstance('lhfaq/new.tpl.php');
if (isset($_POST['Save'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect();
        exit;
    }
    $Errors = erLhcoreClassFaq::validateFaq($faq);
    if (count($Errors) == 0) {
        $faq->saveThis();
        erLhcoreClassChatEventDispatcher::getInstance()->dispatch('faq.created', array('faq' => &$faq));
        erLhcoreClassModule::redirect('faq/list');
        exit;
    } else {
        $tpl->set('errors', $Errors);
    }
}
if (isset($_POST['Cancel'])) {
    erLhcoreClassModule::redirect('faq/list');
    exit;
}
$tpl->set('faq', $faq);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('faq/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('faq/list', 'FAQ')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('faq/new', 'New question')));
示例#15
0
<li><a href="<?php 
echo erLhcoreClassDesign::baseurl('chat/list');
?>
"><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'Chats list');
?>
</a></li>
echo $chatOptionsVariable;
?>
.opt.nh_image != 'undefined') ? <?php 
echo $chatOptionsVariable;
?>
.opt.nh_image : '<?php 
if ($iconsStatuses['need_help_image_url'] == false) {
    echo erLhcoreClassModelChatConfig::fetch('explicit_http_mode')->current_value;
    ?>
//<?php 
    echo $_SERVER['HTTP_HOST'];
}
if ($theme !== false && $theme->need_help_image_url !== false) {
    print $theme->need_help_image_url;
} else {
    echo erLhcoreClassDesign::design('images/general/operator.png');
}
?>
';

subStatus = '<div id="lhc_need_help_container" style="<?php 
echo $currentPosition['nh_hor_pos'];
?>
">'+
'<span id="lhc_need_help_triangle" style="<?php 
echo $currentPosition['nh_tr_pos'];
?>
"></span>'+
'<a id="lhc_need_help_close" title="<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/getstatus', 'Close');
?>
<ul class="list-unstyled">				
      <li ng-repeat="chat in unread_chats.list track by chat.id"  >
      	<span ng-if="chat.country_code != undefined"><img ng-src="<?php 
echo erLhcoreClassDesign::design('images/flags');
?>
/{{chat.country_code}}.png" alt="{{chat.country_name}}" title="{{chat.country_name}}" /></span>
      	<a class="icon-info" title="ID - {{chat.id}}" ng-click="lhc.previewChat(chat.id)" ></a><a class="right-action-hide icon-chat" ng-click="lhc.startChat(chat.id,chat.nick)" title="<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface', 'Add chat');
?>
"></a><a class="icon-popup" ng-click="lhc.startChatNewWindow(chat.id,chat.nick)" title="<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface', 'Open in a new window');
?>
"></a> {{chat.nick}}, {{chat.time_created_front}}, {{chat.department_name}} | <b>{{chat.unread_time.hours}} <?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface', 'h.');
?>
 {{chat.unread_time.minits}} <?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface', 'm.');
?>
 {{chat.unread_time.seconds}} <?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface', 's.');
?>
 <?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface', 'ago');
?>
.</b>
      </li>					
</ul>
<p ng-show="unread_chats.list.length == 0"><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'Empty...');
?>
</p>
示例#18
0
<!DOCTYPE html>

<html lang="<?php 
echo erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'content_language');
?>
" dir="<?php 
echo erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'dir_language');
?>
">
<head>
<?php 
include_once erLhcoreClassDesign::designtpl('pagelayouts/parts/page_head.tpl.php');
?>
<link rel="stylesheet" type="text/css" href="<?php 
echo erLhcoreClassDesign::designCSS('css/print.css');
?>
" />
</head>
<body>

<?php 
echo $Result['content'];
?>

<?php 
if (erConfigClassLhConfig::getInstance()->getSetting('site', 'debug_output') == true) {
    $debug = ezcDebug::getInstance();
    echo $debug->generateOutput();
}
?>
<script>
示例#19
0
        if ($form->hasValidData('HideFor')) {
            $data['hide_for'] = $form->HideFor;
        } else {
            $data['hide_for'] = '';
        }
        if ($form->hasValidData('OtherStatus')) {
            $data['other_status'] = $form->OtherStatus;
        } else {
            $data['other_status'] = '';
        }
        if ($form->hasValidData('RestStatus')) {
            $data['rest_status'] = $form->RestStatus;
        } else {
            $data['rest_status'] = '';
        }
        if ($form->hasValidData('ApplyWidget')) {
            $data['apply_widget'] = 1;
        } else {
            $data['apply_widget'] = 0;
        }
    }
    $geoData->value = serialize($data);
    $geoData->saveThis();
    $CacheManager = erConfigClassLhCacheConfig::getInstance();
    $CacheManager->expireCache();
    $tpl->set('updated', 'done');
}
$tpl->set('geo_data', $data);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'System configuration')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/geoadjustment', 'GEO adjustment')));
示例#20
0
<?php

try {
    $tpl = erLhcoreClassTemplate::getInstance('lhinstance/invoices.tpl.php');
    $pages = new lhPaginator();
    $pages->items_total = erLhcoreClassModelInstanceInvoice::getCount();
    $pages->translationContext = 'abstract/list';
    $pages->serverURL = erLhcoreClassDesign::baseurl('instance/invoices');
    $pages->setItemsPerPage(20);
    $pages->paginate();
    $tpl->set('pages', $pages);
    $items = array();
    if ($pages->items_total > 0) {
        $items = erLhcoreClassModelInstanceInvoice::getList(array('offset' => $pages->low, 'limit' => $pages->items_per_page));
    }
    $tpl->set('items', $items);
    $tpl->set('pages', $pages);
    $Result['content'] = $tpl->fetch();
    $Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'System configuration')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Invoices')));
} catch (Exception $e) {
    print_r($e);
}
示例#21
0
<?php 
if (isset($errors)) {
    ?>
	<?php 
    include erLhcoreClassDesign::designtpl('lhkernel/validation_error.tpl.php');
}
?>

<form action="<?php 
echo erLhcoreClassDesign::baseurl('department/newgroup');
?>
" method="post">

	<?php 
include erLhcoreClassDesign::designtpl('lhdepartment/formgroup.tpl.php');
?>
	
    <div class="btn-group" role="group" aria-label="...">
		<input type="submit" class="btn btn-default" name="Save_departament" value="<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons', 'Save');
?>
"/>
		<input type="submit" class="btn btn-default" name="Cancel_departament" value="<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/buttons', 'Cancel');
?>
"/>
	</div>
	
</form>
示例#22
0
var lhc_hnh = <?php 
    if (erLhcoreClassModelChatConfig::fetch('need_help_tip_timeout')->current_value > 0) {
        ?>
lh_inst.getPersistentAttribute('lhc_hnh');<?php 
    } else {
        ?>
lh_inst.cookieData.lhc_hnh;<?php 
    }
    ?>
if (lhc_hnh == null || lhc_hnh == undefined || parseInt(lhc_hnh) < <?php 
    echo time();
    ?>
) {

<?php 
    include erLhcoreClassDesign::designtpl('lhchat/getstatus/we_here_substatus.tpl.php');
    ?>
	

if (!this.cssNHWasAdded) {
	this.cssNHWasAdded = true;
	var raw_css_need_hl = '#lhc_need_help_container{width:235px;border-radius:20px;background:#<?php 
    $theme !== false ? print $theme->need_help_bcolor : (print '92B830');
    ?>
;position:absolute;color:#<?php 
    $theme !== false ? print $theme->need_help_tcolor : (print 'ffffff');
    ?>
;padding:10px;border:1px solid #<?php 
    $theme !== false ? print $theme->need_help_border : (print 'dbe257');
    ?>
;margin-top:-105px;}#lhc_need_help_container:hover{background-color:#<?php 
示例#23
0
}
?>

			<?php 
if (isset($success)) {
    $msg = erTranslationClassLhTranslation::getInstance()->getTranslation('faq/faqwidget', 'Your question was submitted!');
    ?>
				<?php 
    include erLhcoreClassDesign::designtpl('lhkernel/alert_success.tpl.php');
    ?>
			<?php 
}
?>

		  <form action="<?php 
echo erLhcoreClassDesign::baseurl('faq/faqwidget');
isset($dynamic_url_append) ? print $dynamic_url_append : '';
?>
" method="post" onsubmit="return lhinst.addCaptcha('<?php 
echo time();
?>
',$(this))">
			  <h4><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('faq/faqwidget', 'Type your question');
?>
</h4>
              <div class="form-group">
			     <label><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('faq/faqwidget', 'E-mail');
?>
:<?php 
示例#24
0
<?php

$tpl = erLhcoreClassTemplate::getInstance('lhfile/list.tpl.php');
if (isset($_GET['doSearch'])) {
    $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'filelist', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']));
    $filterParams['is_search'] = true;
} else {
    $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'filelist', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered']));
    $filterParams['is_search'] = false;
}
$append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']);
$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('file/list') . $append;
$pages->items_total = erLhcoreClassChat::getCount($filterParams['filter'], 'lh_chat_file');
$pages->setItemsPerPage(20);
$pages->paginate();
$items = array();
if ($pages->items_total > 0) {
    $items = erLhcoreClassChat::getList(array_merge(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id DESC'), $filterParams['filter']), 'erLhcoreClassModelChatFile', 'lh_chat_file');
}
$tpl->set('items', $items);
$tpl->set('pages', $pages);
$filterParams['input_form']->form_action = erLhcoreClassDesign::baseurl('file/list');
$tpl->set('input', $filterParams['input_form']);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('file/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'List of files')));
    ?>
btop-reset btrad-reset mb0<?php 
}
?>
" placeholder="<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'Type your message here and hit enter to send...');
?>
" id="id_Question" name="Question"><?php 
echo htmlspecialchars($input_data->question);
?>
</textarea>

<?php 
if ($hasExtraField === true) {
    ?>
<div class="btn-group" role="group" aria-label="...">
<input type="submit" name="askQuestionAction" id="idaskQuestionAction" value="<?php 
    echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'Send');
    ?>
" class="btn btn-default btn-sm"/>
<?php 
}
?>

<?php 
include erLhcoreClassDesign::designtpl('lhchat/part/readoperatormessage_button_multiinclude.tpl.php');
if ($hasExtraField === true) {
    ?>
</div>
<?php 
}
示例#26
0
	$('#db-status-checked').hide();
	$('#db-status-updating').show();		
	$.postJSON('<?php 
echo erLhcoreClassDesign::baseurl('system/update');
?>
/(action)/statusdbdoupdate',function(data){
        $('#status-db').html(data.result);            
    }); 
};

(function() {
	
  $.ajax({
      url: 'https://livehelperchat.com/update/version',   
      dataType: 'jsonp',      
      jsonp: 'callback',
      jsonpCallback: 'jsonpCallbackLHC',
      success: function(data){        
              $('#recent-version').text(data.version/100); 
      }
  });
	 
  $.postJSON('<?php 
echo erLhcoreClassDesign::baseurl('system/update');
?>
/(action)/statusdb',function(data){
      $('#status-db').html(data.result);            
  });
    
})();
</script>
示例#27
0
        ?>
        		
            </div>
            </div>
        	<?php 
    }
    ?>
    </div>
    <?php 
}
?>

</div>

<?php 
include_once erLhcoreClassDesign::designtpl('pagelayouts/parts/page_footer.tpl.php');
?>

</div>
</div>


<?php 
if (erConfigClassLhConfig::getInstance()->getSetting('site', 'debug_output') == true) {
    $debug = ezcDebug::getInstance();
    echo $debug->generateOutput();
}
?>

</body>
</html>
示例#28
0
<?php

include erLhcoreClassDesign::designtpl('lhsystem/configuration_links/product_pre.tpl.php');
if ($system_configuration_links_survey_enabled == true && $currentUser->hasAccessTo('lhproduct', 'manage_product')) {
    ?>
    <li><a href="<?php 
    echo erLhcoreClassDesign::baseurl('product/index');
    ?>
"><?php 
    echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'Product');
    ?>
</a></li>
<?php 
}
示例#29
0
<?php

include erLhcoreClassDesign::designtpl('lhabstract/parts/abstract_new_title.tpl.php');
?>

<form method="post" enctype="multipart/form-data" action="">
	
	<?php 
if (!isset($custom_form)) {
    ?>
		<?php 
    include erLhcoreClassDesign::designtpl('lhabstract/abstract_form.tpl.php');
    ?>
	<?php 
} else {
    ?>
		<?php 
    include erLhcoreClassDesign::designtpl("lhabstract/custom/" . $custom_form);
    ?>
	<?php 
}
?>
	
	<?php 
include erLhcoreClassDesign::designtpl('lhkernel/csfr_token.tpl.php');
?>
</form>

示例#30
0
        $data['http_user_group_name'] = $form->HttpGroupName;
    } else {
        $data['http_user_group_name'] = 'apache';
    }
    if ($form->hasValidData('SupportedExtensions')) {
        $data['supported_extension'] = $form->SupportedExtensions;
    } else {
        $data['supported_extension'] = 'ppt,pptx,doc,odp,docx,xlsx,txt,xls,xlsx,pdf,rtf,odt';
    }
    if ($form->hasValidData('BackgroundProcess') && $form->BackgroundProcess == true) {
        $data['background_process'] = 1;
    } else {
        $data['background_process'] = 0;
    }
    if ($form->hasValidData('MaxFileSize')) {
        $data['max_file_size'] = $form->MaxFileSize;
    } else {
        $data['max_file_size'] = 2;
    }
    if (count($Errors) == 0) {
        $docSharer->value = serialize($data);
        $docSharer->saveThis();
        $tpl->set('updated', 'done');
    } else {
        $tpl->set('errors', $Errors);
    }
}
$tpl->set('docsharer_data', $data);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('docshare/index'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('docshare/index', 'Documents sharer')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('docshare/configuration', 'Documents sharer configuration')));