本文整理汇总了PHP中FieldList::fieldValue方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldList::fieldValue方法的具体用法?PHP FieldList::fieldValue怎么用?PHP FieldList::fieldValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldList
的用法示例。
在下文中一共展示了FieldList::fieldValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DoceboACLManager
function _get_LO_query($type = 'html', $report_data = NULL, $other = '')
{
require_once "report_tableprinter.php";
function is_showed($which, $data)
{
if (isset($data['columns_filter'])) {
return in_array($which, $data['columns_filter']['showed_columns']);
} else {
return false;
}
}
if ($report_data == NULL) {
$ref =& $_SESSION['report_tempdata'];
} else {
$ref =& $report_data;
}
$_rows =& $ref['rows_filter'];
$_cols =& $ref['columns_filter'];
$acl_man = new DoceboACLManager();
$acl_man->include_suspended = TRUE;
$all_users =& $_rows['all_users'];
//select root & descendants from orgchart instead
$all_courses =& $_cols['all_courses'];
$courses =& $_cols['selected_courses'];
$types =& $_cols['lo_types'];
$milestones =& $_cols['lo_milestones'];
$showed =& $_cols['showed_columns'];
$customcols =& $_cols['custom_fields'];
$order_by = isset($_cols['order_by']) ? $_cols['order_by'] : 'userid';
$order_dir = isset($_cols['order_dir']) ? $_cols['order_dir'] : 'asc';
$suspended = isset($_cols['show_suspended']) ? (bool) $_cols['show_suspended'] : false;
if ($all_users) {
$users =& $acl_man->getAllUsersIdst();
} else {
$users =& $acl_man->getAllUsersFromSelection($_rows['users']);
}
$temptypes = array();
foreach ($types as $val) {
$temptypes[] = "'" . $val . "'";
}
$tempmilestones = array();
foreach ($milestones as $val) {
switch ($val) {
case _MILESTONE_NONE:
$tempmilestones[] = "''";
$tempmilestones[] = "'-'";
break;
case _MILESTONE_START:
$tempmilestones[] = "'start'";
break;
case _MILESTONE_END:
$tempmilestones[] = "'end'";
break;
}
}
$colspans = array('user' => 0, 'course' => 0, 'lo' => 0);
foreach ($this->LO_columns as $val) {
if ($val['select']) {
if (in_array($val['key'], $showed)) {
switch ($val['key']) {
case 'user_name':
$colspans[$val['group']] += 2;
break;
default:
$colspans[$val['group']]++;
break;
}
}
} else {
if ($val['key'] == '_CUSTOM_FIELDS_') {
//do nothing ...
} else {
$colspans[$val['group']]++;
}
}
}
//custom user fields
require_once _adm_ . '/lib/lib.field.php';
$fman = new FieldList();
$field_values = array();
$temp_head2 = array();
foreach ($customcols as $val) {
if ($val['selected']) {
$colspans['user']++;
$temp_head2[] = $val['label'];
$field_values[$val['id']] = $fman->fieldValue((int) $val['id'], $users);
}
}
$lang = $this->lang;
$head1 = array();
$head1[] = array('colspan' => $colspans['user'], 'value' => $lang->def('_USER'));
//_TH_USER
$head1[] = array('colspan' => $colspans['course'], 'value' => $lang->def('_COURSE'));
//_TH_COURSE
$head1[] = array('colspan' => $colspans['lo'], 'value' => $lang->def('_LEARNING_OBJECTS'));
if ($this->use_mail) {
$head1[] = array('style' => 'img-cell', 'value' => $this->_loadEmailIcon());
}
$head2 = array();
foreach ($this->LO_columns as $val) {
//.........这里部分代码省略.........
示例2: array
$values = array();
switch ($id_field) {
case "name":
$acl_man = new DoceboACLManager();
$users = getSubscribed($id_course);
$allusers_info = $acl_man->getUsers($users);
while (list(, $user_info) = each($allusers_info)) {
$values[$user_info[ACL_INFO_IDST]] = $user_info[ACL_INFO_LASTNAME] . ' ' . $user_info[ACL_INFO_FIRSTNAME];
}
break;
case "email":
$acl_man = new DoceboACLManager();
$users = getSubscribed($id_course);
$allusers_info = $acl_man->getUsers($users);
while (list(, $user_info) = each($allusers_info)) {
$values[$user_info[ACL_INFO_IDST]] = $user_info[ACL_INFO_EMAIL];
}
break;
default:
$users = getSubscribed($id_course);
$values = $fman->fieldValue((int) $id_field, $users);
}
if ($id_field == 'name') {
} else {
}
require_once _base_ . '/lib/lib.json.php';
$json = new Services_JSON();
$output = $json->encode($values);
aout($output);
break;
}