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

This commit is contained in:
fSerny
2012-02-02 10:39:17 +00:00
parent 9ca2b46af2
commit 9ea901672e
2 changed files with 44 additions and 6 deletions
+20
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
*