                                                
<?php
//-->-->-->-->-->-->-->-->-->-->-->-->-->-->
   include_once "/home/waggacwc/public_html/refurb/RETRO-GLOBALS.php";
   include_once "$LIBRARYPATH/RETROVOX-CONSTANT-VARIABLES.php";
   include_once "$LIBRARYPATH/fnFillWebTemplate.php";
   include_once "$LIBRARYPATH/fnMessageToHtml.php";
   include_once "$LIBRARYPATH/fnCodeBlockToHtml.php";
   include_once "$LIBRARYPATH/fnCodeBlockFromHtml.php";
   include_once "$LIBRARYPATH/fnListBlockToHtml.php";

   include_once "$LIBRARYPATH/fnHyperlinkPlainText.php";

   $sFilePath = $_GET['file'];
   $sFilePath = str_replace('\\', '/', $sFilePath);
   $sFilePath = preg_replace('#[/]+#', '/', $sFilePath);

   $sFilePathEncoded = htmlspecialchars($sFilePath);

   $aaTextLines = file($ERRORTEMPLATE);
   $sErrorTemplateContents = implode('', $aaTextLines);

   $aaTextLines = file($ADMINTEMPLATE);
   $sAdminTemplateContents = implode('', $aaTextLines);


   $sPageTitle = "Webpad: Choose a file to edit";
   $sPageContent = "

         = Choose a document to edit

     You can use this page to choose a document to edit.
     
     If you dont know the name or the path to the file which
     you would like to enter, click the button with an empty
     box and you will be shown a list of files and 
     directories to choose from. ";

   $sPageContent = fnMessageToHtml($sPageContent);

   $sPageContent = "
    <form action = 'webpad.php'
          method = 'get'>
    <br>
    <em>Enter the file name and path of an 
        <strong>existing</strong> document to edit</em>
    <br>
    <input  type = 'text'    name  = 'file'  size = '80'
           value = '$sFilePathEncoded'><br>
    <input   type = 'submit'  value = 'Edit this File'>
    </form>

    <!--
    <form action = 'webpad-new.php' 
          method = 'get'>
    <br>
    <em>Enter the file name and path of a <strong>new</strong> 
        file to edit</em>
    <br>
    <input   type = 'text'    name  = 'file'  size = '80'
           value = '$sFilePathEncoded'><br>
    <input   type = 'submit'  value = 'Create and Edit this File'>
    <small>note: this isn't working properly</small>
    </form>
    -->

    <ol type = 'a'>
    <li>
    <a href = 'control.php'>
    Document Management</a></li>

    </ol>

    </body>
    </html>";


    $sOutputPage = fnFillWebTemplate(
      $sAdminTemplateContents, $sPageContent, $sPageTitle);   
    echo $sOutputPage;
    exit;

//--<--<--<--<--<--<--<--<--<--<--<--<--<--<
?>

                    