diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index b8001f874d1..af0a25f11c9 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -143,7 +143,7 @@ CurrentInformationOnImage=This tool was designed to help you to resize or crop a
ImageEditor=Image editor
YouReceiveMailBecauseOfNotification=You receive this message because your email has been added to list of targets to be informed of particular events into %s software of %s.
YouReceiveMailBecauseOfNotification2=This event is the following:
-ThisIsListOfModules=This is list of standard modules preselected by this demo profile. Edit this to have a more personalized demo and click on "Start".
+ThisIsListOfModules=This is a list of modules preselected by this demo profile (only most common modules are visible in this demo). Edit this to have a more personalized demo and click on "Start".
##### Bookmark #####
Bookmark=Bookmark
diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang
index d06bb307593..b15dbb666ba 100644
--- a/htdocs/langs/fr_FR/other.lang
+++ b/htdocs/langs/fr_FR/other.lang
@@ -143,7 +143,7 @@ CurrentInformationOnImage=Cette page permet de redimensionner ou recadrer un ima
ImageEditor=Editeur d'image
YouReceiveMailBecauseOfNotification=Vous recevez ce message car votre email a été abonnée à certaines notifications automatiques pour vous informer d'évenements particuliers issus du logiciel %s de %s.
YouReceiveMailBecauseOfNotification2=L'événement en question est le suivant:
-ThisIsListOfModules=Voici la liste des modules standards présélectionnés par ce profil de démo. Affinez encore vos préférences et cliquez sur "Démarrer".
+ThisIsListOfModules=Voici une liste de modules présélectionnés par ce profil de démo (seuls les plus courants sont accessibles dans cette demo). Affinez encore vos préférences et cliquez sur "Démarrer".
##### Bookmark #####
Bookmark=Marque-page
diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php
index deb0be59704..12d2ee20069 100644
--- a/htdocs/public/demo/index.php
+++ b/htdocs/public/demo/index.php
@@ -60,45 +60,78 @@ $demoprofiles=array(
'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png'),
);
-$alwaysdisabledmodules=array('memcached');
-//$alwaysdisabledmodules=array('boutique','clicktodial','externalsite','ftp','gravatar','ldap','memcached','webcalendar');
+$alwayscheckedmodules=array('barcode','bookmark','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want
+$alwaysuncheckedmodules=array('paybox','filemanager'); // Module we never want
+$alwayshiddenmodules=array('barcode','bookmark','boutique','clicktodial','externalrss','externalsite','fckeditor','ftp','geoipmaxmind','gravatar','ldap','memcached','notification','syslog','user','webcalendar','webservices');
-function llxHeaderVierge($title, $head = "")
+// Search modules
+$dirlist=$conf->file->dol_document_root;
+
+$filename = array();
+$modules = array();
+$orders = array();
+$categ = array();
+$dirmod = array();
+$i = 0; // is a sequencer of modules found
+$j = 0; // j is module number. Automatically affeted if module number not defined.
+foreach ($dirlist as $dirroot)
{
- global $user, $conf, $langs;
+ $dir = $dirroot . "/includes/modules/";
- header("Content-type: text/html; charset=".$conf->file->character_set_client);
+ // Charge tableaux modules, nom, numero, orders depuis r�pertoire dir
+ $handle=opendir($dir);
+ while (($file = readdir($handle))!==false)
+ {
+ //print "$i ".$file."\n
";
+ if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
+ {
+ $modName = substr($file, 0, dol_strlen($file) - 10);
+
+ if ($modName)
+ {
+ include_once($dir.$file);
+ $objMod = new $modName($db);
+
+ if ($objMod->numero > 0)
+ {
+ $j = $objMod->numero;
+ }
+ else
+ {
+ $j = 1000 + $i;
+ }
+
+ $modulequalified=1;
+
+ // We discard modules that does not respect constraint on menu handlers
+ if ($objMod->needleftmenu && sizeof($objMod->needleftmenu) && ! in_array($conf->left_menu,$objMod->needleftmenu)) $modulequalified=0;
+ if ($objMod->needtopmenu && sizeof($objMod->needtopmenu) && ! in_array($conf->top_menu,$objMod->needtopmenu)) $modulequalified=0;
+
+ // We discard modules according to features level (PS: if module is activated we always show it)
+ $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
+ if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0;
+ if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0;
+
+ if ($modulequalified)
+ {
+ $modules[$i] = $objMod;
+ $filename[$i]= $modName;
+ $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
+ //print "x".$modName." ".$orders[$i]."\n
";
+ $categ[$objMod->special]++; // Array of all different modules categories
+ $dirmod[$i] = $dirroot;
+ $j++;
+ $i++;
+ }
+ }
+ }
+ }
- print '';
- //print '';
- print "\n";
- print "\n";
- print "