phpldapadmin/htdocs/schema.php

507 lines
16 KiB
PHP
Raw Normal View History

2009-06-30 08:07:14 +00:00
<?php
2009-06-30 11:46:44 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.67.2.1 2007/12/26 09:26:32 wurley Exp $
2009-06-30 09:22:30 +00:00
2009-06-30 09:29:51 +00:00
/**
2009-06-30 08:05:37 +00:00
* Displays the schema for the specified server_id
2009-06-30 09:29:51 +00:00
*
* Variables that come in as GET vars:
2009-06-30 08:05:37 +00:00
* - view (optional: can be 'attr' or empty. If 'attr', show that attribute)
* - attr (optional)
2009-06-30 09:29:51 +00:00
* - highlight_oid (optional)
*
* @package phpLDAPadmin
2009-06-30 08:05:37 +00:00
*/
2009-06-30 09:29:51 +00:00
/**
*/
2009-06-30 09:22:30 +00:00
require './common.php';
2009-06-30 08:05:37 +00:00
2009-06-30 11:46:44 +00:00
if (! $_SESSION[APPCONFIG]->isCommandAvailable('schema'))
2009-06-30 10:46:00 +00:00
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view schema')));
2009-06-30 09:22:30 +00:00
2009-06-30 10:46:00 +00:00
$entry['view'] = get_request('view','GET','false','objectClasses');
$entry['value'] = get_request('viewvalue','GET');
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
if (! is_null($entry['value'])) {
$entry['viewed'] = false;
$entry['value'] = strtolower($entry['value']);
}
2009-06-30 08:07:14 +00:00
2009-06-30 09:29:51 +00:00
$schema_error_str = sprintf('%s <b>%s</b>.<br /><br /></center>%s<ul><li>%s</li><li>%s</li><li>%s</li><li>%s</li></ul>',
2009-06-30 10:26:08 +00:00
_('Could not retrieve schema from'),htmlspecialchars($ldapserver->name),
_('This could happen for several reasons, the most probable of which are:'),_('The server does not fully support the LDAP protocol.'),
_('Your version of PHP does not correctly perform the query.'),_('phpLDAPadmin doesn\'t know how to fetch the schema for your server.'),
_('Or lastly, your LDAP server doesnt provide this information.'));
2009-06-30 08:05:37 +00:00
2009-06-30 10:46:00 +00:00
printf('<h3 class="title">%s <b>%s</b></h3>',
_('Schema for server'),
htmlspecialchars($ldapserver->name));
$entry['schema_types'] = array(
'objectClasses'=>'ObjectClasses',
'attributes'=>'Attribute Types',
'syntaxes'=>'Syntaxes',
'matching_rules'=>'Matching Rules');
echo '<br />';
echo '<center>';
$counter = 0;
foreach ($entry['schema_types'] as $item => $value) {
if ($counter++)
echo ' | ';
$entry['href'][$item] = sprintf('?cmd=schema&server_id=%s&view=%s&viewvalue=%%s',$ldapserver->server_id,$item);
$href = htmlspecialchars(sprintf($entry['href'][$item],''));
echo ($entry['view'] == $item ? _($value) : sprintf('<a href="%s">%s</a>',$href,_($value)));
}
echo '</center>';
echo '<br />';
switch($entry['view']) {
2009-06-30 09:29:51 +00:00
case 'syntaxes':
$highlight_oid = isset($_GET['highlight_oid']) ? $_GET['highlight_oid'] : false;
2009-06-30 10:46:00 +00:00
print '<table class="schema" border=0>';
printf('<tr class="name"><td>%s</td><td>%s</td></tr>',_('Syntax OID'),_('Description'));
2009-06-30 09:29:51 +00:00
$counter = 1;
2009-06-30 09:40:37 +00:00
$schema_syntaxes = $ldapserver->SchemaSyntaxes(null,true);
2009-06-30 09:29:51 +00:00
if (! $schema_syntaxes)
pla_error($schema_error_str);
foreach ($schema_syntaxes as $syntax) {
$counter++;
$oid = htmlspecialchars($syntax->getOID());
$desc = htmlspecialchars($syntax->getDescription());
if ($highlight_oid && $highlight_oid == $oid)
echo '<tr class="highlight">';
else
printf('<tr class="%s">',$counter%2==0?'even':'odd');
2009-06-30 10:46:00 +00:00
printf('<td class="type">%s</td><td class="type">%s</td></tr>',$oid,$desc);
2009-06-30 09:29:51 +00:00
}
print '</table>';
break;
case 'attributes':
2009-06-30 10:46:00 +00:00
$entry['attr_types'] = array(
'desc' => _('Description'),
'obsolete' => _('Obsolete'),
'inherits' => _('Inherits from'),
'equality' => _('Equality'),
'ordering' => _('Ordering'),
'substring_rule' => _('Substring Rule'),
'syntax' => _('Syntax'),
'single_valued' => _('Single Valued'),
'collective' => _('Collective'),
'user_modification' => _('User Modification'),
'usage' => _('Usage'),
'maximum_length' => _('Maximum Length'),
'aliases' => _('Aliases'),
'used_by_objectclasses' => _('Used by objectClasses')
);
2009-06-30 10:26:08 +00:00
$schema_attrs = $ldapserver->SchemaAttributes();
$schema_object_classes = $ldapserver->SchemaObjectClasses();
2009-06-30 09:29:51 +00:00
if (! $schema_attrs || ! $schema_object_classes)
pla_error($schema_error_str);
2009-06-30 08:07:14 +00:00
2009-06-30 10:26:08 +00:00
printf('<small>%s:</small>',_('Jump to an attribute type'));
2009-06-30 10:46:00 +00:00
echo '<form action="cmd.php" method="get">';
echo '<input type="hidden" name="cmd" value="schema" />';
printf('<input type="hidden" name="view" value="%s" />',$entry['view']);
2009-06-30 10:26:08 +00:00
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
2009-06-30 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
echo '<select name="viewvalue" onChange="submit()">';
echo '<option value=""> - all -</option>';
foreach ($schema_attrs as $name => $attr)
2009-06-30 09:29:51 +00:00
printf('<option value="%s" %s>%s</option>',
2009-06-30 10:46:00 +00:00
$name,$name == $entry['value'] ? 'selected ': '',$attr->getName());
2009-06-30 10:26:08 +00:00
echo '</select>';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
printf('<input type="submit" value="%s" /></form>',_('Go'));
echo '<br />';
2009-06-30 09:29:51 +00:00
foreach ($schema_attrs as $attr) {
2009-06-30 10:46:00 +00:00
if (is_null($entry['value']) || ! strcasecmp($entry['value'],$attr->getName())) {
if (! is_null($entry['value']))
$entry['viewed'] = true;
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
echo '<table class="schema" border=0>';
printf('<tr class="name"><td colspan=2><a name="%s">%s</a></td></tr>',
2009-06-30 09:29:51 +00:00
strtolower($attr->getName()),$attr->getName());
$counter = 0;
2009-06-30 10:46:00 +00:00
foreach ($entry['attr_types'] as $item => $value) {
2009-06-30 09:29:51 +00:00
printf('<tr class="%s">',++$counter%2 ? 'odd' : 'even');
2009-06-30 10:46:00 +00:00
printf('<td class="type">%s</td>',$value);
2009-06-30 09:29:51 +00:00
switch ($item) {
case 'desc':
printf('<td>%s</td>',
is_null($attr->getDescription()) ?
2009-06-30 10:26:08 +00:00
'('._('no description').')' : $attr->getDescription());
2009-06-30 09:29:51 +00:00
print '</tr>';
printf('<tr class="%s">',++$counter%2 ? 'odd' : 'even');
2009-06-30 10:46:00 +00:00
echo '<td class="type"><acronym title="Object Identier">OID</acronym></td>';
2009-06-30 09:29:51 +00:00
printf('<td>%s</td>',$attr->getOID());
break;
case 'obsolete':
2009-06-30 10:26:08 +00:00
printf('<td>%s</td>',$attr->getIsObsolete() ? '<b>'._('Yes').'</b>' : _('No'));
2009-06-30 09:29:51 +00:00
break;
case 'inherits':
print '<td>';
if (is_null($attr->getSupAttribute()))
2009-06-30 10:26:08 +00:00
printf('(%s)',_('none'));
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
else {
$href = htmlspecialchars(sprintf($entry['href']['attributes'],strtolower($attr->getSupAttribute())));
printf('<a href="%s">%s</a>',$href,$attr->getSupAttribute());
}
2009-06-30 09:29:51 +00:00
print '</td>';
break;
case 'equality':
2009-06-30 10:46:00 +00:00
print '<td>';
if (is_null($attr->getEquality()))
printf('(%s)',_('not specified'));
else {
$href = htmlspecialchars(sprintf($entry['href']['matching_rules'],$attr->getEquality()));
printf('<a href="%s">%s</a>',$href,$attr->getEquality());
}
print '</td>';
2009-06-30 09:29:51 +00:00
break;
case 'ordering':
printf('<td>%s</td>',
2009-06-30 10:26:08 +00:00
is_null($attr->getOrdering()) ? '('._('not specified').')' : $attr->getOrdering());
2009-06-30 09:29:51 +00:00
break;
case 'substring_rule':
printf('<td>%s</td>',
2009-06-30 10:26:08 +00:00
is_null($attr->getSubstr()) ? '('._('not specified').')' : $attr->getSubstr());
2009-06-30 09:29:51 +00:00
break;
case 'syntax':
print '<td>';
if (is_null($attr->getType())) {
echo $attr->getSyntaxOID();
} else {
2009-06-30 10:46:00 +00:00
$href = htmlspecialchars(sprintf($entry['href']['syntaxes'].'&highlight_oid=%s#%s','',
$attr->getSyntaxOID(),$attr->getSyntaxOID()));
printf('<a href="%s">%s (%s)</a>',$href,$attr->getType(),$attr->getSyntaxOID());
2009-06-30 09:29:51 +00:00
}
print '</td>';
break;
case 'single_valued':
2009-06-30 10:26:08 +00:00
printf('<td>%s</td>',$attr->getIsSingleValue() ? _('Yes') : _('No'));
2009-06-30 09:29:51 +00:00
break;
case 'collective':
2009-06-30 10:26:08 +00:00
printf('<td>%s</td>',$attr->getIsCollective() ? _('Yes') : _('No'));
2009-06-30 09:29:51 +00:00
break;
case 'user_modification':
2009-06-30 10:26:08 +00:00
printf('<td>%s</td>',$attr->getIsNoUserModification() ? _('No') : _('Yes'));
2009-06-30 09:29:51 +00:00
break;
case 'usage':
2009-06-30 10:26:08 +00:00
printf('<td>%s</td>',$attr->getUsage() ? $attr->getUsage() : '('._('not specified').')');
2009-06-30 09:29:51 +00:00
break;
case 'maximum_length':
print '<td>';
if ( is_null($attr->getMaxLength()))
2009-06-30 10:26:08 +00:00
echo '('._('not applicable').')';
2009-06-30 09:29:51 +00:00
else
printf('%s %s',number_format($attr->getMaxLength()),
2009-06-30 10:26:08 +00:00
$attr->getMaxLength()>1 ? _('characters') : _('character'));
2009-06-30 09:29:51 +00:00
print '</td>';
break;
case 'aliases':
print '<td>';
if (count($attr->getAliases()) == 0)
2009-06-30 10:46:00 +00:00
printf('(%s)',_('none'));
2009-06-30 09:29:51 +00:00
else
2009-06-30 10:46:00 +00:00
foreach ($attr->getAliases() as $alias_attr_name) {
$href = htmlspecialchars(sprintf($entry['href']['attributes'],strtolower($alias_attr_name)));
printf('<a href="%s">%s</a>',$href,$alias_attr_name);
}
2009-06-30 09:29:51 +00:00
print '</td>';
break;
case 'used_by_objectclasses':
print '<td>';
if (count($attr->getUsedInObjectClasses()) == 0)
2009-06-30 10:46:00 +00:00
printf('(%s)',_('none'));
2009-06-30 09:29:51 +00:00
else
2009-06-30 10:46:00 +00:00
foreach ($attr->getUsedInObjectClasses() as $used_in_oclass) {
$href = htmlspecialchars(sprintf($entry['href']['objectClasses'],strtolower($used_in_oclass)));
printf('<a href="%s">%s</a> ',$href,$used_in_oclass);
}
2009-06-30 09:29:51 +00:00
print '</td>';
break;
}
print '</tr>';
}
2009-06-30 10:46:00 +00:00
print '</table>';
echo '<br />';
2009-06-30 09:29:51 +00:00
}
2009-06-30 09:22:30 +00:00
}
2009-06-30 09:29:51 +00:00
break;
case 'matching_rules':
2009-06-30 09:40:37 +00:00
$schema_matching_rules = $ldapserver->MatchingRules(null,true);
2009-06-30 09:29:51 +00:00
if (! $schema_matching_rules)
pla_error($schema_error_str);
2009-06-30 10:26:08 +00:00
printf('<small>%s</small><br />',_('Jump to a matching rule'));
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
print '<form action="cmd.php" method="get">';
print '<input type="hidden" name="cmd" value="schema" />';
2009-06-30 10:26:08 +00:00
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
print '<input type="hidden" name="view" value="matching_rules" />';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
print '<select name="viewvalue" onChange="submit()">';
print '<option value=""> - all -</option>';
2009-06-30 09:29:51 +00:00
foreach ($schema_matching_rules as $rule)
printf('<option value="%s" %s>%s</option>',
$rule->getName(),
2009-06-30 10:46:00 +00:00
($rule->getName() == $entry['value'] ? 'selected': ''),
2009-06-30 09:29:51 +00:00
$rule->getName());
2009-06-30 10:26:08 +00:00
print '</select>';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
printf('<input type="submit" value="%s" />',_('Go'));
2009-06-30 09:29:51 +00:00
print '</form>';
2009-06-30 10:46:00 +00:00
print '<table class="schema" border=0>';
printf('<tr class="name"><td>%s</td><td>%s</td><td>%s</td></tr>',
2009-06-30 10:26:08 +00:00
_('Matching Rule OID'),_('Name'),_('Used by Attributes'));
2009-06-30 09:29:51 +00:00
$counter = 1;
foreach ($schema_matching_rules as $rule) {
$counter++;
$oid = htmlspecialchars($rule->getOID());
$desc = htmlspecialchars($rule->getName());
2009-06-30 10:46:00 +00:00
if ( is_null($entry['value']) || $entry['value'] == strtolower($rule->getName())) {
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
if (! is_null($entry['value']))
$entry['viewed'] = true;
2009-06-30 09:29:51 +00:00
if (null != $rule->getDescription())
$desc .= sprintf(' (%s)',$rule->getDescription());
if ( $rule->getIsObsolete())
2009-06-30 10:26:08 +00:00
$desc .= sprintf(' <span style="color:red">%s</span>',_('Obsolete'));
2009-06-30 09:29:51 +00:00
printf('<tr class="%s">',$counter%2 ? 'odd' : 'even');
2009-06-30 10:46:00 +00:00
printf('<td class="type">%s</td>',$oid);
printf('<td class="type">%s</td>',$desc);
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
print '<td class="type">';
2009-06-30 09:29:51 +00:00
if (count($rule->getUsedByAttrs()) == 0) {
2009-06-30 10:26:08 +00:00
printf('<center>(%s)</center><br /><br />',_('none'));
2009-06-30 09:29:51 +00:00
} else {
2009-06-30 10:46:00 +00:00
print '<table width=100% border=0><tr><td style="text-align: right">';
print '<form action="cmd.php" method="get">';
print '<input type="hidden" name="cmd" value="schema" />';
2009-06-30 09:29:51 +00:00
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
print '<input type="hidden" name="view" value="attributes" />';
print '<select style="width: 150px; color:black; background-color: #eee" size="4" name="viewvalue">';
foreach ($rule->getUsedByAttrs() as $attr)
printf('<option>%s</option>',$attr);
print '</select><br />';
2009-06-30 10:46:00 +00:00
2009-06-30 10:26:08 +00:00
printf('<input type="submit" value="%s" />',_('Go'));
2009-06-30 09:29:51 +00:00
print '</form>';
print '</td></tr></table>';
}
print '</td>';
print '</tr>';
}
2009-06-30 08:09:20 +00:00
}
2009-06-30 09:29:51 +00:00
print '</table>';
break;
case 'objectClasses':
2009-06-30 10:26:08 +00:00
$schema_oclasses = $ldapserver->SchemaObjectClasses();
2009-06-30 09:29:51 +00:00
if (! $schema_oclasses)
pla_error($schema_error_str);
2009-06-30 10:26:08 +00:00
printf('<small>%s:</small>',_('Jump to an objectClass'));
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
echo '<form action="cmd.php" method="get">';
echo '<input type="hidden" name="cmd" value="schema" />';
printf('<input type="hidden" name="view" value="%s" />',$entry['view']);
2009-06-30 10:26:08 +00:00
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
echo '<select name="viewvalue" onChange="submit()">';
echo '<option value=""> - all - </option>';
foreach ($schema_oclasses as $name => $oclass)
2009-06-30 09:29:51 +00:00
printf('<option value="%s" %s>%s</option>',
2009-06-30 10:46:00 +00:00
$name,$name == $entry['value'] ? 'selected ': '',$oclass->getName());
2009-06-30 10:26:08 +00:00
echo '</select>';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
printf('<input type="submit" value="%s" />',_('Go'));
echo '</form>';
2009-06-30 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
echo '<br />';
2009-06-30 09:29:51 +00:00
foreach ($schema_oclasses as $name => $oclass) {
2009-06-30 10:46:00 +00:00
if (is_null($entry['value']) || ($entry['value'] == $name)) {
if (! is_null($entry['value']))
$entry['viewed'] = true;
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
echo '<table class="schema_oclass" border=0>';
printf('<tr class="name"><td colspan=4><a name="%s">%s</a></td></tr>',$name,$oclass->getName());
printf('<tr class="detail"><td colspan=4>%s: <b>%s</b></td></tr>',_('OID'),$oclass->getOID());
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
if ($oclass->getDescription())
2009-06-30 10:46:00 +00:00
printf('<tr class="detail"><td colspan=4>%s: <b>%s</b></td></tr>',_('Description'),$oclass->getDescription());
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
printf('<tr class="detail"><td colspan=4>%s: <b>%s</b></td></tr>',_('Type'),$oclass->getType());
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
if ($oclass->getIsObsolete())
2009-06-30 10:46:00 +00:00
printf('<tr class="detail"><td colspan=4>%s</td></tr>',_('This objectClass is obsolete.'));
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
printf('<tr class="detail"><td colspan=4>%s: <b>',_('Inherits from'));
2009-06-30 09:29:51 +00:00
if (count($oclass->getSupClasses()) == 0)
2009-06-30 10:26:08 +00:00
printf('(%s)',_('none'));
2009-06-30 09:29:51 +00:00
else
foreach ($oclass->getSupClasses() as $i => $object_class) {
2009-06-30 10:46:00 +00:00
$href = htmlspecialchars(sprintf($entry['href']['objectClasses'],strtolower($object_class)));
printf('<a title="%s" href="%s">%s</a>',
_('Jump to this objectClass definition'),$href,$object_class);
2009-06-30 09:29:51 +00:00
if ($i < count($oclass->getSupClasses()) - 1)
2009-06-30 10:26:08 +00:00
echo ', ';
2009-06-30 09:29:51 +00:00
}
2009-06-30 10:46:00 +00:00
echo '</b></td></tr>';
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
printf('<tr class="detail"><td colspan=4>%s: <b>',_('Parent to'));
if (strcasecmp($oclass->getName(),'top') == 0) {
$href = htmlspecialchars(sprintf($entry['href']['objectClasses'],''));
printf('(<a href="%s">all</a>)',$href);
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
} elseif (count($oclass->getChildObjectClasses()) == 0)
2009-06-30 10:26:08 +00:00
printf('(%s)',_('none'));
2009-06-30 09:29:51 +00:00
else
foreach ($oclass->getChildObjectClasses() as $i => $object_class) {
2009-06-30 10:46:00 +00:00
$href = htmlspecialchars(sprintf($entry['href']['objectClasses'],strtolower($object_class)));
printf('<a title="%s" href="%s">%s</a>',_('Jump to this objectClass definition'),$href,$object_class);
2009-06-30 09:29:51 +00:00
if ( $i < count($oclass->getChildObjectClasses()) - 1)
2009-06-30 10:26:08 +00:00
echo ', ';
2009-06-30 09:29:51 +00:00
}
2009-06-30 10:46:00 +00:00
echo '</b></td></tr>';
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
printf('<tr class="attrshead"><td class="left">&nbsp;</td><td><b>%s</b></td><td><b>%s</b></td><td class="right">&nbsp;</td></tr>',
_('Required Attributes'),_('Optional Attributes'));
2009-06-30 09:22:30 +00:00
2009-06-30 10:46:00 +00:00
echo '<tr class="attrs">';
echo '<td class="left">&nbsp;</td>';
2009-06-30 10:26:08 +00:00
echo '<td>';
2009-06-30 10:46:00 +00:00
2009-06-30 09:29:51 +00:00
if (count($oclass->getMustAttrs($schema_oclasses)) > 0) {
2009-06-30 10:46:00 +00:00
echo '<ul class="schema">';
2009-06-30 09:29:51 +00:00
foreach ($oclass->getMustAttrs($schema_oclasses) as $attr) {
2009-06-30 10:26:08 +00:00
echo '<li>';
2009-06-30 10:46:00 +00:00
$href = htmlspecialchars(sprintf($entry['href']['attributes'],strtolower($attr->getName())));
printf('<a href="%s">%s</a>',$href,$attr->getName());
2009-06-30 09:29:51 +00:00
if ($attr->getSource() != $oclass->getName()) {
2009-06-30 10:26:08 +00:00
echo '<br />';
2009-06-30 10:46:00 +00:00
$href = htmlspecialchars(sprintf($entry['href']['objectClasses'],strtolower($attr->getSource())));
printf('<small>(%s <a href="%s">%s</a>)</small>',_('Inherited from'),$href,$attr->getSource());
2009-06-30 09:29:51 +00:00
}
2009-06-30 10:26:08 +00:00
echo '</li>';
2009-06-30 08:09:20 +00:00
}
2009-06-30 10:26:08 +00:00
echo '</ul>';
2009-06-30 09:29:51 +00:00
} else
2009-06-30 10:46:00 +00:00
printf('(%s)',_('none'));
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
echo '</td>';
2009-06-30 10:46:00 +00:00
echo '<td>';
2009-06-30 09:29:51 +00:00
if (count($oclass->getMayAttrs($schema_oclasses)) > 0) {
2009-06-30 10:46:00 +00:00
echo '<ul class="schema">';
2009-06-30 09:29:51 +00:00
foreach ($oclass->getMayAttrs($schema_oclasses) as $attr) {
2009-06-30 10:26:08 +00:00
echo '<li>';
2009-06-30 10:46:00 +00:00
$href = htmlspecialchars(sprintf($entry['href']['attributes'],strtolower($attr->getName())));
printf('<a href="%s">%s</a>',$href,$attr->getName());
2009-06-30 09:29:51 +00:00
if ($attr->getSource() != $oclass->getName()) {
2009-06-30 10:26:08 +00:00
echo '<br />';
2009-06-30 10:46:00 +00:00
$href = htmlspecialchars(sprintf($entry['href']['objectClasses'],strtolower($attr->getSource())));
printf('<small>(%s <a href="%s">%s</a>)</small>',_('Inherited from'),$href,$attr->getSource());
2009-06-30 09:29:51 +00:00
}
2009-06-30 10:26:08 +00:00
echo '</li>';
2009-06-30 09:29:51 +00:00
}
2009-06-30 10:26:08 +00:00
echo '</ul>';
2009-06-30 09:29:51 +00:00
} else
2009-06-30 10:46:00 +00:00
printf('(%s)',_('none'));
2009-06-30 08:05:37 +00:00
2009-06-30 10:26:08 +00:00
echo '</td>';
2009-06-30 10:46:00 +00:00
echo '<td class="right">&nbsp;</td>';
2009-06-30 10:26:08 +00:00
echo '</tr>';
echo '</table>';
2009-06-30 10:46:00 +00:00
echo '<br />';
2009-06-30 09:29:51 +00:00
}
} /* End foreach objectClass */
break;
}
2009-06-30 10:46:00 +00:00
if (! is_null($entry['value']) && ! $entry['viewed'])
pla_error(sprintf(_('No such schema item: "%s"'),htmlspecialchars($entry['value'])));
?>