';
+
-if (count($object->records) > 0) // There is at least one web site
-{
// ***** Part for web sites
print '';
print '
';
@@ -1713,12 +1719,15 @@ if (count($object->records) > 0) // There is at least one web site
if (! empty($object->virtualhost)) $virtualurl=$object->virtualhost;
}
-
- $array=$objectpage->fetchAll($object->id, 'ASC,ASC', 'type_container,pageurl');
+ $array=array();
+ if ($object->id > 0)
+ {
+ $array=$objectpage->fetchAll($object->id, 'ASC,ASC', 'type_container,pageurl');
+ }
if (! is_array($array) && $array < 0) dol_print_error('', $objectpage->error, $objectpage->errors);
$atleastonepage=(is_array($array) && count($array) > 0);
- if ($websitekey && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone'))
+ if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone'))
{
$disabled='';
if (empty($user->rights->website->write)) $disabled=' disabled="disabled"';
@@ -1828,7 +1837,7 @@ if (count($object->records) > 0) // There is at least one web site
// Toolbar for pages
- if ($websitekey && ! in_array($action, array('editcss','editmenu','importsite')))
+ if ($websitekey && $websitekey != '-1' && ! in_array($action, array('editcss','editmenu','importsite')))
{
print '
'; // Close current websitebar to open a new one
@@ -2125,17 +2134,8 @@ if (count($object->records) > 0) // There is at least one web site
}
}
}
-}
-else
-{
- print '
';
- $langs->load("errors");
- print $langs->trans("ErrorModuleSetupNotComplete");
- print '
';
- $action='';
-}
-print '
'; // end current websitebar
+ print '
'; // end current websitebar
}
@@ -2743,7 +2743,8 @@ if ($action == 'editsource')
$doleditor->Create(0, '', false);
}*/
-print "