%#============================================================================
%# ePortal - WEB Based daily organizer
%# Author - S.Rusakov <rusakov_sa@users.sourceforge.net>
%#
%# Copyright (c) 2000-2003 Sergey Rusakov.  All rights reserved.
%# This program is free software; you can redistribute it
%# and/or modify it under the same terms as Perl itself.
%#
%#
%#----------------------------------------------------------------------------
&nbsp;
<% $dlg->dialog_start(title => pick_lang(rus => "Секция", eng => "Section"),
  width => 600 ) %>

% if ($dlg->{obj}->component eq '') {
	<% $dlg->field('component') %>
	<% $dlg->buttons(more_button => 1, ok_button => 0) %>

% } else {

	<% $dlg->field('component', RO => 1) %>
	<% $dlg->row('<hr>') %>
% foreach my $field (qw/title width url memo params xacl_read/) {
	<% $dlg->field($field) %>
% }

	<% $dlg->buttons %>

% } # if component eq ''
<% $dlg->dialog_end %>
&nbsp;<p>

<%perl>
  my $module = "/pv/sections/" . $dlg->{obj}->component;
  my $comp = $m->fetch_comp($module);
  if ( $comp and $comp->method_exists("Help") ) {
    $comp->call_method("Help");
  }
  undef $dlg;
</%perl>



%#=== @METAGS attr =========================================================
<%attr>
Title => {rus => "Редактирование секции домашней страницы", eng => "Edit section"}
require_admin => 1
</%attr>


%#=== @METAGS onStartRequest ====================================================
<%method onStartRequest><%perl>

	$dlg = new ePortal::HTML::Dialog( obj => new ePortal::PageSection);
  my $location = try {
    $dlg->handle_request( );
  } catch ePortal::Exception::DataNotValid with {
    my $E = shift;
    $session{ErrorMessage} = $E->text;
    '';
  };
  return $location if $location;

	# Fill object with default values
	if ($dlg->isButtonPressed('more')) {
		$dlg->{obj}->LoadDefaults( $ARGS{component} );
	}

</%perl></%method>


%#=== @metags once =========================================================
<%once>
my ($dlg, $obj);
</%once>

%#=== @metags cleanup =========================================================
<%cleanup>
($dlg, $obj) = ();
</%cleanup>

