Location: PHPKode > projects > iLP System > Release 2.2/upload/_backend/lib/templates/tpl.eventtypes.php
<?php
/**
 * iLP System Template: Ereignisarten anzeigen
 * 
 * Autor:		Florian "ApoY2k" Peschka
 * Projekt:		iLP System
 * Paket:		apoy2k.ilp.wrynn.lib.tpl
 * Lizenz:		CreativeCommons (by-nc-sa)
 * Kontakt:		hide@address.com
 * Version:		2.1.1
 */

// Ereignisarten bearbeiten
if (!isset($tpl['url'][1]))
{
	echo '<h1>'.$lang['types']['show']['header'].'</h1>';
	
	if (isset($tpl['types']) && 1 <= count($tpl['types']))
	{
		echo '<div class="blocklist eventList">';
		
		foreach ($tpl['types'] as $row)
		{
			echo '<a href="?ilp='.ilpUrlEncode('eventtypes;edit;'.$row['id']).'">
				<img src="../images/icons/'.$row['icon'].'" />
				<span>
					<b>'.$row['name'].'</b><br />
					<span class="note">'.$lang['types']['show']['count'].': '.$row['count'].'</span>
				</span>
			</a>';
		}
		
		echo '</div>';
	}
	else
	{
		echo '<div class="info">
				<h1>'.$lang['types']['none']['header'].'</h1>
				<p>
					'.$lang['types']['none']['text'].'
				</p>
			</div>';
	}
}

// Ereignisart erstellen
elseif (isset($tpl['url'][1]) && 'add' == $tpl['url'][1] && !isset($tpl['url'][2]))
{
	echo '<h1>'.$lang['types']['add']['header'].'</h1>
	<div id="errorMessage" class="warning">
		<h1><img src="../images/icons/error.png" alt="icon" /> '.$lang['error']['header'].'</h1>
		<ul>
			<li><span class="note">'.$lang['error']['note'].'</span></li>
		</ul>
	</div>
	<form method="post" action="?ilp='.ilpUrlEncode('eventtypes;add;do').'" id="addtypeform" enctype="multipart/form-data">
		<fieldset>
			<legend><img src="../images/icons/calendar_add.png" alt="icon" /> '.$lang['types']['add']['header'].'</legend>
			<div class="inputGroup">
				<div class="inputName">
					<label for="addtype_name">
						'.$lang['types']['add']['name'].'
					</label>
				</div>
				<div class="inputField">
					<input type="text" name="addtype_name" id="addtype_name" />
					<div class="inputDesc">
						<label for="addtype_name">
							'.$lang['types']['add']['namenote'].'
						</label>
					</div>
				</div>
			</div>
			<div class="inputGroup">
				<div class="inputName">
					<label for="addtype_icon">
						'.$lang['types']['add']['icon'].'
					</label>
				</div>
				<div class="inputField">
					<input type="file" name="addtype_icon" id="addtype_icon" />
					<div class="inputDesc">
						<label for="addtype_icon">
							'.$lang['types']['add']['iconnote'].'
						</label>
					</div>
				</div>
			</div>
		</fieldset>
		<div>
			<input type="submit" value="'.$lang['types']['add']['header'].'" />
		</div>
	</form>';
}

// Ereignisart bearbeiten
elseif (isset($tpl['url'][1]) && 'edit' == $tpl['url'][1] && isset($tpl['url'][2]) && 'do' != $tpl['url'][2])
{
	echo '<h1><a href="?ilp='.ilpUrlEncode('eventtypes').'">'.$lang['types']['show']['header'].'</a> | '.$lang['types']['edit']['header'].'</h1>
	<div id="errorMessage" class="warning">
		<h1><img src="../images/icons/error.png" alt="icon" /> '.$lang['error']['header'].'</h1>
		<ul>
			<li><span class="note">'.$lang['error']['note'].'</span></li>
		</ul>
	</div>
	<form method="post" action="?ilp='.ilpUrlEncode('eventtypes;edit;do').'" id="edittypeform" enctype="multipart/form-data">
		<input type="hidden" name="edittype_type_id" id="edittype_type_id" value="'.$tpl['type']['id'].'" />
		<input type="hidden" name="edittype_old_icon" id="edittype_old_icon" value="'.$tpl['type']['icon'].'" />
		<fieldset>
			<legend><img src="../images/icons/calendar_edit.png" alt="icon" /> '.$lang['types']['edit']['header'].'</legend>
			<div class="inputGroup">
				<div class="inputName">
					<label for="edittype_name">
						'.$lang['types']['add']['name'].'
					</label>
				</div>
				<div class="inputField">
					<input type="text" name="edittype_name" id="edittype_name" value="'.$tpl['type']['name'].'" />
					<div class="inputDesc">
						<label for="edittype_name">
							'.$lang['types']['add']['namenote'].'
						</label>
					</div>
				</div>
			</div>
			<div class="inputGroup">
				<div class="inputName">
					<label for="edittype_icon">
						'.$lang['types']['edit']['old_icon'].'
					</label>
				</div>
				<div class="inputField">
					<img src="../images/icons/'.$tpl['type']['icon'].'" />
					<div class="inputDesc">
						<label for="edittype_icon">
							'.$lang['types']['edit']['old_iconnote'].'
						</label>
					</div>
				</div>
			</div>
			<div class="inputGroup">
				<div class="inputName">
					<label for="edittype_icon">
						'.$lang['types']['edit']['icon'].'
					</label>
				</div>
				<div class="inputField">
					<input type="file" name="edittype_icon" id="edittype_icon" />
					<div class="inputDesc">
						<label for="edittype_icon">
							'.$lang['types']['edit']['iconnote'].'
						</label>
					</div>
				</div>
			</div>
		</fieldset>
		<div>
			<input type="submit" value="'.$lang['types']['edit']['header'].'" />
		</div>
	</form>';

	if (0 == $tpl['type']['count'])
	{
		echo '<form method="post" action="?ilp='.ilpUrlEncode('eventtypes;delete;do').'" id="deletetypeform">
			<input type="hidden" name="deletetype_confirm_check" id="deletetype_confirm_check" value="'.$lang['page']['delete'].'" />
			<input type="hidden" name="deletetype_type_id" id="deletetype_type_id" value="'.$tpl['url'][2].'" />
			<fieldset>
				<legend><img src="../images/icons/calendar_delete.png" alt="icon" /> '.$lang['types']['delete']['header'].'</legend>
				<div class="inputGroup">
					<div class="inputField">
						<input type="text" name="deletetype_confirm" id="deletetype_confirm" />
						<div class="inputDesc">
							<label for="deletetype_confirm">
								'.$lang['types']['delete']['confirm']['note'].'
							</label>
						</div>
					</div>
				</div>
			</fieldset>
			<div>
				<input type="submit" value="'.$lang['types']['delete']['header'].'" />
			</div>
		</form>';
	}
	else
	{
		echo '<br /><div class="warning">
				<h1>'.$lang['types']['delete']['error']['header'].'</h1>
				<p>'.$lang['types']['delete']['error']['text'].'</p>
			</div>';
	}
}
?>
Return current item: iLP System