Ajout menu pour les produits specifiques

This commit is contained in:
Rodolphe Quiedeville 2006-12-02 13:04:54 +00:00
parent 0febb18214
commit b5ebdb2040

View File

@ -1,5 +1,5 @@
<?php <?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> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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&amp;type=0&amp;canvas=".$module->canvas, $langs->trans($module->menu_new));
}
}
}
closedir($handle);
}
}
if ($conf->service->enabled) if ($conf->service->enabled)
{ {
$menu->add(DOL_URL_ROOT."/product/index.php?type=1", $langs->trans("Services")); $menu->add(DOL_URL_ROOT."/product/index.php?type=1", $langs->trans("Services"));