<?php

if ( ! @include_once( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. ACCESS DENIED !!' ); }
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: maineditmedia.php,v 1.4.2.2 2004/04/18 12:46:51 ajvwaay Exp $




function maineditmedia() {
global $adminurl, $module_name, $imagepath, $gallerypath, $adminpath, $languagepath, $baseurl, $adminurl;
global $version, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $mpnTables, $textcolor1;

#  include ("header.php");
#  GraphicAdmin($hlpfile);
  OpenTable();
  echo "<center><font size=\"4\"><b>"._GALADMIN."</b></font></center>";
  CloseTable();
  echo "<br>";
  OpenTable();
  echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
        <tr><td>";

    echo "
    <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
    <tr>
      <td width=\"50%\"><font size=\"2\"><strong>
      <a href=\"$adminurl\">"._GALCONFIG."</a> &gt; "._GALVIEWMEDIA."
      </strong></font></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
      <td width=\"100%\">
  <!-- Start of Body -->
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
    <tr>
    <td bgcolor=\"$bgcolor1\">
      <table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\">
      <tr>
        <td width=\"25%\" align=\"left\" valign=\"top\">
        <b>"._GALEDITBYCATEGORY."</b>
        </td>
        <td width=\"75%\" align=\"left\" valign=\"top\">
        "._GALEDITBYCATEGORYDESC."
        <hr size=\"1\" color=\"#000000\">";

    $categories = listcategories("$gallerypath");
    $categories = explode(" ", trim($categories));
    while(list($key, $val) = each($categories)) {
        $result = mysql_query("select gallid, gallname, parent from ".$mpnTables['gallery_categories']." where gallid=".$val);
        list ($gid, $name, $parent) = mysql_fetch_row($result);

        $nbtabs = indent($gid);
        $tab = "";
        for ($i=0; $i<$nbtabs; $i++)
            $tab .= "&nbsp;&nbsp;&nbsp;";
        echo "$tab<a href=\"$adminurl&amp;op=editmedia&amp;type=edit&amp;category=$gid\">$name</a><br>";
    }


    echo "<br>
         </td>
      </tr>
      </table>
    </td>
    </tr>
    </table>";

    echo "</td></tr></table>";
    CloseTable();
    print '<br>';
    // Start Of Footer
    OpenTable();
    print '
    <table><tr>
    <td>'
      ."<font face=\"Verdana,Arial\" color=\"$textcolor1\">mpn eGallery Version - $version<br>"._GALVISITUPDATE.'</font>
    </td>
    </tr></table>';
    CloseTable();#      include("footer.php");
}

?>
