Location: PHPKode > projects > iLP System > Release 2.2/upload/lib/templates/tpl.list.php
<?php
/**
 * iLP System Template: Liste 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.2
 */
if (isset($tpl['url'][2]))
{
	if ('add' == $tpl['url'][2])
	{
		echo '<h1><a href="?ilp='.ilpUrlEncode('start;list').'">'.$lang['list']['navi']['home'].'</a> | '.$lang['list']['navi']['add'].'</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 action="?ilp='.ilpUrlEncode('start;list;add;do').'" method="post" id="additemForm">
				<input type="hidden" name="additem_user_id" value="'.$tpl['user']['id'].'" />
				<fieldset>
					<legend>
						<img src="images/icons/add.png" alt="icon" /> '.$lang['list']['add']['header'].'
					</legend>
					<div class="inputGroup">
						<div class="inputField">
							<input type="text" id="additem_item_id" name="additem_item_id" class="required" />
							<div class="inputDesc">
								<label for="additem_item_id">
									'.$lang['page']['itemidnote'].'
								</label>
							</div>
						</div>
					</div>
				</fieldset>
				<div>
					<input type="submit" value="'.$lang['list']['navi']['add'].'" />
				</div>
			</form>';
	}
	
	elseif ('delete' == $tpl['url'][2])
	{
		echo '<h1><a href="?ilp='.ilpUrlEncode('start;list').'">'.$lang['list']['navi']['home'].'</a> | '.$lang['list']['navi']['delete'].'</h1>
			<div class="info">
				<h1>'.$lang['list']['delete']['info']['header'].'</h1>
				<p>
					'.$lang['list']['delete']['info']['text'][0].getWowheadLink($tpl['url'][4], $lang['tooltip_locale']).$lang['list']['delete']['info']['text'][1].'
				</p>
				<p>
					'.$lang['list']['delete']['info']['text'][2].'
				</p>
			</div>
			<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('start;list;delete;do').'" id="deleteitemForm">
				<input type="hidden" name="deleteitem_id" value="'.$tpl['url'][3].'" />
				<input type="hidden" name="deleteitem_item_id" value="'.$tpl['url'][4].'" />
				<input type="hidden" name="deleteitem_confirm_check" id="deleteitem_confirm_check" value="'.$lang['list']['delete']['confirm']['delete'].'" />
				<fieldset>
					<legend><img src="images/icons/delete.png" alt="icon" /> '.$lang['list']['delete']['confirm']['head'].'</legend>
					<div class="inputGroup">
						<div class="inputField">
							<input type="text" id="deleteitem_confirm" name="deleteitem_confirm" class="required" />
							<div class="inputDesc">
								<label for="deleteitem_confirm">
									'.$lang['list']['delete']['confirm']['note'].'
								</label>
							</div>
						</div>
					</div>
				</fieldset>
				<div>
					<input type="submit" value="'.$lang['list']['navi']['delete'].'" />
				</div>
			</form>';
	}
	
	elseif ('edit' == $tpl['url'][2])
	{
		echo '<h1><a href="?ilp='.ilpUrlEncode('start;list').'">'.$lang['list']['navi']['home'].'</a> | '.$lang['list']['navi']['change'].'</h1>
				<div class="info">
					<h1>'.$lang['list']['change']['info']['header'].'</h1>
					<p>
						'.$lang['list']['change']['info']['text'][0].getWowheadLink($tpl['url'][4], $lang['tooltip_locale']).$lang['list']['change']['info']['text'][1].'
					</p>
				</div>
				<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('start;list;edit;do').'" id="edititemForm">
					<input type="hidden" name="edititem_id" value="'.$tpl['url'][3].'" />
					<input type="hidden" name="edititem_old_id" value="'.$tpl['url'][4].'" />
					<fieldset>
						<legend><img src="images/icons/arrow_refresh.png" alt="icon" /> '.$lang['list']['change']['new'].'</legend>
					<div class="inputGroup">
						<div class="inputField">
							<input type="text" id="edititem_new_id" name="edititem_new_id" />
							<div class="inputDesc">
								<label for="edititem_item_id">
									'.$lang['list']['change']['note'].'<br />
									'.$lang['page']['itemidnote'].'
								</label>
							</div>
						</div>
					</div>
				</fieldset>
				<div>
					<input type="submit" value="'.$lang['list']['navi']['change'].'" />
				</div>
			</form>';
	}
	
	elseif ('req' == $tpl['url'][2])
	{
		echo '<h1><a href="?ilp='.ilpUrlEncode('start;list').'">'.$lang['list']['navi']['home'].'</a> | '.$lang['list']['navi']['req'].'</h1>
				<div class="info">
					<h1>'.$lang['list']['req']['info']['header'].'</h1>
					<p>
						'.$lang['list']['req']['info']['text'][0].getWowheadLink($tpl['url'][4], $lang['tooltip_locale']).$lang['list']['req']['info']['text'][1].'
					</p>
					<p>
						'.$lang['list']['req']['info']['text'][2].'
					</p>
				</div>
				<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('start;list;req;do').'" id="reqitemForm">
					<input type="hidden" name="reqitem_id" value="'.$tpl['url'][3].'" />
					<input type="hidden" name="reqitem_old_item_id" value="'.$tpl['url'][4].'" />
					<fieldset>
						<legend><img src="images/icons/email.png" alt="icon" /> '.$lang['list']['req']['header'].'</legend>
						<div class="inputGroup">
							<div class="inputName">
								<label for="reqitem_item_id">
									'.$lang['list']['change']['new'].'
								</label>
							</div>
							<div class="inputField">
								<input type="text" id="reqitem_item_id" name="reqitem_item_id" class="required" value="'.$tpl['url'][4].'" />
								<div class="inputDesc">
									<label for="reqitem_item_id">
										'.$lang['list']['change']['note'].'<br />
										'.$lang['page']['itemidnote'].'
									</label>
								</div>
							</div>
						</div>
						<div class="inputGroup">
							<div class="inputName">
								<label for="reqitem_msg">
									'.$lang['list']['req']['message'].'
								</label>
							</div>
							<div class="inputField">
								<textarea cols="45" rows="10" id="reqitem_msg" name="reqitem_msg" class="required"></textarea>
								<div class="inputDesc">
									<label for="noteitem_msg">
										'.$lang['list']['req']['messagenote'].'
									</label>
								</div>
							</div>
						</div>
					</fieldset>
					<div>
						<input type="submit" value="'.$lang['list']['req']['submit'].'" />
					</div>
				</form>';
	}
}

