%#============================================================================ %# 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. %# %# %#---------------------------------------------------------------------------- <%perl> throw ePortal::Exception::ACL( -operation => 'read', -object => $app) unless $app->xacl_check_read; <&| /dialog.mc:edit_dialog, obj=> $dlgobject, width => 600, title => pick_lang(rus => "Добавить слово", eng => "Add a word") &> <& /dialog.mc:hidden, name => 'url_group_id', value => $ARGS{url_group_id} &> <& /list.mc:state_as_hidden &> <&| /dialog.mc:cell &> <% pick_lang(rus => "Слово:", eng => "Word:") %> <& /dialog.mc:textfield, obj => $dlgobject, name => 'title' &> <% pick_lang(rus => "Тип:", eng => "Type:") %> <& /dialog.mc:popup_menu, obj => $dlgobject, name => 'url_type' &> <& /dialog.mc:_buttons, ok_label => pick_lang(rus => "Добавить!", eng => "Add!"), cancel_button => 0 &>

<&| /list.mc, submit => 1, obj => $obj, restore_where => {url_group_id => $ARGS{url_group_id}} &> <&| /list.mc:row &> <& /list.mc:column_number &> <& /list.mc:column_image &> <& /list.mc:column, id=> 'title', order_by => 'title' &> <& /list.mc:column, id=> 'url_type', -align=>'center', order_by => 'url_type' &> <& /list.mc:column, id => 'ts', -align=>'center', order_by => 'ts' &> <& /list.mc:column_checkbox &> %# <& /list.mc:column_delete &> %#<& /list.mc:row_span, height => 4 &> <& /list.mc:action_bar, popup_menu => { -values => ['delete'], -labels => {delete => pick_lang(rus => "Удалить", eng => "Delete")} } &>

<% pick_lang(rus => "Обычный URL выглядит как http://домен/путь?параметры. Тип URL задает параметры где искать ключевые слова", eng => "Common URL looks like http://domain/path?parameters") %>

%#=== @METAGS onStartRequest ==================================================== <%method onStartRequest><& PARENT:onStartRequest, %ARGS &><%perl> $app = $ePortal->Application('SquidAcnt'); throw ePortal::Exception::Fatal(-text => 'url_group_id not known') if ( ! $ARGS{url_group_id} ); # ---------------------------------------------------------------------- # Dialog object $dlgobject = new ePortal::App::SquidAcnt::SAurl; $m->comp('/dialog.mc:handle_request', obj => $dlgobject, back_url => href('/app/SquidAcnt/url_list.htm', url_group_id => $ARGS{url_group_id}, $m->comp('/list.mc:state')), ); # ---------------------------------------------------------------------- # List object $obj = new ePortal::App::SquidAcnt::SAurl; my @delete_id = $m->comp('/list.mc:checkboxes'); if ($m->comp('/list.mc:list_action') eq 'delete') { foreach (@delete_id) { $obj->restore($_) && $obj->delete; } } # I do not like POST method because of list.mc if ( $r->method eq 'POST' ) { return href($ENV{SCRIPT_NAME}, url_group_id => $ARGS{url_group_id}, $m->comp('/list.mc:state')); } %#=== @metags once ========================================================= <%once> my ($obj, $app, $dlgobject); %#=== @metags cleanup ========================================================= <%cleanup> ($obj, $app, $dlgobject ) = ();