/[A3C]/lib/A3C/View/Strix.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/View/Strix.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 157 by dpavlin, Sun Jun 15 10:51:57 2008 UTC revision 161 by dpavlin, Sun Jun 15 16:11:17 2008 UTC
# Line 85  template 'name_diff' => page { Line 85  template 'name_diff' => page {
85    
86  };  };
87    
88    =head2 sql
89    
90    Execute SQL query on site
91    
92    =cut
93    
94    template 'sql' => page {
95    
96            title is _('Execute SQL');
97    
98            my $action = new_action(
99                    class   => 'StrixSQL',
100                    moniker => 'strix-sql',
101                    sticky_on_success => 1,
102                    sticky_on_failure => 1,
103            );
104    
105            form {
106                    render_action( $action => [ 'strix', 'sql' ] );
107                    form_submit( label => _('Execute SQL') );
108            };
109    
110            if ( my $sql = $action->result->content('sql') ) {
111                    div { _('Found %1 results', $sql->count ) }
112                    table {
113                            row { map { th { $_ } } $sql->_column_names };
114                            while (my $row = $sql->next) {
115                                    row {
116                                            foreach my $col ( $sql->_column_names ) {
117                                                    warn "++ $col\n";
118                                                    cell { $row->$col }
119                                            }
120                                    }
121                            }
122                    }
123            }
124    };
125    
126  =head1 REGIONS  =head1 REGIONS
127    
128  =head2 search_sites  =head2 search_sites

Legend:
Removed from v.157  
changed lines
  Added in v.161

  ViewVC Help
Powered by ViewVC 1.1.26