__section__
default
__description__
Edit a section

* section = name of section
* this_section = hashref of section
* qid = poll to assign to section
* issue = boolean for issue mode
* blocks = arrayref of hashref of blocks for section (we should also pass in
	   template for this section at some point ...)
__title__

__page__
sections
__lang__
en_US
__name__
editSection
__template__
[
<a href="[% gSkin.rootdir %]/admin.pl?section=[% section %]">Stories</a> |
<a href="[% gSkin.rootdir %]/submit.pl?section=[% section %]&op=list">Submissions</a> |
<a href="[% gSkin.rootdir %]/index.pl?section=[% section %]">Preview</a> 
]

[% # Conditions for subsection delete confirmation. If true, show subform.
IF form.DEL_subsection && !form.confirm;
key = "del_subsection_${form.DEL_subsection}" %]
<form action="[% env.script_name %]" method="post">
	<b>Subsection action</b>: [% form.$key %]?
	<input type="hidden" name="section" value="[% form.section | strip_attribute %]">
	<input type="hidden" name="op" value="editsection">
	<input type="hidden" name="action" value="[% form.$key %]">
	<input type="hidden" name="DEL_subsection" value="[% form.DEL_subsection | strip_attribute %]">
	&nbsp;&nbsp;<input type="submit" name="confirm" value="Yes">
	&nbsp;<input type="submit" name="nonconfirm" value="No">
</form>
<br><br>
[% END %]

