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


PHP FieldList::getFieldsAndValueFromUser方法代码示例

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


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

示例1: getUserDetails

 /**
  * Return all the info about the user
  * @param <int> $id_user the idst of the user
  */
 private function getUserDetails($id_user)
 {
     require_once _adm_ . '/lib/lib.field.php';
     $user_data = $this->aclManager->getUser($id_user, false);
     $output = array();
     if (!$user_data) {
         $output['success'] = false;
         $output['message'] = 'Invalid user ID: ' . $id_user . '.';
         $output['details'] = false;
     } else {
         $user_details = array('idst' => $user_data[ACL_INFO_IDST], 'userid' => $this->aclManager->relativeId($user_data[ACL_INFO_USERID]), 'firstname' => $user_data[ACL_INFO_FIRSTNAME], 'lastname' => $user_data[ACL_INFO_LASTNAME], 'email' => $user_data[ACL_INFO_EMAIL], 'signature' => $user_data[ACL_INFO_SIGNATURE], 'valid' => $user_data[ACL_INFO_VALID], 'pwd_expire_at' => $user_data[ACL_INFO_PWD_EXPIRE_AT], 'register_date' => $user_data[ACL_INFO_REGISTER_DATE], 'last_enter' => $user_data[ACL_INFO_LASTENTER]);
         $field_man = new FieldList();
         $field_data = $field_man->getFieldsAndValueFromUser($id_user, false, true);
         $fields = array();
         foreach ($field_data as $field_id => $value) {
             $fields[] = array('id' => $field_id, 'name' => $value[0], 'value' => $value[1]);
         }
         $user_details['custom_fields'] = $fields;
         $output['success'] = true;
         $output['message'] = '';
         $output['details'] = $user_details;
     }
     return $output;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:28,代码来源:api.user.php

示例2: getUserContactNoRestriction

 /**
  * retrive the value of the extra field for the user that is classiied as contact without checking the access list
  */
 function getUserContactNoRestriction($id_user)
 {
     require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
     $field_man = new FieldList();
     $field_founded = $field_man->getFieldsAndValueFromUser($id_user, false, false, array('contact'));
     $field = array();
     foreach ($field_founded as $id => $arr_value) {
         $ob =& $field_man->getFieldInstance($id, $arr_value[5], $arr_value[6]);
         $field[$id] = array('name' => $arr_value[0], 'value' => $arr_value[1], 'href' => $ob->getIMBrowserHref($id_user, $arr_value[1]), 'image' => $ob->getIMBrowserImageSrc($id_user, $arr_value[1]), 'head' => $ob->getIMBrowserHead($id_user, $arr_value[1]), 'field_type' => $arr_value[4]);
     }
     return $field;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:15,代码来源:lib.user_profile.php

示例3: array

 function add_row($row)
 {
     $array_substitution = array();
     $array_param = explode(',', $this->param_string);
     if (array_search('[date_subscription]', $array_param) || array_search('[matriculant]', $array_param)) {
         $query = "SELECT idUser, date_inscr" . " FROM " . $GLOBALS['prefix_lms'] . "_courseuser" . " WHERE idCourse = '" . $row['[id_course]'] . "'" . " AND status = '2'" . ($this->last_execution !== NULL ? " AND date_complete >= '" . $this->last_execution . "'" : '');
         $result = sql_query($query);
         if (mysql_num_rows($result)) {
             $put = '';
             while (list($id_user, $date_inscr) = sql_fetch_row($result)) {
                 foreach ($array_param as $param) {
                     switch ($param) {
                         case '[blank_space]':
                             $array_substitution[] = '';
                             break;
                         case '[course_code]':
                             $array_substitution[] = html_entity_decode($row['[course_code]'], ENT_QUOTES, "UTF-8");
                             break;
                         case '[matriculant]':
                             require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
                             $field_man = new FieldList();
                             //TODO: Modificare con il nome del campo della matricola che hanno in piattaforma
                             $id_common_field = $field_man->getFieldIdCommonFromTranslation('Matricola');
                             $array_field = $field_man->getFieldsAndValueFromUser($id_user);
                             $array_substitution[] = sprintf("%07d", $array_field[$id_common_field][1]);
                             break;
                         case '[date_subscription]':
                             if ($date_inscr !== '0000-00-00' && $date_inscr !== '') {
                                 $array_substitution[] = $date_inscr;
                             } else {
                                 $array_substitution[] = $row['[date_creation]'];
                             }
                             break;
                         case '[course_creation]':
                             if ($row['[create_date]'] !== '0000-00-00') {
                                 $array_substitution[] = $row['[create_date]'];
                             } else {
                                 $array_substitution[] = $row['[course_begin]'];
                             }
                             break;
                         default:
                             $array_substitution[] = $param;
                             break;
                     }
                 }
                 $put .= vsprintf($this->asprintf_string, $array_substitution) . "\r\n";
             }
             if (@fwrite($this->filehandle, $put)) {
                 return true;
             } else {
                 return false;
             }
         }
         return true;
     } else {
         if ($row['[create_date]'] < $this->last_execution) {
             return true;
         }
         foreach ($array_param as $param) {
             switch ($param) {
                 case '[blank_space]':
                     $array_substitution[] = '';
                     break;
                 case '[course_code]':
                     $array_substitution[] = html_entity_decode($row['[course_code]'], ENT_QUOTES, "UTF-8");
                     break;
                 case '[course_name]':
                     $array_substitution[] = html_entity_decode(trim($row['[course_name]']), ENT_QUOTES, "UTF-8");
                     break;
                 case '[course_descr]':
                     $array_substitution[] = html_entity_decode(str_replace(array("\n", "\r"), '', strip_tags(trim($row['[course_descr]']))), ENT_QUOTES, "UTF-8");
                     break;
                 case '[medium_time]':
                     $array_substitution[] = sprintf("%04d", $row['[medium_time]']) . '00';
                     break;
                 case '[course_begin]':
                     $array_substitution[] = $row['[course_begin]'];
                     break;
                 case '[course_end]':
                     if ($row['[course_end]'] !== '0000-00-00') {
                         $array_substitution[] = $row['[course_end]'];
                     } else {
                         $array_substitution[] = '2999-12-31';
                     }
                     break;
                 case '[course_creation]':
                     if ($row['[create_date]'] !== '0000-00-00') {
                         $array_substitution[] = $row['[create_date]'];
                     } else {
                         $array_substitution[] = $row['[course_begin]'];
                     }
                     break;
                 default:
                     $array_substitution[] = $param;
                     break;
             }
         }
         $put = vsprintf($this->asprintf_string, $array_substitution) . "\r\n";
         if (@fwrite($this->filehandle, $put)) {
             return true;
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:connector.fixedtext.php


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