當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。