[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 // 3 // +----------------------------------------------------------------------+ 4 // |zen-cart Open Source E-commerce | 5 // +----------------------------------------------------------------------+ 6 // | Copyright (c) 2003 The zen-cart developers | 7 // | | 8 // | http://www.zen-cart.com/index.php | 9 // | | 10 // | Portions Copyright (c) 2003 osCommerce | 11 // +----------------------------------------------------------------------+ 12 // | This source file is subject to version 2.0 of the GPL license, | 13 // | that is bundled with this package in the file LICENSE, and is | 14 // | available through the world-wide-web at the following url: | 15 // | http://www.zen-cart.com/license/2_0.txt. | 16 // | If you did not receive a copy of the zen-cart license and are unable | 17 // | to obtain it through the world-wide-web, please send a note to | 18 // | license@zen-cart.com so we can mail you a copy immediately. | 19 // +----------------------------------------------------------------------+ 20 // $Id: table_block.php 1969 2005-09-13 06:57:21Z drbyte $ 21 // 22 23 class tableBlock { 24 var $table_border = '0'; 25 var $table_width = '100%'; 26 var $table_cellspacing = '0'; 27 var $table_cellpadding = '2'; 28 var $table_parameters = ''; 29 var $table_row_parameters = ''; 30 var $table_data_parameters = ''; 31 32 function tableBlock($contents) { 33 $tableBox_string = ''; 34 35 $form_set = false; 36 if (isset($contents['form'])) { 37 $tableBox_string .= $contents['form'] . "\n"; 38 $form_set = true; 39 array_shift($contents); 40 } 41 42 $tableBox_string .= '<table border="' . $this->table_border . '" width="' . $this->table_width . '" cellspacing="' . $this->table_cellspacing . '" cellpadding="' . $this->table_cellpadding . '"'; 43 if (zen_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters; 44 $tableBox_string .= '>' . "\n"; 45 46 for ($i=0, $n=sizeof($contents); $i<$n; $i++) { 47 $tableBox_string .= ' <tr'; 48 if (zen_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; 49 if (isset($contents[$i]['params']) && zen_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; 50 $tableBox_string .= '>' . "\n"; 51 52 if (isset($contents[$i][0]) && is_array($contents[$i][0])) { 53 for ($x=0, $y=sizeof($contents[$i]); $x<$y; $x++) { 54 if (isset($contents[$i][$x]['text']) && zen_not_null(isset($contents[$i][$x]['text']))) { 55 $tableBox_string .= ' <td'; 56 if (isset($contents[$i][$x]['align']) && zen_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . $contents[$i][$x]['align'] . '"'; 57 if (isset($contents[$i][$x]['params']) && zen_not_null(isset($contents[$i][$x]['params']))) { 58 $tableBox_string .= ' ' . $contents[$i][$x]['params']; 59 } elseif (zen_not_null($this->table_data_parameters)) { 60 $tableBox_string .= ' ' . $this->table_data_parameters; 61 } 62 $tableBox_string .= '>'; 63 if (isset($contents[$i][$x]['form']) && zen_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; 64 $tableBox_string .= $contents[$i][$x]['text']; 65 if (isset($contents[$i][$x]['form']) && zen_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; 66 $tableBox_string .= '</td>' . "\n"; 67 } 68 } 69 } else { 70 $tableBox_string .= ' <td'; 71 if (isset($contents[$i]['align']) && zen_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . $contents[$i]['align'] . '"'; 72 if (isset($contents[$i]['params']) && zen_not_null($contents[$i]['params'])) { 73 $tableBox_string .= ' ' . $contents[$i]['params']; 74 } elseif (zen_not_null($this->table_data_parameters)) { 75 $tableBox_string .= ' ' . $this->table_data_parameters; 76 } 77 $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n"; 78 } 79 80 $tableBox_string .= ' </tr>' . "\n"; 81 } 82 83 $tableBox_string .= '</table>' . "\n"; 84 85 if ($form_set == true) $tableBox_string .= '</form>' . "\n"; 86 87 return $tableBox_string; 88 } 89 } 90 ?>
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 |
![]() |