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


PHP erLhcoreClassUserDep::parseUserDepartmetnsForFilter方法代码示例

本文整理汇总了PHP中erLhcoreClassUserDep::parseUserDepartmetnsForFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassUserDep::parseUserDepartmetnsForFilter方法的具体用法?PHP erLhcoreClassUserDep::parseUserDepartmetnsForFilter怎么用?PHP erLhcoreClassUserDep::parseUserDepartmetnsForFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在erLhcoreClassUserDep的用法示例。


在下文中一共展示了erLhcoreClassUserDep::parseUserDepartmetnsForFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?php

$tpl = erLhcoreClassTemplate::getInstance('lhdepartament/edit.tpl.php');
$Departament = erLhcoreClassDepartament::getSession()->load('erLhcoreClassModelDepartament', (int) $Params['user_parameters']['departament_id']);
$userDepartments = true;
/**
 * Append user departments filter
 * */
if ($currentUser->hasAccessTo('lhdepartment', 'manageall') !== true) {
    $userDepartments = erLhcoreClassUserDep::parseUserDepartmetnsForFilter($currentUser->getUserID());
    if ($userDepartments !== true) {
        if (!in_array($Departament->id, $userDepartments)) {
            erLhcoreClassModule::redirect('departament/departaments');
            exit;
        }
    }
}
if (isset($_POST['Cancel_departament'])) {
    erLhcoreClassModule::redirect('departament/departaments');
    exit;
}
if (isset($_POST['Delete_departament'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token']) || !$currentUser->hasAccessTo('lhdepartament', 'delete') || !$Departament->can_delete) {
        erLhcoreClassModule::redirect('departament/departaments');
        exit;
    }
    $Departament->removeThis();
    erLhcoreClassModule::redirect('departament/departaments');
    exit;
}
if (isset($_POST['Update_departament']) || isset($_POST['Save_departament'])) {
开发者ID:sajawalsz,项目名称:WebDealerSolutions,代码行数:31,代码来源:edit.php

示例2: getFields

 public function getFields()
 {
     $currentUser = erLhcoreClassUser::instance();
     $userDepartments = erLhcoreClassUserDep::parseUserDepartmetnsForFilter($currentUser->getUserID());
     return array('name' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Name for personal purposes'), 'required' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'operator_name' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Operator name'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'position' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Position'), 'required' => true, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'siteaccess' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Language, leave empty for all. E.g lit, rus, ger etc...'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'time_on_site' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Time on site in seconds'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int')), 'pageviews' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Pageviews'), 'required' => false, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'referrer' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Referrer domain without www, E.g google keyword will match any of google domain'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'hide_after_ntimes' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'How many times user show invitation, 0 - untill users closes it, > 0 limits.'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int')), 'requires_email' => array('type' => 'checkbox', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Requires e-mail'), 'required' => false, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean')), 'requires_username' => array('type' => 'checkbox', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Requires name'), 'required' => false, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean')), 'requires_phone' => array('type' => 'checkbox', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Requires phone'), 'required' => false, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean')), 'show_random_operator' => array('type' => 'checkbox', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Show random operator profile'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean')), 'operator_ids' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Enter operators IDs from whom random operator should be shown, separated by comma'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string')), 'identifier' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Identifier, for what identifier this message should be shown, leave empty for all'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string')), 'tag' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Tag'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string')), 'dep_id' => array('type' => 'combobox', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Department'), 'required' => false, 'hidden' => true, 'source' => 'erLhcoreClassModelDepartament::getList', 'hide_optional' => $userDepartments !== true, 'params_call' => $userDepartments === true ? array() : array('filterin' => array('id' => $userDepartments)), 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int')), 'executed_times' => array('type' => 'none', 'hide_edit' => true, 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Matched times'), 'required' => false, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'message' => array('type' => 'textarea', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Message to user'), 'required' => true, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'message_returning' => array('type' => 'textarea', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Message to returning user'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'message_returning_nick' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Nick which will be used if we cannot determine returning user name'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'wait_message' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Wait message. Visible then users starts chat and is waiting for someone to accept a chat.'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'wait_timeout' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Wait timeout. Time in seconds before timeout message is shown.'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'timeout_message' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'Show visitor this message then wait timeout passes.'), 'required' => false, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')), 'repeat_number' => array('type' => 'text', 'trans' => erTranslationClassLhTranslation::getInstance()->getTranslation('abstract/proactivechatinvitation', 'How many times repeat message?'), 'required' => true, 'hidden' => true, 'validation_definition' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 1))));
 }
开发者ID:detain,项目名称:livehelperchat,代码行数:6,代码来源:erlhabstractmodeleproactivechatinvitation.php


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