[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 源代码 layout_controller.php

Zen Cart 源代码 layout_controller.php




下载文件

文件名: layout_controller.php
文件类型: PHP文件
文件大小: 24.75 KiB
MD5: ab322d8def8358913b6cb9dc5de42757

layout_controller.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2014 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: layout_controller.php drbyte  Modified in v1.5.4 $
  8.  */
  9.  
  10.   require('includes/application_top.php');
  11.  
  12. // Check all existing boxes are in the main /sideboxes
  13.   $boxes_directory = DIR_FS_CATALOG_MODULES . 'sideboxes/';
  14.  
  15.   $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
  16.   $directory_array = array();
  17.   if ($dir = @dir($boxes_directory)) {
  18.     while ($file = $dir->read()) {
  19.       if (!is_dir($boxes_directory . $file)) {
  20.         if (substr($file, strrpos($file, '.')) == $file_extension) {
  21.           if ($file != 'empty.txt') {
  22.             $directory_array[] = $file;
  23.           }
  24.         }
  25.       }
  26.     }
  27.     if (sizeof($directory_array)) {
  28.       sort($directory_array);
  29.     }
  30.     $dir->close();
  31.   }
  32.  
  33. // Check all exisiting boxes are in the current template /sideboxes/template_dir
  34.   $dir_check= $directory_array;
  35.   $boxes_directory = DIR_FS_CATALOG_MODULES . 'sideboxes/' . $template_dir . '/';
  36.  
  37.   $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
  38.  
  39.   if ($dir = @dir($boxes_directory)) {
  40.     while ($file = $dir->read()) {
  41.       if (!is_dir($boxes_directory . $file)) {
  42.           if (in_array($file, $dir_check, TRUE)) {
  43.             // skip name exists
  44.           } else {
  45.             if ($file != 'empty.txt') {
  46.               $directory_array[] = $file;
  47.             }
  48.           }
  49.       }
  50.     }
  51.     sort($directory_array);
  52.     $dir->close();
  53.   }
  54.  
  55.   $warning_new_box='';
  56.   $installed_boxes = array();
  57.   for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) {
  58.     $file = $directory_array[$i];
  59.  
  60. // Verify Definitions
  61.     $definitions = $db->Execute("select layout_box_name from " . TABLE_LAYOUT_BOXES . " where layout_box_name='" . zen_db_input($file) . "' and layout_template='" . zen_db_input($template_dir) . "'");
  62.     if ($definitions->EOF) {
  63.       if (!strstr($file, 'ezpages_bar')) {
  64.         $warning_new_box .= $file . ' ';
  65.       } else {
  66.         // skip ezpage sideboxes
  67. //        $warning_new_box .= $file . ' - HIDDEN ';
  68.       }
  69.       $db->Execute("insert into " . TABLE_LAYOUT_BOXES . "
  70.                  (layout_template, layout_box_name, layout_box_status, layout_box_location, layout_box_sort_order, layout_box_sort_order_single, layout_box_status_single)
  71.                  values ('" . zen_db_input($template_dir) . "', '" . zen_db_input($file) . "', 0, 0, 0, 0, 0)");
  72.     }
  73.   }
  74.  
  75. ////////////////////////////////////
  76.   if ($_GET['action']) {
  77.     switch ($_GET['action']) {
  78.       case 'insert':
  79.         $layout_box_name = zen_db_prepare_input($_POST['layout_box_name']);
  80.         $layout_box_status = zen_db_prepare_input($_POST['layout_box_status']);
  81.         $layout_box_location = zen_db_prepare_input($_POST['layout_box_location']);
  82.         $layout_box_sort_order = zen_db_prepare_input($_POST['layout_box_sort_order']);
  83.         $layout_box_sort_order_single = zen_db_prepare_input($_POST['layout_box_sort_order_single']);
  84.         $layout_box_status_single = zen_db_prepare_input($_POST['layout_box_status_single']);
  85.  
  86.         $db->Execute("insert into " . TABLE_LAYOUT_BOXES . "
  87.                    (layout_box_name, layout_box_status, layout_box_location, layout_box_sort_order, layout_box_sort_order_single, layout_box_status_single)
  88.                    values ('" . zen_db_input($layout_box_name) . "',
  89.                            '" . zen_db_input($layout_box_status) . "',
  90.                            '" . zen_db_input($layout_box_location) . "',
  91.                            '" . zen_db_input($layout_box_sort_order) . "',
  92.                            '" . zen_db_input($layout_box_sort_order_single) . "',
  93.                            '" . zen_db_input($layout_box_status_single) . "')");
  94.  
  95.         $messageStack->add_session(SUCCESS_BOX_ADDED . $_GET['layout_box_name'], 'success');
  96.         zen_redirect(zen_href_link(FILENAME_LAYOUT_CONTROLLER));
  97.         break;
  98.       case 'save':
  99.         $box_id = zen_db_prepare_input($_GET['cID']);
  100.         // $layout_box_name = zen_db_prepare_input($_POST['layout_box_name']);
  101.         $layout_box_status = zen_db_prepare_input($_POST['layout_box_status']);
  102.         $layout_box_location = zen_db_prepare_input($_POST['layout_box_location']);
  103.         $layout_box_sort_order = zen_db_prepare_input($_POST['layout_box_sort_order']);
  104.         $layout_box_sort_order_single = zen_db_prepare_input($_POST['layout_box_sort_order_single']);
  105.         $layout_box_status_single = zen_db_prepare_input($_POST['layout_box_status_single']);
  106.  
  107.         $db->Execute("update " . TABLE_LAYOUT_BOXES . " set layout_box_status = '" . zen_db_input($layout_box_status) . "', layout_box_location = '" . zen_db_input($layout_box_location) . "', layout_box_sort_order = '" . zen_db_input($layout_box_sort_order) . "', layout_box_sort_order_single = '" . zen_db_input($layout_box_sort_order_single) . "', layout_box_status_single = '" . zen_db_input($layout_box_status_single) . "' where layout_id = '" . zen_db_input($box_id) . "'");
  108.  
  109.         $messageStack->add_session(SUCCESS_BOX_UPDATED . $_GET['layout_box_name'], 'success');
  110.         zen_redirect(zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $box_id));
  111.         break;
  112.       case 'deleteconfirm':
  113.         $box_id = zen_db_prepare_input($_POST['cID']);
  114.  
  115.         $db->Execute("delete from " . TABLE_LAYOUT_BOXES . " where layout_id = '" . zen_db_input($box_id) . "'");
  116.  
  117.         $messageStack->add_session(SUCCESS_BOX_DELETED . $_GET['layout_box_name'], 'success');
  118.         zen_redirect(zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page']));
  119.         break;
  120.       case 'reset_defaults':
  121.         if ($_POST['action'] == 'reset_defaults') {
  122.           $reset_boxes = $db->Execute("select * from " . TABLE_LAYOUT_BOXES . " where layout_template= 'default_template_settings'");
  123.           while (!$reset_boxes->EOF) {
  124.             $db->Execute("update " . TABLE_LAYOUT_BOXES . " set layout_box_status= '" . $reset_boxes->fields['layout_box_status'] . "', layout_box_location= '" . $reset_boxes->fields['layout_box_location'] . "', layout_box_sort_order='" . $reset_boxes->fields['layout_box_sort_order'] . "', layout_box_sort_order_single='" . $reset_boxes->fields['layout_box_sort_order_single'] . "', layout_box_status_single='" . $reset_boxes->fields['layout_box_status_single'] . "' where layout_box_name='" . $reset_boxes->fields['layout_box_name'] . "' and layout_template='" . zen_db_input($template_dir) . "'");
  125.             $reset_boxes->MoveNext();
  126.           }
  127.           $messageStack->add_session(SUCCESS_BOX_RESET . $template_dir, 'success');
  128.           zen_redirect(zen_href_link(FILENAME_LAYOUT_CONTROLLER));
  129.         }
  130.         break;
  131.     }
  132.   }
  133.  
  134. ?>
  135. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  136. <html <?php echo HTML_PARAMS; ?>>
  137. <head>
  138. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  139. <title><?php echo TITLE; ?></title>
  140. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  141. <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  142. <script language="javascript" src="includes/menu.js"></script>
  143. <script language="javascript" src="includes/general.js"></script>
  144. <script type="text/javascript">
  145.   <!--
  146.   function init()
  147.   {
  148.     cssjsmenu('navbar');
  149.     if (document.getElementById)
  150.     {
  151.       var kill = document.getElementById('hoverJS');
  152.       kill.disabled = true;
  153.     }
  154.   }
  155.   // -->
  156. </script>
  157. </head>
  158. <body onload="init()">
  159. <!-- header //-->
  160. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  161. <!-- header_eof //-->
  162.  
  163. <!-- body //-->
  164. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  165.   <tr>
  166. <!-- body_text //-->
  167.     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  168.  
  169.       <tr>
  170.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  171. <?php
  172. if ($warning_new_box) {
  173. ?>
  174.         <tr class="messageStackError">
  175.           <td colspan="2" class="messageStackError">
  176. <?php echo 'WARNING: New boxes found: ' . $warning_new_box; ?>
  177.           </td>
  178.         </tr>
  179. <?php
  180. }
  181. ?>
  182.           <tr>
  183.             <td class="pageHeading"><?php echo HEADING_TITLE . ' ' . $template_dir; ?></td>
  184.             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  185.           </tr>
  186.         </table></td>
  187.       </tr>
  188.  
  189.       <tr>
  190.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  191.               <tr>
  192.                 <td class="main" align="left"><strong>Boxes Path: </strong><?php echo DIR_FS_CATALOG_MODULES . ' ... ' . '<br />&nbsp;'; ?></td>
  193.               </tr>
  194.           <tr>
  195.             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  196.               <tr class="dataTableHeadingRow">
  197.                 <td class="dataTableHeadingContent" align="left" width="200"><?php echo TABLE_HEADING_LAYOUT_BOX_NAME; ?></td>
  198.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LAYOUT_BOX_STATUS; ?></td>
  199.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LAYOUT_BOX_LOCATION; ?></td>
  200.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LAYOUT_BOX_SORT_ORDER; ?></td>
  201.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LAYOUT_BOX_SORT_ORDER_SINGLE; ?></td>
  202.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LAYOUT_BOX_STATUS_SINGLE; ?></td>
  203.                 <td colspan="2" class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
  204.               </tr>
  205.  
  206. <?php
  207.   $boxes_directory = DIR_FS_CATALOG_MODULES . 'sideboxes' . '/';
  208.   $boxes_directory_template = DIR_FS_CATALOG_MODULES . 'sideboxes/' . $template_dir . '/';
  209.  
  210.   $column_controller = $db->Execute("select layout_id, layout_box_name, layout_box_status, layout_box_location, layout_box_sort_order, layout_box_sort_order_single, layout_box_status_single from " . TABLE_LAYOUT_BOXES . " where (layout_template='" . zen_db_input($template_dir) . "' and layout_box_name NOT LIKE '%ezpages_bar%') order by  layout_box_location, layout_box_sort_order");
  211.   while (!$column_controller->EOF) {
  212. //    if (((!$_GET['cID']) || (@$_GET['cID'] == $column_controller->fields['layout_id'])) && (!$bInfo) && (substr($_GET['action'], 0, 3) != 'new')) {
  213.   if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $column_controller->fields['layout_id']))) && !isset($bInfo) && (substr($action, 0, 3) != 'new')) {
  214.       $bInfo = new objectInfo($column_controller->fields);
  215.     }
  216.  
  217. //  if ( (is_object($bInfo)) && ($column_controller->fields['layout_id'] == $bInfo->layout_id) ) {
  218.     if (isset($bInfo) && is_object($bInfo) && ($column_controller->fields['layout_id'] == $bInfo->layout_id)) {
  219.       echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $bInfo->layout_id . '&action=edit') . '\'">' . "\n";
  220.     } else {
  221.       echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $column_controller->fields['layout_id']) . '\'">' . "\n";
  222.     }
  223. ?>
  224.                 <td class="dataTableContent" width="100"><?php echo (file_exists($boxes_directory_template . $column_controller->fields['layout_box_name']) ? '<span class="alert">' . str_replace(DIR_FS_CATALOG_MODULES, '', $boxes_directory_template) . '</span>' . $column_controller->fields['layout_box_name'] : str_replace(DIR_FS_CATALOG_MODULES, '', $boxes_directory) . $column_controller->fields['layout_box_name']); ?></td>
  225.                 <td class="<?php echo ( (file_exists($boxes_directory . $column_controller->fields['layout_box_name']) or file_exists($boxes_directory_template . $column_controller->fields['layout_box_name'])) ? dataTableContent : messageStackError ); ?>" align="center"><?php echo ($column_controller->fields['layout_box_status']=='1' ? TEXT_ON : '<span class="alert">' . TEXT_OFF .'</span>'); ?></td>
  226.                 <td class="<?php echo ( (file_exists($boxes_directory . $column_controller->fields['layout_box_name']) or file_exists($boxes_directory_template . $column_controller->fields['layout_box_name'])) ? dataTableContent : messageStackError ); ?>" align="center"><?php echo ($column_controller->fields['layout_box_location']=='0' ? TEXT_LEFT : TEXT_RIGHT); ?></td>
  227.                 <td class="<?php echo ( (file_exists($boxes_directory . $column_controller->fields['layout_box_name']) or file_exists($boxes_directory_template . $column_controller->fields['layout_box_name'])) ? dataTableContent : messageStackError ); ?>" align="center"><?php echo $column_controller->fields['layout_box_sort_order']; ?></td>
  228.                 <td class="<?php echo ( (file_exists($boxes_directory . $column_controller->fields['layout_box_name']) or file_exists($boxes_directory_template . $column_controller->fields['layout_box_name'])) ? dataTableContent : messageStackError ); ?>" align="center"><?php echo $column_controller->fields['layout_box_sort_order_single']; ?></td>
  229.                 <td class="<?php echo ( (file_exists($boxes_directory . $column_controller->fields['layout_box_name']) or file_exists($boxes_directory_template . $column_controller->fields['layout_box_name'])) ? dataTableContent : messageStackError ); ?>" align="center"><?php echo ($column_controller->fields['layout_box_status_single']=='1' ? TEXT_ON : '<span class="alert">' . TEXT_OFF . '</span>'); ?></td>
  230.  
  231.                 <td class="dataTableContent" align="right"><?php echo ( (file_exists($boxes_directory . $column_controller->fields['layout_box_name']) or file_exists($boxes_directory_template . $column_controller->fields['layout_box_name'])) ? TEXT_GOOD_BOX : TEXT_BAD_BOX) ; ?><?php echo '<a href="' . zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $column_controller->fields['layout_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', IMAGE_EDIT) . '</a>'; ?></td>
  232.  
  233.                 <td class="dataTableContent" align="right"><?php echo ( (file_exists($boxes_directory . $column_controller->fields['layout_box_name']) or file_exists($boxes_directory_template . $column_controller->fields['layout_box_name'])) ? TEXT_GOOD_BOX : TEXT_BAD_BOX) ; ?><?php if ( (is_object($bInfo)) && ($column_controller->fields['layout_id'] == $bInfo->layout_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $column_controller->fields['layout_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
  234.               </tr>
  235.  
  236. <?php
  237.     $last_box_column = $column_controller->fields['layout_box_location'];
  238.     $column_controller->MoveNext();
  239.     if (($column_controller->fields['layout_box_location'] != $last_box_column) and !$column_controller->EOF) {
  240. ?>
  241.               <tr valign="top">
  242.                 <td colspan="7" height="20" align="center" valign="middle"><?php echo zen_draw_separator('pixel_black.gif', '90%', '3'); ?></td>
  243.               </tr>
  244. <?php
  245.     }
  246.   }
  247. ?>
  248.  
  249.               <tr valign="top">
  250.                 <td valign="top"><?php echo zen_draw_separator('pixel_trans.gif', '75%', '10'); ?></td>
  251.               </tr>
  252.  
  253.             </table></td>
  254. <?php
  255.   $heading = array();
  256.   $contents = array();
  257.  
  258.     switch ($bInfo->layout_box_status) {
  259.       case '0': $layout_box_status_status_on = false; $layout_box_status_status_off = true; break;
  260.       case '1':
  261.       default: $layout_box_status_status_on = true; $layout_box_status_status_off = false;
  262.     }
  263.     switch ($bInfo->layout_box_status_single) {
  264.       case '0': $layout_box_status_single_on = false; $layout_box_status_single_off = true; break;
  265.       case '1':
  266.       default: $layout_box_status_single_on = true; $layout_box_status_single_off = false;
  267.     }
  268.  
  269.   switch ($_GET['action']) {
  270.     case 'new':
  271.       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_BOX . '</b>');
  272.  
  273.       $contents = array('form' => zen_draw_form('column_controller', FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&action=insert'));
  274.       $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
  275.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_NAME . '<br />' . zen_draw_input_field('layout_box_name'));
  276.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_STATUS . '<br />' . zen_draw_input_field('layout_box_status'));
  277.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_LOCATION . '<br />' . zen_draw_input_field('layout_box_location'));
  278.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_SORT_ORDER . '<br />' . zen_draw_input_field('layout_box_sort_order'));
  279.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_SORT_ORDER_SINGLE . '<br />' . zen_draw_input_field('layout_box_sort_order_single'));
  280.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_STATUS_SINGLE . '<br />' . zen_draw_input_field('layout_box_status_single'));
  281.  
  282.       $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . '&nbsp;<a href="' . zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  283.       break;
  284.     case 'edit':
  285.       switch ($bInfo->layout_box_status) {
  286.         case '0': $in_status = false; $out_status = true; break;
  287.         case '1': $in_status = true; $out_status = false; break;
  288.         default: $in_status = true; $out_status = false;
  289.       }
  290.       switch ($bInfo->layout_box_location) {
  291.         case '0': $left_status = true; $right_status = false; break;
  292.         case '1': $left_status = false; $right_status = true; break;
  293.         default: $left_status = false; $right_status = true;
  294.       }
  295.       switch ($bInfo->layout_box_status_single) {
  296.         case '0': $in_status_single = false; $out_status_single = true; break;
  297.         case '1': $in_status_single = true; $out_status_single = false; break;
  298.         default: $in_status_single = true; $out_status_single = false;
  299.       }
  300.  
  301.       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_BOX . '</b>');
  302.  
  303.       $contents = array('form' => zen_draw_form('column_controller', FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $bInfo->layout_id . '&action=save' . '&layout_box_name=' . $bInfo->layout_box_name));
  304.       $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
  305.       $contents[] = array('text' => TEXT_INFO_LAYOUT_BOX_NAME . ' ' . $bInfo->layout_box_name);
  306.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_STATUS . '<br />' . zen_draw_radio_field('layout_box_status', '1', $in_status) . TEXT_ON . zen_draw_radio_field('layout_box_status', '0', $out_status) . TEXT_OFF);
  307.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_LOCATION . '<br />' . zen_draw_radio_field('layout_box_location', '0', $left_status) . TEXT_LEFT . zen_draw_radio_field('layout_box_location', '1', $right_status) . TEXT_RIGHT);
  308.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_SORT_ORDER . '<br />' . zen_draw_input_field('layout_box_sort_order', $bInfo->layout_box_sort_order,'size="4"'));
  309.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_SORT_ORDER_SINGLE . '<br />' . zen_draw_input_field('layout_box_sort_order_single', $bInfo->layout_box_sort_order_single,'size="4"'));
  310.       $contents[] = array('text' => '<br />' . TEXT_INFO_LAYOUT_BOX_STATUS_SINGLE . '<br />' . zen_draw_radio_field('layout_box_status_single', '1', $in_status_single) . TEXT_ON . zen_draw_radio_field('layout_box_status_single', '0', $out_status_single) . TEXT_OFF);
  311.       $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $bInfo->layout_id . '&layout_box_name=' . $bInfo->layout_box_name) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  312.       break;
  313.     case 'delete':
  314.       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_BOX . '</b>');
  315.  
  316.       $contents = array('form' => zen_draw_form('column_controller', FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&action=deleteconfirm' . '&layout_box_name=' . $bInfo->layout_box_name) . zen_draw_hidden_field('cID', $bInfo->layout_id));
  317.       $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
  318.       $contents[] = array('text' => '<br /><b>' . $bInfo->layout_box_name . '</b>');
  319.       $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $bInfo->layout_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  320.       break;
  321.     default:
  322.       if (is_object($bInfo)) {
  323.         $heading[] = array('text' => '<strong>' . TEXT_INFO_LAYOUT_BOX . $bInfo->layout_box_name . '</strong>');
  324.         $contents[] = array('align' => 'left', 'text' => '<a href="' . zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $bInfo->layout_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
  325.         $contents[] = array('text' => '<strong>' . TEXT_INFO_BOX_DETAILS . '</strong>');
  326.         $contents[] = array('text' => TEXT_INFO_LAYOUT_BOX_NAME . ' ' . $bInfo->layout_box_name);
  327.         $contents[] = array('text' => TEXT_INFO_LAYOUT_BOX_STATUS . ' ' .  ($bInfo->layout_box_status=='1' ? TEXT_ON : TEXT_OFF) );
  328.         $contents[] = array('text' => TEXT_INFO_LAYOUT_BOX_LOCATION . ' ' . ($bInfo->layout_box_location=='0' ? TEXT_LEFT : TEXT_RIGHT) );
  329.         $contents[] = array('text' => TEXT_INFO_LAYOUT_BOX_SORT_ORDER . ' ' . $bInfo->layout_box_sort_order);
  330.         $contents[] = array('text' => TEXT_INFO_LAYOUT_BOX_SORT_ORDER_SINGLE . ' ' . $bInfo->layout_box_sort_order_single);
  331.         $contents[] = array('text' => TEXT_INFO_LAYOUT_BOX_STATUS_SINGLE . ' ' .  ($bInfo->layout_box_status_single=='1' ? TEXT_ON : TEXT_OFF) );
  332.  
  333.         if (!(file_exists($boxes_directory . $bInfo->layout_box_name) or file_exists($boxes_directory_template . $bInfo->layout_box_name))) {
  334.           $contents[] = array('align' => 'left', 'text' => '<br /><strong>' . TEXT_INFO_DELETE_MISSING_LAYOUT_BOX . '<br />' . $template_dir . '</strong>');
  335.           $contents[] = array('align' => 'left', 'text' => TEXT_INFO_DELETE_MISSING_LAYOUT_BOX_NOTE . '<strong>' . $bInfo->layout_box_name . '</strong>');
  336.           $contents[] = array('align' => 'left', 'text' => '<a href="' . zen_href_link(FILENAME_LAYOUT_CONTROLLER, 'page=' . $_GET['page'] . '&cID=' . $bInfo->layout_id . '&action=delete' . '&layout_box_name=' . $bInfo->layout_box_name) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
  337.         }
  338.       }
  339.       break;
  340.   }
  341.  
  342.   if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
  343.     echo "\n" . '            <td width="25%" valign="top">' . "\n";
  344.  
  345.     $box = new box;
  346.     echo $box->infoBox($heading, $contents);
  347.  
  348.     echo '            </td>' . "\n";
  349.   }
  350. ?>
  351.   </tr>
  352.   <tr>
  353.     <td><table align="center">
  354.       <tr>
  355.         <td class="main" align="left">
  356.           <?php echo '<br />' . TEXT_INFO_RESET_TEMPLATE_SORT_ORDER . '<strong>' . $template_dir . '</strong>'; ?>
  357.         </td>
  358.       </tr>
  359.       <tr>
  360.         <td class="main" align="center">
  361.           <?php echo TEXT_INFO_RESET_TEMPLATE_SORT_ORDER_NOTE; ?>
  362.         </td>
  363.       </tr>
  364.       <tr>
  365.         <td class="main" align="center">
  366.             <?php echo zen_draw_form('reset_defaults', FILENAME_LAYOUT_CONTROLLER, 'action=reset_defaults'); ?>
  367.             <?php echo zen_draw_hidden_field('action', 'reset_defaults'); ?>
  368.             <?php echo zen_image_submit('button_reset.gif', IMAGE_RESET) ?>
  369.             </form>
  370.         </td>
  371.       </tr>
  372.     </table></td>
  373.   </tr>
  374.   <tr valign="top">
  375.     <td valign="top"><?php echo zen_draw_separator('pixel_trans.gif', '1', '100'); ?></td>
  376.   </tr>
  377.  
  378. <!-- end of display -->
  379.  
  380.         </table></td>
  381.       </tr>
  382.     </table></td>
  383. <!-- body_text_eof //-->
  384.   </tr>
  385. </table>
  386. <!-- body_eof //-->
  387.  
  388. <!-- footer //-->
  389. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  390. <!-- footer_eof //-->
  391. <br />
  392. </body>
  393. </html>
  394. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  395.  


cron