isReadOnly()) pla_error(_('You cannot perform updates while server is in read-only mode')); if (! $ldapserver->haveAuthInfo()) pla_error(_('Not enough information to login to server. Please check your configuration.')); $container = $_REQUEST['container']; $server_menu_html = server_select_list($ldapserver->server_id,true); include './header.php'; echo ''; printf('

%s

',_('Create Object')); printf('

%s

',_('Choose a template')); printf('

%s

',_('Select a template for the creation process')); echo '
'; printf('',htmlspecialchars($container)); echo ''; printf('',_('Server'),$server_menu_html); echo ''; printf('',_('Template')); echo ''; printf('', htmlspecialchars(_('Proceed >>'))); echo '
%s:%s
%s:'; echo ''; echo '
'; echo ''; $i = -1; $template_xml = new Templates($ldapserver->server_id); $templates = $template_xml->_template; # Remove non-visable templates. foreach ($templates as $index => $template) if (isset($template['visible']) && (! $template['visible'])) unset ($templates[$index]); $templates['custom']['title'] = 'Custom'; $templates['custom']['icon'] = 'images/object.png'; $count = count($templates); foreach ($templates as $name => $template) { $i++; # If the template doesnt have a title, we'll use the desc field. $template['desc'] = isset($template['title']) ? $template['title'] : $template['desc']; # Balance the columns properly if ((count($templates) % 2 == 0 && $i == intval($count / 2)) || (count($templates) % 2 == 1 && $i == intval($count / 2) + 1)) echo '
'; # Check and see if this template should be shown in the list $isValid = false; if (isset($template['regexp'])) { if (@preg_match('/'.$template['regexp'].'/i',$container)) $isValid = true; } else $isValid = true; if (isset($template['invalid']) && $template['invalid']) $isValid = false; echo ''; if (! $isValid || (isset($template['handler']) && ! file_exists(TMPLDIR.'creation/'.$template['handler']))) echo ''; else printf('', htmlspecialchars($name),htmlspecialchars($name), ! $isValid ? 'disabled' : (strcasecmp('Custom',$name) ? '' : 'checked')); printf('', htmlspecialchars($name),$template['icon']); printf(''; } echo '
'; echo '
'; echo '
'; echo '
'; ?>