[set page_perm]page[/set] [set ui_class]Content[/set] [set help_name]page.editor[/set] [set icon_name]icon_pages.gif[/set] [seti page_title]Edit [cgi ui_type] [cgi ui_name][/seti] [seti page_banner]Edit [cgi ui_type] [cgi ui_name][/seti] [comment]This modifies content when regular CGI submit is used[/comment] [if cgi ui_content_op] [tmp ce_status][content-modify][/tmp] [/if] [comment] This modifies content when silent process is used, set also in ContentEditor.pm [/comment] [set ce_modify][content-modify][/set] @_UI_STD_HEAD_@ [comment] These files are kept in lib/UI/pages/include so that there will be little chance of a parsing error. Include files: lib/UI/pages/include/*_editor They can be relocated to a catalog-specific place by copying to CATROOT/include. [/comment] [perl tables=mv_metadata] #open this puppy for [page-calc]; #probably returning from meta if($CGI->{item_id}) { $CGI->{ui_name} ||= $Scratch->{saved_ui_name}; $CGI->{ui_type} ||= $Scratch->{saved_ui_type}; $CGI->{ui_page_template} ||= $Scratch->{saved_ui_page_template}; } else { $Scratch->{saved_ui_name} = $CGI->{ui_name}; $Scratch->{saved_ui_type} = $CGI->{ui_type}; $Scratch->{saved_ui_page_template} = $CGI->{ui_page_template}; } unless ($CGI->{new} || $CGI->{ui_name} =~ /\S/) { $CGI->{new} = 1; $Tag->error({name => 'ui_name', set => 'Please supply name'}); } return; [/perl] [if cgi new] [form-session-id]

[calc] return errmsg("\u$CGI->{ui_type} name"); [/calc]

[set page_name_click] [calc] return unless $CGI->{ui_name} =~ /\S/; $CGI->{ui_name} =~ s/^\s+//; $CGI->{ui_name} =~ s/\s+$//; if($CGI->{ui_type} eq 'page') { $CGI->{ui_name} = $Tag->filter({ op => 'filesafe', body => $CGI->{ui_name}, }); } else { $CGI->{ui_name} =~ s/\W+/_/g; } return unless $CGI->{ui_type} eq 'page'; my $pat = quotemeta $Config->{HTMLsuffix}; #Debug("pat=$pat"); $pat = qr/$pat$/; #Debug("pat=$pat"); $CGI->{ui_name} .= $Config->{HTMLsuffix} unless $CGI->{ui_name} =~ $pat; #Debug("page=$CGI->{ui_name}"); return; [/calc] [/set]

[if cgi ui_type ne page] [L]Names may not contain non-word characters[/L] [/if]

[if cgi ui_type eq page]
[L]Template type[/L] | [display name=ui_page_template type=select passed="[content-info templates=1]" ]
[/if]

[elsif cgi ui_type eq component] [include include/component_editor] [/elsif] [elsif cgi ui_type eq template] [include include/template_editor] [/elsif] [else] [set page_name_click][/set] [if variable PAGE_EDITOR_STYLE] [include include/page_editor___PAGE_EDITOR_STYLE__] [else] [include include/page_editor] [/else] [/if] [/else] [/if] @_UI_STD_FOOTER_@