浏览代码

Merge pull request #6897 from hregis/develop_bug4

Fix: for view special values
Laurent Destailleur 8 年之前
父节点
当前提交
3f5cf0ee18
共有 1 个文件被更改,包括 58 次插入39 次删除
  1. 58 39
      htdocs/admin/modulehelp.php

+ 58 - 39
htdocs/admin/modulehelp.php

@@ -1,5 +1,6 @@
 <?php
-/* Copyright (C) 2017  Laurent Destailleur     <eldy@users.sourceforge.net>
+/* Copyright (C) 2017	Laurent Destailleur		<eldy@users.sourceforge.net>
+ * Copyright (C) 2017	Regis Houssin			<regis.houssin@capnetworks.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -68,7 +69,7 @@ llxHeader('',$langs->trans("Setup"),$help_url);
 print '<!-- Force style container -->'."\n".'<style>
 .id-container {
     width: 100%;
-} 
+}
 </style>';
 
 $arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers"));
@@ -165,6 +166,7 @@ foreach ($modulesdir as $dir)
 
 		    			            // Gives the possibility to the module, to provide his own family info and position of this family
 		    			            if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
+		    			            	if (!is_array($familyinfo)) $familyinfo=array();
 		    			            	$familyinfo = array_merge($familyinfo, $objMod->familyinfo);
 		    			            	$familykey = key($objMod->familyinfo);
 		    			            } else {
@@ -305,13 +307,13 @@ if ($objMod->isCoreOrExternalModule() == 'external')
 
 // Define text of description of module
 $text='';
-   
+
 if ($mode == 'desc')
 {
     if ($moduledesc) $text.=$moduledesc.'<br><br>';
-    
+
     $text.='<strong>'.$langs->trans("Version").':</strong> '.$version;
-    
+
     $textexternal='';
     if ($objMod->isCoreOrExternalModule() == 'external')
     {
@@ -346,8 +348,8 @@ if ($mode == 'desc')
         $text.='<strong>'.$langs->trans("LastActivationIP").':</strong> ';
         $text.= $ip;
         $text.='<br>';
-    }    
-    
+    }
+
     $moduledesclong=$objMod->getDescLong();
     if ($moduledesclong) $text.='<br><hr><div class="moduledesclong">'.$moduledesclong.'<div>';
 }
@@ -360,9 +362,9 @@ if ($mode == 'feature')
     $text.='<br><strong>'.$langs->trans("RequiredBy").':</strong> ';
 	if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby);
 	else $text.=$langs->trans("None");
-	
+
     $text.='<br><br><br>';
-    
+
     $text.='<strong>'.$langs->trans("AddRemoveTabs").':</strong> ';
     if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs))
     {
@@ -375,9 +377,9 @@ if ($mode == 'feature')
         }
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddDictionaries").':</strong> ';
     if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib']))
     {
@@ -389,9 +391,9 @@ if ($mode == 'feature')
         }
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddBoxes").':</strong> ';
     if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes))
     {
@@ -403,27 +405,27 @@ if ($mode == 'feature')
         }
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddModels").':</strong> ';
     if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models'])
     {
         $text.=$langs->trans("Yes");
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddSubstitutions").':</strong> ';
     if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions'])
     {
         $text.=$langs->trans("Yes");
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddSheduledJobs").':</strong> ';
     if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs))
     {
@@ -435,55 +437,72 @@ if ($mode == 'feature')
         }
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddTriggers").':</strong> ';
     if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers'])
     {
         $text.=$langs->trans("Yes");
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddHooks").':</strong> ';
     if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks']))
     {
-        $i=0;
-        foreach($objMod->module_parts['hooks'] as $val)
+    	$i=0;
+        foreach($objMod->module_parts['hooks'] as $key => $val)
         {
-            $text.=($i?', ':'').($val);
-            $i++;
+        	if ($key == 'entity') continue;
+
+        	// For special values
+        	if ($key == 'data')
+        	{
+        		if (is_array($val))
+        		{
+        			foreach($val as $value)
+        			{
+        				$text.=($i?', ':'').($value);
+        				$i++;
+        			}
+
+        			continue;
+        		}
+        	}
+
+        	$text.=($i?', ':'').($val);
+        	$i++;
         }
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddPermissions").':</strong> ';
     if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights))
     {
         $i=0;
         foreach($objMod->rights as $val)
         {
-            $text.=($i?', ':'').($val[1]);
-            $i++;
+        	$text.=($i?', ':'').($val[1]);
+        	$i++;
         }
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddMenus").':</strong> ';
     if (isset($objMod->menu) && ! empty($objMod->menu)) // objMod can be an array or just an int 1
     {
         $text.=$langs->trans("Yes");
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddExportProfiles").':</strong> ';
     if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label))
     {
@@ -495,9 +514,9 @@ if ($mode == 'feature')
         }
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddImportProfiles").':</strong> ';
     if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label))
     {
@@ -509,9 +528,9 @@ if ($mode == 'feature')
         }
     }
     else $text.=$langs->trans("No");
-    
+
     $text.='<br>';
-    
+
     $text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
     $text.=$langs->trans("DetectionNotPossible");
 }