logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

[TEP-COMMIT] [CVS admin] updates to the new template structure / standards : msg#00018

Subject: [TEP-COMMIT] [CVS admin] updates to the new template structure / standards updates
Commit in admin/admin on MAIN
file_manager.php+95-2951.44 -> 1.45
includes/languages/english/file_manager.php+24-231.15 -> 1.16
includes/languages/german/file_manager.php+25-241.19 -> 1.20
includes/languages/espanol/file_manager.php+24-231.17 -> 1.18
templates/pages/file_manager.php+237added 1.1
               /file_manager_edit.php+77added 1.1
+482-365
2 added + 4 modified, total 6 files
updates to the new template structure / standards updates

admin/admin
file_manager.php 1.44 -> 1.45
diff -u -r1.44 -r1.45
--- file_manager.php	2004/07/22 23:33:00	1.44
+++ file_manager.php	2004/08/15 18:16:07	1.45
@@ -5,7 +5,7 @@
   osCommerce, Open Source E-Commerce Solutions
   http://www.oscommerce.com
 
-  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 osCommerce
 
   Released under the GNU General Public License
 */
@@ -14,341 +14,141 @@
 
   $selected_box = 'tools';
 
-  if (!tep_session_is_registered('current_path')) {
-    $current_path = DIR_FS_DOCUMENT_ROOT;
-    tep_session_register('current_path');
-  }
+  define('OSC_ADMIN_FILE_MANAGER_ROOT_PATH', realpath('../'));
 
-  if (isset($HTTP_GET_VARS['goto'])) {
-    $current_path = $HTTP_GET_VARS['goto'];
-    tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
+  if ($osC_Session->exists('fm_directory')) {
+    $current_path = $osC_Session->value('fm_directory');
+  } else {
+    $current_path = OSC_ADMIN_FILE_MANAGER_ROOT_PATH;
+    $osC_Session->set('fm_directory', $current_path);
   }
 
-  if (strstr($current_path, '..')) $current_path = DIR_FS_DOCUMENT_ROOT;
+  if (isset($_GET['directory'])) {
+    $current_path .= '/' . $_GET['directory'];
+    $osC_Session->set('fm_directory', $current_path);
+  } elseif (isset($_GET['goto'])) {
+    $current_path = OSC_ADMIN_FILE_MANAGER_ROOT_PATH . '/' . urldecode($_GET['goto']);
+    $osC_Session->set('fm_directory', $current_path);
+  }
 
-  if (!is_dir($current_path)) $current_path = DIR_FS_DOCUMENT_ROOT;
+  $current_path = realpath($current_path);
 
-  if (!ereg('^' . DIR_FS_DOCUMENT_ROOT, $current_path)) $current_path = DIR_FS_DOCUMENT_ROOT;
+  if ( (substr($current_path, 0, strlen(OSC_ADMIN_FILE_MANAGER_ROOT_PATH)) != OSC_ADMIN_FILE_MANAGER_ROOT_PATH) || (is_dir($current_path) === false) ) {
+    $current_path = OSC_ADMIN_FILE_MANAGER_ROOT_PATH;
+    $osC_Session->set('fm_directory', $current_path);
+  }
 
-  $action = "" ? $HTTP_GET_VARS['action'] : '');
+  $action = "" ? $_GET['action'] : '');
 
