Skip to content

Commit 4c606b0

Browse files
committed
style: formattazione stile codice
1 parent ccc0b32 commit 4c606b0

159 files changed

Lines changed: 1404 additions & 1429 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎ajax_dataload.php‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
include_once __DIR__.'/core.php';
2222

23-
use Util\Query;
2423
use Models\Module;
24+
use Util\Query;
2525

2626
// Informazioni fondamentali
2727
$columns = (array) filter('columns', null, true);
@@ -185,15 +185,15 @@
185185
// Immagine
186186
elseif ($field == '_img_') {
187187
$module = Module::where('id', $id_module)->first();
188-
if( !empty($r['_img_']) ){
189-
$fileinfo = \Uploads::fileInfo($r['_img_']);
190-
188+
if (!empty($r['_img_'])) {
189+
$fileinfo = Uploads::fileInfo($r['_img_']);
190+
191191
$directory = '/'.$module->upload_directory.'/';
192192
$image = $directory.$r['_img_'];
193193
$image_thumbnail = $directory.$fileinfo['filename'].'_thumb600.'.$fileinfo['extension'];
194-
194+
195195
$url = file_exists(base_dir().$image_thumbnail) ? base_path().$image_thumbnail : base_path().$image;
196-
196+
197197
$value = '<img src="'.$url.'" style="max-height: 80px; max-width:120px">';
198198
}
199199
}

‎core.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@
151151
$handler = new Monolog\ErrorHandler($logger);
152152
if (!API\Response::isAPIRequest()) {
153153
$handler->registerErrorHandler([]);
154-
//$handler->registerExceptionHandler(); // Handled by Whoops above
154+
// $handler->registerExceptionHandler(); // Handled by Whoops above
155155
}
156-
$handler->registerFatalHandler(\Psr\Log\LogLevel::ERROR);
156+
$handler->registerFatalHandler(Psr\Log\LogLevel::ERROR);
157157

158158
// Database
159159
$dbo = $database = database();

‎editor.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,8 @@
192192
// Successivo
193193
$next = $posizioni[$key + 1]['id'];
194194

195-
196195
echo '<span class="d-sm-inline">';
197196

198-
199197
echo '
200198
<a class="btn btn-default'.($prev ? '' : ' disabled').'" href="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$prev.'">
201199
<i class="fa fa-arrow-circle-left"></i>
@@ -205,10 +203,8 @@
205203
</a>
206204
</span>';
207205

208-
209206
echo '<div class="extra-buttons d-sm-inline">';
210207

211-
212208
// Pulsanti personalizzati
213209
$buttons = $structure->filepath('buttons.php');
214210

‎include/common/descrizione.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@
5757
input("descrizione").set(value);
5858
}
5959
});
60-
</script>';
60+
</script>';

‎include/init/configuration.php‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@
215215
<h3 class="card-title">'.tr('Configurazione incompleta').'</h3>
216216
</div>
217217
<div class="card-body">
218-
<p>'.tr("Mancano alcuni parametri necessari nella configurazione").'.</p>
219-
<p>'.tr("Verifica che il file _FILE_ contenga tutti i parametri di connessione al database", [
218+
<p>'.tr('Mancano alcuni parametri necessari nella configurazione').'.</p>
219+
<p>'.tr('Verifica che il file _FILE_ contenga tutti i parametri di connessione al database', [
220220
'_FILE_' => '<b>config.inc.php</b>',
221221
]).'.</p>
222222
<p>'.tr("Se il problema persiste, contatta l'assistenza").'.</p>
@@ -454,12 +454,12 @@ class: "img-flag",
454454
echo '
455455
<div class="config-section-content">
456456
<h4 class="config-section-header">'.tr('Benvenuto in _NAME_!', [
457-
'_NAME_' => '<strong>OpenSTAManager</strong>',
458-
]).'</h4>
457+
'_NAME_' => '<strong>OpenSTAManager</strong>',
458+
]).'</h4>
459459
<p>'.tr("Prima di procedere con l'installazione, verifica che il sistema soddisfi i seguenti requisiti").'.</p>
460460
<p class="config-info-text"><i class="fa fa-info-circle text-info mr-1"></i> '.tr('Le impostazioni PHP possono essere modificate nel file _FILE_', [
461-
'_FILE_' => '<b>php.ini</b>',
462-
]).'</p>
461+
'_FILE_' => '<b>php.ini</b>',
462+
]).'</p>
463463
</div>';
464464

