Implemented multi domain anon node
This commit is contained in:
parent
c824e0d280
commit
b95195c6ae
@ -95,7 +95,7 @@ class NavigationPrint extends Printing
|
||||
$tabObject =$this->getObjectSon(eid());
|
||||
for ($i=0; $i<count($tabObject);$i++)
|
||||
{
|
||||
if ($tabObject[$i][0]->getClassName()=="home")
|
||||
if ($tabObject[$i][0]->getClassName()=="Home")
|
||||
{
|
||||
$urlArray["id"]=$tabObject[$i][1]->getId();
|
||||
}
|
||||
|
@ -77,10 +77,12 @@ class UserPrint extends Printing
|
||||
$url=addIdToUrl($url);
|
||||
|
||||
$tabObject =$this->getObjectSon(eid());
|
||||
// var_dump($tabObject);
|
||||
for ($i=0; $i<count($tabObject);$i++)
|
||||
{
|
||||
if ($tabObject[$i][0]->getClassName()=="home")
|
||||
if ($tabObject[$i][0]->getClassName()=="Home")
|
||||
{
|
||||
// var_dump($tabObject[$i][1]->getId());
|
||||
$urlArray["id"]=$tabObject[$i][1]->getId();
|
||||
}
|
||||
}
|
||||
|
@ -1272,7 +1272,9 @@ var $currentCoordinationObject=null;
|
||||
{
|
||||
// var_dump($GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId);
|
||||
$tabObject=$this->getListObjectForNavigation( $GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId );
|
||||
|
||||
// $tabObject=$this->getListObjectForNavigation( 104 );
|
||||
// var_dump($tabObject);
|
||||
|
||||
/* gestion du lib en fonction de la langue courante */
|
||||
$currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode();
|
||||
$defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"];
|
||||
|
@ -163,9 +163,6 @@ var $conn = null;
|
||||
{
|
||||
$sql = "SELECT * FROM ".$this->getTable()." WHERE ".$this->getSqlName("id")."=".$id;
|
||||
// $sql.= " AND ".$this->getSqlName("domain")."=".$_SERVER["SERVER_NAME"];
|
||||
|
||||
if( $id >> 100 )
|
||||
$sql.= " AND ".$this->getSqlName("domain")."=".$_SERVER["SERVER_NAME"];
|
||||
|
||||
# Requete
|
||||
$result=$this->conn->sql_query($sql);
|
||||
|
@ -327,6 +327,7 @@ var $permission;
|
||||
$_SESSION = &$this->session_vars;
|
||||
/* parametrage par defaut */
|
||||
$defaultNode =$this->getDefaultNode();
|
||||
// $defaultNode =104;
|
||||
$this->entryNodeId =$defaultNode;
|
||||
$this->navigationNodeId =$defaultNode;
|
||||
}
|
||||
|
@ -349,6 +349,42 @@ var $tabSon = array();
|
||||
return ($this->getLibelleFromNode($id, $langue));
|
||||
}
|
||||
|
||||
/**
|
||||
* getDomainFromNode: retourne le domaine du noeud
|
||||
*
|
||||
* @param identifiant du Noeud
|
||||
* @access public
|
||||
* @return chaine
|
||||
*/
|
||||
function getDomainFromNode($id)
|
||||
{
|
||||
for ($i=0; $i<count($this->tabFather); $i++)
|
||||
{
|
||||
if ($this->tabFather[$i]->getId()==$id)
|
||||
return $this->tabFather[$i]->getDomain();
|
||||
}
|
||||
|
||||
for ($i=0; $i<count($this->tabSon); $i++)
|
||||
{
|
||||
if ($this->tabSon[$i]->getId()==$id)
|
||||
return $this->tabSon[$i]->getDomain();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* getDomain: retourne le domaine du noeud
|
||||
*
|
||||
* Alias de getDomainFromNode
|
||||
* @param identifiant du Noeud
|
||||
* @access public
|
||||
* @return chaine
|
||||
*/
|
||||
function getDomain($id)
|
||||
{
|
||||
return ($this->getDomainFromNode($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* getNodeId : retourne l'objet noeud
|
||||
*
|
||||
|
@ -239,10 +239,13 @@ var $tabTree = array();
|
||||
|
||||
foreach($this->tabTree as $Tree)
|
||||
{
|
||||
// var_dump($Tree->getDomain($Tree->getId()));
|
||||
// if( $Tree === $_SERVER["HTTP_HOST"] )
|
||||
// var_dump("Tree ID: ".$Tree->getId());
|
||||
// var_dump("Domain: ".$Tree->getDomain($Tree->getId()));
|
||||
// var_dump("HOST: ".$_SERVER["HTTP_HOST"]);
|
||||
if( $Tree->getDomain($Tree->getId()) === $_SERVER["HTTP_HOST"] )
|
||||
$tab[]=$Tree->getId();
|
||||
}
|
||||
// var_dump($tab);
|
||||
return array_values(array_unique($tab));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user