%#============================================================================ %# ePortal - WEB Based daily organizer %# Author - S.Rusakov %# %# Copyright (c) 2000-2004 Sergey Rusakov. All rights reserved. %# This program is open source software. %# %#---------------------------------------------------------------------------- <%init> <& /catalog/group_ring.mc, group => $C->id &> %if ($C->catname_1 eq '') { <& /message.mc, ErrorMessage => pick_lang( rus => "Данный ресурс не использует группировок", eng => "This is resource does not use groupping") &> %return; %}

<&| /rus.mc &> Ниже приведен список всех категорий (группировок), которые могут быть использованы при добавлении элементов в данный ресурс каталога (<% $C->Title |h %>). <&| /eng.mc &> Here is the list of all categories of the resource (<% $C->Title |h %>).
<% plink({rus => 'Вернуться к ресурсу', eng => 'Back to the resource'}, -href => '/catalog/'.$C->id . '/') %>

<& /item_caption.mc, title => pick_lang(rus => "Группировка 1-го уровня: ", eng => "Category 1:"), extra => $C->catname_1 &> <&| /list.mc, obj => new ePortal::CtlgCategory, id => 'L1', restore_where => { where => 'parent_id=? AND catnum=1', bind => [$C->id] }, &> <& /list.mc:column_image &> <& /list.mc:column, id => 'title' &> <& /list.mc:column_delete &>   <&| /dialog.mc, width => 300, title => pick_lang(rus => "Добавить группировку", eng => "Add category") &>
<% $C->catname_1 |h %>
  %#=== @metags onStartRequest ==================================================== <%method onStartRequest><%perl> $C = new ePortal::Catalog; $C->restore_or_throw($ARGS{objid}); # Add new category if ( $r->method eq 'POST' ) { if ( $ARGS{name} and $ARGS{catnum}) { my $dummy = new ePortal::CtlgCategory; $dummy->parent_id( $C->id ); $dummy->catnum( $ARGS{catnum} ); $dummy->Title( $ARGS{name} ); $dummy->insert; } # redirect to base edit form throw ePortal::Exception::Abort(-text => href('/catalog/compositecat_edit.htm', objid => $C->id)); } %#=== @METAGS attr ========================================================= <%attr> Title => {rus => "Категории ресурса", eng => "Categories of resource"} %#=== @METAGS once ========================================================= <%once> my($C); <%cleanup> $C = undef;