-  if (tep_not_null($action)) {
+  if (!empty($action)) {
     switch ($action) {
       case 'reset':
-        tep_session_unregister('current_path');
+        $osC_Session->remove('fm_directory');
+
         tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
         break;
       case 'deleteconfirm':
-        if (strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
+        if (isset($_GET['entry']) && !empty($_GET['entry'])) {
+          $target = $current_path . '/' . basename($_GET['entry']);
 
-        tep_remove($current_path . '/' . $HTTP_GET_VARS['info']);
-        if (!$tep_remove_error) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
+          if (is_writeable($target)) {
+            tep_remove($target);
+          } else {
+            if (is_file($target)) {
+              $messageStack->add_session(sprintf(ERROR_FILE_NOT_WRITEABLE, $target), 'error');
+            } else {
+              $messageStack->add_session(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $target), 'error');
+            }
+          }
+        }
+
+        tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
         break;
-      case 'insert':
-        if (!file_exists($current_path . '/' . $HTTP_POST_VARS['folder_name'])) {
-          if (mkdir($current_path . '/' . $HTTP_POST_VARS['folder_name'], 0777)) {
-            tep_redirect(tep_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($HTTP_POST_VARS['folder_name'])));
+      case 'new_directory':
+        if (isset($_POST['directory_name']) && !empty($_POST['directory_name'])) {
+          if (is_writeable($current_path)) {
+            $new_directory = $current_path . '/' . basename($_POST['directory_name']);
+
+            if (file_exists($new_directory) === false) {
+              if (mkdir($new_directory, 0777)) {
+                tep_redirect(tep_href_link(FILENAME_FILE_MANAGER, 'entry=' . urlencode(basename($_POST['directory_name']))));
+              }
+            } else {
+              $messageStack->add(sprintf(ERROR_DIRECTORY_EXISTS, $new_directory), 'error');
+            }
+          } else {
+            $messageStack->add_session(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $current_path), 'error');
           }
-        } else {
-          $messageStack->add(sprintf(ERROR_DIRECTORY_EXISTS, $current_path . '/' . $HTTP_POST_VARS['folder_name']), 'error');
         }
+
+        tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
         break;
       case 'save':
-        if ($fp = fopen($current_path . '/' . $HTTP_POST_VARS['filename'], 'w+')) {
-          fputs($fp, stripslashes($HTTP_POST_VARS['file_contents']));
-          fclose($fp);
-          tep_redirect(tep_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($HTTP_POST_VARS['filename'])));
+        if ( (isset($_GET['entry']) && !empty($_GET['entry'])) || (isset($_POST['filename']) && !empty($_POST['filename'])) ) {
+          if (isset($_GET['entry']) && !empty($_GET['entry'])) {
+            $filename = basename($_GET['entry']);
+          } elseif (isset($_POST['filename']) && !empty($_POST['filename'])) {
+            $filename = basename($_POST['filename']);
+          }
+
+          if ($fp = fopen($current_path . '/' . $filename, 'w+')) {
+            fputs($fp, $_POST['contents']);
+            fclose($fp);
+          }
+
+          tep_redirect(tep_href_link(FILENAME_FILE_MANAGER, 'entry=' . $filename));
         }
+
+        tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
         break;
       case 'processuploads':
-        for ($i=1; $i<6; $i++) {
-          if (isset($GLOBALS['file_' . $i]) && tep_not_null($GLOBALS['file_' . $i])) {
+        if (is_writeable($current_path)) {
+          for ($i=0; $i<10; $i++) {
             new upload('file_' . $i, $current_path);
           }
+        } else {
+          $messageStack->add_session(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $current_path), 'error');
         }
 
         tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
         break;
       case 'download':
-        header('Content-type: application/x-octet-stream');
-        header('Content-disposition: attachment; filename=' . urldecode($HTTP_GET_VARS['filename']));
-        readfile($current_path . '/' . urldecode($HTTP_GET_VARS['filename']));
-        exit;
-        break;
-      case 'upload':
-      case 'new_folder':
-      case 'new_file':
-        $directory_writeable = true;
-        if (!is_writeable($current_path)) {
-          $directory_writeable = false;
-          $messageStack->add(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $current_path), 'error');
-        }
-        break;
-      case 'edit':
-        if (strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
+        if (isset($_GET['entry']) && !empty($_GET['entry'])) {
+          $target = $current_path . '/' . basename($_GET['entry']);
+
+          if (file_exists($target)) {
+            header('Content-type: application/x-octet-stream');
+            header('Content-disposition: attachment; filename=' . urldecode(basename($_GET['entry'])));
 
-        $file_writeable = true;
-        if (!is_writeable($current_path . '/' . $HTTP_GET_VARS['info'])) {
-          $file_writeable = false;
-          $messageStack->add(sprintf(ERROR_FILE_NOT_WRITEABLE, $current_path . '/' . $HTTP_GET_VARS['info']), 'error');
+            readfile($target);
+            exit;
+          }
         }
         break;
-      case 'delete':
-        if (strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
-        break;
     }
   }
 
-  $in_directory = substr(substr(DIR_FS_DOCUMENT_ROOT, strrpos(DIR_FS_DOCUMENT_ROOT, '/')), 1);
-  $current_path_array = explode('/', $current_path);
-  $document_root_array = explode('/', DIR_FS_DOCUMENT_ROOT);
-  $goto_array = array(array('id' => DIR_FS_DOCUMENT_ROOT, 'text' => $in_directory));
-  for ($i=0, $n=sizeof($current_path_array); $i<$n; $i++) {
-    if ((isset($document_root_array[$i]) && ($current_path_array[$i] != $document_root_array[$i])) || !isset($document_root_array[$i])) {
-      $goto_array[] = array('id' => implode('/', array_slice($current_path_array, 0, $i+1)), 'text' => $current_path_array[$i]);
-    }
-  }
-?>
-<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html <?php echo HTML_PARAMS; ?>>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
-<title><?php echo TITLE; ?></title>
-<link rel="stylesheet" type="text/css" href="">
-<script language="_javascript_" src=""></script>
-</head>
-<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
-<!-- header //-->
-<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
-<!-- header_eof //-->
-
-<!-- body //-->
-<table border="0" width="100%" cellspacing="2" cellpadding="2">
-  <tr>
-    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
-<!-- left_navigation //-->
-<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
-<!-- left_navigation_eof //-->
-    </table></td>
-<!-- body_text //-->
-    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
-      <tr>
-        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
-          <tr><?php echo tep_draw_form('goto', FILENAME_FILE_MANAGER, '', 'get'); ?>
-            <td class="pageHeading"><?php echo HEADING_TITLE . '<br><span class="smallText">' . $current_path . '</span>'; ?></td>
-            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', HEADING_IMAGE_HEIGHT); ?></td>
-            <td class="pageHeading" align="right"><?php echo tep_draw_pull_down_menu('goto', $goto_array, $current_path, ''); ?></td>
-          </form></tr>
-        </table></td>
-      </tr>
-<?php
-  if ( (($action == 'new_file') && ($directory_writeable == true)) || ($action == 'edit') ) {
-    if (isset($HTTP_GET_VARS['info']) && strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
-
-    if (!isset($file_writeable)) $file_writeable = true;
-    $file_contents = '';
-    if ($action == 'new_file') {
-      $filename_input_field = tep_draw_input_field('filename');
-    } elseif ($action == 'edit') {
-      if ($file_array = file($current_path . '/' . $HTTP_GET_VARS['info'])) {
-        $file_contents = htmlspecialchars(implode('', $file_array));
-      }
-      $filename_input_field = $HTTP_GET_VARS['info'] . tep_draw_hidden_field('filename', $HTTP_GET_VARS['info']);
-    }
-?>
-      <tr>
-        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
-      </tr>
-      <tr><?php echo tep_draw_form('new_file', FILENAME_FILE_MANAGER, 'action="" ?>
-        <td><table border="0" cellspacing="0" cellpadding="2">
-          <tr>
-            <td class="main"><?php echo TEXT_FILE_NAME; ?></td>
-            <td class="main"><?php echo $filename_input_field; ?></td>
-          </tr>
-          <tr>
-            <td class="main" valign="top"><?php echo TEXT_FILE_CONTENTS; ?></td>
-            <td class="main"><?php echo tep_draw_textarea_field('file_contents', 'soft', '80', '20', $file_contents, (($file_writeable) ? '' : 'readonly')); ?></td>
-          </tr>
-          <tr>
-            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
-          </tr>
-          <tr>
-            <td align="right" class="main" colspan="2"><?php if ($file_writeable == true) echo tep_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;'; echo '<a href="">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
-          </tr>
-        </table></td>
-      </form></tr>
-<?php
-  } else {
-    $showuser = (function_exists('posix_getpwuid') ? true : false);
-    $contents = array();
-    $dir = dir($current_path);
-    while ($file = $dir->read()) {
-      if ( ($file != '.') && ($file != 'CVS') && ( ($file != '..') || ($current_path != DIR_FS_DOCUMENT_ROOT) ) ) {
-        $file_size = number_format(filesize($current_path . '/' . $file)) . ' bytes';
-
-        $permissions = tep_get_file_permissions(fileperms($current_path . '/' . $file));
-        if ($showuser) {
-          $user = @posix_getpwuid(fileowner($current_path . '/' . $file));
-          $group = @posix_getgrgid(filegroup($current_path . '/' . $file));
-        } else {
-          $user = $group = array();
-        }
-
-        $contents[] = array('name' => $file,
-                            'is_dir' => is_dir($current_path . '/' . $file),
-                            'last_modified' => strftime(DATE_TIME_FORMAT, filemtime($current_path . '/' . $file)),
-                            'size' => $file_size,
-                            'permissions' => $permissions,
-                            'user' => $user['name'],
-                            'group' => $group['name']);
-      }
-    }
-
-    function tep_cmp($a, $b) {
-      return strcmp( ($a['is_dir'] ? 'D' : 'F') . $a['name'], ($b['is_dir'] ? 'D' : 'F') . $b['name']);
-    }
-    usort($contents, 'tep_cmp');
-?>
-
-      <tr>
-        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
-          <tr>
-            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
-              <tr class="dataTableHeadingRow">
-                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FILENAME; ?></td>
-                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SIZE; ?></td>
-                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PERMISSIONS; ?></td>
-                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_USER; ?></td>
-                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_GROUP; ?></td>
-                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LAST_MODIFIED; ?></td>
-                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
-              </tr>
-<?php
-  for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
-    if ((!isset($HTTP_GET_VARS['info']) || (isset($HTTP_GET_VARS['info']) && ($HTTP_GET_VARS['info'] == $contents[$i]['name']))) && !isset($fInfo) && ($action != 'upload') && ($action != 'new_folder')) {
-      $fInfo = new objectInfo($contents[$i]);
-    }
-
-    if ($contents[$i]['name'] == '..') {
-      $goto_link = substr($current_path, 0, strrpos($current_path, '/'));
-    } else {
-      $goto_link = $current_path . '/' . $contents[$i]['name'];
-    }
+  $goto_array = array(array('id' => '', 'text' => '--TOP--'));
 
-    if (isset($fInfo) && is_object($fInfo) && ($contents[$i]['name'] == $fInfo->name)) {
-      if ($fInfo->is_dir) {
-        echo '              <tr id="defaultSelected" class="dataTableRowSelected"  >' . "\n";
-        $ . $goto_link;
-      } else {
-        echo '              <tr id="defaultSelected" class="dataTableRowSelected"  >' . "\n";
-        $ . urlencode($fInfo->name) . '&action=""
-      }
-    } else {
-      echo '              <tr class="dataTableRow"  >' . "\n";
-      $ . urlencode($contents[$i]['name']);
-    }
+  if ($current_path != OSC_ADMIN_FILE_MANAGER_ROOT_PATH) {
+    $path_array = explode('/', substr($current_path, strlen(OSC_ADMIN_FILE_MANAGER_ROOT_PATH)+1));
 
-    if ($contents[$i]['is_dir']) {
-      if ($contents[$i]['name'] == '..') {
-        $icon = tep_image(DIR_WS_ICONS . 'previous_level.gif', ICON_PREVIOUS_LEVEL);
+    foreach ($path_array as $value) {
+      if (sizeof($goto_array) < 2) {
+        $goto_array[] = array('id' => $value, 'text' => $value);
       } else {
-        $icon = (isset($fInfo) && is_object($fInfo) && ($contents[$i]['name'] == $fInfo->name) ? tep_image(DIR_WS_ICONS . 'current_folder.gif', ICON_CURRENT_FOLDER) : tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER));
+        $parent = end($goto_array);
+        $goto_array[] = array('id' => $parent['id'] . '/' . $value, 'text' => $parent['id'] . '/' . $value);
       }
-      $link = tep_href_link(FILENAME_FILE_MANAGER, 'goto=' . $goto_link);
-    } else {
-      $icon = tep_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD);
-      $link = tep_href_link(FILENAME_FILE_MANAGER, 'action="" . urlencode($contents[$i]['name']));
     }
-?>
-                <td class="dataTableContent" ><?php echo '<a href="">' . $icon . '</a>&nbsp;' . $contents[$i]['name']; ?></td>
-                <td class="dataTableContent" align="right" ><?php echo ($contents[$i]['is_dir'] ? '&nbsp;' : $contents[$i]['size']); ?></td>
-                <td class="dataTableContent" align="center" ><tt><?php echo $contents[$i]['permissions']; ?></tt></td>
-                <td class="dataTableContent" ><?php echo $contents[$i]['user']; ?></td>
-                <td class="dataTableContent" ><?php echo $contents[$i]['group']; ?></td>
-                <td class="dataTableContent" align="center" ><?php echo $contents[$i]['last_modified']; ?></td>
-                <td class="dataTableContent" align="right"><?php if ($contents[$i]['name'] != '..') echo '<a href="">' . tep_image(DIR_WS_ICONS . 'delete.gif', ICON_DELETE) . '</a>&nbsp;'; if (isset($fInfo) && is_object($fInfo) && ($fInfo->name == $contents[$i]['name'])) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
-              </tr>
-<?php
   }
-?>
-              <tr>
-                <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
-                  <tr valign="top">
-                    <td class="smallText"><?php echo '<a href="">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
-                    <td class="smallText" align="right"><?php echo '<a href="">' . tep_image_button('button_upload.gif', IMAGE_UPLOAD) . '</a>&nbsp;<a href="">' . tep_image_button('button_new_file.gif', IMAGE_NEW_FILE) . '</a>&nbsp;<a href="">' . tep_image_button('button_new_folder.gif', IMAGE_NEW_FOLDER) . '</a>'; ?></td>
-                  </tr>
-                </table></td>
-              </tr>
-            </table></td>
-<?php
-    $heading = array();
-    $contents = array();
 
-    switch ($action) {
-      case 'delete':
-        $heading[] = array('text' => '<b>' . $fInfo->name . '</b>');
-
-        $contents = array('form' => tep_draw_form('file', FILENAME_FILE_MANAGER, 'info=' . urlencode($fInfo->name) . '&action=""
-        $contents[] = array('text' => TEXT_DELETE_INTRO);
-        $contents[] = array('text' => '<br><b>' . $fInfo->name . '</b>');
-        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
-        break;
-      case 'new_folder':
-        $heading[] = array('text' => '<b>' . TEXT_NEW_FOLDER . '</b>');
-
-        $contents = array('form' => tep_draw_form('folder', FILENAME_FILE_MANAGER, 'action=""
-        $contents[] = array('text' => TEXT_NEW_FOLDER_INTRO);
-        $contents[] = array('text' => '<br>' . TEXT_FILE_NAME . '<br>' . tep_draw_input_field('folder_name'));
-        $contents[] = array('align' => 'center', 'text' => '<br>' . (($directory_writeable == true) ? tep_image_submit('button_save.gif', IMAGE_SAVE) : '') . ' <a href="">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
-        break;
-      case 'upload':
-        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_UPLOAD . '</b>');
-
-        $contents = array('form' => tep_draw_form('file', FILENAME_FILE_MANAGER, 'action="" 'post', 'enctype="multipart/form-data"'));
-        $contents[] = array('text' => TEXT_UPLOAD_INTRO);
-
-        $file_upload = '';
-        for ($i=1; $i<6; $i++) $file_upload .= tep_draw_file_field('file_' . $i) . '<br>';
-
-        $contents[] = array('text' => '<br>' . $file_upload);
-        $contents[] = array('align' => 'center', 'text' => '<br>' . (($directory_writeable == true) ? tep_image_submit('button_upload.gif', IMAGE_UPLOAD) : '') . ' <a href="">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
-        break;
-      default:
-        if (isset($fInfo) && is_object($fInfo)) {
-          $heading[] = array('text' => '<b>' . $fInfo->name . '</b>');
-
-          if (!$fInfo->is_dir) $contents[] = array('align' => 'center', 'text' => '<a href="">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
-          $contents[] = array('text' => '<br>' . TEXT_FILE_NAME . ' <b>' . $fInfo->name . '</b>');
-          if (!$fInfo->is_dir) $contents[] = array('text' => '<br>' . TEXT_FILE_SIZE . ' <b>' . $fInfo->size . '</b>');
-          $contents[] = array('text' => '<br>' . TEXT_LAST_MODIFIED . ' ' . $fInfo->last_modified);
-        }
-    }
-
-    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
-      echo '            <td width="25%" valign="top">' . "\n";
+  switch ($action) {
+    case 'fmEdit': $page_contents = 'file_manager_edit.php'; break;
+    default: $page_contents = 'file_manager.php';
+  }
 
-      $box = new box;
-      echo $box->infoBox($heading, $contents);
+  require('templates/default.php');
 
-      echo '            </td>' . "\n";
-    }
-?>
-          </tr>
-        </table></td>
-      </tr>
-<?php
-  }
+  require('includes/application_bottom.php');
 ?>
-    </table></td>
-<!-- body_text_eof //-->
-  </tr>
-</table>
-<!-- body_eof //-->
-
-<!-- footer //-->
-<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
-<!-- footer_eof //-->
-<br>
-</body>
-</html>
-<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

admin/admin/includes/languages/english
file_manager.php 1.15 -> 1.16
diff -u -r1.15 -r1.16
--- file_manager.php	2003/09/10 17:39:25	1.15
+++ file_manager.php	2004/08/15 18:16:08	1.16
@@ -5,34 +5,35 @@
   osCommerce, Open Source E-Commerce Solutions
   http://www.oscommerce.com
 
-  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 osCommerce
 
   Released under the GNU General Public License
 */
 
-define('HEADING_TITLE', 'File Manager');
+  define('HEADING_TITLE', 'File Manager');
 
-define('TABLE_HEADING_FILENAME', 'Name');
-define('TABLE_HEADING_SIZE', 'Size');
-define('TABLE_HEADING_PERMISSIONS', 'Permissions');
-define('TABLE_HEADING_USER', 'User');
-define('TABLE_HEADING_GROUP', 'Group');
-define('TABLE_HEADING_LAST_MODIFIED', 'Last Modified');
-define('TABLE_HEADING_ACTION', 'Action');
+  define('TABLE_HEADING_FILENAME', 'Name');
+  define('TABLE_HEADING_SIZE', 'Size');
+  define('TABLE_HEADING_PERMISSIONS', 'Permissions');
+  define('TABLE_HEADING_USER', 'User');
+  define('TABLE_HEADING_GROUP', 'Group');
+  define('TABLE_HEADING_WRITEABLE', 'Writeable');
+  define('TABLE_HEADING_LAST_MODIFIED', 'Last Modified');
+  define('TABLE_HEADING_ACTION', 'Action');
 
-define('TEXT_INFO_HEADING_UPLOAD', 'Upload');
-define('TEXT_FILE_NAME', 'Filename:');
-define('TEXT_FILE_SIZE', 'Size:');
-define('TEXT_FILE_CONTENTS', 'Contents:');
-define('TEXT_LAST_MODIFIED', 'Last Modified:');
-define('TEXT_NEW_FOLDER', 'New Folder');
-define('TEXT_NEW_FOLDER_INTRO', 'Enter the name for the new folder:');
-define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this file?');
-define('TEXT_UPLOAD_INTRO', 'Please select the files to upload.');
+  define('TEXT_INFO_HEADING_UPLOAD', 'Upload');
+  define('TEXT_FILE_NAME', 'Filename:');
+  define('TEXT_FILE_SIZE', 'Size:');
+  define('TEXT_FILE_CONTENTS', 'Contents:');
+  define('TEXT_LAST_MODIFIED', 'Last Modified:');
+  define('TEXT_NEW_FOLDER', 'New Folder');
+  define('TEXT_NEW_FOLDER_INTRO', 'Enter the name for the new folder:');
+  define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this file?');
+  define('TEXT_UPLOAD_INTRO', 'Please select the files to upload.');
 
-define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
-define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
-define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Error: I can not remove this directory. Please set the right user permissions on: %s');
-define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
-define('ERROR_DIRECTORY_EXISTS', 'Error: Directory already exists: %s');
+  define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
+  define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+  define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Error: I can not remove this directory. Please set the right user permissions on: %s');
+  define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+  define('ERROR_DIRECTORY_EXISTS', 'Error: Directory already exists: %s');
 ?>

admin/admin/includes/languages/german
file_manager.php 1.19 -> 1.20
diff -u -r1.19 -r1.20
--- file_manager.php	2003/09/10 17:39:25	1.19
+++ file_manager.php	2004/08/15 18:16:08	1.20
@@ -5,34 +5,35 @@
   osCommerce, Open Source E-Commerce Solutions
   http://www.oscommerce.com
 
-  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 osCommerce
 
   Released under the GNU General Public License
 */
 
-define('HEADING_TITLE', 'Datei-Manager');
+  define('HEADING_TITLE', 'Datei-Manager');
 
-define('TABLE_HEADING_FILENAME', 'Name');
-define('TABLE_HEADING_SIZE', 'Gr&ouml;sse');
-define('TABLE_HEADING_PERMISSIONS', 'Zugriffsrechte');
-define('TABLE_HEADING_USER', 'Benutzer');
-define('TABLE_HEADING_GROUP', 'Gruppe');
-define('TABLE_HEADING_LAST_MODIFIED', 'letzte &Auml;nderung');
-define('TABLE_HEADING_ACTION', 'Aktion');
+  define('TABLE_HEADING_FILENAME', 'Name');
+  define('TABLE_HEADING_SIZE', 'Gr&ouml;sse');
+  define('TABLE_HEADING_PERMISSIONS', 'Zugriffsrechte');
+  define('TABLE_HEADING_USER', 'Benutzer');
+  define('TABLE_HEADING_GROUP', 'Gruppe');
+  define('TABLE_HEADING_WRITEABLE', 'Beschreibbar');
+  define('TABLE_HEADING_LAST_MODIFIED', 'letzte &Auml;nderung');
+  define('TABLE_HEADING_ACTION', 'Aktion');
 
-define('TEXT_INFO_HEADING_UPLOAD', 'Upload');
-define('TEXT_FILE_NAME', 'Dateiname:');
-define('TEXT_FILE_SIZE', 'Gr&ouml;sse:');
-define('TEXT_FILE_CONTENTS', 'Inhalt:');
-define('TEXT_LAST_MODIFIED', 'letzte &Auml;nderung:');
-define('TEXT_NEW_FOLDER', 'Neues Verzeichnis');
-define('TEXT_NEW_FOLDER_INTRO', 'Geben Sie den Namen f&uuml;r das neue Verzeichnis ein:');
-define('TEXT_DELETE_INTRO', 'Sind Sie sicher, dass Sie diese Datei l&ouml;schen m&ouml;chten?');
-define('TEXT_UPLOAD_INTRO', 'Bitte die Dateien ausw&auml;hlen, welche hochgeladen werden sollen.');
+  define('TEXT_INFO_HEADING_UPLOAD', 'Upload');
+  define('TEXT_FILE_NAME', 'Dateiname:');
+  define('TEXT_FILE_SIZE', 'Gr&ouml;sse:');
+  define('TEXT_FILE_CONTENTS', 'Inhalt:');
+  define('TEXT_LAST_MODIFIED', 'letzte &Auml;nderung:');
+  define('TEXT_NEW_FOLDER', 'Neues Verzeichnis');
+  define('TEXT_NEW_FOLDER_INTRO', 'Geben Sie den Namen f&uuml;r das neue Verzeichnis ein:');
+  define('TEXT_DELETE_INTRO', 'Sind Sie sicher, dass Sie diese Datei l&ouml;schen m&ouml;chten?');
+  define('TEXT_UPLOAD_INTRO', 'Bitte die Dateien ausw&auml;hlen, welche hochgeladen werden sollen.');
 
-define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis ist schreibgesch&uuml;tzt. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
-define('ERROR_FILE_NOT_WRITEABLE', 'Fehler: Die Datei ist schreibgesch&uuml;tzt. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
-define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Fehler: Das Verzeichnis kann nicht gel&ouml;scht werden. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
-define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis %s existiert nicht!');
-define('ERROR_DIRECTORY_EXISTS', 'Error: Directory already exists: %s');
-?>
\ No newline at end of file
+  define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis ist schreibgesch&uuml;tzt. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
+  define('ERROR_FILE_NOT_WRITEABLE', 'Fehler: Die Datei ist schreibgesch&uuml;tzt. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
+  define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Fehler: Das Verzeichnis kann nicht gel&ouml;scht werden. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
+  define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis %s existiert nicht!');
+  define('ERROR_DIRECTORY_EXISTS', 'Error: Directory already exists: %s');
+?>

admin/admin/includes/languages/espanol
file_manager.php 1.17 -> 1.18
diff -u -r1.17 -r1.18
--- file_manager.php	2003/09/10 17:39:25	1.17
+++ file_manager.php	2004/08/15 18:16:09	1.18
@@ -5,34 +5,35 @@
   osCommerce, Open Source E-Commerce Solutions
   http://www.oscommerce.com
 
-  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 osCommerce
 
   Released under the GNU General Public License
 */
 
-define('HEADING_TITLE', 'Administrador de Archivos');
+  define('HEADING_TITLE', 'Administrador de Archivos');
 
-define('TABLE_HEADING_FILENAME', 'Nombre');
-define('TABLE_HEADING_SIZE', 'Tama&ntilde;o');
-define('TABLE_HEADING_PERMISSIONS', 'Permisos');
-define('TABLE_HEADING_USER', 'Usuario');
-define('TABLE_HEADING_GROUP', 'Grupo');
-define('TABLE_HEADING_LAST_MODIFIED', 'Modificado');
-define('TABLE_HEADING_ACTION', 'Acci&oacute;n');
+  define('TABLE_HEADING_FILENAME', 'Nombre');
+  define('TABLE_HEADING_SIZE', 'Tama&ntilde;o');
+  define('TABLE_HEADING_PERMISSIONS', 'Permisos');
+  define('TABLE_HEADING_USER', 'Usuario');
+  define('TABLE_HEADING_GROUP', 'Grupo');
+  define('TABLE_HEADING_WRITEABLE', 'Writeable');
+  define('TABLE_HEADING_LAST_MODIFIED', 'Modificado');
+  define('TABLE_HEADING_ACTION', 'Acci&oacute;n');
 
-define('TEXT_INFO_HEADING_UPLOAD', 'Subir');
-define('TEXT_FILE_NAME', 'Nombre:');
-define('TEXT_FILE_SIZE', 'Tama&ntilde;o:');
-define('TEXT_FILE_CONTENTS', 'Contenido:');
-define('TEXT_LAST_MODIFIED', 'Ultima Modificaci&oacute;n:');
-define('TEXT_NEW_FOLDER', 'Nueva Carpeta');
-define('TEXT_NEW_FOLDER_INTRO', 'Introduzca el nombre de la carpeta nueva:');
-define('TEXT_DELETE_INTRO', 'Seguro que desea eliminar este fichero?');
-define('TEXT_UPLOAD_INTRO', 'Seleccione los ficheros a subir.');
+  define('TEXT_INFO_HEADING_UPLOAD', 'Subir');
+  define('TEXT_FILE_NAME', 'Nombre:');
+  define('TEXT_FILE_SIZE', 'Tama&ntilde;o:');
+  define('TEXT_FILE_CONTENTS', 'Contenido:');
+  define('TEXT_LAST_MODIFIED', 'Ultima Modificaci&oacute;n:');
+  define('TEXT_NEW_FOLDER', 'Nueva Carpeta');
+  define('TEXT_NEW_FOLDER_INTRO', 'Introduzca el nombre de la carpeta nueva:');
+  define('TEXT_DELETE_INTRO', 'Seguro que desea eliminar este fichero?');
+  define('TEXT_UPLOAD_INTRO', 'Seleccione los ficheros a subir.');
 
-define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: No puedo escribir en este directorio. Asigne los permisos adecuados a: %s');
-define('ERROR_FILE_NOT_WRITEABLE', 'Error: No puedo escribir en este fichero. Asigne los permisos adecuados a: %s');
-define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Error: No puedo eliminar el directorio. Asigne los permisos adecuados a: %s');
-define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio: %s');
-define('ERROR_DIRECTORY_EXISTS', 'Error: Directory already exists: %s');
+  define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: No puedo escribir en este directorio. Asigne los permisos adecuados a: %s');
+  define('ERROR_FILE_NOT_WRITEABLE', 'Error: No puedo escribir en este fichero. Asigne los permisos adecuados a: %s');
+  define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Error: No puedo eliminar el directorio. Asigne los permisos adecuados a: %s');
+  define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio: %s');
+  define('ERROR_DIRECTORY_EXISTS', 'Error: Directory already exists: %s');
 ?>

admin/admin/templates/pages
file_manager.php added at 1.1
diff -N file_manager.php
--- /dev/null	Sun Aug 15 20:16:08 2004
+++ /tmp/cvsAAAp2aql1	Sun Aug 15 20:16:09 2004
@@ -0,0 +1,237 @@
+<?php
+/*
+  $Id$
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/classes/directory_listing.php');
+
+  $osC_DirectoryListing = new osC_DirectoryListing($current_path);
+  $osC_DirectoryListing->setStats(true);
+  $files = $osC_DirectoryListing->getFiles();
+?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td><h1><?php echo HEADING_TITLE; ?></h1></td>
+    <td class="smallText" align="right">
+<?php
+  echo tep_draw_form('file_manager', FILENAME_FILE_MANAGER, '', 'get') .
+       osc_draw_pull_down_menu('goto', $goto_array, substr($current_path, strlen(OSC_ADMIN_FILE_MANAGER_ROOT_PATH)+1), '') .
+       '</form>';
+?>
+    </td>
+  </tr>
+</table>
+
+<div id="infoBox_fmDefault" <?php if (!empty($action)) { echo 'style="display: none;"'; } ?>>
+  <table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">
+    <thead>
+      <tr>
+        <th><?php echo TABLE_HEADING_FILENAME; ?></th>
+        <th><?php echo TABLE_HEADING_SIZE; ?></th>
+        <th><?php echo TABLE_HEADING_PERMISSIONS; ?></th>
+        <th><?php echo TABLE_HEADING_USER; ?></th>
+        <th><?php echo TABLE_HEADING_GROUP; ?></th>
+        <th><?php echo TABLE_HEADING_WRITEABLE; ?></th>
+        <th><?php echo TABLE_HEADING_LAST_MODIFIED; ?></th>
+        <th><?php echo TABLE_HEADING_ACTION; ?></th>
+      </tr>
+    </thead>
+    <tbody>
+<?php
+  if ($current_path != OSC_ADMIN_FILE_MANAGER_ROOT_PATH) {
+    echo '      <tr  >' . "\n" .
+         '        <td colspan="8"><a href="">' . tep_image('templates/' . $template . '/images/icons/16x16/previous_level.gif') . '&nbsp;--Parent--</a></td>' . "\n" .
+         '      </tr>' . "\n";
+  }
+
+  for ($i=0, $n=sizeof($files); $i<$n; $i++) {
+    if (!isset($fmInfo) && (!isset($_GET['entry']) || (isset($_GET['entry']) && ($_GET['entry'] == $files[$i]['name'])))) {
+      $fmInfo = new objectInfo($files[$i]);
+    }
+
+    $file_owner = posix_getpwuid($files[$i]['user_id']);
+    $group_owner = posix_getgrgid($files[$i]['group_id']);
+
+    if ($files[$i]['is_directory'] === true) {
+      $entry_icon = tep_image('templates/' . $template . '/images/icons/16x16/folder_red.png', '', '16', '16');
+      $entry_url = tep_href_link(FILENAME_FILE_MANAGER, 'directory=' . $files[$i]['name']);
+    } else {
+      $entry_icon = tep_image('templates/' . $template . '/images/icons/16x16/file.png', ICON_FILE, '16', '16');
+      $entry_url = tep_href_link(FILENAME_FILE_MANAGER, 'entry=' . $files[$i]['name'] . '&action=""
+    }
+
+    if (isset($fmInfo) && ($files[$i]['name'] == $fmInfo->name)) {
+        echo '      <tr class="selected">' . "\n";
+      } else {
+        echo '      <tr   >' . "\n";
+      }
+?>
+        <td><?php echo '<a href="">' . $entry_icon . '&nbsp;' . $files[$i]['name'] . '</a>'; ?></td>
+        <td align="right"><?php echo number_format($files[$i]['size']); ?></td>
+        <td align="center"><tt><?php echo tep_get_file_permissions($files[$i]['permissions']); ?></tt></td>
+        <td><?php echo $file_owner['name']; ?></td>
+        <td><?php echo $group_owner['name']; ?></td>
+        <td align="center"><?php echo tep_image('templates/' . $template . '/images/icons/' . (is_writable($osC_DirectoryListing->getDirectory() . '/' . $files[$i]['name']) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif')); ?></td>
+        <td align="right"><?php echo date('F d Y H:i:s', $files[$i]['last_modified']); ?></td>
+        <td align="right">
+<?php
+    if ($files[$i]['is_directory'] === false) {
+      echo '<a href="" >' . tep_image('templates/' . $template . '/images/icons/16x16/edit.png', IMAGE_EDIT, '16', '16') . '</a>' . '&nbsp;' .
+           '<a href="" >' . tep_image('templates/' . $template . '/images/icons/16x16/save.png', IMAGE_SAVE, '16', '16') . '</a>' . '&nbsp;';
+    } else {
+      echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif') . '&nbsp;' .
+           tep_image(DIR_WS_IMAGES . 'pixel_trans.gif') . '&nbsp;';
+    }
+
+    if (isset($fmInfo) && ($files[$i]['name'] == $fmInfo->name)) {
+      echo '<a href="" >' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
+    } else {
+      echo '<a href="" >' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
+    }
+?>
+        </td>
+      </tr>
+<?php
+  }
+?>
+    </tbody>
+  </table>
+
+  <p><?php echo $current_path; ?></p>
+
+  <table border="0" width="100%" cellspacing="0" cellpadding="2">
+    <tr valign="top">
+<?php
+  if ($current_path != OSC_ADMIN_FILE_MANAGER_ROOT_PATH) {
+    echo '      <td class="smallText"><input type="button" value="' . IMAGE_RESET . '"  class="infoBoxButton"></td>' . "\n";
+  }
+?>
+      <td class="smallText" align="right"><?php echo '<input type="button" value="' . IMAGE_UPLOAD . '"  class="infoBoxButton">&nbsp;<input type="button" value="' . IMAGE_NEW_FILE . '"  class="infoBoxButton">&nbsp;<input type="button" value="' . IMAGE_NEW_FOLDER . '"  class="infoBoxButton">'; ?></td>
+    </tr>
+  </table>
+</div>
+
+<div id="infoBox_fmNewDirectory" <?php if ($action != 'fmNewDirectory') { echo 'style="display: none;"'; } ?>>
+  <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/new.png', IMAGE_INSERT, '16', '16') . ' ' . TEXT_NEW_FOLDER; ?></div>
+  <div class="infoBoxContent">
+
+<?php
+  if (is_writeable($current_path)) {
+?>
+
+    <?php echo tep_draw_form('fmNewDirectory', FILENAME_FILE_MANAGER, 'action="" ?>
+
+    <p><?php echo TEXT_NEW_FOLDER_INTRO; ?></p>
+
+    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="smallText" width="40%"><?php echo '<b>' . TEXT_FILE_NAME . '</b>'; ?></td>
+        <td class="smallText" width="60%"><?php echo osc_draw_input_field('directory_name', '', 'style="width: 100%;"'); ?></td>
+      </tr>
+    </table>
+
+    <p align="center"><?php echo '<input type="submit" value="' . IMAGE_SAVE . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '"  class="operationButton">'; ?></p>
+
+    </form>
+
+<?php
+  } else {
+?>
+
+    <p><?php echo sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $current_path); ?></p>
+
+    <p align="center"><?php echo '<input type="button" value="Retry"  class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '"  class="operationButton">'; ?></p>
+
+<?php
+  }
+?>
+
+  </div>
+</div>
+
+<div id="infoBox_fmUpload" <?php if ($action != 'fmUpload') { echo 'style="display: none;"'; } ?>>
+  <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/new.png', IMAGE_INSERT, '16', '16') . ' ' . TEXT_INFO_HEADING_UPLOAD; ?></div>
+  <div class="infoBoxContent">
+
+<?php
+  if (is_writeable($current_path)) {
+?>
+
+    <?php echo tep_draw_form('fmUpload', FILENAME_FILE_MANAGER, 'action="" 'post', 'enctype="multipart/form-data"'); ?>
+
+    <p><?php echo TEXT_UPLOAD_INTRO; ?></p>
+
+    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+    for ($i=0; $i<10; $i++) {
+?>
+      <tr>
+        <td class="smallText" width="40%"><?php echo '<b>' . TEXT_FILE_NAME . '</b>'; ?></td>
+        <td class="smallText" width="60%"><?php echo osc_draw_file_field('file_' . $i); ?></td>
+      </tr>
+<?php
+    }
+?>
+    </table>
+
+    <p align="center"><?php echo '<input type="submit" value="' . IMAGE_UPLOAD . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '"  class="operationButton">'; ?></p>
+
+    </form>
+
+<?php
+  } else {
+?>
+
+    <p><?php echo sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $current_path); ?></p>
+
+    <p align="center"><?php echo '<input type="button" value="Retry"  class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '"  class="operationButton">'; ?></p>
+
+<?php
+  }
+?>
+
+  </div>
+</div>
+
+<?php
+  if (isset($fmInfo)) {
+?>
+
+<div id="infoBox_fmDelete" <?php if ($action != 'fmDelete') { echo 'style="display: none;"'; } ?>>
+  <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . ' ' . $fmInfo->name; ?></div>
+  <div class="infoBoxContent">
+
+<?php
+    if (is_writeable($current_path . '/' . $fmInfo->name)) {
+?>
+
+    <p><?php echo TEXT_DELETE_INTRO; ?></p>
+    <p><?php echo '<b>' . $current_path . '/' . $fmInfo->name . '</b>'; ?></p>
+    <p align="center"><?php echo '<input type="button" value="' . IMAGE_DELETE . '"  class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '"  class="operationButton">'; ?></p>
+
+<?php
+    } else {
+?>
+
+    <p><?php echo sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $current_path . '/' . $fmInfo->name); ?></p>
+
+    <p align="center"><?php echo '<input type="button" value="Retry"  class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '"  class="operationButton">'; ?></p>
+
+<?php
+    }
+?>
+
+  </div>
+</div>
+
+<?php
+  }
+?>

admin/admin/templates/pages
file_manager_edit.php added at 1.1
diff -N file_manager_edit.php
--- /dev/null	Sun Aug 15 20:16:08 2004
+++ /tmp/cvsAAA53aGl1	Sun Aug 15 20:16:09 2004
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id$
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td><h1><?php echo HEADING_TITLE; ?></h1></td>
+    <td class="smallText" align="right">
+<?php
+  echo tep_draw_form('file_manager', FILENAME_FILE_MANAGER, '', 'get') .
+       osc_draw_pull_down_menu('goto', $goto_array, substr($current_path, strlen(OSC_ADMIN_FILE_MANAGER_ROOT_PATH)+1), '') .
+       '</form>';
+?>
+    </td>
+  </tr>
+</table>
+
+<?php
+  $writeable = true;
+  $contents = '';
+
+  if (isset($_GET['entry']) && !empty($_GET['entry'])) {
+    $target = $current_path . '/' . basename($_GET['entry']);
+
+    if (file_exists($target)) {
+      if (is_writeable($target) === false) {
+        $writeable = false;
+
+        echo '<p>' . sprintf(ERROR_FILE_NOT_WRITEABLE, $target) . '</p>';
+      }
+
+      $contents = file_get_contents($target);
+    } else {
+      $writeable = false;
+    }
+  } else {
+    if (is_writeable($current_path) === false) {
+      $writeable = false;
+
+      echo '<p>' . sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $current_path) . '</p>';
+    }
+  }
+?>
+
+<?php echo tep_draw_form('file_manager_edit', FILENAME_FILE_MANAGER, (isset($_GET['entry']) && !empty($_GET['entry']) ? 'entry=' . basename($_GET['entry']) . '&' : '') . 'action="" ?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="main"><?php echo TEXT_FILE_NAME; ?></td>
+    <td class="main"><?php echo (isset($_GET['entry']) && !empty($_GET['entry']) ? $target : $current_path . '/' . osc_draw_input_field('filename')); ?></td>
+  </tr>
+  <tr>
+    <td class="main" valign="top"><?php echo TEXT_FILE_CONTENTS; ?></td>
+    <td class="main"><?php echo osc_draw_textarea_field('contents', $contents, '80', '20', 'off', 'style="width: 100%;"' . (($writeable) ? '' : ' readonly')); ?></td>
+  </tr>
+</table>
+
+<p align="right">
+<?php
+  if ($writeable === true) {
+    echo '<input type="submit" value="' . IMAGE_SAVE . '" class="operationButton">&nbsp;';
+  }
+
+  echo '<input type="button" value="' . IMAGE_CANCEL . '" class="operationButton" >';
+?>
+</p>
+
+</form>
CVSspam 0.2.9
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
<Prev in Thread] Current Thread [Next in Thread>