package SGN::View::Mason::Commands;
use strict;
use vars qw($m $c);
HTML::Mason::Component::FileBased->new(
'code' => sub {
use utf8; local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
HTML::Mason::Exception::Params->throw
    ( error =>
      "Odd number of parameters passed to component expecting name/value pairs"
    ) if @_ % 2;
my ( $object_id, $dbh, $person_id, $size );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( dbh ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 41 "/home/production/cxgn/sgn/mason/image/index.mas"
     $object_id = exists $pos{'object_id'} ? $_[ $pos{'object_id'} ] :  undef;
#line 42 "/home/production/cxgn/sgn/mason/image/index.mas"
    $dbh = $_[ $pos{'dbh'} ];
#line 43 "/home/production/cxgn/sgn/mason/image/index.mas"
     $person_id = exists $pos{'person_id'} ? $_[ $pos{'person_id'} ] :  undef;
#line 44 "/home/production/cxgn/sgn/mason/image/index.mas"
     $size = exists $pos{'size'} ? $_[ $pos{'size'} ] :  'medium';
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '
' );
#line 39 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '
' );
#line 46 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '
' );
#line 47 "/home/production/cxgn/sgn/mason/image/index.mas"
 

use SGN::Image;

if (!$object_id) { 
   print "<br /><br />No image is available with these parameters."; 
   return; 
 }

my $image = SGN::Image->new($dbh, $object_id);

#line 59 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '
' );
#line 60 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->comp(   '/page/page_title.mas', title=>"SGN Image ".$image->get_name()   
); #line 60 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '

' );
#line 62 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->comp( { content => sub {
#line 62 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '

    ' );
#line 64 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->comp(   '/page/form.mas', object_type=>'image', object_id=>"$object_id", form_name=> 'image_form', server_side_script => '/image/ajax/image_ajax_form.pl', form_div_name=>'image_info_div', js_object_name=> 'image_form', page_url => '/image/index.pl', alternate_new_button => ''   
); #line 64 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '

' );
#line 66 "/home/production/cxgn/sgn/mason/image/index.mas"
} }, '/page/info_section.mas', title=>"Image data"
 );
#line 66 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '

' );
#line 68 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->comp( { content => sub {
#line 68 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '
    ' );
#line 69 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->comp(   '/image/display_image.mas', image=>$image, size=>$size   
); #line 69 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '
' );
#line 70 "/home/production/cxgn/sgn/mason/image/index.mas"
} }, '/page/info_section.mas', title=>"Image"
 );
#line 70 "/home/production/cxgn/sgn/mason/image/index.mas"
$m->print( '
' );
;return;
},
'declared_args' => {
  '$dbh' => { default => undef },
  '$object_id' => { default => ' undef' },
  '$person_id' => { default => ' undef' },
  '$size' => { default => ' \'medium\'' }
},
'load_time' => 1763082844,

)
;