465465
// REQUISITI PER IL CORRETTO FUNZIONAMENTO
@@ -474,8 +474,8 @@ class: "img-flag",
474474
<div class="config-section-content">
475475
<h4 class="config-section-header">'.tr('Licenza del software').'</h4>
476476
<p>'.tr('OpenSTAManager è tutelato dalla licenza _LICENSE_', [
477-
'_LICENSE_' => '<strong>GPL 3.0</strong>',
478-
]).':</p>
477+
'_LICENSE_' => '<strong>GPL 3.0</strong>',
478+
]).':</p>
479479
</div>
480480
481481
<div class="config-license-container">

‎include/init/update.php‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<script>
4848
updateCurrentFile("'.tr('Database aggiornato').': '.$update['filename'].'.sql");
4949
</script>';
50-
} else if (!empty($update['sql'])) {
50+
} elseif (!empty($update['sql'])) {
5151
echo '
5252
<script>
5353
updateCurrentFile("'.tr('Aggiornamento database').': '.$update['filename'].'.sql");
@@ -96,7 +96,7 @@
9696
</div>
9797
<div class="card-body">
9898
<div class="alert alert-light border-left border-danger">
99-
<h5 class="text-danger font-weight-bold"><i class="fa fa-info-circle mr-2"></i>'.tr("Messaggio di errore").'</h5>
99+
<h5 class="text-danger font-weight-bold"><i class="fa fa-info-circle mr-2"></i>'.tr('Messaggio di errore').'</h5>
100100
<p class="mb-0 font-weight-bold">'.$error_message.'</p>
101101
</div>';
102102

@@ -107,14 +107,14 @@
107107
<div class="card-header">
108108
<div class="d-flex justify-content-between align-items-center">
109109
<h5 class="mb-0 font-weight-bold"><i class="fa fa-database mr-2"></i>'.tr("Query SQL che ha causato l'errore").'</h5>
110-
<button type="button" class="btn btn-sm btn-danger copy-query-btn" data-query="'.htmlspecialchars($error_query).'">
111-
<i class="fa fa-copy mr-1"></i>'.tr("Copia query").'
110+
<button type="button" class="btn btn-sm btn-danger copy-query-btn" data-query="'.htmlspecialchars((string) $error_query).'">
111+
<i class="fa fa-copy mr-1"></i>'.tr('Copia query').'
112112
</button>
113113
</div>
114114
</div>
115115
<div class="card-body p-0">
116116
<div class="p-3 bg-light code-container">
117-
<pre class="mb-0" style="white-space: pre-wrap; word-wrap: break-word;"><code>'.htmlspecialchars($error_query).'</code></pre>
117+
<pre class="mb-0" style="white-space: pre-wrap; word-wrap: break-word;"><code>'.htmlspecialchars((string) $error_query).'</code></pre>
118118
</div>
119119
</div>
120120
</div>
@@ -130,7 +130,7 @@
130130
// Show feedback
131131
var $btn = $(this);
132132
var originalText = $btn.html();
133-
$btn.html(\'<i class="fa fa-check mr-1"></i>'.tr("Copiato!").'\');
133+
$btn.html(\'<i class="fa fa-check mr-1"></i>'.tr('Copiato!').'\');
134134
$btn.addClass("btn-success").removeClass("btn-outline-light");
135135
136136
setTimeout(function() {
@@ -173,8 +173,8 @@
173173
<div class="alert alert-warning mb-4">
174174
<i class="fa fa-exclamation-triangle mr-2"></i>
175175
'.tr('Per maggiore sicurezza, rimuovi i permessi di scrittura dal file _FILE_', [
176-
'_FILE_' => '<b>config.inc.php</b>',
177-
]).'
176+
'_FILE_' => '<b>config.inc.php</b>',
177+
]).'
178178
</div>';
179179
}
180180

@@ -238,7 +238,7 @@
238238
<p><strong>'.tr("Benvenuto! Procediamo con l'installazione del database").'.</strong></p>';
239239
} else {
240240
echo '
241-
<p>'.tr("È necessario aggiornare il database alla nuova versione").'.</p>';
241+
<p>'.tr('È necessario aggiornare il database alla nuova versione').'.</p>';
242242
}
243243

244244
// Prepara l'HTML per l'elenco degli aggiornamenti, ma non lo mostra ancora
@@ -256,7 +256,7 @@
256256
$column_updates = array_chunk($updates, $updates_per_column);
257257

258258
// Per ogni colonna
259-
for ($col = 0; $col < count($column_updates); $col++) {
259+
for ($col = 0; $col < count($column_updates); ++$col) {
260260
$updates_html .= '
261261
<div class="col-md-3">
262262
<ul class="list-unstyled mb-0">';
@@ -290,8 +290,8 @@
290290
echo '
291291
<div id="install-instructions">
292292
<p>'.tr("Clicca su _BUTTON_ per avviare l'".(!$dbo->isInstalled() ? tr('installazione') : tr('aggiornamento')), [
293-
'_BUTTON_' => '<b>"'.$button.'"</b>',
294-
]).'</p>
293+
'_BUTTON_' => '<b>"'.$button.'"</b>',
294+
]).'</p>
295295
<input type="button" class="btn btn-primary btn-lg" value="'.$button.'" onclick="continue_update()" id="continue_button">
296296
</div>
297297

‎include/manager.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
$attr_td .= " width='100'";
125125
}
126126

127-
//Immagine
127+
// Immagine
128128
elseif (trim((string) $field) == '_img_') {
129129
$attr_td .= " width='30'";
130130
$field = str_replace('_img_', '', $field);

‎include/riferimenti/documenti_collegati.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
$articolo_riga = Articolo::find($source->idarticolo);
4141
echo $articolo_riga->codice.' - '.$source->descrizione;
4242
} else {
43-
echo nl2br($source->descrizione);
43+
echo nl2br((string) $source->descrizione);
4444
}
4545
echo '
4646
</h3>

‎include/top.php‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
$array = $_SESSION['module_'.$id_module];
9393
if (!empty($array)) {
9494
foreach ($array as $field => $value) {
95-
if (!empty($value) && str_contains($field, 'search_')) {
95+
if (!empty($value) && str_contains((string) $field, 'search_')) {
9696
echo '
9797
search.push("'.$field.'");
9898
search["'.$field.'"] = "'.addslashes((string) $value).'";';
@@ -395,11 +395,9 @@
395395
<body class="sidebar-mini layout-fixed '.(!empty($hide_sidebar) ? ' sidebar-collapse' : '').(!Auth::check() ? ' hold-transition login-page' : '').'">
396396
<div class="'.(!Auth::check() ? '' : 'wrapper').'">';
397397

398-
399398
$isInstallation = (!$dbo->isInstalled() || !$dbo->isConnected() || Update::isUpdateAvailable());
400399

401400
if (Auth::check()) {
402-
403401
$calendar_color_label = ($_SESSION['period_start'] != date('Y').'-01-01' || $_SESSION['period_end'] != date('Y').'-12-31') ? 'danger' : 'secondary';
404402

405403
echo '
@@ -442,8 +440,8 @@
442440
<!-- Navbar Right Menu -->
443441
<ul class="navbar-nav ml-auto">';
444442

445-
if (!$config['disable_hooks'] && !$isInstallation) {
446-
echo '
443+
if (!$config['disable_hooks'] && !$isInstallation) {
444+
echo '
447445
<div class="nav-item dropdown">
448446
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
449447
<i class="fa fa-bell-o"></i>
@@ -715,8 +713,8 @@ function checkActiveTab() {
715713
}
716714

717715
// Non mostrare la card nella pagina di login quando ci sono solo errori
718-
if ((!empty($messages['warning']) || (!empty($messages['error']) && ($pageTitle != tr('Login')))) &&
719-
!($pageTitle == tr('Login') && empty($messages['warning']) && !empty($messages['error']))) {
716+
if ((!empty($messages['warning']) || (!empty($messages['error']) && ($pageTitle != tr('Login'))))
717+
&& !($pageTitle == tr('Login') && empty($messages['warning']) && !empty($messages['error']))) {
720718
echo '
721719
<div class="card card-warning card-center card-center-large">
722720
<div class="card-header with-border text-center">
@@ -746,7 +744,7 @@ function checkActiveTab() {
746744

747745
foreach ($messages['error'] as $value) {
748746
// Rimuovi il codice errore dal messaggio
749-
$value = preg_replace('/\[uid: ([a-z0-9]+)\]/i', '', $value);
747+
$value = preg_replace('/\[uid: ([a-z0-9]+)\]/i', '', (string) $value);
750748

751749
if ($is_admin) {
752750
// Visualizzazione migliorata per amministratori
@@ -793,9 +791,9 @@ function checkActiveTab() {
793791
}
794792

795793
// Chiusura della card informazioni - non mostrare nella pagina di login quando ci sono solo errori
796-
if (!Auth::check() &&
797-
(!empty($messages['info']) || !empty($messages['warning']) ||
798-
(!empty($messages['error']) && $pageTitle != tr('Login')))) {
794+
if (!Auth::check()
795+
&& (!empty($messages['info']) || !empty($messages['warning'])
796+
|| (!empty($messages['error']) && $pageTitle != tr('Login')))) {
799797
echo '
800798
</div>
801799
</div>';

‎index.php‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105

106106
include_once App::filepath('include|custom|', 'top.php');
107107

108-
109108
// Controllo se è una beta e in caso mostro un warning
110109
if (Update::isBeta()) {
111110
echo '
@@ -177,7 +176,6 @@ function brute() {
177176
</script>';
178177
}
179178

180-
181179
if ($dbo->isInstalled() && $dbo->isConnected() && !Update::isUpdateAvailable()) {
182180
echo '
183181
<form action="?op=login" method="post" autocomplete="off">
@@ -191,11 +189,11 @@ function brute() {
191189
<p class="login-box-msg text-secondary mb-4"><i class="fa fa-lock mr-2"></i>'.tr('Accedi con le tue credenziali').'</p>
192190
<div class="input-group mb-4">
193191
<input type="text" name="username" autocomplete="username" class="form-control form-control-lg" placeholder="'.tr('Nome utente').'"';
194-
if (isset($username)) {
195-
echo ' value="'.$username.'"';
196-
}
192+
if (isset($username)) {
193+
echo ' value="'.$username.'"';
194+
}
197195

198-
echo ' required>
196+
echo ' required>
199197
<div class="input-group-append">
200198
<div class="input-group-text bg-light">
201199
<i class="fa fa-user text-primary"></i>
@@ -216,17 +214,17 @@ function brute() {
216214
<i class="fa fa-question-circle mr-1"></i>'.tr('Password dimenticata?').'
217215
</a>
218216
</div>';
219-
if ($microsoft) {
220-
echo '
217+
if ($microsoft) {
218+
echo '
221219
<div class="social-auth-links text-center mt-4 pt-3 border-top">
222220
<p class="text-muted">'.tr('- oppure -').'</p>
223221
224222
<a href="'.base_path().'/oauth2_login.php?id='.$microsoft['id'].'" class="btn btn-block btn-social btn-primary btn-flat shadow-sm">
225223
<i class="fa fa-windows mr-2"></i>'.tr('Accedi con Microsoft').'
226224
</a>
227225
</div>';
228-
}
229-
echo '
226+
}
227+
echo '
230228
</div>
231229
</div>
232230
</div>

0 commit comments

Comments
 (0)