Skip to content

Commit 8d46e81

Browse files
committed
fix: navigazione record per moduli custom
1 parent 6dc3171 commit 8d46e81

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

editor.php

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -186,25 +186,27 @@
186186
$posizioni = $module_query ? $dbo->fetchArray($module_query) : 0;
187187
$key = $posizioni ? array_search($id_record, array_column($posizioni, 'id')) : 0;
188188

189-
// Precedente
190-
$prev = $posizioni[$key - 1]['id'];
189+
if (is_array($posizioni)) {
190+
// Precedente
191+
$prev = $posizioni[$key - 1]['id'];
191192

192-
// Successivo
193-
$next = $posizioni[$key + 1]['id'];
193+
// Successivo
194+
$next = $posizioni[$key + 1]['id'];
194195

195-
echo '<span class="d-sm-inline">';
196+
echo '<span class="d-sm-inline">';
196197

197-
echo '
198-
<div class="btn-group">
199-
<a class="btn btn-default'.($prev ? '' : ' disabled').'" href="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$prev.'">
200-
<i class="fa fa-arrow-circle-left"></i>
201-
</a>
202-
<span class="btn btn-default disabled">'.($key + 1).'/'.count($posizioni).'</span>
203-
<a class="btn btn-default'.($next ? '' : ' disabled').'" href="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$next.'">
204-
<i class="fa fa-arrow-circle-right"></i>
205-
</a>
206-
</div>
207-
</span>';
198+
echo '
199+
<div class="btn-group">
200+
<a class="btn btn-default'.($prev ? '' : ' disabled').'" href="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$prev.'">
201+
<i class="fa fa-arrow-circle-left"></i>
202+
</a>
203+
<span class="btn btn-default disabled">'.($key + 1).'/'.count($posizioni).'</span>
204+
<a class="btn btn-default'.($next ? '' : ' disabled').'" href="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$next.'">
205+
<i class="fa fa-arrow-circle-right"></i>
206+
</a>
207+
</div>
208+
</span>';
209+
}
208210

209211
echo '<div class="extra-buttons d-sm-inline">';
210212

0 commit comments

Comments
 (0)