<?php
if (!defined('ADMIN_FILE')) die("Illegal File Access");
function maineditmedia() {
	global $prefix, $gallerypath, $db, $admin_file;
	head();
	navigationAdmin("<b><a href=\"".$admin_file.".php?op=album\">"._GALCONFIG."</a></b> &gt;&gt; <b>"._GALVIEWMEDIA."</b>");
	OpenTable();
	$categories = listcategories("$gallerypath");
	if ($categories != "") {
		echo "<center><font class=\"option\"><b>"._GALEDITBYCATEGORYDESC."</b></font></center>";
		$categories = explode(" ", trim($categories));
        while(list($key, $val) = each($categories)) {
			$result = $db->sql_query("SELECT gallid, gallname, parent FROM $prefix"._album_categories." WHERE gallid=".$val);
			list ($gid, $name, $parent) = $db->sql_fetchrow($result);
			$nbtabs = indent($gid);
			$tab = "";
			for ($i=0; $i<$nbtabs; $i++) $tab .= "&nbsp;&nbsp;&nbsp;";
			echo "$tab<a href=\"".$admin_file.".php?op=album&do=editmedia&type=edit&category=$gid\">$name</a><br>";
		}
	}
	CloseTable();
	foot();
}
?>