<?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: editalltemplates.php,v 1.7.2.2 2004/04/18 12:46:51 ajvwaay Exp $



function editalltemplates() {
global $adminurl, $module_name, $imagepath, $gallerypath, $adminpath, $languagepath, $baseurl, $adminurl, $modulepath;
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>
            <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
            <tr>
                <td><strong>
                    <a href=\"$adminurl\">"._GALCONFIG."</a> &gt;
                    "._GALEDITALLTEMPLATES."
                    </strong>
                </td>
            </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td bgcolor=\"$bgcolor3\">
        <table border=\"0\" bgcolor=\"$bgcolor3\" width=\"100%\">
        <tr>
                <td width=\"25%\" valign=\"top\">
                <font size=\"2\"><b>"._GALECDTEMPLATES."</b></font>
            </td>
            <td width=\"75%\">"._GALECDTEMPLATESDESC."
            <p></p>

            <form method=\"POST\" action=\"$adminurl\">
            <input type=\"hidden\" name=\"fct\" value=\"gallery\">
            <input type=\"hidden\" name=\"op\" value=\"edittemplate\">
            <input type=\"hidden\" name=\"type\" value=\"edit\">
            <hr size=\"1\" color=\"#000000\">

            <p></p>
            <table border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#000000\">
            <tr>
                <td>
                <table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"$bgcolor1\">
                <tr>
                    <td><a href=\"$adminurl&amp;op=edittemplate&amp;type=edit&amp;xtype=2\">"._GALCLICK2CREATETEMP."</a></td>
                    <td align=\"right\"><a href=\"$adminurl&amp;op=edittemplate&amp;type=edit&amp;xtype=1\">"._GALCLICK2CREATETEMPMAIN."</a></td>
                </tr>
                </table>
                </td>
            </tr>
            </table>
            <br>";
    echo "<select name=\"template\">";

    $templateID = null;

    $sel_template[$templateID] = ' selected';
    $tempres = mysql_query("SELECT id, title, type FROM ".$mpnTables['gallery_template_types']." ORDER BY type, title");
    while($row = mysql_fetch_array($tempres)) {
        if (isset( $sel_template[$row['id']] ))
        {
            $sel = $sel_template[$row['id']];
        }
        else
        {
            $sel = null;
        }

        if($row['type'] == 1){$type = '[Main Page]';}else{$type = '[Gallery Pages]';}
        print '<option value="' . $row['id'] . '" ' . $sel . '>' . $type . ' ' .  $row['title'] . '</option>' . "\n";
    }
    echo "</select>
            <hr size=\"1\" color=\"#000000\">
            <input class=\"button\" type=\"submit\" name=\"save\" value=\""._GALEDIT."\"> <input class=\"button\" type=\"submit\" name=\"delete\" value=\""._GALDELETE."\">
            </form>
            </td>
        </tr>
        </table>
        </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");

}

?>
