|
ZenCart_Documentation
1.5.0
http://www.collinsharper.com
|
00001 <?php 00011 require('includes/application_top.php'); 00012 00013 $action = (isset($_GET['action']) ? $_GET['action'] : ''); 00014 00015 if (zen_not_null($action)) { 00016 switch ($action) { 00017 case 'save': 00018 // demo active test 00019 if (zen_admin_demo()) { 00020 $_GET['action']= ''; 00021 $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution'); 00022 zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID)); 00023 } 00024 $configuration_value = zen_db_prepare_input($_POST['configuration_value']); 00025 $cID = zen_db_prepare_input($_GET['cID']); 00026 00027 $db->Execute("update " . TABLE_CONFIGURATION . " 00028 set configuration_value = '" . zen_db_input($configuration_value) . "', 00029 last_modified = now() where configuration_id = '" . (int)$cID . "'"); 00030 $configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue 00031 from ' . TABLE_CONFIGURATION; 00032 00033 $configuration = $db->Execute($configuration_query); 00034 00035 // set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true 00036 if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'true') ) { 00037 $db->Execute("update " . TABLE_CONFIGURATION . " 00038 set configuration_value = 'false', last_modified = '" . NOW . "' 00039 where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'"); } 00040 00041 $configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue 00042 from ' . TABLE_CONFIGURATION; 00043 00044 $configuration = $db->Execute($configuration_query); 00045 00046 zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID)); 00047 break; 00048 } 00049 } 00050 00051 $gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1; 00052 $_GET['gID'] = $gID; 00053 $cfg_group = $db->Execute("select configuration_group_title 00054 from " . TABLE_CONFIGURATION_GROUP . " 00055 where configuration_group_id = '" . (int)$gID . "'"); 00056 00057 if ($gID == 7) { 00058 $shipping_errors = ''; 00059 if (zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == 'NONE' or zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == '') { 00060 $shipping_errors .= '<br />' . ERROR_SHIPPING_ORIGIN_ZIP; 00061 } 00062 if (zen_get_configuration_key_value('ORDER_WEIGHT_ZERO_STATUS') == '1' and !defined('MODULE_SHIPPING_FREESHIPPER_STATUS')) { 00063 $shipping_errors .= '<br />' . ERROR_ORDER_WEIGHT_ZERO_STATUS; 00064 } 00065 if (defined('MODULE_SHIPPING_USPS_STATUS') and (MODULE_SHIPPING_USPS_USERID=='NONE' or MODULE_SHIPPING_USPS_SERVER == 'test')) { 00066 $shipping_errors .= '<br />' . ERROR_USPS_STATUS; 00067 } 00068 if ($shipping_errors != '') { 00069 $messageStack->add(ERROR_SHIPPING_CONFIGURATION . $shipping_errors, 'caution'); 00070 } 00071 } 00072 00073 ?> 00074 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> 00075 <html <?php echo HTML_PARAMS; ?>> 00076 <head> 00077 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 00078 <title><?php echo TITLE; ?></title> 00079 <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> 00080 <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS"> 00081 <script language="javascript" src="includes/menu.js"></script> 00082 <script language="javascript" src="includes/general.js"></script> 00083 <script type="text/javascript"> 00084 <!-- 00085 function init() 00086 { 00087 cssjsmenu('navbar'); 00088 if (document.getElementById) 00089 { 00090 var kill = document.getElementById('hoverJS'); 00091 kill.disabled = true; 00092 } 00093 } 00094 // --> 00095 </script> 00096 </head> 00097 <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()"> 00098 <!-- header //--> 00099 <?php require(DIR_WS_INCLUDES . 'header.php'); ?> 00100 <!-- header_eof //--> 00101 00102 <!-- body //--> 00103 <table border="0" width="100%" cellspacing="2" cellpadding="2"> 00104 <tr> 00105 <!-- body_text //--> 00106 <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> 00107 <tr> 00108 <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 00109 <tr> 00110 <td class="pageHeading"><?php echo $cfg_group->fields['configuration_group_title']; ?></td> 00111 <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> 00112 </tr> 00113 </table></td> 00114 </tr> 00115 <tr> 00116 <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 00117 <tr> 00118 <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> 00119 <tr class="dataTableHeadingRow"> 00120 <td class="dataTableHeadingContent" width="55%"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td> 00121 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td> 00122 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> 00123 </tr> 00124 <?php 00125 $configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key, 00126 use_function from " . TABLE_CONFIGURATION . " 00127 where configuration_group_id = '" . (int)$gID . "' 00128 order by sort_order"); 00129 while (!$configuration->EOF) { 00130 if (zen_not_null($configuration->fields['use_function'])) { 00131 $use_function = $configuration->fields['use_function']; 00132 if (preg_match('/->/', $use_function)) { 00133 $class_method = explode('->', $use_function); 00134 if (!is_object(${$class_method[0]})) { 00135 include(DIR_WS_CLASSES . $class_method[0] . '.php'); 00136 ${$class_method[0]} = new $class_method[0](); 00137 } 00138 $cfgValue = zen_call_function($class_method[1], $configuration->fields['configuration_value'], ${$class_method[0]}); 00139 } else { 00140 $cfgValue = zen_call_function($use_function, $configuration->fields['configuration_value']); 00141 } 00142 } else { 00143 $cfgValue = $configuration->fields['configuration_value']; 00144 } 00145 00146 if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $configuration->fields['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) { 00147 $cfg_extra = $db->Execute("select configuration_key, configuration_description, date_added, 00148 last_modified, use_function, set_function 00149 from " . TABLE_CONFIGURATION . " 00150 where configuration_id = '" . (int)$configuration->fields['configuration_id'] . "'"); 00151 $cInfo_array = array_merge($configuration->fields, $cfg_extra->fields); 00152 $cInfo = new objectInfo($cInfo_array); 00153 } 00154 00155 if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) { 00156 echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n"; 00157 } else { 00158 echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id'] . '&action=edit') . '\'">' . "\n"; 00159 } 00160 ?> 00161 <td class="dataTableContent"><?php echo $configuration->fields['configuration_title']; ?></td> 00162 <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td> 00163 <td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id']) . '" name="link_' . $configuration->fields['configuration_key'] . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> 00164 </tr> 00165 <?php 00166 $configuration->MoveNext(); 00167 } 00168 ?> 00169 </table></td> 00170 <?php 00171 $heading = array(); 00172 $contents = array(); 00173 00174 switch ($action) { 00175 case 'edit': 00176 $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>'); 00177 00178 if ($cInfo->set_function) { 00179 eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE) . '");'); 00180 } else { 00181 $value_field = zen_draw_input_field('configuration_value', htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE), 'size="60"'); 00182 } 00183 00184 $contents = array('form' => zen_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save')); 00185 if (ADMIN_CONFIGURATION_KEY_ON == 1) { 00186 $contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />'); 00187 } 00188 $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); 00189 $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field); 00190 $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE, 'name="submit' . $cInfo->configuration_key . '"') . ' <a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); 00191 break; 00192 default: 00193 if (isset($cInfo) && is_object($cInfo)) { 00194 $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>'); 00195 if (ADMIN_CONFIGURATION_KEY_ON == 1) { 00196 $contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />'); 00197 } 00198 00199 $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>'); 00200 $contents[] = array('text' => '<br>' . $cInfo->configuration_description); 00201 $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($cInfo->date_added)); 00202 if (zen_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($cInfo->last_modified)); 00203 } 00204 break; 00205 } 00206 00207 if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) { 00208 echo ' <td width="25%" valign="top">' . "\n"; 00209 00210 $box = new box; 00211 echo $box->infoBox($heading, $contents); 00212 00213 echo ' </td>' . "\n"; 00214 } 00215 ?> 00216 </tr> 00217 </table></td> 00218 </tr> 00219 </table></td> 00220 <!-- body_text_eof //--> 00221 </tr> 00222 </table> 00223 <!-- body_eof //--> 00224 00225 <!-- footer //--> 00226 <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> 00227 <!-- footer_eof //--> 00228 <br> 00229 </body> 00230 </html> 00231 <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>