%#============================================================================ %# ePortal - WEB Based daily organizer %# Author - S.Rusakov %# %# Copyright (c) 2000-2004 Sergey Rusakov. All rights reserved. %# This program is open source software %# %# %#----------------------------------------------------------------------------

<&| /dialog.mc:edit_dialog, title => pick_lang(rus => "Настройка секции", eng => "Section setup"), obj => $obj, focus => '', width => 500 &> %#<& /dialog.mc:read_only, id => 'component' &> % if (ref($comp) and $comp->method_exists('setup_dialog')) { <% $comp->call_method('setup_dialog', setupinfo => $obj->setupinfo_hash) %> % } else { <&| /dialog.mc:cell &> <& /message.mc, ErrorMessage => pick_lang( rus => "Секция ".$obj->title." не имеет настройки", eng => "The section ".$obj->title." does not support setup") &> % } <& /dialog.mc:buttons &>

%#=== @METAGS ControlBar ==================================================== <%def .ControlBar>
<% plink({rus => "Назад, на главную страницу", eng => "Back to home"}, -href => "/index.htm") %>
%#=== @METAGS onStartRequest ==================================================== <%method onStartRequest><%perl> $obj = new ePortal::UserSection; $obj->restore_or_throw($ARGS{objid}); $comp = $m->fetch_comp('/pv/sections/' . $obj->component); try { if ( $m->comp('/dialog.mc:isButtonPressed', button => 'ok') ) { my $hash = $obj->setupinfo_hash; $comp->call_method('setup_save', args => \%ARGS, setupinfo => $hash); # Save setupinfo hash to object $obj->setupinfo_hash($hash); if ( ref($comp) and $comp->method_exists('setup_validate') ) { $comp->call_method('setup_validate', $obj => $obj, setupinfo => $hash); } $obj->update; throw ePortal::Exception::Abort( -text => $m->comp('/dialog.mc:back_url')); } elsif ( $m->comp('/dialog.mc:isButtonPressed', button => 'cancel') ) { throw ePortal::Exception::Abort( -text => $m->comp('/dialog.mc:back_url')); } } catch ePortal::Exception::DataNotValid with { my $E = shift; $session{ErrorMessage} = $E->text; }; %#=== @metags once ========================================================= <%once> my ($obj, $comp); %#=== @metags cleanup ========================================================= <%cleanup> ($obj, $comp) = ();