%#============================================================================
%# 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 => "Вставка HTML",
      eng => "HTML inset"),
			width => 500) %>
<% $dlg->field("number", hidden => 1, value => $ARGS{number}) %>
<% $dlg->field("page", hidden => 1, value => $ARGS{page}) %>

<% $dlg->row(pick_lang(rus => "Страница", eng => "Page"), $ARGS{page}) %>
<% $dlg->row(pick_lang(rus => "Номер вставки", eng => "Insent number"), $ARGS{number}) %>
<% $dlg->row("<hr>") %>
<% $dlg->row(
		pick_lang(rus => "Текст вставки", eng => "Insent text"),
    CGI::textarea({-name => 'inset',
      -class => 'dlgfield',
			-rows => 10, -columns => 70, -default => $inset})) %>
<% $dlg->row('&nbsp;') %>
<% $dlg->buttons() %>
<% $dlg->dialog_end %>
<p>


%#=== @METAGS attr =========================================================
<%attr>
Title => {rus => "Вставка HTML", eng => "HTML inset"}
</%attr>


%#=== @METAGS onStartRequest ====================================================
<%method onStartRequest><%perl>
	$inset_id = "inset$ARGS{number}_$ARGS{page}";
	$inset = $ePortal->Config($inset_id);

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

	if ($dlg->isButtonPressed("ok")) {
		$ePortal->Config($inset_id, $ARGS{inset});
	}

	return $location if $location;
</%perl></%method>




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

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

