dnExists($request['dn'])) error(sprintf(_('The entry (%s) does not exist.'),$request['dn']),'error','index.php'); $request['page'] = new TemplateRender($app['server']->getIndex(),get_request('template','REQUEST',false,null)); $request['page']->setDN($request['dn']); $request['page']->accept(true); $request['template'] = $request['page']->getTemplate(); # Render the form if (get_request('meth','REQUEST') != 'ajax') { $request['page']->drawTitle(sprintf('%s %s',_('Add new attribute'),get_rdn($request['dn']))); $request['page']->drawSubTitle(); echo '
'; if (count($request['template']->getAvailAttrs())) { # If we have more than the configured entries, we'll separate our input to the old ways. if (count($request['template']->getAvailAttrs()) > $_SESSION[APPCONFIG]->getValue('appearance','max_add_attrs')) { $attr = array(); $attr['avail'] = array(); $attr['binary'] = array(); foreach ($request['template']->getAvailAttrs() as $attribute) if ($app['server']->isAttrBinary($attribute->getName())) array_push($attr['binary'],$attribute); else array_push($attr['avail'],$attribute); if (count($attr['avail']) > 0) { echo '
'; echo _('Add new attribute'); echo '
'; echo '
'; echo '
'; echo '
'; if ($_SESSION[APPCONFIG]->getValue('confirm','update')) echo ''; else echo ''; printf('',$app['server']->getIndex()); printf('',htmlspecialchars($request['dn'])); echo ''; echo ''; printf('',_('Add')); echo '
'; echo '
'; } else { echo '
'; printf('(%s)',_('no new attributes available for this entry')); } if (count($attr['binary']) > 0) { echo '
'; echo _('Add new binary attribute'); echo '
'; echo '
'; echo ''; echo '
'; echo '
'; if ($_SESSION[APPCONFIG]->getValue('confirm','update')) echo ''; else echo ''; printf('',$app['server']->getIndex()); printf('',$request['dn']); echo ''; echo ''; echo ''; printf('',_('Add')); if (! ini_get('file_uploads')) printf('
%s
', _('Your PHP configuration has disabled file uploads. Please check php.ini before proceeding.')); else printf('
%s: %s
',_('Maximum file size'),ini_get('upload_max_filesize')); echo '
'; echo '
'; } else { echo '
'; printf('(%s)',_('no new binary attributes available for this entry')); } } else { echo '
'; $request['page']->drawFormStart(); printf('',$app['server']->getIndex()); printf('',htmlspecialchars($request['dn'])); echo ''; foreach ($request['template']->getAvailAttrs() as $attribute) $request['page']->draw('Template',$attribute); $request['page']->drawFormSubmitButton(); echo '
'; $request['page']->drawFormEnd(); } } else { printf('(%s)',_('no new attributes available for this entry')); } echo '
'; # The ajax addition (it is going into an existing TemplateRendered page } else { # Put our DIV there for the callback echo '
'; printf('%s',_('Add Attribute')); echo '
'; echo ''; echo ''; echo '
'; printf(''; echo '
'; echo '
'; echo '
'; } ?>