Enhancement #36 done
This commit is contained in:
parent
fce0a1239d
commit
c6eee1fde0
@ -431,11 +431,11 @@ function systemPrint($data)
|
||||
}
|
||||
|
||||
/**
|
||||
* Function permettant de modifier le contenu dans la bd et redirection
|
||||
* Function permettant de récupérer l'id du noeud racine de communauté
|
||||
* @access private
|
||||
* @return chaine entier noeud de configuration
|
||||
*/
|
||||
function recupCommunauty()
|
||||
function recupCommunity($get='id', $langcode="fr")
|
||||
{
|
||||
/* Récupération de la communauté courante */
|
||||
$myEntryNode =$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId; /* Noeud d'entrée de l'utilisateur */
|
||||
@ -446,7 +446,15 @@ function systemPrint($data)
|
||||
{
|
||||
if ($myTree->tabFather[$i]->getIdPere()==1)
|
||||
{
|
||||
$nodeId=$myTree->tabFather[$i]->getId();
|
||||
if( $get == 'id' ) { $nodeId=$myTree->tabFather[$i]->getId();}
|
||||
elseif( $get == 'domain' ) { $nodeId=$myTree->tabFather[$i]->getDomain();}
|
||||
elseif( $get == 'ctype' ) { $nodeId=$myTree->tabFather[$i]->getCType();}
|
||||
elseif( $get == 'lib' ) {$nodeId=$myTree->tabFather[$i]->getLibelle($langcode);}
|
||||
elseif( $get == 'usergroup' ) {$nodeId=$myTree->tabFather[$i]->getUserGroupId();}
|
||||
elseif( $get == 'subsgroup' ) {$nodeId=$myTree->tabFather[$i]->getSubsGroupId();}
|
||||
elseif( $get == 'subsgrouptemp' ) {$nodeId=$myTree->tabFather[$i]->getSubsGroupTempId();}
|
||||
elseif( $get == 'mailnode' ) {$nodeId=$myTree->tabFather[$i]->getMailNode();}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -455,32 +463,58 @@ function systemPrint($data)
|
||||
systemRedirect( $GLOBALS["CONF_PAGE_EXECUTION"] );
|
||||
}
|
||||
/* -- Fin Recup Communauté */
|
||||
// var_dump($nodeId);
|
||||
return $nodeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function permettant de modifier le contenu dans la bd et redirection
|
||||
* Function permettant de récupérer l'id du noeud racine de communauté
|
||||
* @access private
|
||||
* @return chaine entier noeud de configuration
|
||||
* @return chaine entier noeud de configuration
|
||||
*/
|
||||
function recupCommunautyByDomain($domain)
|
||||
function recupCommunityByDomain($domain)
|
||||
{
|
||||
$sql="SELECT * FROM ".DATA_ACCES_TABLE_PREFIX."node_domains WHERE node_domain='".$domain."';";
|
||||
# Execution de Requete (utilisation de la connexion systeme)
|
||||
// var_dump($domain);
|
||||
// var_dump($sql);
|
||||
$result=$GLOBALS['SYSTEM_DATABASE_CONN']->sql_query($sql);
|
||||
/* Récupération de la communauté courante */
|
||||
$myEntryNode =$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId; /* Noeud d'entrée de l'utilisateur */
|
||||
$myTree =$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE"]->createInstance($myEntryNode); /* Récupération du Tree correspondant */
|
||||
|
||||
# Teste si il y a des enregistrements
|
||||
if ($GLOBALS['SYSTEM_DATABASE_CONN']->sql_numrows()>0)
|
||||
$nodeId=NULL;
|
||||
for ($i=0; $i<count($myTree->tabFather); $i++)
|
||||
{
|
||||
$view = $GLOBALS['SYSTEM_DATABASE_CONN']->sql_fetchrow();
|
||||
$nodeId = stripslashes($view['node_id']);
|
||||
# Destruction des resultats
|
||||
$GLOBALS['SYSTEM_DATABASE_CONN']->sql_freeresult();
|
||||
if( ($myTree->tabFather[$i]->getIdPere()==1) AND ($myTree->tabFather[$i]->getDomain()==$_SERVER["HTTP_HOST"]) )
|
||||
{
|
||||
$nodeId=$myTree->tabFather[$i]->getId();
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* -- Fin Recup Communauté */
|
||||
return $nodeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function permettant de récupérer l'id du noeud racine de communauté
|
||||
* @access private
|
||||
* @return chaine entier noeud de configuration
|
||||
*/
|
||||
function recupCommunityPublic($domain=NULL)
|
||||
{
|
||||
if( !$domain )
|
||||
$domain=$_SERVER["HTTP_HOST"];
|
||||
|
||||
/* Récupération de la communauté courante */
|
||||
$myTree =$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE"]->createInstance(1); /* Récupération du Tree correspondant */
|
||||
|
||||
$nodeId=NULL;
|
||||
for ($i=0; $i<count($myTree->tabSon); $i++)
|
||||
{
|
||||
if( ($myTree->tabSon[$i]->getIdPere()==1) AND ($myTree->tabSon[$i]->getHasLanding()=="on") )
|
||||
{
|
||||
if( $myTree->tabSon[$i]->getDomain()==$domain )
|
||||
{
|
||||
$nodeId=$myTree->tabSon[$i]->getId();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
/* -- Fin Recup Communauté */
|
||||
return $nodeId;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user