Fixing style errors.
This commit is contained in:
parent
650bb54051
commit
2569c792e7
@ -102,8 +102,7 @@ foreach ($modulesdir as $dir)
|
|||||||
// File duplicate
|
// File duplicate
|
||||||
print "Warning duplicate file found : ".$file." (Found ".$dir.$file.", already found ".$modules_fullpath[$file].")<br>";
|
print "Warning duplicate file found : ".$file." (Found ".$dir.$file.", already found ".$modules_fullpath[$file].")<br>";
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
// File to load
|
// File to load
|
||||||
$res = include_once $dir.$file;
|
$res = include_once $dir.$file;
|
||||||
if (class_exists($modName))
|
if (class_exists($modName))
|
||||||
@ -120,8 +119,7 @@ foreach ($modulesdir as $dir)
|
|||||||
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
|
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,8 +146,7 @@ foreach ($modules as $key=>$module)
|
|||||||
if (preg_match('/^\//', $module->picto)) $newModule->picto = img_picto($alt, $module->picto, 'width="14px"', 1);
|
if (preg_match('/^\//', $module->picto)) $newModule->picto = img_picto($alt, $module->picto, 'width="14px"', 1);
|
||||||
else $newModule->picto = img_object($alt, $module->picto, 'width="14px"');
|
else $newModule->picto = img_object($alt, $module->picto, 'width="14px"');
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$newModule->picto = img_object($alt, 'generic', 'width="14px"');
|
$newModule->picto = img_object($alt, 'generic', 'width="14px"');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,24 +169,24 @@ foreach ($modules as $key=>$module)
|
|||||||
$newModule->permission = $permission;
|
$newModule->permission = $permission;
|
||||||
|
|
||||||
// pre-filter list
|
// pre-filter list
|
||||||
if($search_name && !stristr($newModule->name, $search_name)) continue;
|
if ($search_name && !stristr($newModule->name, $search_name)) continue;
|
||||||
if($search_version && !stristr($newModule->version, $search_version)) continue;
|
if ($search_version && !stristr($newModule->version, $search_version)) continue;
|
||||||
if($search_id && !stristr($newModule->id, $search_id)) continue;
|
if ($search_id && !stristr($newModule->id, $search_id)) continue;
|
||||||
|
|
||||||
if($search_permission)
|
if ($search_permission)
|
||||||
{
|
{
|
||||||
$found = false;
|
$found = false;
|
||||||
|
|
||||||
foreach($newModule->permission as $permission)
|
foreach ($newModule->permission as $permission)
|
||||||
{
|
{
|
||||||
if(stristr($permission, $search_permission))
|
if (stristr($permission, $search_permission))
|
||||||
{
|
{
|
||||||
$found = true;
|
$found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$found) continue;
|
if (!$found) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$moduleList[] = $newModule;
|
$moduleList[] = $newModule;
|
||||||
@ -227,25 +224,25 @@ print '<table class="noborder centpercent">';
|
|||||||
// Lines with input filters
|
// Lines with input filters
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
|
|
||||||
if($arrayfields['name']['checked'])
|
if ($arrayfields['name']['checked'])
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre left">';
|
print '<td class="liste_titre left">';
|
||||||
print '<input class="flat" type="text" name="search_name" size="8" value="'.$search_name.'">';
|
print '<input class="flat" type="text" name="search_name" size="8" value="'.$search_name.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if($arrayfields['version']['checked'])
|
if ($arrayfields['version']['checked'])
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre left">';
|
print '<td class="liste_titre left">';
|
||||||
print '<input class="flat" type="text" name="search_version" size="8" value="'.$search_version.'">';
|
print '<input class="flat" type="text" name="search_version" size="8" value="'.$search_version.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if($arrayfields['id']['checked'])
|
if ($arrayfields['id']['checked'])
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre left">';
|
print '<td class="liste_titre left">';
|
||||||
print '<input class="flat" type="text" name="search_id" size="8" value="'.$search_id.'">';
|
print '<input class="flat" type="text" name="search_id" size="8" value="'.$search_id.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if($arrayfields['permission']['checked'])
|
if ($arrayfields['permission']['checked'])
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre left">';
|
print '<td class="liste_titre left">';
|
||||||
print '<input class="flat" type="text" name="search_permission" size="8" value="'.$search_permission.'">';
|
print '<input class="flat" type="text" name="search_permission" size="8" value="'.$search_permission.'">';
|
||||||
@ -261,19 +258,19 @@ print '</tr>';
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
if($arrayfields['name']['checked'])
|
if ($arrayfields['name']['checked'])
|
||||||
{
|
{
|
||||||
print_liste_field_titre($arrayfields['name']['label'], $_SERVER["PHP_SELF"], "name", "", "", "", $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['name']['label'], $_SERVER["PHP_SELF"], "name", "", "", "", $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if($arrayfields['version']['checked'])
|
if ($arrayfields['version']['checked'])
|
||||||
{
|
{
|
||||||
print_liste_field_titre($arrayfields['version']['label'], $_SERVER["PHP_SELF"], "version", "", "", "", $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['version']['label'], $_SERVER["PHP_SELF"], "version", "", "", "", $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if($arrayfields['id']['checked'])
|
if ($arrayfields['id']['checked'])
|
||||||
{
|
{
|
||||||
print_liste_field_titre($arrayfields['id']['label'], $_SERVER["PHP_SELF"], "id", "", "", "", $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['id']['label'], $_SERVER["PHP_SELF"], "id", "", "", "", $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if($arrayfields['permission']['checked'])
|
if ($arrayfields['permission']['checked'])
|
||||||
{
|
{
|
||||||
print_liste_field_titre($arrayfields['permission']['label'], $_SERVER["PHP_SELF"], "permission", "", "", "", $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['permission']['label'], $_SERVER["PHP_SELF"], "permission", "", "", "", $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
@ -287,20 +284,24 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// sort list
|
// sort list
|
||||||
if($sortfield == "name" && $sortorder == "asc") usort($moduleList, function(stdClass $a, stdClass $b) { return strcasecmp($a->name, $b->name); });
|
if ($sortfield == "name" && $sortorder == "asc") usort($moduleList, function (stdClass $a, stdClass $b) {
|
||||||
if($sortfield == "name" && $sortorder == "desc") usort($moduleList, function(stdClass $a, stdClass $b) { return strcasecmp($b->name, $a->name); });
|
return strcasecmp($a->name, $b->name); });
|
||||||
if($sortfield == "version" && $sortorder == "asc") usort($moduleList, function (stdClass $a, stdClass $b) { return strcasecmp($a->version, $b->version); });
|
if ($sortfield == "name" && $sortorder == "desc") usort($moduleList, function (stdClass $a, stdClass $b) {
|
||||||
if($sortfield == "version" && $sortorder == "desc") usort($moduleList, function(stdClass $a, stdClass $b) { return strcasecmp($b->version, $a->version); });
|
return strcasecmp($b->name, $a->name); });
|
||||||
if($sortfield == "id" && $sortorder == "asc") usort($moduleList, "sortIdAsc");
|
if ($sortfield == "version" && $sortorder == "asc") usort($moduleList, function (stdClass $a, stdClass $b) {
|
||||||
if($sortfield == "id" && $sortorder == "desc") usort($moduleList, "sortIdDesc");
|
return strcasecmp($a->version, $b->version); });
|
||||||
if($sortfield == "permission" && $sortorder == "asc") usort($moduleList, "sortPermissionIdsAsc");
|
if ($sortfield == "version" && $sortorder == "desc") usort($moduleList, function (stdClass $a, stdClass $b) {
|
||||||
if($sortfield == "permission" && $sortorder == "desc") usort($moduleList, "sortPermissionIdsDesc");
|
return strcasecmp($b->version, $a->version); });
|
||||||
|
if ($sortfield == "id" && $sortorder == "asc") usort($moduleList, "sortIdAsc");
|
||||||
|
if ($sortfield == "id" && $sortorder == "desc") usort($moduleList, "sortIdDesc");
|
||||||
|
if ($sortfield == "permission" && $sortorder == "asc") usort($moduleList, "sortPermissionIdsAsc");
|
||||||
|
if ($sortfield == "permission" && $sortorder == "desc") usort($moduleList, "sortPermissionIdsDesc");
|
||||||
|
|
||||||
foreach ($moduleList as $module)
|
foreach ($moduleList as $module)
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
if($arrayfields['name']['checked'])
|
if ($arrayfields['name']['checked'])
|
||||||
{
|
{
|
||||||
print '<td width="300" class="nowrap">';
|
print '<td width="300" class="nowrap">';
|
||||||
print $module->picto;
|
print $module->picto;
|
||||||
@ -308,17 +309,17 @@ foreach ($moduleList as $module)
|
|||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($arrayfields['version']['checked'])
|
if ($arrayfields['version']['checked'])
|
||||||
{
|
{
|
||||||
print '<td>'.$module->version.'</td>';
|
print '<td>'.$module->version.'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($arrayfields['id']['checked'])
|
if ($arrayfields['id']['checked'])
|
||||||
{
|
{
|
||||||
print '<td class="center">'.$module->id.'</td>';
|
print '<td class="center">'.$module->id.'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($arrayfields['permission']['checked'])
|
if ($arrayfields['permission']['checked'])
|
||||||
{
|
{
|
||||||
$idperms = '';
|
$idperms = '';
|
||||||
foreach ($module->permission as $permission)
|
foreach ($module->permission as $permission)
|
||||||
@ -326,7 +327,7 @@ foreach ($moduleList as $module)
|
|||||||
$idperms .= ($idperms ? ", " : "").$permission;
|
$idperms .= ($idperms ? ", " : "").$permission;
|
||||||
|
|
||||||
$translationKey = "Permission".$permission;
|
$translationKey = "Permission".$permission;
|
||||||
if(empty($langs->tab_translate[$translationKey]))
|
if (empty($langs->tab_translate[$translationKey]))
|
||||||
{
|
{
|
||||||
$tooltip = 'Missing translation (key '.$translation.' not found in admin.lang)';
|
$tooltip = 'Missing translation (key '.$translation.' not found in admin.lang)';
|
||||||
$idperms .= ' <img src="../../theme/eldy/img/warning.png" alt="Warning" title="'.$tooltip.'">';
|
$idperms .= ' <img src="../../theme/eldy/img/warning.png" alt="Warning" title="'.$tooltip.'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user