<form action="[% env.script_name %]" method="post">
	<table><tr><td valign="TOP">
				[% PROCESS formLabel value 	=> "Section name" comment => "must be unique" %]
				<input type="text" name="section" value="[% section | strip_attribute %]">
				<br><br>

				[% PROCESS formLabel value="Article Count" comment="how many articles to display on section index" %]
				<input type="text" name="artcount" size="4" value="[% this_section.artcount %]"> 
				1/3rd of these will display intro text, 2/3rds just headers<br><br>

				[% PROCESS formLabel value="Title" comment="be descriptive" %]
				<input type="text" name="title" size="30" value="[% 
				this_section.title %]"><br>

				[% IF qid.length %]
				[% PROCESS formLabel value="Polls for this section" comment="" %]
				[% qid %]
				[% END %]

				[% PROCESS formLabel value="Type" comment="" %]
				[% types = Slash.db.getDescriptions("section-types") %]
				[% Slash.createSelect("type", types, this_section.type, 1) %]
				<p>

				[% PROCESS formLabel value="Issue mode" comment="" %]
				[% issue %]
				<p>

				[% PROCESS formLabel value="URL" comment="if the section has its own url" %]
				<input type="text" name="url" size="30" value="[% this_section.url %]"><br>

				[% PROCESS formLabel value	= "Hostname" comment = "Hostname we should match against" %]
				<input type="text" name="hostname" size="30" value="[% this_section.hostname %]"><br>

				[% PROCESS formLabel value => "Cookiedomain" comment => "if the section requires that you give out a special cookie"
				%]
				<br><input type="text" name="cookiedomain" size="30" value="[% this_section.cookiedomain %]"><br>

				[% PROCESS formLabel value => "Index Handler" comment => "the script that acts as / queries" %]
				<br><input type="text" name="index_handler" size="30" value="[% this_section.index_handler %]"><br>

				[% IF blocks.size %]
					[% PROCESS formLabel value 	=> "Edit Section slashboxes" comment => "blocks" %]
					[% FOREACH block = blocks %]
						<li>
						<b><a href="[% gSkin.rootdir %]/admin.pl?op=blocks&bid=[% block.bid %]">[% block.title %]</a></b>
						<a href="[% block.url %]">[% block.url %]</a>
						[% IF block.ordernum && block.ordernum > 0 %]
							[% ' (default)' %]
						[% END %]
					[% END %]
				[% END %]
				<br>
				<br>


				<input type="hidden" name="subsections" value="[% subsections.join(',') %]">
				[%	INCLUDE titlebar title=>"Subsections" width=>"99%" %]
				<table border=0 width="70%">
					<tr>
						<td colspan=3>
							<table border=0 width="100%">
								<tr>
									<td width=75%">
										Enter name of new subsection:
										<input type="text" name="new_subsection" value="">
										</td><td>
										<input type="submit" value="Add Subsection">
									</td>
								</tr>
							</table>
							<br><br>
						</td>
					</tr>
					[% IF subsections.size %]
					<tr>
						<th bgcolor="[% user.colors.bg_2 %]">Subsection</th>
						<th bgcolor="[% user.colors.bg_2 %]">Article Count</th>
						<th bgcolor="[% user.colors.bg_2 %]">Remove Subsection</th>
					</tr>
					[% END %]
					[% FOR ss=subsections %]
					<tr align="CENTER">
						<td width="33%">
							<input type="text" name="subsection_title_[% ss.id %]" value="[% ss.title %]">
						</td>
						<td>
							<input type="text" name="subsection_artcount_[% ss.id %]" value="[% ss.artcount %]" size=4>
						</td>
						<td>
							<input type="submit" name="del_subsection_[% ss.id %]" value="Remove [% ss.title %]">
						</td>
					</tr>
					[% END %]
				</table>
				<br><br>

				[% IF form.addextra; extras.push(['','']); END; IF extras.size; INCLUDE titlebar title=>"Extra Story Fields", width=>"99%"; id = 1 %]
				<table border=0 width=\"40%\">\n";
					[% FOR e=extras %]
					[%	UNLESS loop.first %]
					<tr>
						<td bgcolor="[% user.colors.bg_0 %]" colspan="4">
							[% INCLUDE spacer %]
						</td>
						</tr><tr>
						<td bgcolor="[% user.colors.bg_3 %]" colspan="4">
							[% INCLUDE spacer %]
						</td>
						</tr><tr>
						<td bgcolor="[% user.colors.bg_0 %]" colspan="4">
							[% INCLUDE spacer %]
						</td>
					</tr>
					[%	END %]
					<tr>
						<td>
							[% PROCESS formLabel value=>"Field Name:" comment='' %]
							<input type="text" name="extraname_[% id %]" value="[% e.1 %]">
						</td>

						<td>
							[% PROCESS formLabel value=>"Field Text:" %]
							<input type="text" name="extraval_[% id %]" value="[% e.0 %]">
							[% nbsp='&nbsp;'; nbsp.repeat(4) %]
						</td>

						<td>
							[% PROCESS formLabel value="Field&nbsp;Type:" %]
							[% Slash.createSelect( "extratype_$id", extra_types, e.type, 1) %]
						</td>

						<td valign="BOTTOM" align="RIGHT">
							<input type="checkbox" name="extradel_[% id %]">&nbsp;Del?</td>
					</tr>
					[% id = id + 1; END %]
				</table>&nbsp;<input type="submit" name="addextra" value="add extra">
				<p>
				[% ELSE %]

				<br><input type="submit" name="addextra" value="add extra">
				[% END %]

				<br><input type="submit" name="savesection" value="save section">
				<br><input type="submit" name="deletesection" value="delete section">
			</td>
			<td valign="TOP">
			[% IF this_section.type != 'collected' %]
				[% PROCESS formLabel value 	=> "Topics" comment => "topics assigned to this section" %]
				<ul>
					[% FOREACH tid = topics.sort %]
					<li>
					<a href="[% gSkin.rootdir %]/admin.pl?op=topics&nexttid=[% tid %]">[% topics.$tid %]</a>
					</li>
					[% END %]

				</ul>
			[% END %]
			&nbsp;
			</td>
		</tr>
	</table>
</form>

__seclev__
10000
__version__
$Id: editSection;sections;default,v 1.18 2005/07/27 22:54:13 pudge Exp $
