[10.0.58.dev] homepage ok
This commit is contained in:
parent
85b4b178ca
commit
755db23dd0
@ -31,7 +31,7 @@ class common {
|
|||||||
const TEMP_DIR = 'site/tmp/';
|
const TEMP_DIR = 'site/tmp/';
|
||||||
|
|
||||||
// Numéro de version
|
// Numéro de version
|
||||||
const ZWII_VERSION = '10.0.57.dev';
|
const ZWII_VERSION = '10.0.58.dev';
|
||||||
|
|
||||||
public static $actions = [];
|
public static $actions = [];
|
||||||
public static $coreModuleIds = [
|
public static $coreModuleIds = [
|
||||||
@ -483,7 +483,6 @@ class common {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getHomePageId () {
|
public function getHomePageId () {
|
||||||
$hierarchy = $this->getHierarchy(null, true);
|
|
||||||
foreach($this->getHierarchy(null, null, null) as $parentPageId => $childrenPageIds) {
|
foreach($this->getHierarchy(null, null, null) as $parentPageId => $childrenPageIds) {
|
||||||
if ($this->getData(['page',$parentPageId,"homePageId"]) === true) {
|
if ($this->getData(['page',$parentPageId,"homePageId"]) === true) {
|
||||||
return ($parentPageId);
|
return ($parentPageId);
|
||||||
@ -496,6 +495,24 @@ class common {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retourne l'Id de la homePage de la langue courante
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function resetHomePageId () {
|
||||||
|
foreach($this->getHierarchy(null, null, null) as $parentPageId => $childrenPageIds) {
|
||||||
|
if ($this->getData(['page',$parentPageId,"homePageId"]) === true) {
|
||||||
|
$this->setData(['page',$parentPageId,"homePageId", false]);
|
||||||
|
}
|
||||||
|
foreach($childrenPageIds as $childKey) {
|
||||||
|
if ($this->getData(['page',$childKey,"homePageId"]) === true) {
|
||||||
|
$this->setData(['page',$childKey,"homePageId", false]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accède à une valeur des variables http (ordre de recherche en l'absence de type : _COOKIE, _POST)
|
* Accède à une valeur des variables http (ordre de recherche en l'absence de type : _COOKIE, _POST)
|
||||||
* @param string $key Clé de la valeur
|
* @param string $key Clé de la valeur
|
||||||
|
@ -241,12 +241,7 @@ class page extends common {
|
|||||||
}
|
}
|
||||||
// Reset homePage
|
// Reset homePage
|
||||||
if ($this->getinput('pageHomePageId', helper::FILTER_BOOLEAN) === true ) {
|
if ($this->getinput('pageHomePageId', helper::FILTER_BOOLEAN) === true ) {
|
||||||
foreach ($hierarchy as $hierarchyPageId) {
|
$this->resetHomePageId();
|
||||||
$this->setData(['page',$hierarchyPageId,"homePageId", false]);
|
|
||||||
foreach ($hierarchyPageId as $childId) {
|
|
||||||
$this->setData(['page',$childId,"homePageId", false]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Modifie la page ou en crée une nouvelle si l'id a changé
|
// Modifie la page ou en crée une nouvelle si l'id a changé
|
||||||
$this->setData([
|
$this->setData([
|
||||||
|
Loading…
Reference in New Issue
Block a user