[*] BO : Each module hooked on displayAdminProductsExtra add a Product Tab

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12924 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
fSerny
2012-02-02 10:39:17 +00:00
parent 4197ae40dc
commit d1afff824a
2 changed files with 44 additions and 6 deletions

View File

@@ -827,6 +827,26 @@ abstract class ModuleCore
return str_replace('\'', '\\\'', Tools::htmlentitiesDecodeUTF8($string));
}
public static function getModuleName($module)
{
// Config file
$configFile = _PS_MODULE_DIR_.$module.'/config.xml';
if (!file_exists($configFile))
return 'Module '.ucfirst($module);
// Load config.xml
libxml_use_internal_errors(true);
$xml_module = simplexml_load_file($configFile);
foreach (libxml_get_errors() as $error)
return 'Module '.ucfirst($module);
libxml_clear_errors();
// Return Name
return Module::findTranslation($xml_module->name, Module::configXmlStringFormat($xml_module->displayName), (string)$xml_module->name);
}
/**
* Return available modules
*