Changeset 1772

Show
Ignore:
Timestamp:
04/04/08 20:05:22 (23 months ago)
Author:
bchoate
Message:

Fixed itemset actions to work for template listing screen. BugId:74595

Location:
branches/release-33
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/release-33/lib/MT/Template/ContextHandlers.pm

    r1765 r1772  
    931931    my $actions_top = ""; 
    932932    my $actions_bottom = ""; 
     933    my $form_id = "$id-form"; 
    933934    if ($show_actions) { 
    934         $actions_top = qq{<\$MTApp:ActionBar bar_position="top" hide_pager="$hide_pager"\$>}; 
    935         $actions_bottom = qq{<\$MTApp:ActionBar bar_position="bottom" hide_pager="$hide_pager"\$>}; 
     935        $actions_top = qq{<\$MTApp:ActionBar bar_position="top" hide_pager="$hide_pager" form_id="$form_id"\$>}; 
     936        $actions_bottom = qq{<\$MTApp:ActionBar bar_position="bottom" hide_pager="$hide_pager" form_id="$form_id"\$>}; 
    936937    } else { 
    937938        $listing_class .= " hide_actions"; 
     
    959960        $listing_header 
    960961    </div> 
    961     <form id="$id-form" class="listing-form" 
     962    <form id="$form_id" class="listing-form" 
    962963        action="$action" method="post" 
    963964        onsubmit="return this['__mode'] ? true : false"> 
     
    10061007    my ($ctx, $args, $cond) = @_; 
    10071008    my $pos = $args->{bar_position} || 'top'; 
     1009    my $form_id = $args->{form_id} ? qq{ form_id="$args->{form_id}"} : ""; 
    10081010    my $pager = $args->{hide_pager} ? '' 
    10091011        : qq{\n        <mt:include name="include/pagination.tmpl" bar_position="$pos">}; 
     
    10141016        <span class="button-actions actions">$buttons</span> 
    10151017        <span class="plugin-actions actions"> 
    1016     <mt:include name="include/itemset_action_widget.tmpl"> 
     1018    <mt:include name="include/itemset_action_widget.tmpl"$form_id> 
    10171019        </span> 
    10181020    </div> 
     
    13291331        my $res = $builder->build($ctx, $tokens, $cond); 
    13301332        return $ctx->error($builder->errstr) unless defined $res; 
    1331         $out .= $glue if $cnt > 1; 
    1332         $out .= $res; 
    1333         $cnt++; 
     1333        if ($res ne '') { 
     1334            $out .= $glue if $cnt > 1; 
     1335            $out .= $res; 
     1336            $cnt++; 
     1337        } 
    13341338    } 
    13351339    return $out; 
     
    16031607        my $res = $builder->build($ctx, $tokens, $cond); 
    16041608        return $ctx->error($builder->errstr) unless defined $res; 
    1605         $out .= $glue if $i > 1; 
    1606         $out .= $res; 
    1607         $i++; 
     1609        if ($res ne '') { 
     1610            $out .= $glue if $i > 1; 
     1611            $out .= $res; 
     1612            $i++; 
     1613        } 
    16081614    } 
    16091615    return $out; 
     
    47064712        defined(my $out = $builder->build($ctx, $tokens, $cond)) 
    47074713            or return $ctx->error( $builder->errstr ); 
    4708         push @res, $out; 
     4714        push @res, $out if $out ne ''; 
    47094715    } 
    47104716    my $sep = $args->{glue} || ''; 
  • branches/release-33/tmpl/cms/include/itemset_action_widget.tmpl

    r1309 r1772  
    2525</select> 
    2626</div> 
    27 <a href="javascript:void(0)" class="small-button" onclick="doPluginAction(getByID('<$mt:var name="object_type"$>-listing-form'), '<mt:if name="object_label_plural"><mt:var name="object_label_plural" escape="js"></mt:if>', '<__trans phrase="to act upon" escape="js">'); return false;"><__trans phrase="Go"></a> 
     27<a href="javascript:void(0)" class="small-button" onclick="doPluginAction(getByID('<mt:if name="form_id"><mt:var name="form_id"><mt:else><$mt:var name="object_type"$>-listing-form</mt:if>'), '<mt:if name="object_label_plural"><mt:var name="object_label_plural" escape="js"></mt:if>', '<__trans phrase="to act upon" escape="js">'); return false;"><__trans phrase="Go"></a> 
    2828</mt:if>