Fix: rename $class to $classname to prevents problems
http://www.manuelphp.com/php/reserved.keywords.php
This commit is contained in:
parent
7b1c726424
commit
73f216fd89
@ -122,8 +122,8 @@ else
|
||||
// Define working variables
|
||||
$table=strtolower($table);
|
||||
$tablenollx=preg_replace('/llx_/i','',$table);
|
||||
$class=ucfirst($tablenollx);
|
||||
$classmin=strtolower($class);
|
||||
$classname=ucfirst($tablenollx);
|
||||
$classmin=strtolower($classname);
|
||||
|
||||
|
||||
// Read skeleton_class.class.php file
|
||||
@ -145,7 +145,7 @@ $targetcontent=$sourcecontent;
|
||||
$targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent);
|
||||
$targetcontent=preg_replace('/\$element=\'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent);
|
||||
$targetcontent=preg_replace('/\$table_element=\'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent);
|
||||
$targetcontent=preg_replace('/Skeleton_class/', $class, $targetcontent);
|
||||
$targetcontent=preg_replace('/Skeleton_class/', $classname, $targetcontent);
|
||||
|
||||
// Substitute comments
|
||||
$targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent);
|
||||
@ -376,7 +376,7 @@ $targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.ph
|
||||
$targetcontent=preg_replace('/skeleton_script\.php/', $classmin.'_script.php', $targetcontent);
|
||||
$targetcontent=preg_replace('/\$element=\'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent);
|
||||
$targetcontent=preg_replace('/\$table_element=\'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent);
|
||||
$targetcontent=preg_replace('/Skeleton_class/', $class, $targetcontent);
|
||||
$targetcontent=preg_replace('/Skeleton_class/', $classname, $targetcontent);
|
||||
|
||||
// Substitute comments
|
||||
$targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent);
|
||||
|
||||
@ -141,8 +141,8 @@ if ($_GET["action"] == 'setmethod' || $_GET["action"] == 'setmod')
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/expedition/methode_expedition_$module.modules.php");
|
||||
|
||||
$class = "methode_expedition_$module";
|
||||
$expem = new $class($db);
|
||||
$classname = "methode_expedition_$module";
|
||||
$expem = new $classname($db);
|
||||
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."expedition_methode";
|
||||
$sql.= " WHERE rowid = ".$moduleid;
|
||||
|
||||
@ -206,7 +206,7 @@ if ($handle)
|
||||
if (preg_match('/^(mod_.*)\.php$/i',$file,$reg))
|
||||
{
|
||||
$file = $reg[1];
|
||||
$className = substr($file,4);
|
||||
$classname = substr($file,4);
|
||||
|
||||
require_once($dir.$file.".php");
|
||||
|
||||
@ -227,13 +227,13 @@ if ($handle)
|
||||
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->FICHEINTER_ADDON == $className)
|
||||
if ($conf->global->FICHEINTER_ADDON == $classname)
|
||||
{
|
||||
print img_picto($langs->trans("Activated"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$className.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -430,7 +430,7 @@ class Categorie
|
||||
* \param class PHP Class of object to store entity
|
||||
* \param table Table name for select in table. Full table name will be PREFIX_categorie_table.
|
||||
*/
|
||||
function get_type($field,$class,$table='')
|
||||
function get_type($field,$classname,$table='')
|
||||
{
|
||||
$objs = array();
|
||||
|
||||
@ -446,7 +446,7 @@ class Categorie
|
||||
{
|
||||
while ($rec = $this->db->fetch_array($resql))
|
||||
{
|
||||
$obj = new $class($this->db);
|
||||
$obj = new $classname($this->db);
|
||||
$obj->fetch($rec['fk_'.$field]);
|
||||
$objs[] = $obj;
|
||||
}
|
||||
|
||||
@ -544,13 +544,13 @@ class ActionComm
|
||||
* \return string Chaine avec URL
|
||||
* \remarks Utilise $this->id, $this->code et $this->libelle
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$maxlength=0,$class='',$option='')
|
||||
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result='';
|
||||
if ($option=='birthday') $lien = '<a '.($class?'class="'.$class.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">';
|
||||
else $lien = '<a '.($class?'class="'.$class.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">';
|
||||
if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">';
|
||||
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
|
||||
if ($langs->trans("Action".$this->type_code) != "Action".$this->type_code || ! $this->libelle)
|
||||
|
||||
@ -41,11 +41,11 @@ class ComptaExport
|
||||
\param USER Object utilisateur
|
||||
\param classe Nom de la classe utilis<EFBFBD>e pour formater les rapports
|
||||
*/
|
||||
function ComptaExport ($DB, $USER, $classe)
|
||||
function ComptaExport ($DB, $USER, $classname)
|
||||
{
|
||||
$this->db = $DB;
|
||||
$this->user = $USER;
|
||||
$this->classe_export = $classe;
|
||||
$this->classe_export = $classname;
|
||||
$this->error_message = '';
|
||||
}
|
||||
|
||||
|
||||
@ -317,7 +317,7 @@ if ($result)
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
$class = "impayee";
|
||||
$classname = "impayee";
|
||||
|
||||
print '<td nowrap="nowrap">';
|
||||
|
||||
|
||||
@ -418,8 +418,8 @@ class CommonObject
|
||||
if ($object == 'shipping') $object = 'expedition';
|
||||
if ($object == 'delivery') $object = 'livraison';
|
||||
|
||||
$class = ucfirst($object);
|
||||
$this->$object = new $class($this->db);
|
||||
$classname = ucfirst($object);
|
||||
$this->$object = new $classname($this->db);
|
||||
$this->$object->fetch($this->origin_id);
|
||||
}
|
||||
|
||||
@ -1027,9 +1027,9 @@ class CommonObject
|
||||
// TODO uniformiser emplacement classe
|
||||
require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/compta/facture/facture.class.php');
|
||||
$class = ucfirst($object);
|
||||
if(!class_exists($class)) require(DOL_DOCUMENT_ROOT."/".$object."/class/".$object.".class.php");
|
||||
$linkedObjectBlock = new $class($this->db);
|
||||
$classname = ucfirst($object);
|
||||
if(!class_exists($classname)) require(DOL_DOCUMENT_ROOT."/".$object."/class/".$object.".class.php");
|
||||
$linkedObjectBlock = new $classname($this->db);
|
||||
if ($object == 'facture') $object = 'compta/'.$object;
|
||||
if ($object == 'propal') $object = 'comm/'.$object;
|
||||
include(DOL_DOCUMENT_ROOT.'/'.$object.'/tpl/linkedobjectblock.tpl.php');
|
||||
|
||||
@ -421,10 +421,10 @@ class DolGraph
|
||||
if (! defined('LEGEND_LINE')) define('LEGEND_LINE',1);
|
||||
|
||||
// Create graph
|
||||
$class='';
|
||||
if ($this->type == 'bars') $class='BarPlot';
|
||||
if ($this->type == 'lines') $class='LinePlot';
|
||||
include_once DOL_DOCUMENT_ROOT."/includes/artichow/".$class.".class.php";
|
||||
$classname='';
|
||||
if ($this->type == 'bars') $classname='BarPlot';
|
||||
if ($this->type == 'lines') $classname='LinePlot';
|
||||
include_once DOL_DOCUMENT_ROOT."/includes/artichow/".$classname.".class.php";
|
||||
|
||||
// Definition de couleurs
|
||||
$bgcolor=new Color($this->bgcolor[0],$this->bgcolor[1],$this->bgcolor[2]);
|
||||
|
||||
@ -38,7 +38,7 @@ class Document
|
||||
|
||||
|
||||
/**
|
||||
\brief G<EFBFBD>n<EFBFBD>re le document
|
||||
\brief Genere le document
|
||||
\return int 0= ok, <> 0 = ko
|
||||
*/
|
||||
function Generate ($id)
|
||||
@ -47,11 +47,11 @@ class Document
|
||||
|
||||
dol_syslog("Document::Generate id=$id", LOG_DEBUG );
|
||||
$this->id = $id;
|
||||
$class = $id;
|
||||
$classfile = 'docs/class/'.$class.'.class.php';
|
||||
$classname = $id;
|
||||
$classfile = 'docs/class/'.$classname.'.class.php';
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/'.$classfile;
|
||||
$obj = new $class($this->db);
|
||||
$obj = new $classname($this->db);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
@ -848,9 +848,9 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
if ($code) {
|
||||
$classe = "methode_expedition_".strtolower($code);
|
||||
$classname = "methode_expedition_".strtolower($code);
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/expedition/methode_expedition_".strtolower($code).".modules.php");
|
||||
$obj = new $classe;
|
||||
$obj = new $classname();
|
||||
$url = $obj->provider_url_status($this->tracking_number);
|
||||
if ($url)
|
||||
{
|
||||
|
||||
@ -84,8 +84,8 @@ if ($_POST["action"] == 'add')
|
||||
|
||||
// On boucle sur chaque ligne du document d'origine pour completer objet expedition
|
||||
// avec qte a livrer
|
||||
$class = ucfirst($expedition->origin);
|
||||
$object = new $class($db);
|
||||
$classname = ucfirst($expedition->origin);
|
||||
$object = new $classname($db);
|
||||
$object->fetch($expedition->origin_id);
|
||||
//$object->fetch_lines();
|
||||
|
||||
@ -257,9 +257,9 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
if ($origin)
|
||||
{
|
||||
$class = ucfirst($origin);
|
||||
$classname = ucfirst($origin);
|
||||
|
||||
$object = new $class($db);
|
||||
$object = new $classname($db);
|
||||
|
||||
if ($object->fetch($origin_id))
|
||||
{
|
||||
|
||||
@ -202,7 +202,7 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
$class = "impayee";
|
||||
$classname = "impayee";
|
||||
|
||||
print '<td nowrap>';
|
||||
$facturestatic->id=$objp->facid;
|
||||
|
||||
@ -73,14 +73,14 @@ function print_auguria_menu($db,$atarget,$hideifnotallowed)
|
||||
}
|
||||
|
||||
// Define the class (top menu selected or not)
|
||||
if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $class='class="tmenusel"';
|
||||
else if (! empty($_SESSION['mainmenu']) && $tabMenu[$i]['mainmenu'] == $_SESSION['mainmenu']) $class='class="tmenusel"';
|
||||
else $class='class="tmenu"';
|
||||
if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
|
||||
else if (! empty($_SESSION['mainmenu']) && $tabMenu[$i]['mainmenu'] == $_SESSION['mainmenu']) $classname='class="tmenusel"';
|
||||
else $classname='class="tmenu"';
|
||||
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
|
||||
print '<div class="mainmenu '.$idsel.'"><span class="mainmenu_'.$idsel.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($tabMenu[$i]['atarget']?" target='".$tabMenu[$i]['atarget']."'":($atarget?" target=$atarget":"")).'>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($tabMenu[$i]['atarget']?" target='".$tabMenu[$i]['atarget']."'":($atarget?" target=$atarget":"")).'>';
|
||||
print $tabMenu[$i]['titre'];
|
||||
print '</a>';
|
||||
|
||||
|
||||
@ -45,19 +45,19 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
print '<table class="tmenu" summary="topmenu"><tr class="tmenu">';
|
||||
|
||||
// Home
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "home")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
$idsel='home';
|
||||
print '<td class="tmenu" align="center" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/index.php?mainmenu=home&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("Home").'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/index.php?mainmenu=home&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("Home").'</a>';
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -67,14 +67,14 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
$langs->load("companies");
|
||||
$langs->load("suppliers");
|
||||
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
|
||||
$idsel='companies';
|
||||
@ -83,7 +83,7 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
print '<td class="tmenu" align="center" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/index.php?mainmenu=companies&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("ThirdParties").'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/index.php?mainmenu=companies&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("ThirdParties").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
@ -104,14 +104,14 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
$langs->load("products");
|
||||
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
$chaine="";
|
||||
if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); }
|
||||
@ -123,7 +123,7 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/product/index.php?mainmenu=products&leftmenu="'.($atarget?" target=$atarget":"").'>'.$chaine.'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/product/index.php?mainmenu=products&leftmenu="'.($atarget?" target=$atarget":"").'>'.$chaine.'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
@ -143,14 +143,14 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
$langs->load("commercial");
|
||||
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
|
||||
$idsel='commercial';
|
||||
@ -158,7 +158,7 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="'.$id.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("Commercial").'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("Commercial").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
@ -179,14 +179,14 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
$langs->load("compta");
|
||||
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
|
||||
$idsel='accountancy';
|
||||
@ -195,7 +195,7 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/compta/index.php?mainmenu=accountancy&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("MenuFinancial").'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/compta/index.php?mainmenu=accountancy&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("MenuFinancial").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
@ -215,14 +215,14 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
$langs->load("projects");
|
||||
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
|
||||
$idsel='project';
|
||||
@ -230,7 +230,7 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/projet/index.php?mainmenu=project&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("Projects").'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/projet/index.php?mainmenu=project&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("Projects").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
@ -250,14 +250,14 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
$langs->load("other");
|
||||
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
|
||||
$idsel='tools';
|
||||
@ -265,7 +265,7 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/index.php?mainmenu=tools&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("Tools").'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/index.php?mainmenu=tools&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("Tools").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
@ -285,20 +285,20 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
$langs->load("shop");
|
||||
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
|
||||
$idsel='shop';
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("OSCommerce").'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("OSCommerce").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -307,20 +307,20 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
$langs->load("shop");
|
||||
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
|
||||
$idsel='shop';
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/oscommerce_ws/index.php?mainmenu=shop&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("OSCommerce").'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/oscommerce_ws/index.php?mainmenu=shop&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("OSCommerce").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -329,14 +329,14 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
// $langs->load("members"); Added in main file
|
||||
|
||||
$class="";
|
||||
$classname="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members")
|
||||
{
|
||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
$classname='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
$classname = 'class="tmenu"';
|
||||
}
|
||||
|
||||
$idsel='members';
|
||||
@ -344,7 +344,7 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
{
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/adherents/index.php?mainmenu=members&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("MenuMembers").'</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'/adherents/index.php?mainmenu=members&leftmenu="'.($atarget?" target=$atarget":"").'>'.$langs->trans("MenuMembers").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
@ -393,13 +393,13 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed)
|
||||
}
|
||||
|
||||
// Define the class (top menu selected or not)
|
||||
if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $class='class="tmenusel"';
|
||||
else if (! empty($_SESSION['mainmenu']) && $tabMenu[$i]['mainmenu'] == $_SESSION['mainmenu']) $class='class="tmenusel"';
|
||||
else $class='class="tmenu"';
|
||||
if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
|
||||
else if (! empty($_SESSION['mainmenu']) && $tabMenu[$i]['mainmenu'] == $_SESSION['mainmenu']) $classname='class="tmenusel"';
|
||||
else $classname='class="tmenu"';
|
||||
|
||||
print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$class.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($tabMenu[$i]['atarget']?" target='".$tabMenu[$i]['atarget']."'":($atarget?" target=$atarget":"")).'>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($tabMenu[$i]['atarget']?" target='".$tabMenu[$i]['atarget']."'":($atarget?" target=$atarget":"")).'>';
|
||||
print $tabMenu[$i]['titre'];
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
@ -62,10 +62,10 @@ class MenuTop {
|
||||
// ***** START *****
|
||||
|
||||
// print '<td class="tmenu">';
|
||||
// print '<a '.$class.' href="'.DOL_URL_ROOT.'/thepage1.php>My menu entry 1</a>';
|
||||
// print '<a '.$classname.' href="'.DOL_URL_ROOT.'/thepage1.php>My menu entry 1</a>';
|
||||
// print '</td>';
|
||||
// print '<td class="tmenu">';
|
||||
// print '<a '.$class.' href="'.DOL_URL_ROOT.'/thepage2.php>My menu entry 2</a>';
|
||||
// print '<a '.$classname.' href="'.DOL_URL_ROOT.'/thepage2.php>My menu entry 2</a>';
|
||||
// print '</td>';
|
||||
// ...
|
||||
|
||||
@ -90,10 +90,10 @@ class MenuTop {
|
||||
else $url.='&';
|
||||
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=';
|
||||
$url.="&idmenu=".$tabMenu[$i]['rowid'];
|
||||
if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $class='class="tmenusel"';
|
||||
else $class='class="tmenu"';
|
||||
if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
|
||||
else $classname='class="tmenu"';
|
||||
print '<td class="tmenu">';
|
||||
print '<a '.$class.' '.$idsel.'href="'.$url.'"'.($this->atarget?" target=$this->atarget":($this->atarget?" target=$this->atarget":"")).'>';
|
||||
print '<a '.$classname.' '.$idsel.'href="'.$url.'"'.($this->atarget?" target=$this->atarget":($this->atarget?" target=$this->atarget":"")).'>';
|
||||
print $tabMenu[$i]['titre'];
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
@ -2721,15 +2721,15 @@ function yn($yesno, $case=1, $color=0)
|
||||
if ($yesno == 1 || strtolower($yesno) == 'yes' || strtolower($yesno) == 'true') // A mettre avant test sur no a cause du == 0
|
||||
{
|
||||
$result=($case?$langs->trans("Yes"):$langs->trans("yes"));
|
||||
$class='ok';
|
||||
$classname='ok';
|
||||
}
|
||||
elseif ($yesno == 0 || strtolower($yesno) == 'no' || strtolower($yesno) == 'false')
|
||||
{
|
||||
$result=($case?$langs->trans("No"):$langs->trans("no"));
|
||||
if ($color == 2) $class='ok';
|
||||
else $class='error';
|
||||
if ($color == 2) $classname='ok';
|
||||
else $classname='error';
|
||||
}
|
||||
if ($color) return '<font class="'.$class.'">'.$result.'</font>';
|
||||
if ($color) return '<font class="'.$classname.'">'.$result.'</font>';
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -123,9 +123,9 @@ if ($_POST["action"] == 'add' && ($user->rights->produit->creer || $user->rights
|
||||
{
|
||||
if ($_POST["canvas"] <> '' && file_exists('canvas/'.$_POST["canvas"].'/product.'.$_POST["canvas"].'.class.php') )
|
||||
{
|
||||
$class = 'Product'.ucfirst($_POST["canvas"]);
|
||||
$classname = 'Product'.ucfirst($_POST["canvas"]);
|
||||
include_once('canvas/'.$_POST["canvas"].'/product.'.$_POST["canvas"].'.class.php');
|
||||
$product = new $class($db);
|
||||
$product = new $classname($db);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -256,10 +256,10 @@ if ($_POST["action"] == 'update' && ($user->rights->produit->creer || $user->rig
|
||||
// Specific product
|
||||
if ($product->canvas <> '' && file_exists('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php') )
|
||||
{
|
||||
$class = 'Product'.ucfirst($product->canvas);
|
||||
$classname = 'Product'.ucfirst($product->canvas);
|
||||
include_once('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php');
|
||||
|
||||
$product = new $class($db);
|
||||
$product = new $classname($db);
|
||||
if ($product->FetchCanvas($_POST["id"]))
|
||||
{
|
||||
$product->UpdateCanvas($_POST);
|
||||
@ -624,11 +624,11 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ
|
||||
if (! isset($product))
|
||||
{
|
||||
$filecanvas = DOL_DOCUMENT_ROOT.'/product/canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php';
|
||||
$class = 'Product'.ucfirst($_GET["canvas"]);
|
||||
$classname = 'Product'.ucfirst($_GET["canvas"]);
|
||||
|
||||
include_once($filecanvas);
|
||||
|
||||
$product = new $class($db,0,$user);
|
||||
$product = new $classname($db,0,$user);
|
||||
}
|
||||
|
||||
$product->assign_smarty_values($smarty, 'create');
|
||||
@ -859,9 +859,9 @@ if ($_GET["id"] || $_GET["ref"])
|
||||
// Gestion des produits specifiques
|
||||
if ($product->canvas <> '' && file_exists('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php') )
|
||||
{
|
||||
$class = 'Product'.ucfirst($product->canvas);
|
||||
$classname = 'Product'.ucfirst($product->canvas);
|
||||
include_once('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php');
|
||||
$product = new $class($db);
|
||||
$product = new $classname($db);
|
||||
|
||||
$result = $product->fetchCanvas($_GET["id"],'',$_GET["action"]);
|
||||
|
||||
|
||||
@ -93,10 +93,10 @@ $htmlother=new FormOther($db);
|
||||
|
||||
if ($_GET["canvas"] <> '' && file_exists('canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php') )
|
||||
{
|
||||
$class = 'Product'.ucfirst($_GET["canvas"]);
|
||||
$classname = 'Product'.ucfirst($_GET["canvas"]);
|
||||
include_once('canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php');
|
||||
|
||||
$object = new $class($db);
|
||||
$object = new $classname($db);
|
||||
$object->getFieldList();
|
||||
$object->LoadListDatas($limit, $offset, $sortfield, $sortorder);
|
||||
$title = $object->getTitle();
|
||||
|
||||
@ -159,7 +159,7 @@ $listofreferent=array(
|
||||
foreach ($listofreferent as $key => $value)
|
||||
{
|
||||
$title=$value['title'];
|
||||
$class=$value['class'];
|
||||
$classname=$value['class'];
|
||||
$qualified=$value['test'];
|
||||
if ($qualified)
|
||||
{
|
||||
@ -181,7 +181,7 @@ foreach ($listofreferent as $key => $value)
|
||||
$total = 0;
|
||||
for ($i = 0; $i<sizeof($elementarray);$i++)
|
||||
{
|
||||
$element = new $class($db);
|
||||
$element = new $classname($db);
|
||||
$element->fetch($elementarray[$i]);
|
||||
|
||||
$var=!$var;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user