本文整理汇总了PHP中erLhcoreClassChat::getLoggedDepartmentsIds方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassChat::getLoggedDepartmentsIds方法的具体用法?PHP erLhcoreClassChat::getLoggedDepartmentsIds怎么用?PHP erLhcoreClassChat::getLoggedDepartmentsIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassChat
的用法示例。
在下文中一共展示了erLhcoreClassChat::getLoggedDepartmentsIds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
header('Content-Type: application/json');
$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;
}
}
$departmentParams['sort'] = 'sort_priority ASC, name ASC';
$departmentNames = array();
$departmentList = array();
$departments = erLhcoreClassModelDepartament::getList($departmentParams);
$loggedDepartments = erLhcoreClassChat::getLoggedDepartmentsIds(array_keys($departments), false);
$loggedDepartmentsExplicit = erLhcoreClassChat::getLoggedDepartmentsIds(array_keys($departments), true);
// Filter products
$filterProducts = array();
foreach ($departments as $department) {
$departmentNames[$department->id] = $department->name;
$departmentList[] = array('id' => $department->id, 'name' => $department->name, 'hidden' => $department->hidden, 'disabled' => $department->disabled == 1, 'ogen' => in_array($department->id, $loggedDepartments), 'oexp' => in_array($department->id, $loggedDepartmentsExplicit));
$filterProducts[] = $department->id;
}
$productsFilter = array();
// Add products
if (!empty($departments)) {
$productsFilter['filterin']['departament_id'] = array_keys($departments);
}
$productsNames = array();
$products = erLhAbstractModelProduct::getList($productsFilter);
foreach ($products as $product) {
示例2: array
<h4><span class="label label-success"><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/transferchat', 'Online');
?>
</span></h4>
<?php
$departments = erLhcoreClassModelDepartament::getList(array_merge($departments_filter['filter'], array('sort' => 'sort_priority ASC, name ASC')));
$onlineDepartments = erLhcoreClassChat::getLoggedDepartmentsIds(array_keys($departments), $departments_filter['explicit']);
foreach ($departments as $departament) {
if ($departament->id !== $departments_filter['dep_id'] && in_array($departament->id, $onlineDepartments)) {
?>
<div class="checkbox"><label><input type="radio" name="DepartamentID<?php
echo $departments_filter['chat_id'];
?>
" value="<?php
echo $departament->id;
?>
"/> <?php
echo htmlspecialchars($departament->name);
?>
</label></div>
<?php
}
}
?>
<h4><span class="label label-default"><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/transferchat', 'Offline');
?>
</span></h4>
<?php
foreach ($departments as $departament) {