Location: PHPKode > projects > Enigma > Enigma2/Enigma2_Install/Themes/Enigma/portal/modules/ArticlesManagement.template.php
<?php
// Version: 1.0 RC1; NewsManagement

function template_ArtMgmt_addsec()
{
	global $context, $scripturl, $txt, $settings;

	echo '
<div class="tborder">
	<table width="100%" border="0" class="bordercolor" cellspacing="1" align="center">
			<tr>
				<td class="catbg">' . $txt['art02'] . '</td>
				<td class="catbg">' . $txt['art03'] . '</td>
				<td class="catbg">' . $txt['art04'] . '</td>
				<td class="catbg">' . $txt['art05'] . '</td>
			</tr>';

	if (!empty($context['artsec']))
	{
		foreach ($context['artsec'] AS $artsec)
		{
			echo '
			<tr>
				<td valign="top" class="windowbg2">' . $artsec['title'] . '<br /><br />
				<img src="' . $settings['images_url'] . '/Articles/' . $artsec['image'] . '" border="0" alt="' . $txt['art06'] . '" /></td>
				<td valign="top" class="windowbg2" align="center">' . $artsec['position'] . '</td>
				<td class="windowbg2" align="center">' . groupselect($artsec['groups'],'section_permit[]') . '</td>
				<td valign="top" class="windowbg2">
					<a href="' . $scripturl . '?module=ArticlesManagement;sa=esection;secid=' . $artsec['ID_SECTION'] . '">' . $txt['art07'] . '</a> | <a href="' . $scripturl . '?module=ArticlesManagement;sa=delsection;secid=' . $artsec['ID_SECTION'] . '">' . $txt['art08'] . '</a></td>
			</tr>';
		}
	}

   echo '
	</table>
</div>
<br /><br />
	<script language="JavaScript1.2" type="text/javascript">
	<!--
		function setImage(ImageName)
		{
			document.images.ArticlesImage.src="', $settings['images_url'], '/Articles/"+ document.add_ncat.image.options[document.add_ncat.image.selectedIndex].value+"";
		}
	//-->
	</script>
	<form name="add_ncat" method="post" action="', $scripturl, '?module=ArticlesManagement;sa=asection2">
	<a name="addNcat"></a>
	<div class="tborder">
		<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center">
			<tr>
				<td class="titlebg" colspan="2">' . $txt['art09'] . '</td>
			</tr><tr>
				<td>' . $txt['art10'] . '</td>
				<td><input type="text" name="title" size="30"></td>
			</tr><tr>
				<td>' . $txt['art11'] . '</td>
				<td>
					<select name="image" onChange="setImage(document.add_ncat.image.options[document.add_ncat.image.selectedIndex].value)" size="6">
						<option value="blank.gif" selected>None</option>';

	foreach ($context['ArticlesImage'] as $line)
	{
		$filename = $line;
		$title = substr($line,0,(strlen($line)-strlen(strrchr($line,'.'))));

		echo '
						<option value="', $filename, '">', $title, '</option>';
	}

	echo '
					</select>&nbsp;<img src="', $settings['images_url'], '/Articles/', $context['artsec']['image'], '" name="ArticlesImage"  border="1" hspace="15" width="80" height="80" alt="', $context['artsec']['title'], '"></td>
			</tr><tr>
				<td>' . $txt['art12'] . '</td>
				<td><input type="text" name="position" size="2"></td>
			</tr><tr>
				<td>' . $txt['art13'] . '</td>
				<td>
					' . groupselect('','section_permit[]',true) . '</td>
			</tr><tr>
				<td colspan="2" align="center"><input type="submit" name="submit" value="' . $txt['art14'] . '"></td>
			</tr>
		</table>
	</div>
	</form>';
}


function template_ArtMgmt_editsec()
{
	global $context, $txt, $scripturl, $settings;

	foreach($context['editart'] AS $result)
	{

		echo '
		<script language="JavaScript1.2" type="text/javascript">
		<!--
			function setImage(ImageName)
			{
				document.images.ArticlesImage.src="', $settings['images_url'], '/Articles/"+ document.edit_ncat.image.options[document.edit_ncat.image.selectedIndex].value+"";
			}
		//-->
		</script>
		<form name="edit_ncat" method="post" action="', $scripturl, '?module=ArticlesManagement;sa=esection2">
		<a name="addNcat"></a>
		<div class="tborder">
			<table class="windowbg" width="100%" border="0" cellspacing="0" cellpadding="4" align="center">
				<tr>
					<td class="titlebg" colspan="2">' . $txt['art09'] . '</td>
				</tr><tr>
					<td>' . $txt['art10'] . '</td>
					<td><input type="text" name="title" size="30" value="' . $result['title'] . '"></td>
				</tr><tr>
					<td>' . $txt['art11'] . '</td>
					<td>
						<select name="image" onChange="setImage(document.edit_ncat.image.options[document.edit_ncat.image.selectedIndex].value)" size="6">
							<option value="blank.gif">None</option>';

		foreach ($context['ArticlesImage'] as $line)
		{
			$filename = $line;
			$title = substr($line,0,(strlen($line)-strlen(strrchr($line,'.'))));

			echo '
							<option value="', $filename, '"', ($result['image'] == $filename) ? ' selected' : '', '>', $title, '</option>';
		}

		echo '
						</select>&nbsp;<img src="', $settings['images_url'], '/Articles/', $result['image'] . '" name="ArticlesImage"  border="1" hspace="15" width="80" height="80" alt="', $result['title'], '"></td>
				</tr><tr>
					<td>' . $txt['art12'] . '</td>
					<td><input type="text" name="position" size="2" value="' . $result['position'] . '"></td>
				</tr><tr>
					<td>' . $txt['art13'] . '</td>
					<td>' . groupselect($result['groups'], 'section_permit[]') . '</td>
				</tr><tr>
					<td colspan="2" align="center"><input type="submit" name="submit" value="' . $txt['art07'] . '"></td>
				</tr>
			</table>
		</div>
		<input type="hidden" name="secid" value="' . $result['ID_SECTION'] . '">
		</form>';
	}
}
?>
Return current item: Enigma