Commit info for scoop/lib/Scoop/Comments:

Modified Files:
      Tag: scoop-1
	Format.pm Post.pm 
Log Message:
Comment post form to database. (Tested by hillct, but his cvs password
doesn't seem to be working at the moment, so I'm committing it.)

-janra



Index: Format.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Comments/Format.pm,v
retrieving revision 1.50
retrieving revision 1.50.4.1
diff -r1.50 -r1.50.4.1
50,59d49
< 	#else {
< 	#	my $perm = $S->have_perm('editorial_comments');
< 	#	my $warning = qq|cid=$cid -
< 	#			commentcid=$comment->{cid} -
< 	#			var=$S->{UI}->{VARS}->{restrict_editorial_comments} -
< 	#			perm=$perm -
< 	#			pending=$comment->{pending} -|;
< 	#	warn "$warning";
< 	#}
< 

Index: Post.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Comments/Post.pm,v
retrieving revision 1.70
retrieving revision 1.70.4.1
diff -r1.70 -r1.70.4.1
13c13,14
< 	my $mode = $S->{CGI}->param('mode');
---
> 	my $preview = $S->{CGI}->param('preview');
> 	my $post = $S->{CGI}->param('post');
21a23,25
> 	my $keys;
> 	$keys->{'sid'} = $sid;
> 	$keys->{'pid'} = $pid;
80,81c84
< 	my $form = qq|
< 	<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>|;
---
> 	my $form = $S->{UI}->{BLOCKS}->{comment_post_form};
84,85c87,88
< 	my $here = 'here';
< 	if ($mode eq 'Preview') {
---
> 	$keys->{'here'} = 'here';
> 	if ($preview) {
97d99
< 			#mode => 'alone',
106,119c108,110
< 		$form .= qq|
< 		<TR>
< 			<TD BGCOLOR="%%title_bgcolor%%" WIDTH="100%">
< 				<A NAME="here">%%title_font%%<B>Preview Comment</B>%%title_font_end%%</A>
< 			</TD>
< 		</TR>
< 		<TR>
< 			<TD>
< 			$S->{UI}->{BLOCKS}->{COMM_ERR}
< 			<TABLE WIDTH=98% BORDER=0 CELLPADDING=0 CELLSPACING=0>
< 				<TR>
< 					<TD>|;
< 			
< 		$form .= $S->format_comment($pre_comment);
---
> 		$keys->{'preview_msg'} = $S->{UI}->{BLOCKS}->{comment_preview_msg};
> 
> 		$keys->{'PRE_COMMENT'} = $S->format_comment($pre_comment);
121,128c112
< 		$form .= qq|
< 					</TD>
< 				</TR>
< 			</TABLE>
< 			
< 			</TD>
< 		</TR>|;
< 		$here = 'there';
---
> 		$keys->{'here'} = 'there';
131,138c115,117
< 	$form .= qq|
< 		<TR>
< 			<TD BGCOLOR="%%title_bgcolor%%" WIDTH="100%">
< 				<A NAME="$here">%%title_font%%<B>Post Comment</B>%%title_font_end%%</A>
< 			</TD>
< 		</TR>|;
< 	
< 	my $anon = $S->get_nick('-1');
---
> 	$keys->{'not_logged_in'} = $S->{UI}->{BLOCKS}->{comment_not_logged_in} if ($S->{UID} <= 0);
> 
> 	my $anon = $S->get_nick_from_uid('-1');
140,175c119
< 	
< 	$form .= qq|
< 		<TR>
< 			<TD>%%norm_font%%|;
< 			
< 	if ($S->{UID} <= 0) {
< 		$form .= qq|
< 			You are not logged in. If you don't have a user account yet, by all means <A HREF="%%rootdir%%/newuser">go make one</A>!
< 			If you do have one, you can post as "yourself" by filling in your nickname and password below. Otherwise, your comment will be posted as <B>$anon</B>.
< 				<P>|; #'
< 	}
< 	$form .= $S->{UI}->{BLOCKS}->{commentdisclaimer}.'<P>';
< 	
< 	my $formkey_element = $S->get_formkey_element();
< 	
< 	$form .= qq|
< 		<FORM NAME="postcomment" ACTION="%%rootdir%%/#here" METHOD="POST">
< 		<INPUT TYPE="hidden" NAME="cid" VALUE="$pid">
< 		<INPUT TYPE="hidden" NAME="sid" VALUE="$sid">
< 		<INPUT TYPE="hidden" NAME="op" VALUE="comments">
< 		<INPUT TYPE="hidden" NAME="tool" VALUE="post">
< 		$formkey_element
< 		
< 		<TABLE ALIGN="center" BORDER=0 CELLPADDING=3 CELLSPACING=0>|;
< 	
< 	if ($S->{UID} <= 0) {
< 		$form .= qq|
< 			<TR>
< 				<TD>%%norm_font%%Nickname: 
< 				<INPUT TYPE="text" SIZE="30" NAME="uname">%%norm_font_end%%</TD>
< 			</TR>
< 			<TR>
< 				<TD>%%norm_font%%Password: 
< 				<INPUT TYPE="password" SIZE="30" NAME="pass">%%norm_font_end%%</TD>
< 			</TR>|;
< 	}
---
> 	my $content = '';
177,190c121,126
< 	# this has been modified so that the drop down box for "Post As"
< 	# doesn't appear unless anonymous posts are permitted
< 	if( $S->{UID} > 0 && $S->have_perm('comment_post','Anonymous')) {
< 		$form .= qq|
< 			<TR>
< 				<TD>%%norm_font%%Post as: 
< 				<SELECT SIZE=1 NAME="uid">
< 				<OPTION VALUE="$S->{UID}">$self
< 				<OPTION VALUE="-1">$anon
< 				</SELECT>|;
< 	} else {
< 		$form .= qq|
< 		<TR>
< 		<TD>%%norm_font%%|;
---
> 	if ( $S->{UID} > 0 && $S->have_perm('comment_post','Anonymous') ) {
> 		$keys->{'post_as'} = qq|Post as:
> 			<SELECT SIZE=1 NAME="uid">
> 			<OPTION VALUE="$S->{UID}">$self
> 			<OPTION VALUE="-1">$anon
> 			</SELECT>|;
193,196c129,130
< 	if ($S->{UID} <= 0) {
< 		$form .= qq|[ <A HREF="%%rootdir%%/newuser">Create Account</A> ]%%norm_font_end%%|;
< 	}
< 	
---
> 	$keys->{'formkey_element'} = $S->get_formkey_element();
> 
200c134
< 		$form .= $S->pending_select($pending);                
---
> 		$keys->{'pending_form'} = $S->pending_select($pending);                
210c144
< 		$form .= qq|<INPUT TYPE="hidden" NAME="pending" VALUE="$pending">|;
---
> 		$keys->{'pending_form'} = qq|<INPUT TYPE="hidden" NAME="pending" VALUE="$pending">|;
216,218d149
< 	$form .= qq|
< 		</TD></TR>|;
< 
222,229d152
< 	#$subject =~ s/&amp;/&/g;
< 	#$subject =~ s/&/&amp;/g;	
< 	
< 	#$comment =~ s/&amp;/&/g;
< 	#$comment =~ s/&/&amp;/g;
< 	
< 	#$subject =~ s/\%\%/&#37;&#37;/g;
< 	#$comment =~ s/\%\%/&#37;&#37;/g;
233,254c156,162
< 	#$subject =~ s/"/&quot;/g;
< 	my $textarea_cols= $S->{prefs}->{textarea_cols} || $S->{UI}->{VARS}->{default_textarea_cols};
< 	my $textarea_rows= $S->{prefs}->{textarea_rows} || $S->{UI}->{VARS}->{default_textarea_rows};
< 	$form .= qq|
< 		<TR>
< 			<TD>
< 			%%norm_font%%Subject:%%norm_font_end%%<BR>
< 			%%norm_font%%<INPUT TYPE="text" size=50 name="subject" VALUE="$subject" maxlength=50>%%norm_font_end%%
< 			</TD>
< 		</TR>
< 		<TR>
< 			<TD>
< 			%%norm_font%%Comment:%%norm_font_end%%<BR>
< 			%%norm_font%%<TEXTAREA NAME="comment" COLS=$textarea_cols ROWS=$textarea_rows WRAP="soft">$comment</TEXTAREA>%%norm_font_end%%
< 			</TD>
< 		</TR>|;
< 
< 
< 	my $sig_opt  = $S->_sig_option_form($user);
< 	my $post_opt = $S->_postmode_option_form();
< 	my $allow_tags = $S->html_checker->allowed_html_as_string('comment') 
< 		unless ($S->{UI}->{VARS}->{hide_comment_allowed_html});
---
> 	$keys->{'textarea_cols'} = $S->{prefs}->{textarea_cols} || $S->{UI}->{VARS}->{default_textarea_cols};
> 	$keys->{'textarea_rows'} = $S->{prefs}->{textarea_rows} || $S->{UI}->{VARS}->{default_textarea_rows};
> 	$keys->{'subject'} = $subject;
> 	$keys->{'comment_body'} = $comment;
> 
> 	$keys->{'post_opt'} = $S->_postmode_option_form();
> 	$keys->{'allow_tags'} = $S->html_checker->allowed_html_as_string('comment') unless ($S->{UI}->{VARS}->{hide_comment_allowed_html});
262,267c170,171
< 		$form .= qq|
< 		<TR>
< 			<TD>%%norm_font%%Spellcheck text (will force "Preview"): 
< 			<INPUT TYPE="checkbox" NAME="spellcheck" VALUE="1"$checked>
< 			%%norm_font_end%%</TD>
< 		</TR>|;
---
> 		$keys->{'spellcheck_form'} = $S->{UI}->{BLOCKS}->{spellcheck_form_item};
> 		$keys->{'spellcheck_form'} =~ s/%%checked%%/$checked/;
271,274c175,176
< 		$form .= qq|	
< 		<TR>
< 			<TD>%%norm_font%%Signature Behavior: $sig_opt %%norm_font_end%%</TD>
< 		</TR>|;
---
> 		my $sig_opt  = $S->_sig_option_form($user);
> 		$keys->{'sig_behavior_form'} = qq{Signature Behavior: $sig_opt};
276,278d177
< 	
< 	$form .= qq|
< 		<TR>
280,297c179
<  			<TD>%%norm_font%%
< 			<INPUT TYPE="submit" NAME="mode" VALUE="Preview">
< 			$post_opt
< 			<INPUT TYPE="submit" NAME="mode" VALUE="Post">
< 			%%norm_font_end%%</TD>
< 		</TR>
< 		<TR>
< 			<TD>
< 				$allow_tags
< 			</TD>
< 		</TR>|;
< 	
< 	$form .= '</TABLE></FORM></TD></TR></TABLE>';
< 	
< 	if ($S->{UI}->{VARS}->{comment_image_box}) {
< 		$form .= qq|%%BOX,user_files_list,comment%%|;
< 	}
< 	
---
> 	$form = $S->interpolate($form,$keys);



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Scoop-checkins mailing list
Scoop-checkins at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scoop-checkins