*/
/**
* Print a table with attributes and their current values
* @var array $attrs Attributes to print.
* @var array $entry Current LDAP entry array.
* @return void
*/
function directory_print_editable_attributes($attrs, $entry) {
global $color, $editprofile_langs, $ldq_attributes, $orgs3, $charset;
$toggle = false;
foreach($attrs as $attr) {
print '
';
print '' . $ldq_attributes[$attr]['text'] . ': '.
'';
/* Print widget */
if(false && $ldq_attributes[$attr]['lala']) {
print '';
directory_print_orgs3($orgs3, 0);
print ' ';
} elseif(isset($ldq_attributes[$attr]['posvals'])) {
foreach($ldq_attributes[$attr]['posvals'] as $p) {
print ' '.
''.$ldq_attributes[$p]['text'].' ';
}
} elseif(isset($ldq_attributes[$attr]['map'])) {
print '';
foreach($ldq_attributes[$attr]['map'] as $a=>$t) {
print ''.$t.' ';
}
print ' ';
} elseif(isset($ldq_attributes[$attr]['url'])) {
switch ($ldq_attributes[$attr]['url']) {
case 'eduorg':
print '';
directory_print_orgs3($orgs3, 0);
print ' ';
break;
case 'labeled':
if(isset($entry[0][$attr])) {
for($k=0; $k < $entry[0][$attr]['count']; $k++) {
$parts = explode(' ', $entry[0][$attr][$k], 2);
if(!isset($parts[1])) {
$parts[1] = '';
}
$labeleduris[$k]['url'] = $parts[0];
$labeleduris[$k]['desc'] = directory_string_convert($parts[1], 'UTF-8', $charset);
}
}
$k=0;
if(isset($labeleduris)) {
for($k=0; $k '.
_("Description:") . ' ';
}
}
print _("URL:") . ' '.
_("Description:") . ' ';
break;
case 'callto':
case 'mailto':
default:
print ' ';
}
/*
} elseif(isset($ldq_attributes[$attr]['posvals'])) {
print '';
foreach($posvals as $p) {
print ''.$ldq_attributes[$p]['text'].' ';
}
print ' ';
*/
} else {
if(empty($editprofile_langs)) {
$editprofile_langs = array('en');
}
foreach($editprofile_langs as $l) {
if($l != 'en') {
$a = $attr.';lang-'.$l;
} else {
$a = $attr;
}
if(sizeof($editprofile_langs) > 1) {
/* If only one language, don't bother displaying the language
* indicator. */
echo ' ';
}
echo ' ';
}
/*
print '