Ajout menu pour les produits specifiques
This commit is contained in:
parent
0febb18214
commit
b5ebdb2040
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -55,6 +55,34 @@ function llxHeader($head = "", $urlp = "", $title="")
|
||||
}
|
||||
}
|
||||
|
||||
// Produit specifique
|
||||
$dir = DOL_DOCUMENT_ROOT . "/product/canvas/";
|
||||
|
||||
if(is_dir($dir))
|
||||
{
|
||||
if ($handle = opendir($dir))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, strlen($file) -10) == '.class.php' && substr($file,0,8) == 'product.')
|
||||
{
|
||||
$parts = explode('.',$file);
|
||||
$classname = 'Product'.ucfirst($parts[1]);
|
||||
|
||||
require_once($dir.$file);
|
||||
|
||||
$module = new $classname();
|
||||
|
||||
if ($module->active === '1')
|
||||
{
|
||||
$menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=0&canvas=".$module->canvas, $langs->trans($module->menu_new));
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->service->enabled)
|
||||
{
|
||||
$menu->add(DOL_URL_ROOT."/product/index.php?type=1", $langs->trans("Services"));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user