else
{
	echo '<h1>'.$lang['list']['navi']['home'].'</h1>
		<p>
			'.$lang['list']['home']['text'][0].'
		</p>
		<p>
			'.$lang['list']['home']['text'][1].'
		</p>';
	
	// Wenn der Benutzer gesperrt ist, Warnung anzeigen
	if (1 == $tpl['user']['locked'])
	{
		echo '<div class="warning">
				<h1>'.$lang['list']['locked']['header'].'</h1>
				<p>
					'.$lang['list']['locked']['text'].'
				</p>
			</div>';
	}
	
	echo '<table class="itemlist" cellpadding="0" cellspacing="1" border="0">
			<thead>
				<tr>
					<th>
						'.$lang['list']['item'].'
					</th>
					<th>
						'.$lang['list']['points'].'
					</th>
					<th>
						'.$lang['list']['options'].'
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="3">';
	if ($_SESSION['config']['default_slots'] <= $tpl['list_length'] || 1 == $tpl['user']['locked'])
	{
		echo '<span class="warning"><img src="images/icons/cross.png" alt="icon" /> '.$lang['list']['home']['full'].'</span>';
	}
	else
	{
		echo '<a href="?ilp='.ilpUrlEncode('start;list;add').'"><img src="images/icons/add.png" alt="icon" /> '.$lang['list']['home']['add'].'</a>';
	}
	
	echo '			</td>
				</tr>
			</tfoot>
			<tbody>';
	
	if (isset($tpl['list']) && 1 <= count($tpl['list']))
	{
		foreach ($tpl['list'] as $row)
		{
			echo '<tr>
					<td>
						'.getWowHeadLink($row['item_id'], $lang['tooltip_locale']).'
					</td>
					<td>
						'.$row['item_value'].'
					</td>
					<td>';
			if (1 == $tpl['user']['locked'] || $row['item_value'] < 0)
			{
				echo '<img src="images/icons/delete_grey.png" alt="icon" title="'.$lang['list']['home']['delete'].'" />
						<img src="images/icons/arrow_refresh_grey.png" alt="icon" title="'.$lang['list']['home']['change'].'" />
						<img src="images/icons/email_grey.png" alt="icon" title="'.$lang['list']['home']['req'].'" />';
			}
			else
			{
				echo '<a href="?ilp='.ilpUrlEncode('start;list;delete;'.$row['id'].';'.$row['item_id']).'"><img src="images/icons/delete.png" alt="icon" title="'.$lang['list']['home']['delete'].'" /></a>
						<a href="?ilp='.ilpUrlEncode('start;list;edit;'.$row['id'].';'.$row['item_id']).'"><img src="images/icons/arrow_refresh.png" alt="icon" title="'.$lang['list']['home']['change'].'" /></a>
						<a href="?ilp='.ilpUrlEncode('start;list;req;'.$row['id'].';'.$row['item_id']).'"><img src="images/icons/email.png" alt="icon" title="'.$lang['list']['home']['req'].'" /></a>';
			}
			echo '</td>
				</tr>';
		}
	}
	else
	{
		echo '<tr>
				<td colspan="3" class="info">
					'.$lang['error']['noitems']['text'].'
				</td>
			</tr>';
	}
	echo '
			</tbody>
		</table>';
}
?>
Return current item: iLP System