[VTAB-TEAM-LINDER-PARTNER-1][OSC] - Revue de la charte Graphique
/*
ATTENTION - le design du site ne peut pas être passé en doctype html (html 5) dans la révision 1 du design.
bien qu'une révision 2 sera instanciée plus tard, il faudra se contenter de nombreux workaround en restant en HTML TRANSITIONAL 4.01
Du fait du nombre massif des éléments DE CETTE PAGE (et de ce qui en découlerait) qui seront à revoir pour transformer le design en design responsive et lui appliquer une nouvelle charte graphique..
.. il est alors plus judicieux de globaliser un TAG unique pour cette tâche pour ne pas alourdir de commentaires le code déjà suffisemment alourdi comme cela!
En gros, ici, pour cette méga-tâche, je vais ré-utiliser le même format maison de commentaires que la tâche [SI-LINDER-PARTNER-2][OSC] pour cette tâche précise:
--> pour en comprendre les méandres, voir le fichier /[!] - Saphyra-Interactive-TaskList-Explanations/[SI-LINDER-PARTNER-2][OSC]--semantic.php
---> mais à la place de [SI-LINDER-PARTNER-2][OSC], ici, on abordera le fichier et sa logique comme faisant parties de la tâche [VTAB-TEAM-LINDER-PARTNER-1][OSC]
*/
// <- [VTAB-TEAM-LINDER-PARTNER-1][OSC] - Revue de la charte Graphique
class tableBox {
var $table_border = '0';
var $table_width = '100%';
var $table_cellspacing = '0';
var $table_cellpadding = '2';
var $table_parameters = '';
var $table_row_parameters = '';
var $table_data_parameters = '';
// class constructor
function tableBox($contents, $direct_output = false) {
$tableBox_string = '
table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
$tableBox_string .= '>' . "\n";
for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
$tableBox_string .= ' table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
$tableBox_string .= '>' . "\n";
if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
$tableBox_string .= ' | table_data_parameters)) {
$tableBox_string .= ' ' . $this->table_data_parameters;
}
$tableBox_string .= '>';
if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
$tableBox_string .= $contents[$i][$x]['text'];
if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '';
$tableBox_string .= ' | ' . "\n";
}
}
} else {
$tableBox_string .= ' table_data_parameters)) {
$tableBox_string .= ' ' . $this->table_data_parameters;
}
$tableBox_string .= '>' . $contents[$i]['text'] . ' | ' . "\n";
}
$tableBox_string .= '
' . "\n";
if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '' . "\n";
}
$tableBox_string .= '
' . "\n";
if ($direct_output == true) echo $tableBox_string;
return $tableBox_string;
}
}
class infoBox extends tableBox {
function infoBox($contents) {
$info_box_contents = array();
$info_box_contents[] = array('text' => $this->infoBoxContents($contents));
$this->table_cellpadding = '1';
$this->table_parameters = 'class="infoBox"';
$this->tableBox($info_box_contents, true);
}
function infoBoxContents($contents) {
$this->table_cellpadding = '3';
$this->table_parameters = 'class="infoBoxContents"';
$info_box_contents = array();
$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
'params' => 'class="boxText"',
'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
}
$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
return $this->tableBox($info_box_contents);
}
}
class infoBoxHeading extends tableBox {
function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
$this->table_cellpadding = '0';
if ($left_corner == true) {
// -> VDDESIGN
$left_corner = tep_image(DIR_WS_DESIGN . 'boxcorner_left.gif');
} else {
$left_corner = tep_image(DIR_WS_DESIGN . 'boxcorner_right_left.gif');
// <- VDDESIGN
}
if ($right_arrow == true) {
$right_arrow = '' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '';
} else {
$right_arrow = '';
}
if ($right_corner == true) {
// -> VDDESIGN
$right_corner = $right_arrow . tep_image(DIR_WS_DESIGN . 'boxcorner_right.gif');
// <- VDDESIGN
} else {
$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
}
$info_box_contents = array();
$info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
'text' => $left_corner),
array('params' => 'width="100%" height="14" class="infoBoxHeading"',
'text' => $contents[0]['text']),
array('params' => 'height="14" class="infoBoxHeading" nowrap',
'text' => $right_corner));
$this->tableBox($info_box_contents, true);
}
}
/************************************************************************
[VTAB-TEAM-LINDER-PARTNER-1][OSC][MultiTaskDescriptions]:{
- 1/ pour des besoins spécifiques de la nouvelle charte graphique on a besoin de modifier un peu cette classe PHP de OSCommerce
- 2/ on a besoin de passer une valeur de classe CSS à la propriété $table_row_parameters
à la classe contentBox qui est en fait une extension héritée de la classe tableBox (aussi dans ce fichier)
- 3/ on a besoin de passer une valeur de classe CSS à la propriété $table_row_parameters
à la classe contentBoxContents qui est en fait une extension héritée de la classe tableBox (aussi dans ce fichier), appellée à travers la méthode contentBox()
*/
// ([1])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::BEGIN
class contentBox extends tableBox {
function contentBox($contents) {
$info_box_contents = array();
$info_box_contents[] = array('text' => $this->contentBoxContents($contents));
$this->table_cellpadding = '1';
$this->table_parameters = 'class="infoBox"';
// ([2])-->BEGIN[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END
$this->table_row_parameters = 'class="infoBoxTR"';
$this->tableBox($info_box_contents, true);
}
function contentBoxContents($contents) {
$this->table_cellpadding = '4';
$this->table_parameters = 'class="infoBoxContents"';
// ([3])-->BEGIN[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END
$this->table_row_parameters = 'class="infoBoxContentsTR"';
return $this->tableBox($contents);
}
}
// ([1])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END
/*
[VTAB-TEAM-LINDER-PARTNER-1][OSC][MultiTaskDescriptions]
************************************************************************/
class contentBoxHeading extends tableBox {
function contentBoxHeading($contents) {
$this->table_width = '100%';
$this->table_cellpadding = '0';
$info_box_contents = array();
$info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
// -> VDDESIGN
'text' => tep_image(DIR_WS_DESIGN . 'boxcorner_left.gif')),
// <- VDDESIGN
array('params' => 'height="14" class="infoBoxHeading" width="100%"',
'text' => $contents[0]['text']),
array('params' => 'height="14" class="infoBoxHeading"',
// -> VDDESIGN
'text' => tep_image(DIR_WS_DESIGN . 'boxcorner_right_left.gif')));
// <- VDDESIGN
$this->tableBox($info_box_contents, true);
}
}
class errorBox extends tableBox {
function errorBox($contents) {
$this->table_data_parameters = 'class="errorBox"';
$this->tableBox($contents, true);
}
}
class productListingBox extends tableBox {
function productListingBox($contents) {
$this->table_parameters = 'class="productListing"';
$this->tableBox($contents, true);
}
}
// <- OSC-12 : Arrondissement des angles pour le visuel du site
/*
finalement, nous avons décidé à dupliquer entièrement la classe php tableBox() (ainsi que ses extensions de classes et dépendances) mais à y apporter quelques ajustements.
*/
class menuBox {
var $menu_border = '0';
var $menu_width = '100%';
var $menu_cellspacing = '0';
var $menu_cellpadding = '2';
var $menu_parameters = '';
var $menu_row_parameters = '';
var $menu_data_parameters = '';
// class constructor
function menuBox($menu_contents, $menu_direct_output = false) {
$menuBox_string = 'menu_parameters)) $menuBox_string .= ' ' . $this->menu_parameters;
$menuBox_string .= '>' . "\n";
for ($i=0, $n=sizeof($menu_contents); $i<$n; $i++) {
if (isset($menu_contents[$i]['form']) && tep_not_null($menu_contents[$i]['form'])) $menuBox_string .= $menu_contents[$i]['form'] . "\n";
$menuBox_string .= ' menu_row_parameters)) $menuBox_string .= ' ' . $this->menu_row_parameters;
if (isset($menu_contents[$i]['params']) && tep_not_null($menu_contents[$i]['params'])) $menuBox_string .= ' ' . $menu_contents[$i]['params'];
$menuBox_string .= '>' . "\n";
if (isset($menu_contents[$i][0]) && is_array($menu_contents[$i][0])) {
for ($x=0, $n2=sizeof($menu_contents[$i]); $x<$n2; $x++) {
if (isset($menu_contents[$i][$x]['text']) && tep_not_null($menu_contents[$i][$x]['text'])) {
$menuBox_string .= ' | menu_data_parameters)) {
$menuBox_string .= ' ' . $this->menu_data_parameters;
}
$menuBox_string .= '>';
if (isset($menu_contents[$i][$x]['form']) && tep_not_null($menu_contents[$i][$x]['form'])) $menuBox_string .= $menu_contents[$i][$x]['form'];
$menuBox_string .= $menu_contents[$i][$x]['text'];
if (isset($menu_contents[$i][$x]['form']) && tep_not_null($menu_contents[$i][$x]['form'])) $menuBox_string .= '';
$menuBox_string .= ' | ' . "\n";
}
}
} else {
$menuBox_string .= ' menu_data_parameters)) {
$menuBox_string .= ' ' . $this->menu_data_parameters;
}
$menuBox_string .= '>' . $menu_contents[$i]['text'] . ' | ' . "\n";
}
$menuBox_string .= '
' . "\n";
if (isset($menu_contents[$i]['form']) && tep_not_null($menu_contents[$i]['form'])) $menuBox_string .= '' . "\n";
}
$menuBox_string .= '
' . "\n";
if ($menu_direct_output == true) echo $menuBox_string;
return $menuBox_string;
}
}
class menuInfoBox extends menuBox {
function menuInfoBox($menu_contents) {
$menu_info_box_contents = array();
$menu_info_box_contents[] = array('text' => $this->menuInfoBoxContents($menu_contents));
$this->menu_cellpadding = '1';
$this->menu_parameters = 'class="menuInfoBox"';
$this->menuBox($menu_info_box_contents, true);
}
function menuInfoBoxContents($menu_contents) {
$this->menu_cellpadding = '3';
$this->menu_parameters = 'class="menuInfoBoxContents"';
$menu_info_box_contents = array();
$menu_info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
for ($i=0, $n=sizeof($menu_contents); $i<$n; $i++) {
$menu_info_box_contents[] = array(array('align' => (isset($menu_contents[$i]['align']) ? $menu_contents[$i]['align'] : ''),
'form' => (isset($menu_contents[$i]['form']) ? $menu_contents[$i]['form'] : ''),
'params' => 'class="boxText"',
'text' => (isset($menu_contents[$i]['text']) ? $menu_contents[$i]['text'] : '')));
}
$menu_info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
return $this->menuBox($menu_info_box_contents);
}
}
class menuInfoBoxHeading extends menuBox {
// Ajustement important 1: on créé une affectation false PAR défaut aux paramètres de la classe.
function menuInfoBoxHeading($menu_contents, $menu_left_corner = false, $menu_right_corner = false, $menu_right_arrow = false) {
$this->menu_cellpadding = '0';
if ($menu_left_corner == true) {
// -> VDDESIGN
$menu_left_corner = tep_image(DIR_WS_DESIGN . 'boxcorner_left.gif');
} else {
$menu_left_corner = tep_image(DIR_WS_DESIGN . 'boxcorner_right_left.gif');
// Ajustement important 2: on vide les variables, j'aurais bien aussi pu effacer la ligne, mais comme ça c'est plus clair
$menu_left_corner = '';
// <- VDDESIGN
}
if ($menu_right_arrow == true) {
$menu_right_arrow = '' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '';
} else {
$menu_right_arrow = '';
}
if ($menu_right_corner == true) {
// -> VDDESIGN
$menu_right_corner = $menu_right_arrow . tep_image(DIR_WS_DESIGN . 'boxcorner_right.gif');
// <- VDDESIGN
} else {
$menu_right_corner = $menu_right_arrow . tep_draw_separator('pixel_trans.gif', '5', '14');
}
$menu_info_box_contents = array();
$menu_info_box_contents[] = array(array('params' => 'height="14" class="menuInfoBoxHeading"',
'text' => $menu_left_corner),
array('params' => 'width="100%" height="14" class="menuInfoBoxHeading"',
'text' => $menu_contents[0]['text']),
array('params' => 'height="14" class="menuInfoBoxHeadingArrow" nowrap',
'text' => $menu_right_corner));
$this->menuBox($menu_info_box_contents, true);
}
}
class menu_contentBox extends menuBox {
function menu_contentBox($menu_contents) {
$menu_info_box_contents = array();
$menu_info_box_contents[] = array('text' => $this->menu_contentBoxContents($menu_contents));
$this->menu_cellpadding = '1';
$this->menu_parameters = 'class="menuInfoBox"';
$this->menuBox($menu_info_box_contents, true);
}
function menu_contentBoxContents($menu_contents) {
$this->menu_cellpadding = '4';
$this->menu_parameters = 'class="menuInfoBoxContents"';
return $this->menuBox($menu_contents);
}
}
class menu_contentBoxHeading extends menuBox {
function menu_contentBoxHeading($menu_contents) {
$this->menu_width = '100%';
$this->menu_cellpadding = '0';
$menu_info_box_contents = array();
$menu_info_box_contents[] = array(array('params' => 'height="14" class="menuInfoBoxHeading"',
// -> VDDESIGN
'text' => tep_image(DIR_WS_DESIGN . 'boxcorner_left.gif')),
// <- VDDESIGN
array('params' => 'height="14" class="menuInfoBoxHeading" width="100%"',
'text' => $menu_contents[0]['text']),
array('params' => 'height="14" class="menuInfoBoxHeading"',
// -> VDDESIGN
'text' => tep_image(DIR_WS_DESIGN . 'boxcorner_right_left.gif')));
// <- VDDESIGN
$this->menuBox($menu_info_box_contents, true);
}
}
/*
inutile (un gère les erreurs, l'autre les produits, j'en conclus que c'est inutile pour les menus..
class menu_errorBox extends menuBox {
function menu_errorBox($menu_contents) {
$this->menu_data_parameters = 'class="errorBox"';
$this->menuBox($menu_contents, true);
}
}
class menu_productListingBox extends menuBox {
function menu_productListingBox($menu_contents) {
$this->menu_parameters = 'class="productListing"';
$this->menuBox($menu_contents, true);
}
}
*/
// -> OSC-12 : Arrondissement des angles pour le visuel du site
?>