Work on website
This commit is contained in:
parent
a8385c0255
commit
957d5958a4
@ -92,7 +92,7 @@ if (empty($action)) $action='preview';
|
|||||||
$object=new Website($db);
|
$object=new Website($db);
|
||||||
$objectpage=new WebsitePage($db);
|
$objectpage=new WebsitePage($db);
|
||||||
|
|
||||||
$object->fetchAll(); // Init $object->records
|
$object->fetchAll(); // Init $object->records with list of websites
|
||||||
|
|
||||||
// If website not defined, we take first found
|
// If website not defined, we take first found
|
||||||
if (empty($websitekey))
|
if (empty($websitekey))
|
||||||
@ -118,7 +118,14 @@ if (($pageid > 0 || $pageref) && $action != 'addcontainer')
|
|||||||
// Check if pageid is inside the new website, if not we reset param pageid
|
// Check if pageid is inside the new website, if not we reset param pageid
|
||||||
if ($res >= 0 && $object->id > 0)
|
if ($res >= 0 && $object->id > 0)
|
||||||
{
|
{
|
||||||
if ($objectpage->fk_website != $object->id) // We have a bad page.
|
if ($objectpage->fk_website != $object->id) // We have a bad page that does not belong to web site
|
||||||
|
{
|
||||||
|
if ($object->fk_default_home > 0)
|
||||||
|
{
|
||||||
|
$res = $objectpage->fetch($object->fk_default_home, $object->id, ''); // We search first page of web site
|
||||||
|
if ($res > 0) $pageid = $object->fk_default_home;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$res = $objectpage->fetch(0, $object->id, ''); // We search first page of web site
|
$res = $objectpage->fetch(0, $object->id, ''); // We search first page of web site
|
||||||
if ($res == 0) // Page was not found, we reset it
|
if ($res == 0) // Page was not found, we reset it
|
||||||
@ -130,6 +137,7 @@ if (($pageid > 0 || $pageref) && $action != 'addcontainer')
|
|||||||
$pageid = $objectpage->id;
|
$pageid = $objectpage->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else // We have a valid page. We force pageid for the case we got the page with a fetch on ref.
|
else // We have a valid page. We force pageid for the case we got the page with a fetch on ref.
|
||||||
{
|
{
|
||||||
$pageid = $objectpage->id;
|
$pageid = $objectpage->id;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user