本文整理汇总了PHP中erLhcoreClassChat::prefillGetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassChat::prefillGetAttributes方法的具体用法?PHP erLhcoreClassChat::prefillGetAttributes怎么用?PHP erLhcoreClassChat::prefillGetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassChat
的用法示例。
在下文中一共展示了erLhcoreClassChat::prefillGetAttributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_numeric
}
$onlineOperators = erLhcoreClassModelUserDep::getOnlineOperators($currentUser, $canListOnlineUsersAll, $filter, is_numeric($Params['user_parameters_unordered']['limito']) ? (int) $Params['user_parameters_unordered']['limito'] : 10, $onlineTimeout);
erLhcoreClassChat::prefillGetAttributes($onlineOperators, array('lastactivity_ago', 'user_id', 'id', 'name_support', 'active_chats', 'departments_names'), array(), array('remove_all' => true));
$ReturnMessages['online_op'] = array('list' => array_values($onlineOperators));
}
if ($unreadTabEnabled == true) {
$filter = array('ignore_fields' => erLhcoreClassChat::$chatListIgnoreField);
$limitList = is_numeric($Params['user_parameters_unordered']['limitu']) ? (int) $Params['user_parameters_unordered']['limitu'] : 10;
if (is_array($Params['user_parameters_unordered']['unreadd']) && !empty($Params['user_parameters_unordered']['unreadd'])) {
erLhcoreClassChat::validateFilterIn($Params['user_parameters_unordered']['unreadd']);
$filter['filterin']['dep_id'] = $Params['user_parameters_unordered']['unreadd'];
}
// Unread chats
$unreadChats = erLhcoreClassChat::getUnreadMessagesChats($limitList, 0, $filter);
$lastPendingChatID = 0;
$lastChatNick = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'Visitor');
$lastMessage = erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'New unread message');
if (!empty($unreadChats)) {
$lastPendingChatID = max(array_keys($unreadChats));
$chatRecent = reset($unreadChats);
$lastChatNick = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'Unread message') . ' | ' . $chatRecent->nick . ' | ' . $chatRecent->department;
$lastMessage = erLhcoreClassChat::getGetLastChatMessagePending($chatRecent->id);
}
erLhcoreClassChat::prefillGetAttributes($unreadChats, array('time_created_front', 'department_name', 'unread_time', 'plain_user_name'), array('department', 'time', 'status', 'user_id', 'user'));
$ReturnMessages['unread_chats'] = array('msg' => $lastMessage, 'nick' => $lastChatNick, 'last_id' => $lastPendingChatID, 'last_id_identifier' => 'unread_chat', 'list' => array_values($unreadChats));
}
// Update last visit
$currentUser->updateLastVisit();
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.syncadmininterface', array('lists' => &$ReturnMessages));
echo json_encode(array('error' => 'false', 'result' => $ReturnMessages));
exit;
示例2: isset
$timeout = isset($Params['user_parameters_unordered']['timeout']) && is_numeric($Params['user_parameters_unordered']['timeout']) ? (int) $Params['user_parameters_unordered']['timeout'] : 30;
$maxrows = isset($Params['user_parameters_unordered']['maxrows']) && is_numeric($Params['user_parameters_unordered']['maxrows']) ? (int) $Params['user_parameters_unordered']['maxrows'] : 50;
$filter = array('offset' => 0, 'limit' => $maxrows, 'sort' => 'last_visit DESC', 'filtergt' => array('last_visit' => time() - $timeout));
$department = isset($Params['user_parameters_unordered']['department']) && is_numeric($Params['user_parameters_unordered']['department']) ? (int) $Params['user_parameters_unordered']['department'] : false;
if ($department !== false) {
$filter['filter']['dep_id'] = $department;
}
/**
* Append user departments filter
* */
$departmentParams = array();
$userDepartments = erLhcoreClassUserDep::parseUserDepartmetnsForFilter($currentUser->getUserID());
if ($userDepartments !== true) {
$departmentParams['filterin']['id'] = $userDepartments;
if (!$currentUser->hasAccessTo('lhchat', 'sees_all_online_visitors')) {
$filter['filterin']['dep_id'] = $userDepartments;
}
}
if ($is_ajax == true) {
$items = erLhcoreClassModelChatOnlineUser::getList($filter);
erLhcoreClassChat::prefillGetAttributes($items, array('online_attr_system_array', 'notes_intro', 'last_check_time_ago', 'visitor_tz_time', 'last_visit_seconds_ago', 'lastactivity_ago', 'time_on_site_front', 'can_view_chat', 'operator_user_send', 'operator_user_string', 'first_visit_front', 'last_visit_front'), array('notes', 'online_attr_system'), array('do_not_clean' => true));
echo json_encode(array_values($items));
exit;
}
$tpl->set('departmentParams', $departmentParams);
$tpl->set('tracking_enabled', erLhcoreClassModelChatConfig::fetch('track_online_visitors')->current_value == 1);
$tpl->set('geo_location_data', erLhcoreClassModelChatConfig::fetch('geo_location_data')->data);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Online visitors')));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.onlineusers_path', array('result' => &$Result));
$Result['additional_footer_js'] = '<script src="' . erLhcoreClassDesign::designJS('js/angular.lhc.online.min.js') . '"></script>';
示例3: array
<?php
$currentUser = erLhcoreClassUser::instance();
if (!$currentUser->isLogged() && !$currentUser->authenticate($_POST['username'], $_POST['password'])) {
exit;
}
$activeChats = erLhcoreClassChat::getActiveChats(10);
$closedChats = erLhcoreClassChat::getClosedChats(10);
$pendingChats = erLhcoreClassChat::getPendingChats(10);
$transferedChats = erLhcoreClassTransfer::getTransferChats();
$unreadChats = erLhcoreClassChat::getUnreadMessagesChats(10, 0);
erLhcoreClassChat::prefillGetAttributes($activeChats, array('department_name'), array('updateIgnoreColumns', 'department'));
erLhcoreClassChat::prefillGetAttributes($closedChats, array('department_name'), array('updateIgnoreColumns', 'department'));
erLhcoreClassChat::prefillGetAttributes($pendingChats, array('department_name'), array('updateIgnoreColumns', 'department'));
erLhcoreClassChat::prefillGetAttributes($unreadChats, array('department_name'), array('updateIgnoreColumns', 'department'));
$onlineUsers = array();
if ($currentUser->hasAccessTo('lhchat', 'use_onlineusers')) {
$filter = array('offset' => 0, 'limit' => 50, 'sort' => 'last_visit DESC', 'filtergt' => array('last_visit' => time() - 3600));
$departmentParams = array();
$userDepartments = erLhcoreClassUserDep::parseUserDepartmetnsForFilter($currentUser->getUserID());
if ($userDepartments !== true) {
$departmentParams['filterin']['id'] = $userDepartments;
if (!$currentUser->hasAccessTo('lhchat', 'sees_all_online_visitors')) {
$filter['filterin']['dep_id'] = $userDepartments;
}
}
$onlineUsers = erLhcoreClassModelChatOnlineUser::getList($filter);
}
$columnsToHide = array('user_closed_ts', 'tslasign', 'reinform_timeout', 'unread_messages_informed', 'wait_timeout', 'wait_timeout_send', 'status_sub', 'timeout_message', 'nc_cb_executed', 'fbst', 'user_id', 'transfer_timeout_ts', 'operator_typing_id', 'transfer_timeout_ac', 'transfer_if_na', 'na_cb_executed', 'status', 'remarks', 'operation', 'operation_admin', 'screenshot_id', 'mail_send', 'online_user_id', 'dep_id', 'last_msg_id', 'hash', 'user_status', 'support_informed', 'support_informed', 'country_code', 'user_typing', 'user_typing_txt', 'lat', 'lon', 'chat_initiator', 'chat_variables', 'chat_duration', 'operator_typing', 'has_unread_messages', 'last_user_msg_time', 'additional_data');
$columnsName = array('id' => 'ID', 'user_tz_identifier' => 'User time zone', 'department_name' => 'Department', 'nick' => 'Nick', 'time' => 'Time', 'referrer' => 'Referrer', 'session_referrer' => 'Original referrer', 'ip' => 'IP', 'country_name' => 'Country', 'email' => 'E-mail', 'priority' => 'Priority', 'name' => 'Department', 'phone' => 'Phone', 'city' => 'City', 'wait_time' => 'Waited');
$onlineuserscolumnsToHide = array('requires_phone', 'lat_check_time', 'dep_id', 'requires_email', 'requires_username', 'invitation_seen_count', 'screenshot_id', 'operation', 'reopen_chat', 'vid', 'user_country_code', 'invitation_assigned', 'current_page', 'chat_id', 'operator_user_id', 'message_seen', 'operator_user_proactive', 'message_seen_ts', 'lat', 'lon', 'invitation_id', 'time_on_site', 'tt_time_on_site', 'invitation_count', 'store_chat');
示例4: array
<?php
$currentUser = erLhcoreClassUser::instance();
if (!$currentUser->isLogged() && !$currentUser->authenticate($_POST['username'], $_POST['password'])) {
exit;
}
$activeChats = erLhcoreClassChat::getActiveChats(10);
$closedChats = erLhcoreClassChat::getClosedChats(10);
$pendingChats = erLhcoreClassChat::getPendingChats(10);
$transferedChats = erLhcoreClassTransfer::getTransferChats();
erLhcoreClassChat::prefillGetAttributes($activeChats, array(), array('updateIgnoreColumns'));
erLhcoreClassChat::prefillGetAttributes($closedChats, array(), array('updateIgnoreColumns'));
erLhcoreClassChat::prefillGetAttributes($pendingChats, array(), array('updateIgnoreColumns'));
$onlineUsers = array();
if ($currentUser->hasAccessTo('lhchat', 'use_onlineusers')) {
$onlineUsers = erLhcoreClassModelChatOnlineUser::getList();
}
$columnsToHide = array('tslasign', 'reinform_timeout', 'unread_messages_informed', 'wait_timeout', 'wait_timeout_send', 'status_sub', 'timeout_message', 'nc_cb_executed', 'fbst', 'user_id', 'transfer_timeout_ts', 'operator_typing_id', 'transfer_timeout_ac', 'transfer_if_na', 'na_cb_executed', 'status', 'remarks', 'operation', 'operation_admin', 'screenshot_id', 'mail_send', 'online_user_id', 'dep_id', 'last_msg_id', 'hash', 'user_status', 'support_informed', 'support_informed', 'country_code', 'user_typing', 'user_typing_txt', 'lat', 'lon', 'chat_initiator', 'chat_variables', 'chat_duration', 'operator_typing', 'has_unread_messages', 'last_user_msg_time', 'additional_data');
$columnsName = array('id' => 'ID', 'nick' => 'Nick', 'time' => 'Time', 'referrer' => 'Referrer', 'session_referrer' => 'Original referrer', 'ip' => 'IP', 'country_name' => 'Country', 'email' => 'E-mail', 'priority' => 'Priority', 'name' => 'Department', 'phone' => 'Phone', 'city' => 'City', 'wait_time' => 'Waited');
$onlineuserscolumnsToHide = array('dep_id', 'requires_email', 'requires_username', 'invitation_seen_count', 'screenshot_id', 'operation', 'reopen_chat', 'vid', 'user_country_code', 'page_title', 'invitation_assigned', 'current_page', 'chat_id', 'operator_user_id', 'message_seen', 'operator_user_proactive', 'message_seen_ts', 'lat', 'lon', 'invitation_id', 'time_on_site', 'tt_time_on_site', 'invitation_count', 'store_chat');
$onlineuserscolumnsNames = array('online_attr' => 'Attributes', 'id' => 'ID', 'operator_message' => 'Operator message', 'ip' => 'IP', 'identifier' => 'Identifier', 'user_agent' => 'Browser', 'last_visit' => 'Last visit', 'first_visit' => 'First visit', 'total_visits' => 'Total visits', 'user_country_name' => 'Country', 'city' => 'City', 'pages_count' => 'Pages viewed', 'tt_pages_count' => 'Total pages viewed');
echo json_encode(array('active_chats' => array('rows' => $activeChats, 'size' => count($activeChats), 'hidden_columns' => $columnsToHide, 'timestamp_delegate' => array('time'), 'column_names' => $columnsName), 'online_users' => array('rows' => $onlineUsers, 'size' => count($onlineUsers), 'hidden_columns' => $onlineuserscolumnsToHide, 'column_names' => $onlineuserscolumnsNames, 'timestamp_delegate' => array('last_visit', 'first_visit')), 'closed_chats' => array('rows' => $closedChats, 'size' => count($closedChats), 'hidden_columns' => $columnsToHide, 'timestamp_delegate' => array('time'), 'column_names' => $columnsName), 'pending_chats' => array('rows' => $pendingChats, 'size' => count($pendingChats), 'hidden_columns' => $columnsToHide, 'timestamp_delegate' => array('time'), 'column_names' => $columnsName), 'transfered_chats' => array('rows' => $transferedChats, 'size' => count($transferedChats), 'hidden_columns' => array_merge($columnsToHide, array('transfer_id')), 'timestamp_delegate' => array('time'), 'column_names' => $columnsName)));
$currentUser->updateLastVisit();
exit;