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, $object_type, $referer );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

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

#line 1 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print( '
' );
#line 40 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print( '
' );
#line 46 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print( '
' );
#line 47 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->comp(   '/util/import_javascript.mas', classes=>[ 'CXGN.Page.Comments', 'MochiKit.Async' ]   
); #line 47 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print( '

' );
#line 49 "/home/production/cxgn/sgn/mason/page/comments.mas"


our %urlencode;
use Tie::UrlEncoder;
use CXGN::Page::FormattingHelpers qw / info_section_html / ;

if ($object_id!~/^\d+$/) { return; }


    # object_type would be something like "marker" or "bac"
    # object_id would be the marker_id or the clone_id

    my $placeholder = info_section_html(
        title=>"User comments",
        contents=>qq{<!-- check for comments only shows up when AJAX is not enabled
     (old browsers, buggy ajax) -->
Please wait, checking for comments.  (If comments do not show up, access them <a href="/forum/return_comments.pl?type=$object_type&amp;id=$object_id">here</a>)}
    );

my $encoded_referer = $urlencode{ $referer || '' };



#line 73 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print( '

<span class="noshow" id="referer">' );
#line 75 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print(  $encoded_referer  );
#line 75 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print( '</span>
<span class="noshow" id="commentstype">' );
#line 76 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print(  $object_type  );
#line 76 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print( '</span>
<span class="noshow" id="commentsid">' );
#line 77 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print(  $object_id  );
#line 77 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print( '</span>
<div id="commentsarea">
  ' );
#line 79 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print(  $placeholder  );
#line 79 "/home/production/cxgn/sgn/mason/page/comments.mas"
$m->print( '
</div>



' );
;return;
},
'declared_args' => {
  '$object_id' => { default => undef },
  '$object_type' => { default => undef },
  '$referer' => { default => undef }
},
'load_time' => 1763079528,

)
;