当前位置: 首页>>代码示例>>PHP>>正文


PHP erLhcoreClassChat::getLoggedDepartmentsIds方法代码示例

本文整理汇总了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) {
开发者ID:detain,项目名称:livehelperchat,代码行数:30,代码来源:loadinitialdata.php

示例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) {
开发者ID:detain,项目名称:livehelperchat,代码行数:31,代码来源:transferchatrefilter.tpl.php


注:本文中的erLhcoreClassChat::getLoggedDepartmentsIds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。