diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 642fdf6c03b..13987f7a05c 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -60,19 +60,19 @@ $demoprofiles=array( 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png'), array('default'=>'0', 'key'=>'profdemoall','label'=>'DemoCompanyAll', 'disablemodules'=>'adherent,boutique,don,externalsite,mailmanspip', - 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png'), + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png') ); -/* + $tmpaction = 'view'; $parameters=array(); $object=(object) 'nothing'; $reshook=$hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; -$demoprofiles[]=array('default'=>'0', 'key'=>'profdemomed','label'=>'DemoCabinetMed', +/* +$demoprofiles[]=array('default'=>'0', 'key'=>'profdemomed', 'lang'=>'cabinetmed@cabinetmed', 'label'=>'DemoCabinetMed', 'url'=>'http://demodolimed.dolibarr.org', 'disablemodules'=>'adherent,boutique,don,externalsite', - 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png'), - ); + 'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png'); */ $alwayscheckedmodules=array('barcode','bookmark','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want @@ -242,66 +242,72 @@ print ''; print ''."\n"; $i=0; -foreach ($demoprofiles as $profilarray) +foreach ($demoprofiles as $profilearray) { - if ($profilarray['default'] >= 0) + if ($profilearray['default'] >= 0) { + //print $profilearray['lang']; + if (! empty($profilearray['lang'])) $langs->load($profilearray['lang']); + $url=$_SERVER["PHP_SELF"].'?action=gotodemo&urlfrom='.urlencode($_SERVER["PHP_SELF"]); - $urlwithmod=$url.'&demochoice='.$profilarray['key']; + $urlwithmod=$url.'&demochoice='.$profilearray['key']; // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' //print "xx".$_SERVER["PHP_SELF"].' '.DOL_URL_ROOT.'
'; $urlfrom=preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/i','',$_SERVER["PHP_SELF"]); //print $urlfrom; + if (! empty($profilearray['url'])) $urlwithmod=$profilearray['url']; //if ($i % $NBOFCOLS == 0) print ''; print ''; print ''; @@ -381,9 +387,36 @@ function llxHeaderVierge($title, $head = "") print ''."\n"; print ''."\n"; if ($head) print $head."\n"; - print ''; print "\n"; print ''."\n";
'."\n"; - print '
'."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; - print ''; - print ''; - //print ''; - print ''."\n"; - - print ''; - print ''; + print '
Demo '.$profilarray['label'].''.$langs->trans($profilarray['label']).'
'; - print $langs->trans("ThisIsListOfModules").'
'; - print ''; - $listofdisabledmodules=explode(',',$profilarray['disablemodules']); - $j=0;$nbcolsmod=4; - foreach($modules as $val) // Loop on qualified (enabled) modules - { - $modulekeyname=strtolower($val->name); - - $modulequalified=1; - if (! empty($val->always_enabled) || in_array($modulekeyname,$alwayshiddenmodules)) $modulequalified=0; - if ($val->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; - if ($val->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; - if (! $modulequalified) continue; - - $modulo=($j % $nbcolsmod); - if ($modulo == 0) print ''; - print ''; - if ($modulo == ($nbcolsmod - 1)) print ''; - $j++; - } - print '
'.$val->getName().'  '; - print ''; - print '
'; - print '
'."\n"; + // Title + print ''; + print ''; + print ''; print ''."\n"; + // Modules + if (empty($profilearray['url'])) + { + print ''; + print ''; + print ''."\n"; + + print ''; + } print '
Demo '.$profilearray['label'].''.$langs->trans($profilearray['label']).'
'; + print $langs->trans("ThisIsListOfModules").'
'; + print ''; + $listofdisabledmodules=explode(',',$profilearray['disablemodules']); + $j=0;$nbcolsmod=4; + foreach($modules as $val) // Loop on qualified (enabled) modules + { + $modulekeyname=strtolower($val->name); - print ''; + $modulequalified=1; + if (! empty($val->always_enabled) || in_array($modulekeyname,$alwayshiddenmodules)) $modulequalified=0; + if ($val->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; + if ($val->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; + if (! $modulequalified) continue; + + $modulo=($j % $nbcolsmod); + if ($modulo == 0) print ''; + print ''; + if ($modulo == ($nbcolsmod - 1)) print ''; + $j++; + } + print '
'.$val->getName().'  '; + print ''; + print '
'; + print '
'."\n"; print '