<tal:block metal:use-macro="python:here.getFormsTool().getForm('site_admin_template').macros['page']">

<h1 metal:fill-slot="title" i18n:translate="">Manage portlets - For folders</h1>

<tal:block metal:fill-slot="section"
	tal:define="site_url here/getSitePath;
				ob_id python:request.get('id', '')">
<div class="tabbedmenu">
<ul>
	<li><a tal:attributes="href string:${site_url}/admin_remotechportlets_html" i18n:translate="">Remote channels</a></li>
	<li><a tal:attributes="href string:${site_url}/admin_localchportlets_html" i18n:translate="">Local channels</a></li>
	<li class="currenttab"><a tal:attributes="href string:${site_url}/admin_folderportlets_html" i18n:translate="">For folders</a></li>
	<li><a tal:attributes="href string:${site_url}/admin_linksportlets_html" i18n:translate="">List of links</a></li>
	<li><a tal:attributes="href string:${site_url}/admin_htmlportlets_html" i18n:translate="">Static HTML</a></li>
	<li><a tal:attributes="href string:${site_url}/admin_specialportlets_html" i18n:translate="">Special</a></li>
</ul>
</div>

<p i18n:translate="" class="cleaner">
	This form allows you to create new portlets from a
	<em i18n:name="folder" i18n:translate="">folder</em>, using its title and
	description.
</p>

<fieldset>
	<legend i18n:translate="">Choose the folder you wish to generate a portlet from</legend>
	<p i18n:translate="">
		From the portal sitemap displayed below, select a folder by clicking on its
		name and then clicking
		<em i18n:name="create-button" i18n:translate="">Create</em>.
	</p>
	<form name="frmportlets" method="post" tal:attributes="action string:${site_url}/admin_addfolderportlet">
	<script type="text/javascript">
	<!--
	function fTreeClick(expand)
	{
		document.frmportlets.action = '';
		document.frmportlets.expand.value = expand;
	}
	function fTreeNodeClick(node_path)
	{
		document.frmportlets.folder.value = node_path;
	}
	//-->
	</script>
	<tal:block tal:define="expand python:request.get('expand', '');
							expand_list python:here.splitToList(expand);
							tree python:here.getSiteMap(expand_list, None, 0);
							folder python:request.get('folder', '')">
	<table border="0" cellspacing="1" cellpadding="1" tal:repeat="tree_node tree">
	<tr>
		<td>
			<img tal:repeat="i python:range(0, tree_node[2])"
					src="misc_/Naaya/square.gif" alt="" />
			<tal:block tal:condition="python:tree_node[1]==-1">
				<img src="misc_/Naaya/square.gif" alt="" />
			</tal:block>
			<tal:block 
				tal:define="node_expand python:here.processCollapse(expand_list, tree_node[0].absolute_url(1))"
				tal:condition="python:tree_node[1]==0">
				<input type="image" src="misc_/Naaya/minus.gif" alt="Collapse node" i18n:attributes="alt" tal:attributes="onclick string:javascript:fTreeClick('${node_expand}')" />
			</tal:block>
			<tal:block
				tal:define="node_expand python:here.processExpand(expand_list, tree_node[0].absolute_url(1))"
				tal:condition="python:tree_node[1]==1">
				<input type="image" src="misc_/Naaya/plus.gif" alt="Expand node" i18n:attributes="alt" tal:attributes="onclick string:javascript:fTreeClick('${node_expand}')" />
			</tal:block>
		</td>
		<td><img tal:attributes="src python:tree_node[0].icon" alt="Folder icon" /></td>
		<td><a tal:define="node_path python:tree_node[0].absolute_url(1)" tal:attributes="href string:javascript:fTreeNodeClick('${node_path}')" tal:content="python:tree_node[0].title_or_id()">folder</a></td>
	</tr>
	</table>
	<input type="text" name="folder" tal:attributes="value folder" size="35" readonly="readonly" />
	<input type="hidden" name="expand" tal:attributes="value expand" />
	</tal:block>
	<p><input type="submit" value="Create" i18n:attributes="value" /></p>
	</form>
</fieldset>
<br />
<form method="post" tal:attributes="action string:${site_url}/admin_deletefolderportlet">
	<table class="datatable" tal:define="portlets python:here.getPortletsTool().get_folders_portlets()">
	<thead>
		<tr>
			<th class="scope-col" scope="col">&nbsp;</th>
			<th class="scope-col" scope="col" i18n:translate="">Title</th>
		</tr>
	</thead>
	<tbody>
		<tr tal:repeat="portlet portlets" tal:attributes="class python:test(path('repeat/portlet/odd'), 'zebraodd', 'zebraeven')">
			<td><input type="checkbox" name="ids" tal:attributes="value portlet/id" /></td>
			<td tal:content="portlet/title_or_id" />
		</tr>
	</tbody>
	</table>
	<input type="submit" value="Delete" i18n:attributes="value" />
</form>
</tal:block>

</tal:block>
