[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.22 KiB
MD5: eb89e01f5a2935046e9150cc087a4df1

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


cron