[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 /** 3 * Box Builder Class 4 * 5 * This class is used for display output of boxed information * 6 * @access private 7 * @ignore 8 * @deprecated 9 * @copyright Copyright 2003-2005 Zen Cart Development Team 10 * @copyright Portions Copyright 2003 osCommerce 11 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 12 * @version $Id: boxes.php 2467 2005-11-28 05:00:27Z drbyte $ 13 */ 14 15 /** 16 * tableBox 17 * 18 */ 19 class tableBox { 20 var $table_border = '0'; 21 var $table_width = '100%'; 22 var $table_cellspacing = '0'; 23 var $table_cellpadding = '2'; 24 var $table_parameters = ''; 25 var $table_row_parameters = ''; 26 var $table_data_parameters = ''; 27 28 // class constructor 29 function tableBox($contents, $direct_output = false) { 30 $tableBox_string = '<table border="' . zen_output_string($this->table_border) . '" width="' . zen_output_string($this->table_width) . '" cellspacing="' . zen_output_string($this->table_cellspacing) . '" cellpadding="' . zen_output_string($this->table_cellpadding) . '"'; 31 if (zen_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters; 32 $tableBox_string .= '>' . "\n"; 33 34 for ($i=0, $n=sizeof($contents); $i<$n; $i++) { 35 if (isset($contents[$i]['form']) && zen_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n"; 36 $tableBox_string .= ' <tr'; 37 if (zen_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; 38 if (isset($contents[$i]['params']) && zen_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; 39 $tableBox_string .= '>' . "\n"; 40 41 if (isset($contents[$i][0]) && is_array($contents[$i][0])) { 42 for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) { 43 if (isset($contents[$i][$x]['text']) && zen_not_null($contents[$i][$x]['text'])) { 44 $tableBox_string .= ' <td'; 45 if (isset($contents[$i][$x]['align']) && zen_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . zen_output_string($contents[$i][$x]['align']) . '"'; 46 if (isset($contents[$i][$x]['params']) && zen_not_null($contents[$i][$x]['params'])) { 47 $tableBox_string .= ' ' . $contents[$i][$x]['params']; 48 } elseif (zen_not_null($this->table_data_parameters)) { 49 $tableBox_string .= ' ' . $this->table_data_parameters; 50 } 51 $tableBox_string .= '>'; 52 if (isset($contents[$i][$x]['form']) && zen_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; 53 $tableBox_string .= $contents[$i][$x]['text']; 54 if (isset($contents[$i][$x]['form']) && zen_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; 55 $tableBox_string .= '</td>' . "\n"; 56 } 57 } 58 } else { 59 $tableBox_string .= ' <td'; 60 if (isset($contents[$i]['align']) && zen_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . zen_output_string($contents[$i]['align']) . '"'; 61 if (isset($contents[$i]['params']) && zen_not_null($contents[$i]['params'])) { 62 $tableBox_string .= ' ' . $contents[$i]['params']; 63 } elseif (zen_not_null($this->table_data_parameters)) { 64 $tableBox_string .= ' ' . $this->table_data_parameters; 65 } 66 $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n"; 67 } 68 69 $tableBox_string .= ' </tr>' . "\n"; 70 if (isset($contents[$i]['form']) && zen_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n"; 71 } 72 73 $tableBox_string .= '</table>' . "\n"; 74 75 if ($direct_output == true) echo $tableBox_string; 76 77 return $tableBox_string; 78 } 79 } 80 81 class infoBox extends tableBox { 82 function infoBox($contents) { 83 $info_box_contents = array(); 84 $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); 85 $this->table_cellpadding = '1'; 86 $this->table_parameters = 'class="sideBox"'; 87 $this->tableBox($info_box_contents, true); 88 } 89 90 function infoBoxContents($contents) { 91 $this->table_cellpadding = '3'; 92 $this->table_parameters = 'class="sideBoxContent"'; 93 $info_box_contents = array(); 94 $info_box_contents[] = array(array('text' => zen_draw_separator('pixel_trans.gif', '100%', '1'))); 95 for ($i=0, $n=sizeof($contents); $i<$n; $i++) { 96 $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''), 97 'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''), 98 'params' => 'class="boxText"', 99 'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : ''))); 100 } 101 $info_box_contents[] = array(array('text' => zen_draw_separator('pixel_trans.gif', '100%', '1'))); 102 return $this->tableBox($info_box_contents); 103 } 104 } 105 106 // $no_corners = true eliminates all images from the header completely. 107 class infoBoxHeading extends tableBox { 108 function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false, $no_corners = false) { 109 $this->table_cellpadding = '0'; 110 111 if ($left_corner == true) { 112 $left_corner = zen_image(DIR_WS_TEMPLATE_IMAGES . 'infobox/corner_left.gif'); 113 } else { 114 if ($no_corners == true) { 115 $left_corner = ''; 116 } else { 117 $left_corner = zen_image(DIR_WS_TEMPLATE_IMAGES . 'infobox/corner_right_left.gif'); 118 } 119 } 120 if ($right_arrow == true) { 121 $right_arrow = '<a href="' . $right_arrow . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>'; 122 } else { 123 $right_arrow = ''; 124 } 125 if ($right_corner == true) { 126 $right_corner = $right_arrow . zen_image(DIR_WS_TEMPLATE_IMAGES . 'infobox/corner_right.gif'); 127 } else { 128 if ($no_corners == true) { 129 $right_corner = ''; 130 } else { 131 $right_corner = $right_arrow . zen_draw_separator('pixel_trans.gif', '11', '14'); 132 } 133 } 134 135 $info_box_contents = array(); 136 $info_box_contents[] = array(array('params' => 'height="14" class="sideBoxHeading"', 137 'text' => $left_corner), 138 array('params' => 'width="100%" height="14" class="sideBoxHeading"', 139 'text' => $contents[0]['text']), 140 array('params' => 'height="14" class="sideBoxHeading" ', 141 'text' => $right_corner)); 142 143 $this->tableBox($info_box_contents, true); 144 } 145 } 146 147 class contentBox extends tableBox { 148 function contentBox($contents) { 149 $info_box_contents = array(); 150 $info_box_contents[] = array('text' => $this->contentBoxContents($contents)); 151 $this->table_cellpadding = '1'; 152 $this->table_parameters = 'class="sideBox"'; 153 $this->tableBox($info_box_contents, true); 154 } 155 156 function contentBoxContents($contents) { 157 $this->table_cellpadding = '4'; 158 $this->table_parameters = 'class="sideBoxContents"'; 159 return $this->tableBox($contents); 160 } 161 } 162 163 class contentBoxHeading extends tableBox { 164 function contentBoxHeading($contents) { 165 $this->table_width = '100%'; 166 $this->table_cellpadding = '0'; 167 168 $info_box_contents = array(); 169 $info_box_contents[] = array(array('params' => 'height="14" class="sideBoxHeading"', 170 'text' => zen_image(DIR_WS_TEMPLATE_IMAGES . 'infobox/corner_left.gif')), 171 array('params' => 'height="14" class="sideBoxHeading" width="100%"', 172 'text' => $contents[0]['text']), 173 array('params' => 'height="14" class="sideBoxHeading"', 174 'text' => zen_image(DIR_WS_TEMPLATE_IMAGES . 'infobox/corner_right_left.gif'))); 175 176 $this->tableBox($info_box_contents, true); 177 } 178 } 179 180 class errorBox extends tableBox { 181 function errorBox($contents) { 182 $this->table_data_parameters = 'class="errorBox"'; 183 $this->tableBox($contents, true); 184 } 185 } 186 187 class productListingBox extends tableBox { 188 function productListingBox($contents) { 189 $this->table_parameters = 'class="productListing"'; 190 $this->tableBox($contents, true); 191 } 192 } 193 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |