From 6093dfe3334c5f5b6bc7c9ef7929a119cb1ba66d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Sep 2016 12:10:12 +0200 Subject: [PATCH] Uniformize code --- htdocs/core/class/html.formsms.class.php | 36 +++++++++++++++--------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 35736b56228..b2802f91c09 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -85,10 +85,11 @@ class FormSms /** * Show the form to input an sms. * - * @param string $width Width of form + * @param string $morecss Class on first column td + * @param int $showform Show form tags and submit button (recommanded is to use with value 0) * @return void */ - function show_form($width='180px') + function show_form($morecss='titlefield', $showform=1) { global $conf, $langs, $user, $form; @@ -119,13 +120,14 @@ function limitChars(textarea, limit, infodiv) } '; - print "
param["returnurl"]."\">\n"; + if ($showform) print "param["returnurl"]."\">\n"; + print ''; foreach ($this->param as $key=>$value) { print "\n"; } - print "\n"; + print "
\n"; // Substitution array if ($this->withsubstit) @@ -145,8 +147,9 @@ function limitChars(textarea, limit, infodiv) { if ($this->withfromreadonly) { + print '
'.$langs->trans("SmsFrom"); print ''; - print "
".$langs->trans("SmsFrom").""; + print ""; if ($this->fromtype == 'user') { $langs->load("users"); @@ -172,7 +175,7 @@ function limitChars(textarea, limit, infodiv) } else { - print "
".$langs->trans("SmsFrom").""; + print '
'.$langs->trans("SmsFrom").""; //print ''; if ($conf->global->MAIN_SMS_SENDMODE == 'ovh') // For backward compatibility @deprecated { @@ -320,16 +323,21 @@ function limitChars(textarea, limit, infodiv) print "
\n"; - print '
'; - print ''; - if ($this->withcancel) + + if ($showform) { - print '     '; - print ''; + print '
'; + print ''; + if ($this->withcancel) + { + print '     '; + print ''; + } + print '
'; + + print "\n"; } - print '
'; - - print "\n"; + print "\n"; }