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


PHP FieldList::getUserFieldEntryData方法代码示例

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


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

示例1: checkUser

 function checkUser($user_to_check, $param = false)
 {
     $output = false;
     $_testvar = '';
     $f_arr = $param ? $param : Get::req($this->id . "_input", DOTY_MIXED, false);
     if (!$user_to_check) {
         return $output;
     }
     if (!$f_arr) {
         return $output;
     }
     $a_obj = Docebo::user()->getAclManager();
     $fman = new FieldList();
     $filter = $this->json->decode(stripslashes($f_arr));
     $user_data_std = $a_obj->getUser($user_to_check, false);
     $user_data_extra = $fman->getUserFieldEntryData($user_to_check, false);
     $exclusive = $filter['exclusive'];
     $conds = $filter['filters'];
     if (count($conds) <= 0) {
         return true;
     }
     //if no conditions, return true anyway
     $output = $exclusive;
     foreach ($conds as $cond) {
         $id_field = $cond['id_field'];
         $params = $this->json->decode($cond['value']);
         if ($params == null) {
             $params = $cond['value'];
         }
         $res = $exclusive;
         list($id_type, $id) = explode('_', $id_field);
         switch ($id_type) {
             // stadard core_user fields
             case _STANDARD_FIELDS_PREFIX:
                 require_once _adm_ . '/modules/field/class.field.php';
                 require_once _adm_ . '/modules/field/class.date.php';
                 switch ($id) {
                     case 0:
                         //userid
                         $user_data_std[ACL_INFO_USERID] = $a_obj->relativeId($user_data_std[ACL_INFO_USERID]);
                         $res = Field::checkUserField($user_data_std[ACL_INFO_USERID], $params);
                         break;
                     case 1:
                         //firstname
                         $res = Field::checkUserField($user_data_std[ACL_INFO_FIRSTNAME], $params);
                         break;
                     case 2:
                         //lastname
                         $res = Field::checkUserField($user_data_std[ACL_INFO_LASTNAME], $params);
                         break;
                     case 3:
                         //email
                         $res = Field::checkUserField($user_data_std[ACL_INFO_EMAIL], $params);
                         break;
                     case 4:
                         //register date
                         $res = Field_Date::checkUserField($user_data_std[ACL_INFO_REGISTER_DATE], $params);
                         break;
                     case 5:
                         //lastenter
                         $res = Field_Date::checkUserField($user_data_std[ACL_INFO_LASTENTER], $params);
                         break;
                     default:
                         $res = false;
                 }
                 break;
                 // custom fields -----------------------------------
             // custom fields -----------------------------------
             case _CUSTOM_FIELDS_PREFIX:
                 //first check if the user own this extra field
                 if (isset($user_data_extra[$id])) {
                     $fobj = $fman->getFieldInstance($id);
                     $res = $fobj->checkUserField($user_data_extra[$id], $params);
                     //check if the field value match the condition
                 } else {
                     $res = false;
                 }
                 break;
                 // other fields -------------------------------------
             // other fields -------------------------------------
             case _OTHER_FIELDS_PREFIX:
                 $ofobj = new OtherFieldTypes();
                 $res = $ofobj->checkUserField($id, $user_to_check, $params);
                 break;
             default:
                 $res = false;
         }
         if ($exclusive) {
             //AND of conditions
             if (!$res) {
                 $output = false;
                 break;
             }
         } else {
             //OR of conditions
             if ($res) {
                 $output = true;
                 break;
             }
         }
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:lib.dynamicuserfilter.php


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