[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.15 KiB
MD5: d6b50d093ec9764e691b3ac8263f5f8e

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


cron