[ Index ] |
|
Code source de osCommerce 2.2ms2-060817 |
1 <?php 2 /* 3 $Id: table_block.php,v 1.8 2003/06/20 15:51:18 hpdl Exp $ 4 5 osCommerce, Open Source E-Commerce Solutions 6 http://www.oscommerce.com 7 8 Copyright (c) 2003 osCommerce 9 10 Released under the GNU General Public License 11 */ 12 13 class tableBlock { 14 var $table_border = '0'; 15 var $table_width = '100%'; 16 var $table_cellspacing = '0'; 17 var $table_cellpadding = '2'; 18 var $table_parameters = ''; 19 var $table_row_parameters = ''; 20 var $table_data_parameters = ''; 21 22 function tableBlock($contents) { 23 $tableBox_string = ''; 24 25 $form_set = false; 26 if (isset($contents['form'])) { 27 $tableBox_string .= $contents['form'] . "\n"; 28 $form_set = true; 29 array_shift($contents); 30 } 31 32 $tableBox_string .= '<table border="' . $this->table_border . '" width="' . $this->table_width . '" cellspacing="' . $this->table_cellspacing . '" cellpadding="' . $this->table_cellpadding . '"'; 33 if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters; 34 $tableBox_string .= '>' . "\n"; 35 36 for ($i=0, $n=sizeof($contents); $i<$n; $i++) { 37 $tableBox_string .= ' <tr'; 38 if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; 39 if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; 40 $tableBox_string .= '>' . "\n"; 41 42 if (isset($contents[$i][0]) && is_array($contents[$i][0])) { 43 for ($x=0, $y=sizeof($contents[$i]); $x<$y; $x++) { 44 if (isset($contents[$i][$x]['text']) && tep_not_null(isset($contents[$i][$x]['text']))) { 45 $tableBox_string .= ' <td'; 46 if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . $contents[$i][$x]['align'] . '"'; 47 if (isset($contents[$i][$x]['params']) && tep_not_null(isset($contents[$i][$x]['params']))) { 48 $tableBox_string .= ' ' . $contents[$i][$x]['params']; 49 } elseif (tep_not_null($this->table_data_parameters)) { 50 $tableBox_string .= ' ' . $this->table_data_parameters; 51 } 52 $tableBox_string .= '>'; 53 if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; 54 $tableBox_string .= $contents[$i][$x]['text']; 55 if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; 56 $tableBox_string .= '</td>' . "\n"; 57 } 58 } 59 } else { 60 $tableBox_string .= ' <td'; 61 if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . $contents[$i]['align'] . '"'; 62 if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) { 63 $tableBox_string .= ' ' . $contents[$i]['params']; 64 } elseif (tep_not_null($this->table_data_parameters)) { 65 $tableBox_string .= ' ' . $this->table_data_parameters; 66 } 67 $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n"; 68 } 69 70 $tableBox_string .= ' </tr>' . "\n"; 71 } 72 73 $tableBox_string .= '</table>' . "\n"; 74 75 if ($form_set == true) $tableBox_string .= '</form>' . "\n"; 76 77 return $tableBox_string; 78 } 79 } 80 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 19:48:25 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |