From 3c927fbe0e19320740ee9ad8fe2f04fad256c463 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Apr 2016 20:35:38 +0200 Subject: [PATCH] Debug website module --- htdocs/websites/index.php | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index 58a2981d2da..417484c2269 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -91,6 +91,18 @@ if (empty($action)) $action='preview'; $object=new Website($db); $objectpage=new WebsitePage($db); +$object->fetchAll(); // Init $object->records + +// If website not defined, we take first found +if (empty($website)) +{ + foreach($object->records as $key => $valwebsite) + { + $website=$valwebsite->ref; + break; + } +} + if ($website) { $res = $object->fetch(0, $website); @@ -262,7 +274,6 @@ if ($action != 'preview' && $action != 'editcontent') $style=' margin-bottom: 5p print '
'; -$tmp = $object->fetchAll(); if (count($object->records) > 0) { print '
'; @@ -317,16 +328,20 @@ if (count($object->records) > 0) print '
'; $out=''; $out.=''; print $out; print '';