本文整理汇总了PHP中FieldList::storeDirectFieldsForUser方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldList::storeDirectFieldsForUser方法的具体用法?PHP FieldList::storeDirectFieldsForUser怎么用?PHP FieldList::storeDirectFieldsForUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldList
的用法示例。
在下文中一共展示了FieldList::storeDirectFieldsForUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateUser
public function updateUser($id_user, $userdata)
{
$acl_man = new DoceboACLManager();
$output = array();
$user_data = $this->aclManager->getUser($id_user, false);
if (!$user_data) {
return -1;
}
if (isset($userdata['valid']) && $userdata['valid'] == '1') {
$res = $this->aclManager->recoverUser($id_user);
} elseif (isset($userdata['valid']) && $userdata['valid'] == '0') {
$res = $this->aclManager->suspendUser($id_user);
}
$res = $this->aclManager->updateUser($id_user, isset($userdata['userid']) ? $userdata['userid'] : false, isset($userdata['firstname']) ? $userdata['firstname'] : false, isset($userdata['lastname']) ? $userdata['lastname'] : false, isset($userdata['password']) ? $userdata['password'] : false, isset($userdata['email']) ? $userdata['email'] : false, false, isset($userdata['signature']) ? $userdata['signature'] : false, isset($userdata['lastenter']) ? $userdata['lastenter'] : false, false);
//additional fields
$okcustom = true;
if (isset($userdata['_customfields']) && $res) {
require_once _adm_ . '/lib/lib.field.php';
$fields =& $userdata['_customfields'];
if (count($fields) > 0) {
$fl = new FieldList();
$okcustom = $fl->storeDirectFieldsForUser($id_user, $fields);
}
}
return $id_user;
}
示例2: FieldList
/**
* @param string $id_folder folder destination of fields
* @param array $arr_fields an array with fields to attach to folder
* any element of folder is an array:
* key => array( 'fvalue', 'mandatory' )
* - key is the field name in current language
* - fvalue is the value of the field
* - mandatory is TRUE if this field is mandatory
*/
function _add_custom_fields($id_folder, $arr_fields)
{
require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
$fl = new FieldList();
$fl->setGroupFieldsTable($GLOBALS['prefix_fw'] . ORGCHAR_FIELDTABLE);
$fl->setFieldEntryTable($GLOBALS['prefix_fw'] . ORGCHAR_FIELDENTRYTABLE);
$arr_all_fields = $fl->getFlatAllFields(false, false, $this->default_lang);
// remove all fields
foreach ($arr_all_fields as $id_field => $ftranslation) {
$fl->removeFieldFromGroup($id_field, $id_folder);
}
$arr_all_fields_translation = array_flip($arr_all_fields);
$arr_fields_value = array();
// add selected fields
foreach ($arr_fields as $field_translation => $field_data) {
if (isset($arr_all_fields_translation[$field_translation])) {
$field_id = $arr_all_fields_translation[$field_translation];
$fl->addFieldToGroup($field_id, $id_folder, $field_data['mandatory']);
$arr_fields_value[$field_id] = $field_data['fvalue'];
} else {
die("Field non trovato: {$field_translation}");
}
}
$fl->storeDirectFieldsForUser($id_folder, $arr_fields_value, FALSE);
}