[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 developers_tool_kit.php

Zen Cart 源代码 developers_tool_kit.php




下载文件

文件名: developers_tool_kit.php
文件类型: PHP文件
文件大小: 39.85 KiB
MD5: 5c97844d4bd0c284c54c0e743a7d7b49

developers_tool_kit.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2011 Zen Cart Development Team
  5.  * @copyright Portions Copyright 2003 osCommerce
  6.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  7.  * @version $Id: developers_tool_kit.php 18695 2011-05-04 05:24:19Z drbyte $
  8.  */
  9.  
  10.   require('includes/application_top.php');
  11.  
  12.   require(DIR_WS_CLASSES . 'currencies.php');
  13.   $currencies = new currencies();
  14.  
  15.   $languages = zen_get_languages();
  16.  
  17.   $configuration_key_lookup = zen_db_prepare_input($_POST['configuration_key'], false);
  18.   if (isset($_GET['configuration_key_lookup']) && $_GET['configuration_key_lookup'] != '') {
  19.     $configuration_key_lookup = zen_db_prepare_input(strtoupper($_GET['configuration_key_lookup']), false);
  20.     $_POST['configuration_key'] = strtoupper($_GET['configuration_key_lookup']);
  21.     $_POST['zv_files'] = 1;
  22.     $_POST['zv_filestype'] = $_POST['zv_filestype'];
  23.     $_POST['case_sensitive'] = $_POST['case_sensitive'];
  24.   }
  25.  
  26.   function getDirList ($dirName, $filetypes = 1) {
  27.     global $directory_array, $sub_dir_files;
  28. // add directory name to the sub_dir_files list;
  29.     $sub_dir_files[] = $dirName;
  30.     $d = @dir($dirName);
  31.     $file_extension = '.php';
  32.     if ($d) {
  33.       while($entry = $d->read()) {
  34.         if ($entry != "." && $entry != "..") {
  35.           if (is_dir($dirName."/".$entry)) {
  36.             if ($entry == 'CVS') {
  37.             // skip
  38.             } else {
  39.               getDirList($dirName."/".$entry);
  40.             }
  41.           } else {
  42.             if (preg_match('/\\' . $file_extension . '$/', $entry) > 0) {
  43. //echo 'I AM HERE 2 ' . $dirName."/".$entry . '<br>';
  44. //            $directory_array[] .= $dirName."/".$entry;
  45.             } else {
  46. //echo 'I AM HERE 3 ' . $dirName."/".$entry . '<br>';
  47.             }
  48.           }
  49.         }
  50.       }
  51.       $d->close();
  52.       unset($d);
  53.     }
  54.  
  55.     return $sub_dir_files;
  56.   }
  57.  
  58.   function zen_display_files($include_root = false, $filetypesincluded = 1) {
  59.     global $check_directory, $found, $configuration_key_lookup;
  60.     global $db;
  61.     $directory_array = array();
  62.     for ($i = 0, $n = sizeof($check_directory); $i < $n; $i++) {
  63. //echo 'I SEE ' . $check_directory[$i] . '<br>';
  64.  
  65.       $dir_check = $check_directory[$i];
  66.  
  67.       switch($filetypesincluded) {
  68.         case(1):
  69.           $file_extensions = array('.php');
  70.           break;
  71.         case(2):
  72.           $file_extensions = array('.php', '.css');
  73.           break;
  74.         case(3):
  75.           $file_extensions = array('.css');
  76.           break;
  77.         case(4):
  78.           $file_extensions = array('.html', '.txt');
  79.           break;
  80.         case(5):
  81.           $file_extensions = array('.js');
  82.           break;
  83.         default:
  84.           $file_extensions = array('.php', '.css');
  85.           break;
  86.       }
  87.  
  88.       if ($dir = @dir($dir_check)) {
  89.         while ($file = $dir->read()) {
  90.           if (!is_dir($dir_check . $file)) {
  91.             foreach($file_extensions as $extension) {
  92.               if (preg_match('/\\' . $extension . '$/', $file) > 0) {
  93.                 $directory_array[] = $dir_check . $file;
  94.               }
  95.             }
  96.           }
  97.         }
  98.         if (sizeof($directory_array)) {
  99.           sort($directory_array);
  100.         }
  101.         $dir->close();
  102.         unset($dir);
  103.       }
  104.     }
  105.  
  106.     if ($include_root == true) {
  107.       $original_array = $directory_array;
  108.       $root_array = array();
  109. // if not html/txt
  110.     if ($filetypesincluded != 3 && $filetypesincluded != 4 && $filetypesincluded != 5) {
  111.       $root_array[] = DIR_FS_CATALOG . 'index.php';
  112.       $root_array[] = DIR_FS_CATALOG . 'ipn_main_handler.php';
  113.       $root_array[] = DIR_FS_CATALOG . 'page_not_found.php';
  114.     }
  115.  
  116.       $root_array[] = DIR_FS_CATALOG . 'nddbc.html';
  117.       $new_array = array_merge($root_array, $original_array);
  118.       $directory_array = $new_array;
  119.     }
  120.  
  121. // show path and filename
  122.     if (strtoupper($configuration_key_lookup) == $configuration_key_lookup) {
  123.       while (strstr($configuration_key_lookup, '"')) $configuration_key_lookup = str_replace('"', '', $configuration_key_lookup);
  124.       while (strstr($configuration_key_lookup, "'")) $configuration_key_lookup = str_replace("'", '', $configuration_key_lookup);
  125.  
  126.       // if appears to be a constant ask about configuration table
  127.       $check_database = true;
  128.       $sql = "select * from " . TABLE_CONFIGURATION . " where configuration_key=:zcconfigkey:";
  129.       $sql = $db->BindVars($sql, ':zcconfigkey:', strtoupper($configuration_key_lookup), 'string');
  130.       $check_configure = $db->Execute($sql);
  131.       if ($check_configure->RecordCount() < 1) {
  132.         $sql = "select * from " . TABLE_PRODUCT_TYPE_LAYOUT . " where configuration_key=:zcconfigkey:";
  133.         $sql = $db->BindVars($sql, ':zcconfigkey:', strtoupper($configuration_key_lookup), 'string');
  134.         $check_configure = $db->Execute($sql);
  135.       }
  136.       if ($check_configure->RecordCount() >= 1) {
  137.         $links = '<strong><span class="alert">' . TEXT_SEARCH_DATABASE_TABLES . '</span></strong> ' . '<a href="' . zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=' . 'locate_configuration' . '&configuration_key_lookup=' . $configuration_key_lookup) . '">' . $configuration_key_lookup . '</a><br /><br />';
  138.       } else {
  139.         // do nothing
  140.       }
  141.     } else {
  142.       // don't ask about configuration table
  143.     }
  144. //die('I SEE ' . $check_configure->RecordCount() . ' vs ' . $check_database);
  145.     echo '<table border="0" width="100%" cellspacing="2" cellpadding="1" align="center">' . "\n";
  146.     if (isset($check_database ) && ($check_database == true && $check_configure->RecordCount() >= 1)) {
  147.       // only ask if found
  148.       echo '<tr><td>' . $links . '</td></tr>';
  149.     }
  150.     echo '<tr class="infoBoxContent"><td class="dataTableHeadingContent">' . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . TEXT_INFO_SEARCHING . sizeof($directory_array) . TEXT_INFO_FILES_FOR . $configuration_key_lookup . '</td></tr></table>' . "\n\n";
  151.     echo '<tr><td>&nbsp;</td></tr>';
  152.  
  153. // check all files located
  154.     $file_cnt = 0;
  155.     $cnt_found=0;
  156.     for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) {
  157.     // build file content of matching lines
  158.       $file_cnt++;
  159.       $file = $directory_array[$i];
  160. //echo 'I SEE ' . $directory_array[$i] . '<br>';
  161.       // clean path name
  162.       while (strstr($file, '//')) $file = str_replace('//', '/', $file);
  163.  
  164.       $show_file = '';
  165.       if (file_exists($file)) {
  166.         $show_file .= "\n" . '<table border="2" width="95%" cellspacing="2" cellpadding="1" align="center"><tr><td class="main">' . "\n";
  167.         $show_file .= '<tr class="infoBoxContent"><td class="dataTableHeadingContent">';
  168.         $show_file .= '<strong>' . $file . '</strong>';
  169.         $show_file .= '</td></tr>';
  170.         $show_file .= '<tr><td class="main">';
  171.  
  172.         // put file into an array to be scanned
  173.         $lines = file($file);
  174.         $found_line = 'false';
  175.         // loop through the array, show line and line numbers
  176.         $cnt_lines = 0;
  177.         foreach ($lines as $line_num => $line) {
  178.           $cnt_lines++;
  179.           if (isset($_POST['case_sensitive']) && $_POST['case_sensitive']) {
  180.             $check_case = strstr($line, $configuration_key_lookup);
  181.           } else {
  182.             $check_case = strstr(strtoupper($line), strtoupper($configuration_key_lookup));
  183.           }
  184.           if ($check_case) {
  185.             $found_line= 'true';
  186.             $found = 'true';
  187.             $cnt_found++;
  188.             $show_file .= "<br />Line #<strong>{$line_num}</strong> : " ;
  189.             //prevent db pwd from being displayed, for sake of security
  190.             $show_file .= (substr_count($line,"'DB_SERVER_PASSWORD'")) ? '***HIDDEN***' : htmlspecialchars($line, ENT_QUOTES, CHARSET);
  191.             $show_file .= "<br />\n";
  192.           } else {
  193.             if ($cnt_lines >= 5) {
  194. //            $show_file .= ' .';
  195.               $cnt_lines=0;
  196.             }
  197.           }
  198.         }
  199.       }
  200.       $show_file .= '</td></tr></table>' . "\n";
  201.  
  202.       // if there was a match, show lines
  203.       if ($found_line == 'true') {
  204.         echo $show_file . '<table><tr><td>&nbsp;</td></tr></table>';
  205.       } // show file
  206.     }
  207.     echo '<table border="0" width="100%" cellspacing="2" cellpadding="1" align="center"><tr class="infoBoxContent"><td class="dataTableHeadingContent">' . TEXT_INFO_MATCHES_FOUND . $cnt_found . '</td></tr></table>';
  208.   } // zen_display_files
  209.  
  210.  
  211.   $products_filter = (isset($_GET['products_filter']) ? $_GET['products_filter'] : (isset($products_filter) ? $products_filter : ''));
  212.  
  213.   $action = (isset($_GET['action']) ? $_GET['action'] : '');
  214.   // don't do any 'action' if clicked on the Check for Updates button
  215.   if (isset($_GET['vcheck']) && $_GET['vcheck']=='yes') $action = '';
  216.  
  217.   $current_category_id = (isset($_GET['current_category_id']) ? (int)$_GET['current_category_id'] : (int)$current_category_id);
  218.   $found= 'true';
  219.  
  220.   switch($action) {
  221.     case ('locate_configuration'):
  222.       if ($configuration_key_lookup == '') {
  223.         $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
  224.         zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
  225.       }
  226.       $found = 'false';
  227.       $zv_files_group = $_POST['zv_files'];
  228.  
  229.       $sql = "select * from " . TABLE_CONFIGURATION . " where configuration_key=:zcconfigkey:";
  230.       $sql = $db->BindVars($sql, ':zcconfigkey:', $_POST['configuration_key'], 'string');
  231.       $check_configure = $db->Execute($sql);
  232.       if ($check_configure->RecordCount() < 1) {
  233.         $sql = "select * from " . TABLE_PRODUCT_TYPE_LAYOUT . " where configuration_key=:zcconfigkey:";
  234.         $sql = $db->BindVars($sql, ':zcconfigkey:', $_POST['configuration_key'], 'string');
  235.         $check_configure = $db->Execute($sql);
  236.         if ($check_configure->RecordCount() < 1) {
  237.           // build filenames to search
  238.           switch ($zv_files_group) {
  239.             case (0): // none
  240.               $filename_listing = '';
  241.               break;
  242.             case (1): // all english.php files
  243.               $check_directory = array();
  244.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES;
  245.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/';
  246.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $template_dir . '/' . $_SESSION['language'] . '/';
  247.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/';
  248.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/extra_definitions/';
  249.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/extra_definitions/' . $template_dir . '/';
  250.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/payment/';
  251.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/shipping/';
  252.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/order_total/';
  253.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/product_types/';
  254.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES;
  255.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
  256.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/newsletters/';
  257.               break;
  258.             case (2): // all catalog /language/*.php
  259.               $check_directory = array();
  260.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES;
  261.               break;
  262.             case (3): // all catalog /language/english/*.php
  263.               $check_directory = array();
  264.               $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/';
  265.               break;
  266.             case (4): // all admin /language/*.php
  267.               $check_directory = array();
  268.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES;
  269.               break;
  270.             case (5): // all admin /language/english/*.php
  271.               // set directories and files names
  272.               $check_directory = array();
  273.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
  274.               break;
  275.             } // eof: switch
  276.  
  277.               // Check for new databases and filename in extra_datafiles directory
  278.  
  279.               zen_display_files();
  280.  
  281.         } else {
  282.           $show_products_type_layout = 'true';
  283.           $show_configuration_info = 'true';
  284.           $found = 'true';
  285.         }
  286.       } else {
  287.         $show_products_type_layout = 'false';
  288.         $show_configuration_info = 'true';
  289.         $found = 'true';
  290.       }
  291.  
  292.       break;
  293.  
  294.     case ('locate_function'):
  295.       if ($configuration_key_lookup == '') {
  296.         $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
  297.         zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
  298.       }
  299.       $found = 'false';
  300.       $zv_files_group = $_POST['zv_files'];
  301.  
  302.           // build filenames to search
  303.           switch ($zv_files_group) {
  304.             case (0): // none
  305.               $filename_listing = '';
  306.               break;
  307.             case (1): // all admin/catalog function files
  308.               $check_directory = array();
  309.               $check_directory[] = DIR_FS_CATALOG . DIR_WS_FUNCTIONS;
  310.               $check_directory[] = DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'extra_functions/';
  311.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_FUNCTIONS;
  312.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_FUNCTIONS . 'extra_functions/';
  313.               break;
  314.             case (2): // all catalog function files
  315.               $check_directory = array();
  316.               $check_directory[] = DIR_FS_CATALOG . DIR_WS_FUNCTIONS;
  317.               $check_directory[] = DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'extra_functions/';
  318.               break;
  319.             case (3): // all admin function files
  320.               $check_directory = array();
  321.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_FUNCTIONS;
  322.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_FUNCTIONS . 'extra_functions/';
  323.               break;
  324.             } // eof: switch
  325.  
  326.               // Check for new databases and filename in extra_datafiles directory
  327.  
  328.               zen_display_files();
  329.  
  330.       break;
  331.  
  332.     case ('locate_class'):
  333.       if ($configuration_key_lookup == '') {
  334.         $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
  335.         zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
  336.       }
  337.       $found = 'false';
  338.       $zv_files_group = $_POST['zv_files'];
  339.  
  340.           // build filenames to search
  341.           switch ($zv_files_group) {
  342.             case (0): // none
  343.               $filename_listing = '';
  344.               break;
  345.             case (1): // all admin/catalog classes files
  346.               $check_directory = array();
  347.               $check_directory[] = DIR_FS_CATALOG . DIR_WS_CLASSES;
  348.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_CLASSES;
  349.               break;
  350.             case (2): // all catalog classes files
  351.               $check_directory = array();
  352.               $check_directory[] = DIR_FS_CATALOG . DIR_WS_CLASSES;
  353.               break;
  354.             case (3): // all admin function files
  355.               $check_directory = array();
  356.               $check_directory[] = DIR_FS_ADMIN . DIR_WS_CLASSES;
  357.               break;
  358.             } // eof: switch
  359.  
  360.               // Check for new databases and filename in extra_datafiles directory
  361.  
  362.               zen_display_files();
  363.  
  364.       break;
  365.  
  366.     case ('locate_template'):
  367.       if ($configuration_key_lookup == '') {
  368.         $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
  369.         zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
  370.       }
  371.       $found = 'false';
  372.       $zv_files_group = $_POST['zv_files'];
  373.  
  374.           // build filenames to search
  375.           switch ($zv_files_group) {
  376.             case (0): // none
  377.               $filename_listing = '';
  378.               break;
  379.             case (1): // all template files
  380.               $check_directory = array();
  381.               $check_directory[] = DIR_FS_CATALOG_TEMPLATES . 'template_default/templates' . '/';
  382.               $check_directory[] = DIR_FS_CATALOG_TEMPLATES . 'template_default/sideboxes' . '/';
  383.               $check_directory[] = DIR_FS_CATALOG_MODULES;
  384.               $check_directory[] = DIR_FS_CATALOG_MODULES . 'sideboxes/';
  385.  
  386.               $check_directory[] = DIR_FS_CATALOG_TEMPLATES . $template_dir . '/templates' . '/';
  387.               $check_directory[] = DIR_FS_CATALOG_TEMPLATES . $template_dir . '/sideboxes' . '/';
  388.  
  389.               $sub_dir_files = array();
  390.               getDirList(DIR_FS_CATALOG_MODULES . 'pages');
  391.  
  392.               $check_dir = array_merge($check_directory, $sub_dir_files);
  393.               for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
  394.                 $check_directory[] = $check_dir[$i] . '/';
  395.               }
  396.  
  397.               break;
  398.             case (2): // all /templates files
  399.               $check_directory = array();
  400.               $check_directory[] = DIR_FS_CATALOG_TEMPLATES . 'template_default/templates' . '/';
  401.               $check_directory[] = DIR_FS_CATALOG_TEMPLATES . $template_dir . '/templates' . '/';
  402.               break;
  403.             case (3): // all sideboxes files
  404.               $check_directory = array();
  405.               $check_directory[] = DIR_FS_CATALOG_TEMPLATES . 'template_default/sideboxes' . '/';
  406.               $check_directory[] = DIR_FS_CATALOG_MODULES . 'sideboxes/';
  407.               $check_directory[] = DIR_FS_CATALOG_TEMPLATES . $template_dir . '/sideboxes' . '/';
  408.               break;
  409.             case (4): // all /pages files
  410.               $check_directory = array();
  411.               //$check_directory[] = DIR_FS_CATALOG_MODULES . 'pages/';
  412.               $sub_dir_files = array();
  413.               getDirList(DIR_FS_CATALOG_MODULES . 'pages');
  414.  
  415.               $check_dir = array_merge($check_directory, $sub_dir_files);
  416.               for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
  417.                 $check_directory[] = $check_dir[$i] . '/';
  418.               }
  419.  
  420.               break;
  421.             } // eof: switch
  422.  
  423.               // Check for new databases and filename in extra_datafiles directory
  424.  
  425.               zen_display_files();
  426.  
  427.       break;
  428.  
  429.  
  430. /// all files
  431.     case ('locate_all_files'):
  432.       $zv_check_root = false;
  433.       if ($configuration_key_lookup == '') {
  434.         $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
  435.         zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
  436.       }
  437.       $found = 'false';
  438.       $zv_files_group = $_POST['zv_files'];
  439.       $zv_filestype_group = $_POST['zv_filestype'];
  440. //echo 'settings: ' . '$zv_files_group: ' . $zv_files_group . '$zv_filestype_group: ' . $zv_filestype_group . '<br>';
  441. //echo 'Who am I template ' . $template_dir . ' sess lang ' . $_SESSION['language'];
  442.       switch ($zv_files_group) {
  443.         case (0): // none
  444.           $filename_listing = '';
  445.           break;
  446.         case (1): // all
  447.           $zv_check_root = true;
  448.           $filename_listing = '';
  449.  
  450.           $check_directory = array();
  451.  
  452. // get includes
  453.           $sub_dir_files = array();
  454.           getDirList(DIR_FS_CATALOG . DIR_WS_INCLUDES, $zv_filestype_group);
  455.           $sub_dir_files_catalog = $sub_dir_files;
  456.  
  457. // get email
  458.           $sub_dir_files = array();
  459.           getDirList(DIR_FS_EMAIL_TEMPLATES, $zv_filestype_group);
  460.           $sub_dir_files_email = $sub_dir_files;
  461.  
  462. // get admin
  463.           $sub_dir_files = array();
  464.           getDirList(DIR_FS_ADMIN, $zv_filestype_group);
  465.           $sub_dir_files_admin= $sub_dir_files;
  466.  
  467.           $check_dir = array_merge($sub_dir_files_catalog, $sub_dir_files_email, $sub_dir_files_admin);
  468.           for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
  469.             $check_directory[] = $check_dir[$i] . '/';
  470.           }
  471.           break;
  472.  
  473.         case (2): // all catalog
  474.           $zv_check_root = true;
  475.           $filename_listing = '';
  476.  
  477.           $check_directory = array();
  478.  
  479.           $sub_dir_files = array();
  480.           getDirList(DIR_FS_CATALOG . DIR_WS_INCLUDES, $zv_filestype_group);
  481.           $sub_dir_files_catalog = $sub_dir_files;
  482.  
  483. // get email
  484.           $sub_dir_files = array();
  485.           getDirList(DIR_FS_EMAIL_TEMPLATES, $zv_filestype_group);
  486.           $sub_dir_files_email = $sub_dir_files;
  487.  
  488.           $check_dir = array_merge($sub_dir_files_catalog, $sub_dir_files_email);
  489.           for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
  490.             $zv_add_dir= str_replace('//', '/', $check_dir[$i] . '/');
  491.             if (strstr($zv_add_dir, DIR_WS_ADMIN) == '') {
  492.               $check_directory[] = $zv_add_dir;
  493.             }
  494.           }
  495.           break;
  496.  
  497.         case (3): // all admin
  498.           $zv_check_root = false;
  499.           $filename_listing = '';
  500.  
  501.           $check_directory = array();
  502.  
  503.           $sub_dir_files = array();
  504.           getDirList(DIR_FS_ADMIN, $zv_filestype_group);
  505.           $sub_dir_files_admin = $sub_dir_files;
  506.  
  507.           $check_dir = array_merge($sub_dir_files_admin);
  508.           for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
  509.             $check_directory[] = $check_dir[$i] . '/';
  510.           }
  511.           break;
  512.         }
  513.           zen_display_files($zv_check_root, $zv_filestype_group);
  514.  
  515.       break;
  516.     } // eof: action
  517.  
  518.     // if no matches in either databases or selected language directory give an error
  519.     if ($found == 'false') {
  520.       $messageStack->add(ERROR_CONFIGURATION_KEY_NOT_FOUND . ' ' . $configuration_key_lookup, 'caution');
  521.     } elseif ($action != '') {
  522.       echo '<table width="90%" align="center"><tr><td>' . zen_draw_separator('pixel_black.gif', '100%', '2') . '</td></tr><tr><td>&nbsp;</td></tr></table>' . "\n";
  523.     }
  524.  
  525. ?>
  526. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  527. <html <?php echo HTML_PARAMS; ?>>
  528. <head>
  529. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  530. <title><?php echo TITLE; ?></title>
  531. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  532. <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  533. <script language="javascript" src="includes/menu.js"></script>
  534. <script language="javascript" src="includes/general.js"></script>
  535.  
  536. <script type="text/javascript">
  537.   <!--
  538.   function init()
  539.   {
  540.     cssjsmenu('navbar');
  541.     if (document.getElementById)
  542.     {
  543.       var kill = document.getElementById('hoverJS');
  544.       kill.disabled = true;
  545.     }
  546.   }
  547.   // -->
  548. </script>
  549. </head>
  550. <body onLoad="init()">
  551. <!-- header //-->
  552. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  553. <!-- header_eof //-->
  554.  
  555. <!-- body //-->
  556. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  557.   <tr>
  558. <!-- body_text //-->
  559.     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  560.       <tr>
  561.         <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  562.         <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  563.       </tr>
  564.  
  565. <?php
  566. if (isset($show_configuration_info) && $show_configuration_info == 'true') {
  567.   $show_configuration_info = 'false';
  568. ?>
  569.       <tr><td colspan="2">
  570.         <table border="3" cellspacing="4" cellpadding="4">
  571.           <tr class="infoBoxContent">
  572.             <td colspan="2" class="pageHeading" align="center"><?php echo TABLE_CONFIGURATION_TABLE; ?></td>
  573.           </tr>
  574.           <tr>
  575.             <td class="infoBoxHeading"><?php echo TABLE_TITLE_KEY; ?></td>
  576.             <td class="dataTableHeadingContentWhois"><?php echo $check_configure->fields['configuration_key']; ?></td>
  577.           </tr>
  578.           <tr>
  579.             <td class="infoBoxHeading"><?php echo TABLE_TITLE_TITLE; ?></td>
  580.             <td class="dataTableHeadingContentWhois"><?php echo $check_configure->fields['configuration_title']; ?></td>
  581.           </tr>
  582.           <tr>
  583.             <td class="infoBoxHeading"><?php echo TABLE_TITLE_DESCRIPTION; ?></td>
  584.             <td class="dataTableHeadingContentWhois"><?php echo $check_configure->fields['configuration_description']; ?></td>
  585.           </tr>
  586. <?php
  587.   if ($show_products_type_layout == 'true') {
  588.     $check_configure_group = $db->Execute("select * from " . TABLE_PRODUCT_TYPES . " where type_id='" . (int)$check_configure->fields['product_type_id'] . "'");
  589.   } else {
  590.     $check_configure_group = $db->Execute("select * from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id='" . (int)$check_configure->fields['configuration_group_id'] . "'");
  591.   }
  592. ?>
  593.  
  594. <?php
  595.   if ($show_products_type_layout == 'true') {
  596. ?>
  597.           <tr>
  598.             <td class="infoBoxHeading"><?php echo TABLE_TITLE_GROUP; ?></td>
  599.             <td class="dataTableHeadingContentWhois"><?php echo 'Product Type Layout'; ?></td>
  600.           </tr>
  601. <?php } else { ?>
  602.           <tr>
  603.             <td class="infoBoxHeading"><?php echo TABLE_TITLE_VALUE; ?></td>
  604.             <td class="dataTableHeadingContentWhois"><?php echo $check_configure->fields['configuration_value']; ?></td>
  605.           </tr>
  606.           <tr>
  607.             <td class="infoBoxHeading"><?php echo TABLE_TITLE_GROUP; ?></td>
  608.             <td class="dataTableHeadingContentWhois">
  609.             <?php
  610.               if ($check_configure_group->fields['configuration_group_id'] == '6') {
  611.                 $id_note = TEXT_INFO_CONFIGURATION_HIDDEN;
  612.               } else {
  613.                 $id_note = '';
  614.               }
  615.               echo 'ID#' . $check_configure_group->fields['configuration_group_id'] . ' ' . $check_configure_group->fields['configuration_group_title'] . $id_note;
  616.             ?>
  617.             </td>
  618.           </tr>
  619. <?php } ?>
  620.           <tr>
  621.             <td class="main" align="center" valign="middle">
  622.               <?php
  623.                 if ($show_products_type_layout == 'false' and ($check_configure->fields['configuration_id'] != 0 and $check_configure->fields['configuration_group_id'] != 6)) {
  624.                   echo '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $check_configure_group->fields['configuration_group_id'] . '&cID=' . $check_configure->fields['configuration_id']) . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>';
  625.                 } else {
  626.                   $page= '';
  627.                   if (strstr($check_configure->fields['configuration_key'], 'MODULE_SHIPPING')) $page .= 'shipping';
  628.                   if (strstr($check_configure->fields['configuration_key'], 'MODULE_PAYMENT')) $page .= 'payment';
  629.                   if (strstr($check_configure->fields['configuration_key'], 'MODULE_ORDER_TOTAL')) $page .= 'ordertotal';
  630.  
  631.                   if ($show_products_type_layout == 'true') {
  632.                     echo '<a href="' . zen_href_link(FILENAME_PRODUCT_TYPES) . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>';
  633.                   } else {
  634.                     if ($page != '') {
  635.                       echo '<a href="' . zen_href_link(FILENAME_MODULES, 'set=' . $page) . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>';
  636.                     } else {
  637.                       echo TEXT_INFO_NO_EDIT_AVAILABLE . '<br />';
  638.                     }
  639.                   }
  640.                 }
  641.               ?>
  642.               </td>
  643.             <td class="main" align="center" valign="middle"><?php echo '<a href="' . zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
  644.           </tr>
  645.           <tr class="infoBoxContent">
  646.             <td colspan="2" class="pageHeading" align="center">
  647. <?php
  648.       $links = '<br /><strong><span class="alert">' . TEXT_SEARCH_ALL_FILES . '</span></strong> ' . '<a href="' . zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=' . 'locate_all_files' . '&configuration_key_lookup=' . $configuration_key_lookup . '&zv_files=1') . '">' . $configuration_key_lookup . '</a><br />';
  649.       echo $links;
  650. ?>
  651.             </td>
  652.           </tr>
  653.         </table>
  654.       </td></tr>
  655. <?php
  656. } else {
  657. ?>
  658.  
  659. <?php
  660. // disabled and here for an example
  661. if (false) {
  662. ?>
  663. <!-- bof: update all products price sorter -->
  664.       <tr>
  665.         <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
  666.           <tr>
  667.             <td class="main" align="left" valign="top"><?php echo TEXT_INFO_PRODUCTS_PRICE_SORTER_UPDATE; ?></td>
  668.             <td class="main" align="right" valign="middle"><?php echo '<a href="' . zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=update_all_products_price_sorter') . '">' . zen_image_button('button_update.gif', IMAGE_UPDATE) . '</a>'; ?></td>
  669.           </tr>
  670.         </table></td>
  671.       </tr>
  672. <!-- eof: update all products price sorter -->
  673. <?php } ?>
  674.  
  675. <!-- bof: Locate a configuration constant -->
  676.       <tr>
  677.         <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
  678.           <tr>
  679.             <td colspan="3" class="main" align="left" valign="middle"><?php echo TEXT_CONFIGURATION_CONSTANT; ?></td>
  680.           </tr>
  681.  
  682.           <tr><form name = "locate_configure" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_configuration', 'NONSSL'); ?>" method="post"><?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
  683.             <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
  684.             <td class="main" align="left" valign="middle">
  685.               <?php
  686.                 $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
  687.                                               array('id' => '1', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_LANGUAGE),
  688.                                               array('id' => '2', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_CATALOG),
  689.                                               array('id' => '3', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_CATALOG_TEMPLATE),
  690.                                               array('id' => '4', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ADMIN),
  691.                                               array('id' => '5', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ADMIN_LANGUAGE)
  692.                                                     );
  693. //                                              array('id' => '6', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ALL)
  694.  
  695.                 echo '<strong>' . TEXT_LANGUAGE_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
  696.               ?>
  697.             </td>
  698.             <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
  699.           </form></tr>
  700.           <tr>
  701.             <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
  702.           </tr>
  703.         </table></td>
  704.       </tr>
  705. <!-- eof: Locate a configuration constant -->
  706.  
  707.  
  708. <!-- bof: Locate a function -->
  709.       <tr>
  710.         <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
  711.           <tr>
  712.             <td colspan="3" class="main" align="left" valign="middle"><?php echo TEXT_FUNCTION_CONSTANT; ?></td>
  713.           </tr>
  714.  
  715.           <tr><form name = "locate_function" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_function', 'NONSSL'); ?>"' method="post"><?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
  716.             <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
  717.             <td class="main" align="left" valign="middle">
  718.               <?php
  719.                 $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
  720.                                               array('id' => '1', 'text' => TEXT_FUNCTION_LOOKUP_CURRENT),
  721.                                               array('id' => '2', 'text' => TEXT_FUNCTION_LOOKUP_CURRENT_CATALOG),
  722.                                               array('id' => '3', 'text' => TEXT_FUNCTION_LOOKUP_CURRENT_ADMIN)
  723.                                                     );
  724. //                                              array('id' => '6', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ALL)
  725.  
  726.                 echo '<strong>' . TEXT_FUNCTION_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
  727.               ?>
  728.             </td>
  729.             <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
  730.           </form></tr>
  731.           <tr>
  732.             <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
  733.           </tr>
  734.         </table></td>
  735.       </tr>
  736. <!-- eof: Locate a function -->
  737.  
  738. <!-- bof: Locate a class -->
  739.       <tr>
  740.         <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
  741.           <tr>
  742.             <td colspan="3" class="main" align="left" valign="middle"><?php echo TEXT_CLASS_CONSTANT; ?></td>
  743.           </tr>
  744.  
  745.           <tr><form name = "locate_class" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_class', 'NONSSL'); ?>"' method="post"><?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
  746.             <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
  747.             <td class="main" align="left" valign="middle">
  748.               <?php
  749.                 $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
  750.                                               array('id' => '1', 'text' => TEXT_CLASS_LOOKUP_CURRENT),
  751.                                               array('id' => '2', 'text' => TEXT_CLASS_LOOKUP_CURRENT_CATALOG),
  752.                                               array('id' => '3', 'text' => TEXT_CLASS_LOOKUP_CURRENT_ADMIN)
  753.                                                     );
  754. //                                              array('id' => '6', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ALL)
  755.  
  756.                 echo '<strong>' . TEXT_CLASS_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
  757.               ?>
  758.             </td>
  759.             <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
  760.           </form></tr>
  761.           <tr>
  762.             <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
  763.           </tr>
  764.         </table></td>
  765.       </tr>
  766. <!-- eof: Locate a class -->
  767.  
  768. <!-- bof: Locate a template files -->
  769.       <tr>
  770.         <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
  771.           <tr>
  772.             <td colspan="3" class="main" align="left" valign="middle"><?php echo TEXT_TEMPLATE_CONSTANT; ?></td>
  773.           </tr>
  774.  
  775.           <tr><form name = "locate_template" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_template', 'NONSSL'); ?>"' method="post"><?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
  776.             <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
  777.             <td class="main" align="left" valign="middle">
  778.               <?php
  779.                 $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
  780.                                               array('id' => '1', 'text' => TEXT_TEMPLATE_LOOKUP_CURRENT),
  781.                                               array('id' => '2', 'text' => TEXT_TEMPLATE_LOOKUP_CURRENT_TEMPLATES),
  782.                                               array('id' => '3', 'text' => TEXT_TEMPLATE_LOOKUP_CURRENT_SIDEBOXES),
  783.                                               array('id' => '4', 'text' => TEXT_TEMPLATE_LOOKUP_CURRENT_PAGES)
  784.                                                     );
  785. //                                              array('id' => '6', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ALL)
  786.  
  787.                 echo '<strong>' . TEXT_TEMPLATE_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
  788.               ?>
  789.             </td>
  790.             <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
  791.           </form></tr>
  792.           <tr>
  793.             <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
  794.           </tr>
  795.         </table></td>
  796.       </tr>
  797. <!-- eof: Locate template Files -->
  798.  
  799.  
  800. <!-- bof: Locate all files -->
  801.       <tr>
  802.         <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
  803.           <tr>
  804.             <td colspan="4" class="main" align="left" valign="middle"><?php echo TEXT_ALL_FILES_CONSTANT; ?></td>
  805.           </tr>
  806.  
  807.           <tr><form name = "locate_all_files" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_all_files', 'NONSSL'); ?>" method="post"><?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
  808.             <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
  809.             <td class="main" align="left" valign="middle">
  810.               <?php
  811.                 $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
  812.                                               array('id' => '1', 'text' => TEXT_ALL_FILES_LOOKUP_CURRENT),
  813.                                               array('id' => '2', 'text' => TEXT_ALL_FILES_LOOKUP_CURRENT_CATALOG),
  814.                                               array('id' => '3', 'text' => TEXT_ALL_FILES_LOOKUP_CURRENT_ADMIN)
  815.                                                     );
  816.  
  817.                 echo '<strong>' . TEXT_ALL_FILES_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
  818.               ?>
  819.             </td>
  820.             <td class="main" align="left" valign="middle">
  821.               <?php
  822.                 $za_lookup_filetype = array(
  823.                                               array('id' => '1', 'text' => TEXT_ALL_FILES_LOOKUP_PHP),
  824.                                               array('id' => '2', 'text' => TEXT_ALL_FILES_LOOKUP_PHPCSS),
  825.                                               array('id' => '3', 'text' => TEXT_ALL_FILES_LOOKUP_CSS),
  826.                                               array('id' => '4', 'text' => TEXT_ALL_FILES_LOOKUP_HTMLTXT),
  827.                                               array('id' => '5', 'text' => TEXT_ALL_FILES_LOOKUP_JS)
  828.                                                     );
  829.  
  830.                 echo '<strong>' . TEXT_ALL_FILESTYPE_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_filestype', $za_lookup_filetype, '0');
  831.                 echo '<strong>' . TEXT_CASE_SENSITIVE . '</strong>' . zen_draw_checkbox_field('case_sensitive', true);
  832.               ?>
  833.             </td>
  834.             <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
  835.           </form></tr>
  836.           <tr>
  837.             <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
  838.           </tr>
  839.         </table></td>
  840.       </tr>
  841. <!-- eof: Locate all files -->
  842.  
  843. <?php
  844. } // eof configure
  845. ?>
  846.       <tr>
  847.         <td colspan="2"><?php echo '<br />' . zen_draw_separator('pixel_black.gif', '100%', '2'); ?></td>
  848.       </tr>
  849.  
  850.  
  851.     </table></td>
  852. <!-- body_text_eof //-->
  853.   </tr>
  854. </table>
  855. <!-- body_eof //-->
  856.  
  857. <!-- footer //-->
  858. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  859. <!-- footer_eof //-->
  860. </body>
  861. </html>
  862. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>