[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.93 KiB
MD5: 328fedbc5c67e0a50f8ce111ed45eb5a

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


cron