2 # Select which schema files are included
4 require './ldap-server-lib.pl';
5 &local_ldap_server() == 1 || &error($text{'slapd_elocal'});
6 $access{'schema'} || &error($text{'schema_ecannot'});
7 &ui_print_header(undef, $text{'schema_title'}, "", "schema");
10 if (&get_config_type() == 1) {
11 $conf = &get_config();
12 foreach $i (&find_value("include", $conf)) {
13 if ($i =~ /^(.*)\// && $1 eq $config{'schema_dir'}) {
20 # Show a table of all known schema files, with checkboxes
21 print $text{'schema_pagedesc'},"<p>\n";
22 @tds = ( $editable ? ( "width=5" ) : ( ),
23 "width=20%", "width=65%", "width=10%", "width=5% nowrap" );
24 print &ui_form_start("save_schema.cgi", "post");
25 print &ui_columns_start([ $editable ? ( "" ) : ( ),
29 $editable ? ( $text{'schema_move'} ) : ( ) ],
31 @files = sort { &schema_sorter } &list_schema_files();
32 for($i=0; $i<@files; $i++) {
34 @acts = ( "<a href='view_sfile.cgi?file=".&urlize($s->{'file'})."'>".
35 "$text{'schema_view'}</a>",
36 "<a href='edit_sfile.cgi?file=".&urlize($s->{'file'})."'>".
37 "$text{'schema_edit'}</a>" );
38 if ($incs{$s->{'file'}}) {
39 $mover = &ui_up_down_arrows(
40 "up_schema.cgi?file=".&urlize($s->{'file'}),
41 "down_schema.cgi?file=".&urlize($s->{'file'}),
43 $i && $i < @files-1 && $incs{$files[$i+1]->{'file'}});
49 # With move / enable checkbox
50 print &ui_checked_columns_row(
52 $s->{'desc'} || $s->{'file'},
53 &ui_links_row(\@acts),
56 \@tds, "d", $s->{'file'}, $incs{$s->{'file'}},
57 $s->{'name'} eq 'core');
61 print &ui_columns_row(
63 $s->{'desc'} || $s->{'file'},
64 &ui_links_row(\@acts) ], \@tds);
67 print &ui_columns_end();
68 print &ui_form_end($editable ? [ [ undef, $text{'save'} ] ] : [ ]);
70 &ui_print_footer("", $text{'index_return'});
74 return ($incs{$a->{'file'}} || 999) <=> ($incs{$b->{'file'}} || 999);