%#============================================================================ %# ePortal - WEB Based daily organizer %# Author - S.Rusakov %# %# 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. %# %# %#---------------------------------------------------------------------------- %# %# Compose new message in a forum %#----------------------------------------------------------------------------

<% $dlg->dialog_start( width => 500, title => $prev_message ? pick_lang(rus => "Ответ на сообщение", eng => "Reply to message") : pick_lang(rus => "Новое сообщение", eng => "New message")) %> <% $dlg->field("forum_id", RO => 1) %> <% $dlg->field("prev_id", hidden => 1) %> % if (! $ARGS{prev_id}) { <% $dlg->field("title") %> % if ($forum->titleurl ) { <% $dlg->field('titleurl') %> % } %} else { <% $dlg->field("title", RO => 1) %> % } <% $dlg->row(pick_lang({rus => 'Иконка', eng => 'Icon'}), $m->scomp('compose.htm:icons', obj => $message)) %> <% $dlg->row('


') %> <% $dlg->field("body", vertical => 1) %> <% $dlg->row($m->scomp('compose.htm:smiles')) %> % if ($forum->xacl_check('xacl_attach')) { <% $dlg->row('
') %> <% $dlg->field("upload_file") %> % } <% $dlg->row('
') %> <% $dlg->buttons %> <% $dlg->dialog_end %>

<& SELF:javascript &> <& /inset.mc &>


<% pick_lang( rus => 'Правила написания сообщений', eng => 'Some guidlines of message writing') %>

% if ($ePortal->isAdmin) { % foreach my $sm (@ePortal::App::MsgForum::Smiles2) { % }}
<% pick_lang(rus => 'Фозможности форматирования текста', eng => 'Formatting the text') %>
[b]bold жирный[/b] bold жирный
[i]italic наклонный[/i] italic наклонный
[u]underline подчерк[/u] underline подчерк
[a href="..."]href ссылка[/a] href ссылка
[img src="..."] <% pick_lang(rus => "вставка картинки", eng =>"insert an image") %>
[font color="red"]red font[/font] red font
[span style="color:green;"]green font[/span] green font
:<% $sm %>:
%#=== @METAGS onStartRequest ==================================================== <%method onStartRequest><%perl> $message = new ePortal::App::MsgForum::MsgItem; if ( $ARGS{msgid} ) { if ( !$message->restore($ARGS{msgid}) ) { return "message_not_found.htm"; } } if ( $ARGS{forum_id} ) { $message->forum_id( $ARGS{forum_id}); } if ( $ARGS{prev_id} ) { $message->prev_id( $ARGS{prev_id}); } if ( $ARGS{reply_to} ) { $prev_message = new ePortal::App::MsgForum::MsgItem; if ( !$prev_message->restore($ARGS{reply_to}) ) { return "message_not_found.htm"; } $message->forum_id( $prev_message->forum_id ); if ( $ePortal->isAdmin ) { $message->Body( $prev_message->ReplyTo ); } $message->Title( $prev_message->Title ); } $dlg = new ePortal::HTML::Dialog( obj => $message, multipart_form => 1 ); my $location = try { $dlg->handle_request( ); } catch ePortal::Exception::DataNotValid with { my $E = shift; $session{ErrorMessage} = $E->text; ''; }; return $location if $location; $forum = new ePortal::App::MsgForum::MsgForum; if ( !$forum->restore($message->forum_id)) { return "forum_not_found.htm"; } if ( !$prev_message and !$forum->xacl_check('xacl_post') ) { return "no_rights.htm"; } if ( $prev_message and !$forum->xacl_check('xacl_reply') ) { return "no_rights.htm"; } %#=== @metags once ========================================================= <%once> my ($dlg, $obj); my $forum; my ($message, $prev_message); %#=== @metags cleanup ========================================================= <%cleanup> ($dlg, $obj) = (); ($message, $prev_message) = (); undef $forum; %#=== @METAGS attr ========================================================= <%attr> Title => {rus => "Новое сообщение", eng => "New message"} Layout => 'Dialog' %#=== @METAGS icons ==================================================== <%method icons> % my $obj = $ARGS{obj}; Picture? undef: ' checked' %>> <% pick_lang(rus=>'нет', eng =>'no') %>  % foreach my $opt (1..4, 'br', 5..8) { % if ($opt eq 'br') {
% next; } Picture == $opt? ' checked': undef %>> <% img(src => "/images/MsgForum/msg/$opt.gif") %>   % } %#=== @metags smiles ==================================================== <%method smiles> <% pick_lang( rus => "Для вставки рисунка щелкните на нем мышкой", eng => "Click a mouse on icon to insert it") %>
% foreach (@ePortal::App::MsgForum::Smiles) { % } <%perl> %#=== @METAGS javascript ==================================================== <%method javascript>