本文整理汇总了PHP中erLhcoreClassModule::getExtensionInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModule::getExtensionInstance方法的具体用法?PHP erLhcoreClassModule::getExtensionInstance怎么用?PHP erLhcoreClassModule::getExtensionInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassModule
的用法示例。
在下文中一共展示了erLhcoreClassModule::getExtensionInstance方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: publishXMPPAccount
/**
* At the moment it just stores an account. In the future there will be a call to create an account in xmpp server using NodeJS extension
* @param erLhcoreClassModelXMPPAccount $xmppAccount
*/
public static function publishXMPPAccount(erLhcoreClassModelXMPPAccount &$xmppAccount)
{
if ($xmppAccount->id == 0) {
erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice')->registerOperator($xmppAccount);
} elseif ($xmppAccount->password != '') {
erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice')->changeOperatorPassword($xmppAccount);
}
// We do not store operators passwords because we do not need them
if ($xmppAccount->type == erLhcoreClassModelXMPPAccount::USER_TYPE_OPERATOR) {
$xmppAccount->password = '';
}
$xmppAccount->saveThis();
}
示例2: __get
public function __get($var)
{
switch ($var) {
case 'ctime_front':
$this->ctime_front = date('Ymd') == date('Ymd', $this->ctime) ? date(erLhcoreClassModule::$dateHourFormat, $this->ctime) : date(erLhcoreClassModule::$dateDateHourFormat, $this->ctime);
return $this->ctime_front;
break;
case 'lactivity_front':
$this->lactivity_front = date('Ymd') == date('Ymd', $this->lactivity) ? date(erLhcoreClassModule::$dateHourFormat, $this->lactivity) : date(erLhcoreClassModule::$dateDateHourFormat, $this->lactivity);
return $this->lactivity_front;
break;
case 'user':
$this->user = false;
if ($this->user_id > 0) {
try {
$this->user = erLhcoreClassModelUser::fetch($this->user_id, true);
} catch (Exception $e) {
$this->user = false;
}
}
return $this->user;
break;
case 'username_plain':
list($this->username_plain) = explode('@', $this->username);
return $this->username_plain;
break;
case 'username_plain_edit':
list($this->username_plain_edit) = explode('@', $this->username);
$subdomain = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice')->settings['subdomain'];
if ($subdomain != '') {
$this->username_plain_edit = $this->str_lreplace('.' . $subdomain, '', $this->username_plain_edit);
}
return $this->username_plain_edit;
break;
default:
break;
}
}
示例3: catch
<?php
$chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
if (erLhcoreClassChat::hasAccessToRead($chat)) {
try {
$tpl = erLhcoreClassTemplate::getInstance('lhosticket/createanissue.tpl.php');
$osTicket = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionOsticket');
$osTicketId = $osTicket->createTicketByChat($chat);
$tpl->set('chat', $chat);
echo json_encode(array('error' => false, 'msg' => $tpl->fetch()));
} catch (Exception $e) {
echo json_encode(array('error' => true, 'msg' => $e->getMessage()));
}
exit;
} else {
echo json_encode(array('error' => true, 'msg' => erTranslationClassLhTranslation::getInstance()->getTranslation('osticket/createanissue', 'You do not have permission to access a chat')));
exit;
}
示例4:
<?php
include erLhcoreClassDesign::designtpl('lhsugarcrm/sugarcrm_tab_enabled_pre.tpl.php');
?>
<?php
if (erLhcoreClassUser::instance()->hasAccessTo('lhsugarcrm', 'use') && $sugarcrm_tab_enabled_pre == true) {
?>
<?php
$sugarCRMSettings = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionSugarcrm')->settings;
?>
<?php
if (isset($sugarCRMSettings['sugarcrm_enabled']) && $sugarCRMSettings['sugarcrm_enabled'] == true) {
?>
<div role="tabpanel" class="tab-pane" id="main-extension-sugarcrm-chat-<?php
echo $chat->id;
?>
">
<?php
if (!isset($chat->chat_variables_array['sugarcrm_lead_id']) || $chat->chat_variables_array['sugarcrm_lead_id'] == '') {
?>
<div class="form-group">
<a data-loading-text="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('sugarcrm/module', 'Processing');
?>
..." class="btn btn-default" onclick="sugarcrm.createOrUpdate($(this),<?php
echo $chat->id;
?>
)" href="javascript:void(0)"><?php
示例5:
<?php
if (isset($Result['chat']) && is_numeric($Result['chat']->id)) {
$xmppServiceExtension = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice');
if ($xmppServiceExtension->settings['enabled'] == true && ($xmppAccount = $xmppServiceExtension->getXMPPAccountByChat($Result['chat'])) !== false) {
$pageUser = $Result['chat']->online_user !== false ? $Result['chat']->online_user->current_page : '';
$paramsOnline = erLhcoreClassExtensionXmppserviceHandler::getNickAndStatusByChat($Result['chat'], $pageUser);
?>
<script>var xmppservice = {debug:<?php
echo $xmppServiceExtension->settings['debug'] == true ? 'true' : 'false';
?>
,use_notification:<?php
echo $xmppServiceExtension->settings['use_notification'] == true ? 'true' : 'false';
?>
,nick:<?php
echo json_encode($paramsOnline['nick']);
?>
,status:<?php
echo json_encode($paramsOnline['status']);
?>
,BOSH_SERVICE : '<?php
echo $xmppServiceExtension->settings['bosh_service'];
?>
', USR : <?php
echo json_encode($xmppAccount->username);
?>
,PSW : <?php
echo json_encode($xmppAccount->password);
?>
}</script>
<script type="text/javascript" language="javascript" src="<?php
示例6: json_encode
<?php
$sugarcrm = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionSugarcrm');
$lead = $sugarcrm->getLeadById($Params['user_parameters']['lead_id']);
$tpl = erLhcoreClassTemplate::getInstance('lhsugarcrm/getleadfields.tpl.php');
$tpl->set('lead', $lead);
echo json_encode(array('result' => $tpl->fetch()));
exit;
示例7: array
<?php
/* This is what messages looks like
$params = array(
'body' => 'PArasiau vartotojui zinute',
'sender' => 'remdex2',
'receiver' => 'visitor.6034.chat',
'server' => 'xmpp.livehelperchat.com'
); */
//erLhcoreClassLog::write(print_r($_POST,true));
if (erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice')->settings['enabled'] == false) {
erLhcoreClassModule::redirect('/');
exit;
}
$params = array('body' => isset($_POST['body']) ? $_POST['body'] : '', 'sender' => isset($_POST['sender']) ? $_POST['sender'] : '', 'receiver' => isset($_POST['receiver']) ? $_POST['receiver'] : '', 'server' => isset($_POST['server']) ? $_POST['server'] : '');
try {
if (!empty($params['body']) && !empty($params['sender']) && !empty($params['receiver']) && !empty($params['server'])) {
erLhcoreClassExtensionXmppserviceHandler::handleMessageFromOperator($params);
}
} catch (Exception $e) {
if (erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice')->settings['debug'] == true) {
erLhcoreClassLog::write(print_r($e, true));
}
}
exit;
示例8: lhPaginator
<?php
if (erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice')->settings['enabled'] == false) {
erLhcoreClassModule::redirect('/');
exit;
}
$tpl = erLhcoreClassTemplate::getInstance('lhxmppservice/operators.tpl.php');
if (isset($_GET['doSearch'])) {
$filterParams = erLhcoreClassSearchHandler::getParams(array('customfilterfile' => 'extension/xmppservice/classes/filter.php', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']));
$filterParams['is_search'] = true;
} else {
$filterParams = erLhcoreClassSearchHandler::getParams(array('customfilterfile' => 'extension/xmppservice/classes/filter.php', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered']));
$filterParams['is_search'] = false;
}
$append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']);
$pages = new lhPaginator();
$pages->items_total = erLhcoreClassModelXMPPAccount::getCount($filterParams['filter']);
$pages->translationContext = 'chat/activechats';
$pages->serverURL = erLhcoreClassDesign::baseurl('xmppservice/operators') . $append;
$pages->paginate();
$tpl->set('pages', $pages);
if ($pages->items_total > 0) {
$items = erLhcoreClassModelXMPPAccount::getList(array_merge(array('limit' => $pages->items_per_page, 'offset' => $pages->low), $filterParams['filter']));
$tpl->set('items', $items);
}
$filterParams['input_form']->form_action = erLhcoreClassDesign::baseurl('xmppservice/operators');
$tpl->set('input', $filterParams['input_form']);
$tpl->set('inputAppend', $append);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('xmppservice/index'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('xmppservice/module', 'XMPP Service')), array('url' => erLhcoreClassDesign::baseurl('xmppservice/operators'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('xmppservice/module', 'XMPP Accounts')));
示例9: htmlspecialchars
disabled="disabled"<?php
}
?>
value="<?php
echo htmlspecialchars($xmppaccount->username_plain_edit);
?>
" />
<div class="input-group-addon"><?php
if (($ahSubdomain = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice')->settings['subdomain']) != '') {
?>
.<?php
echo $ahSubdomain;
}
?>
@<?php
echo erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice')->settings['xmpp_host'];
?>
</div>
</div>
</div>
<div class="form-group">
<label><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('xmppservice/form', 'XMPP Password, enter only if you are creating new user. In most cases system does not need it.');
?>
</label>
<input type="password" maxlength="250" autocomplete="new-password" class="form-control" name="password" value="" />
</div>
<div class="form-group">
<label><input type="checkbox" name="sendmessage" value="on" <?php
示例10:
<a class="small button radius success" href="<?php
echo erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionOsticket')->getIssueUrl($chat->chat_variables_array['os_ticket_id']);
?>
" title="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('osticket/createanissue', 'Open a ticket in osTicket');
?>
" target="_blank">osTicket [<?php
echo $chat->chat_variables_array['os_ticket_id'];
?>
]</a>
示例11:
<?php
$fieldsDisplay = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionSugarcrm')->getFieldsForUpdate();
// Set values
foreach ($lead->name_value_list as $nameValue) {
if (key_exists($nameValue->name, $fieldsDisplay)) {
$fieldsDisplay[$nameValue->name]['value'] = $nameValue->value;
}
}
if ($lead !== false) {
?>
<?php
if (isset($lead_updated) && $lead_updated == true) {
?>
<div class="alert alert-success" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('sugarcrm/module', 'Lead was updated');
?>
</div>
<?php
}
?>
<form action="" method="post" onsubmit="return sugarcrm.updateLeadFields('<?php
echo $lead->id;
?>
',$(this))">
示例12: handleOperatorPing
/**
* Handlers requests like
*
* May 08 23:02:11 [Warning] [default] [default] {"action":"ping","user":"remdex2@xmpp.livehelperchat.com/25304460891431118632139491"}
* May 08 23:02:14 [Warning] [default] [default] {"action":"disconnect","user":"remdex2","server":"xmpp.livehelperchat.com"}
* May 08 23:21:52 [Warning] [default] [default] {"action":"connect","user":"remdex2","server":"xmpp.livehelperchat.com"}
*/
public static function handleOperatorPing($jsonContent)
{
$params = json_decode($jsonContent, true);
$xmppService = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice');
// If ping just update last action
if ($params['action'] == 'ping') {
// Parse user parts
$userParts = self::parseXMPPUser($params['user']);
// Fetches user id by xmpp username
$userId = self::getUserIDByXMPPUsername($userParts['xmppuser']);
// Updates last activity
if (is_numeric($userId)) {
self::updateActivityByUserId($userId, time() + $xmppService->settings['append_time']);
} else {
throw new Exception("Could not find LHC user by user - " . $userParts['xmppuser']);
}
} elseif ($params['action'] == 'disconnect' || $params['action'] == 'connect') {
// Fetches user id by xmpp username
$userId = self::getUserIDByXMPPUsername($params['user'] . '@' . $params['server']);
// Updates last activity to zero
if (is_numeric($userId)) {
self::updateActivityByUserId($userId, $params['action'] == 'connect' ? time() + $xmppService->settings['append_time'] : 0);
if ($params['action'] == 'connect') {
$userData = erLhcoreClassModelUser::fetch($userId);
if ($userData instanceof erLhcoreClassModelUser && $userData->hide_online == 1) {
$userData->hide_online = 0;
erLhcoreClassUser::getSession()->update($userData);
erLhcoreClassUserDep::setHideOnlineStatus($userData);
}
}
} else {
throw new Exception("Could not find LHC user by user - " . $params['user'] . '@' . $params['server']);
}
}
return true;
}