';
+ print '| '.$langs->trans("Name").' | ';
+ print ''.$langs->trans("Description").' | ';
+ print ''.$langs->trans("Status").' | ';
+ print ''.$langs->trans("ShortInfo").' | ';
+ print ''.$langs->trans("Preview").' | ';
+ print "
\n";
+
+ $var=true;
+ foreach ($dirproduct as $dirroot)
+ {
+ $dir = dol_buildpath($dirroot.'core/modules/product/doc/',0);
+ $handle=@opendir($dir);
+ if (is_resource($handle))
+ {
+ while (($file = readdir($handle))!==false)
+ {
+ if (preg_match('/\.modules\.php$/i',$file))
+ {
+ $name = substr($file, 4, dol_strlen($file) -16);
+ $classname = substr($file, 0, dol_strlen($file) -12);
+
+ try {
+ dol_include_once($dirroot.'core/modules/product/doc/'.$file);
+ }
+ catch(Exception $e)
+ {
+ dol_syslog($e->getMessage(), LOG_ERR);
+ }
+
+ $module = new $classname($db);
+
+ $modulequalified=1;
+ if (! empty($module->version)) {
+ if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
+ else if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
+ }
+
+ if ($modulequalified)
+ {
+ $var = !$var;
+ print '| ';
+ print $module->name;
+ print " | \n";
+ if (method_exists($module,'info')) print $module->info($langs);
+ else print $module->description;
+ print ' | ';
+
+ // Activate / Disable
+ if (in_array($name, $def))
+ {
+ print "\n";
+ print 'scandir.'&label='.urlencode($module->name).'">';
+ print img_picto($langs->trans("Enabled"),'switch_on');
+ print '';
+ print " | ";
+ }
+ else
+ {
+ if (versioncompare($module->phpmin,versionphparray()) > 0)
+ {
+ print "\n";
+ print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion",join('.',$module->phpmin))),'switch_off');
+ print " | ";
+ }
+ else
+ {
+ print "\n";
+ print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'';
+ print " | ";
+ }
+ }
+
+ // Info
+ $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
+ $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
+ if ($module->type == 'pdf')
+ {
+ $htmltooltip.='
'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
+ }
+ $htmltooltip.='
'.$langs->trans("FeaturesSupported").':';
+ $htmltooltip.='
'.$langs->trans("WatermarkOnDraft").': '.yn((! empty($module->option_draft_watermark)?$module->option_draft_watermark:''), 1, 1);
+
+ print '';
+ print $form->textwithpicto('',$htmltooltip,1,0);
+ print ' | ';
+
+ // Preview
+ print '';
+ if ($module->type == 'pdf')
+ {
+ $linkspec=''.img_object($langs->trans("Preview"),'bill').'';
+ }
+ else
+ {
+ $linkspec=img_object($langs->trans("PreviewNotAvailable"),'generic');
+ }
+ print $linkspec;
+ print ' | ';
+
+ print "
\n";
+ }
+ }
+ }
+ closedir($handle);
+ }
+ }
+ print '