Update of /cvs/scoop/scoop/lib/Scoop/Polls
In directory lithium.sabren.com:/tmp/cvs-serv4270/lib/Scoop/Polls

Modified Files:
	Forms.pm 
Log Message:
Move story posting form into blocks. Also moves the part of the poll form where it makes sense into blocks, since it's part of story 
posting. Adds an "edit_own_stories" perm that you can enable for users if you want them to be able to edit their own stuff after posting. 
And finally changes admin tools semantics to allow multiple perms per admin tool. The admin tools box right now only respects the first 
perm listed when it makes the tools list, to preserve the traditional behavior of that box. In the long run, this will need to be 
fixed. Also, it may be advantageous eventually to add an "edit" perm category to sections, to enable editing of some sections but not 
others.

--rusty



Index: Forms.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Polls/Forms.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Forms.pm	2 Jul 2004 21:05:58 -0000	1.10
--- Forms.pm	3 Feb 2005 15:48:30 -0000	1.11
***************
*** 165,185 ****
  	# not a preview (i.e. an attached poll)
  	unless ($editqid eq '' || $action eq 'preview') {
! 		$content .= qq| <TR>
! 			<td><br>%%norm_font%% This poll last updated on $last_write<br>
! 			|;
  		if( my $sid = $S->get_sid_from_qid($editqid) ) {
! 			$content .= qq|
! 				This poll is attached to story <a href="%%rootdir%%/story/$sid">$sid</a><br>|;
  		}
  		if( $editqid eq $S->_get_current_poll() ) {
! 			$content .= qq|
! 				This is the current poll.<br>|;
  		}
  
! 	} else {
! 		$content .= qq| <TR>
! 			<td>%%norm_font%%<br>
! 			|;
! 	}
  
  	# escape the metachars  -- use the functions we have!
--- 165,178 ----
  	# not a preview (i.e. an attached poll)
  	unless ($editqid eq '' || $action eq 'preview') {
! 		$content->{last_update} = qq|This poll last updated on $last_write<br>|;
! 
  		if( my $sid = $S->get_sid_from_qid($editqid) ) {
! 			$content->{attached_to} = qq|This poll is attached to story <a href="%%rootdir%%/story/$sid">$sid</a><br>|;
  		}
  		if( $editqid eq $S->_get_current_poll() ) {
! 			$content->{current} = qq|This is the current poll.<br>|;
  		}
  
! 	} 
  
  	# escape the metachars  -- use the functions we have!
***************
*** 196,218 ****
  
  	# qid is deprecated, it will be taken out later
! 	$content .= qq|
  		<INPUT type="hidden" name="editqid" value="$editqid">
  		<INPUT type="hidden" name="qid" value="$editqid">
! 		<INPUT type="hidden" name="voters" value="$voters">
! 		<br><br>
! 		Poll Question:<br>
! 		<INPUT type="text" size="30" name="question" value="$question"><br><br>
! 		Poll Answers:<br>
! 		|;
! 
  	if ($S->{UI}->{VARS}->{allow_multiple_choice}) {
! 		$content .=qq|
! 			<INPUT type="checkbox" name="is_multiple_choice" value="1"$is_multiple_choice_checked>
! 			Allow multiple selections in poll<br>
! 			|;
  	}
  
! 
! 	return ($content, $editqid);
  }
  
--- 189,208 ----
  
  	# qid is deprecated, it will be taken out later
! 	$content->{hidden_form_input} = qq|
  		<INPUT type="hidden" name="editqid" value="$editqid">
  		<INPUT type="hidden" name="qid" value="$editqid">
! 		<INPUT type="hidden" name="voters" value="$voters">|;
! 		
! 	$content->{question} = $question;
! 	
! 	my $form = $S->{UI}->{BLOCKS}->{poll_form_question};
! 	
  	if ($S->{UI}->{VARS}->{allow_multiple_choice}) {
! 		$form =~ s/%%multiple_choice%%/$S->{UI}->{BLOCKS}->{poll_form_multi}/g;
! 		$content->{allow_multiple} = $is_multiple_choice_checked;
  	}
  
! 	my $return = $S->interpolate($form, $content);
! 	return ($return, $editqid);
  }