<?php
if (!defined('ADMIN_FILE')) {
	die("Illegal File Access");
}

function editalltemplates() {
	global $prefix, $db, $admin_file;
	include("header.php");
	navigationAdmin("<b><a href=\"".$admin_file.".php?op=album&do=showoptions\">"._GALCONFIG."</a></b> &gt;&gt; <b>"._GALEDITALLTEMPLATES."</b>");
	OpenTable();
	echo "<center><font class=\"option\"><b>"._GALECDTEMPLATESDESC."</b></font></center>";
	echo "<form method=\"post\" action=\"".$admin_file.".php?op=album\"><input type=\"hidden\" name=\"op\" value=\"album\"><input type=\"hidden\" name=\"do\" value=\"edittemplate\"><input type=\"hidden\" name=\"type\" value=\"edit\"><center>[ <a href=\"".$admin_file.".php?op=album&do=edittemplate&amp;type=edit&amp;xtype=2\">"._GALCLICK2CREATETEMP."</a> | <a href=\"".$admin_file.".php?op=album&do=edittemplate&amp;type=edit&amp;xtype=1\">"._GALCLICK2CREATETEMPMAIN."</a> ]<br><br>";
	echo "<select name=\"template\">";
	$sel_template[$templateID] = ' selected';
	$tempres = $db->sql_query("SELECT id, title, type FROM $prefix"._album_template_types." ORDER BY type, title");
	while($row = $db->sql_fetchrow($tempres)) {
		$sel = $sel_template[$row[id]];
		if($row[type] == 1){$type = '[Main Page]';}else{$type = '[Gallery Pages]';}
		echo "<option value=\"$row[id]\"$sel>$type $row[title]</option>";
	}
	echo "</select> <input type=\"submit\" name=\"save\" value=\""._GALEDIT."\"> <input type=\"submit\" name=\"delete\" value=\""._GALDELETE."\"></form></center>";
	CloseTable();
	include("footer.php");
}
?>