From b34a613504a99aece94f3f2942875330689e202f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Thu, 1 Aug 2013 10:52:21 +0200 Subject: [PATCH] code formating --- htdocs/core/class/html.formfile.class.php | 90 +++++++++++++---------- 1 file changed, 53 insertions(+), 37 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 3beb2eec1ad..97606b19379 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1021,14 +1021,13 @@ class FormFile public function list_of_links($object, $permtodelete=1, $action=null, $selected=null) { - global $user, $conf, $langs, $hookmanager, $user; + global $user, $conf, $langs, $user; global $bc; - global $sortfield, $sortorder, $maxheightmini; + global $sortfield, $sortorder; require_once DOL_DOCUMENT_ROOT . '/link/class/link.class.php'; $link = new Link($this->db); $links = array(); - //HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXX if ($sortfield == "name") { $sortfield = "label"; } elseif ($sortfield == "date") { @@ -1037,28 +1036,55 @@ class FormFile $sortfield = null; } $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder); - $param = (isset($object->id)?'&id='.$object->id:'').$param; + $param = (isset($object->id)?'&id=' . $object->id : ''); // Show list of associated links - if (empty($useinecm)) print_titre($langs->trans("LinkedFiles")); + print_titre($langs->trans("LinkedFiles")); print ''; print ''; - print_liste_field_titre($langs->trans("Documents2"),$_SERVER['PHP_SELF'],"name","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Size"),"","","","",'align="right"'); - print_liste_field_titre($langs->trans("Date"),$_SERVER['PHP_SELF'],"date","",$param,'align="center"',$sortfield,$sortorder); - if (empty($useinecm)) print_liste_field_titre('',$_SERVER['PHP_SELF'],"","",$param,'align="center"'); + print_liste_field_titre($langs->trans("Documents2"), + $_SERVER['PHP_SELF'], + "name", + "", + $param, + 'align="left"', + $sortfield, + $sortorder + ); + print_liste_field_titre($langs->trans("Size"), + "", + "", + "", + "", + 'align="right"' + ); + print_liste_field_titre($langs->trans("Date"), + $_SERVER['PHP_SELF'], + "date", + "", + $param, + 'align="center"', + $sortfield, + $sortorder + ); + print_liste_field_titre('', + $_SERVER['PHP_SELF'], + "", + "", + $param, + 'align="center"' + ); print_liste_field_titre('','',''); print ''; - - $nboflinks = count($links); - - if ($nboflinks > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + if ($nboflinks > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + } $var = true; - foreach($links as $link) { + foreach ($links as $link) { $var =! $var; - print ''; + print ''; //edit mode if ($action == 'update' && $selected === $link->id) { print ''; @@ -1078,39 +1104,29 @@ class FormFile } else { print '\n"; print ''; - print ''; - // Preview - /*if (empty($useinecm)) - { - print ''; - }*/ + print ''; print ''; - // Delete or view link - // ($param must start with &) print '"; } print "\n"; } - if ($nboflinks == 0) - { - print ''; } print "
'; - //print "XX".$file['name']; //$file['name'] must be utf8 print ''; print $link->label; print ''; print "'.dol_print_date($link->datea, "dayhour", "tzuser").''; - $tmp=explode('.',$file['name']); - $minifile=$tmp[0].'_mini.'.$tmp[1]; - if (image_format_supported($file['name']) > 0) print ''; - else print ' '; - print '' . dol_print_date($link->datea, "dayhour", "tzuser") . ''; - print ''.img_edit().''; - if ($permtodelete) print ''.img_delete().''; - else print ' '; + print '' . img_edit().''; + if ($permtodelete) { + print '' . img_delete() . ''; + } else { + print ' '; + } print "
'; - if (empty($textifempty)) print $langs->trans("NoLinkFound"); - else print $textifempty; + if ($nboflinks == 0) { + print '
'; + print $langs->trans("NoLinkFound"); print '
";