From 7a426099996f12c2df5a48cc84950388afd91d6c Mon Sep 17 00:00:00 2001 From: "tristan.champomier" <rooty@rooty.me> Date: Thu, 10 Dec 2020 18:33:53 +0100 Subject: [PATCH] Fixed issue #11 --- .../object_printing/navigationprint/main.mxt | 6 +- .../navigationprint/navigationdiv.mxt | 5 +- .../navigationprint/navigationnode.mxt | 17 +- .../navigationprint/navigationsub.mxt | 16 +- .../navigationprint/navigationprint.php | 307 +++--------------- 5 files changed, 76 insertions(+), 275 deletions(-) diff --git a/data/template/lcube6/object_printing/navigationprint/main.mxt b/data/template/lcube6/object_printing/navigationprint/main.mxt index e98246f..c14afa5 100755 --- a/data/template/lcube6/object_printing/navigationprint/main.mxt +++ b/data/template/lcube6/object_printing/navigationprint/main.mxt @@ -1,14 +1,14 @@ <nav id="navigationprint" class="navbar main-nav fixed-top navbar-expand-lg navbar-light bg-light" role="navigation"> - <a class="navbar-brand" href="/"> + <a class="navbar-brand" href="/"> <img class="img-responsive" style="max-width: 25%;" src="data/image/communities/139_logo.png" alt="logo"/> </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#topmenu" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> - + <div class="collapse navbar-collapse" id="topmenu"> <ul class="navbar-nav mr-auto"> - <mx:text id="Navigation"/><mx:text id="nodeDir"/> + <mx:text id="Navigation"/> </ul> <ul class="nav navbar-nav navbar-right"> <li class="nav-item"><a class="nav-link envelope" href="mailto:contact@fab-l3.org" target="_blank"><i class="fa fa-lg fa-envelope"></i></a></li> diff --git a/data/template/lcube6/object_printing/navigationprint/navigationdiv.mxt b/data/template/lcube6/object_printing/navigationprint/navigationdiv.mxt index 8821207..2b81b77 100755 --- a/data/template/lcube6/object_printing/navigationprint/navigationdiv.mxt +++ b/data/template/lcube6/object_printing/navigationprint/navigationdiv.mxt @@ -1,6 +1,9 @@ <mx:bloc id="bloc1"> <li class="nav-item dropdown"> - <a class="nav-link dropdown-toggle" role="button" data-toggle="dropdown" mXattribut="href:nodeUrl" aria-haspopup="true" aria-expanded="false"><mx:text id="nodeName"/></a> + <a class="nav-link dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" mXattribut="href:nodeUrl"> + <mx:image id="pictoNode"/> + <mx:text id="nodeName"/> + </a> <mx:text id="nodeDir"/> </li> </mx:bloc id="bloc1"> diff --git a/data/template/lcube6/object_printing/navigationprint/navigationnode.mxt b/data/template/lcube6/object_printing/navigationprint/navigationnode.mxt index c998d4c..7e8a3be 100755 --- a/data/template/lcube6/object_printing/navigationprint/navigationnode.mxt +++ b/data/template/lcube6/object_printing/navigationprint/navigationnode.mxt @@ -1,14 +1,9 @@ <mx:bloc id="bloc1"> - <li mXattribut="class:class"> - <mx:bloc id="blocDropdown"> - <a class="nav-link dropdown-toggle" role="button" data-toggle="dropdown" href="#" aria-haspopup="true" aria-expanded="false"><mx:text id="nodeName"/></a> - - <mx:bloc id="nodeDir"> - <mx:text id="nodeDir"/> - </mx:bloc id="nodeDir"> - </mx:bloc id="blocDropdown"> - <mx:bloc id="blocNoDropdown"> - <a class="nav-link" href="#"><mx:text id="nodeName"/><span class="sr-only">(current)</span></a> - </mx:bloc id="blocNoDropdown"> + <li mxAttribut="class:class"> + <a class="nav-link" mXattribut="href:nodeUrl"> + <mx:image id="pictoNode"/> + <mx:text id="nodeName"/>1 + </a> + <mx:text id="nodeDir"/> </li> </mx:bloc id="bloc1"> diff --git a/data/template/lcube6/object_printing/navigationprint/navigationsub.mxt b/data/template/lcube6/object_printing/navigationprint/navigationsub.mxt index 2da3b11..a6bbf2d 100755 --- a/data/template/lcube6/object_printing/navigationprint/navigationsub.mxt +++ b/data/template/lcube6/object_printing/navigationprint/navigationsub.mxt @@ -1,7 +1,11 @@ -<ul class="dropdown-menu"> - <mx:bloc id="bloc1"> - <mx:bloc id="blocDropdown"> - <li mXattribut="class:class"><a class="nav-link text-nowrap" mXattribut="href:nodeUrl"><mx:text id="nodeName"/></a></li><mx:text id="nodeDir"/> - </mx:bloc id="blocDropdown"> - </mx:bloc id="bloc1"> +<ul> + <mx:bloc id="bloc1"> + <li mxAttribut="class:class"> + <a class="nav-link text-nowrap" mXattribut="href:nodeUrl"> + <mx:image id="pictoNode"/> + <mx:text id="nodeName"/>2 + </a> + <mx:text id="nodeDir"/> + </li> + </mx:bloc id="bloc1"> </ul> diff --git a/lib/object_printing/navigationprint/navigationprint.php b/lib/object_printing/navigationprint/navigationprint.php index 6c87715..427344e 100755 --- a/lib/object_printing/navigationprint/navigationprint.php +++ b/lib/object_printing/navigationprint/navigationprint.php @@ -2,8 +2,8 @@ /**----------------------------------------------- * -* Rooty, 2018 <rooty@rooty.me> -* +* Granilim (C) 2004-2006, Limousin expansion +* Limousin expansion contact@granilim.org * * This software is protected by copyright, please * read the file COPYRIGHT. @@ -18,10 +18,10 @@ * Ce fichier contient la classe NavigationPrint *<BR> * @author Initiance <www.initiance.com|martial@initiance.com> -* @copyright Copyright © 2009-2018, Rooty +* @copyright Copyright © 2004-2006, Limousin expansion * @since 2004/06/07 -* @version 0.3 -* @link www.rooty.me +* @version 0.1 +* @link www.granilim.org * @package object_printing * @subpackage NavigationPrint */ @@ -53,7 +53,7 @@ class NavigationPrint extends Printing function __construct() { - parent::__construct("1.1", "Rooty <rooty@rooty.me>", "Affichage de la NavigationNode"); + parent::__construct("1.0", "Olivier DEVAINE", "Affichage de la NavigationNode"); } /** @@ -62,8 +62,6 @@ class NavigationPrint extends Printing */ function __print() { - global $SERVER_NAME, $SCRIPT_NAME, $CONF_AUTH_SECURE; - /* gestion du lib en fonction de la langue courante */ $currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode(); $defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"]; @@ -75,146 +73,33 @@ class NavigationPrint extends Printing $Node =$GLOBALS["SYSTEM_USER_SESSION"]->getNode($GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId); /* recuperation de l'image de la langue courante */ - if (file_exists($GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/node/".strtolower($Node->getIcone())) && ($Node->getIcone()!="")) + if (file_exists("data/image/icons/node/".strtolower($Node->getIcone())) && ($Node->getIcone()!="")) { - $img=$GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/node/".strtolower($Node->getIcone()); + $img="data/image/icons/node/".strtolower($Node->getIcone()); }else{ - $img=$GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/node/defaultnode.gif"; + $img="data/image/icons/node/defaultnode.gif"; } - - // BLOC INFOS UTILISATEUR - if ($GLOBALS["SYSTEM_USER_SESSION"]->user->getId()==$GLOBALS["SYSTEM_DEFAULT_USER_GUEST"]) - { - $nodeId = $GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId; - - /* création de l'url de login */ - $url =$_SERVER['SCRIPT_NAME']; - $url.="?system=authSession"; - $url=addIdToUrl($url); - - $tabObject =$this->getObjectSon(eid()); - for ($i=0; $i<count($tabObject);$i++) - { - if ($tabObject[$i][0]->getClassName()=="home") - { - $urlArray["id"]=$tabObject[$i][1]->getId(); - } - } - - /* Création de l'URL pour nouveau compte */ - $urlNewAccount = $_SERVER['SCRIPT_NAME']; - $urlNewAccount.= "?system=authNewAccount"; - $urlNewAccount = addIdToUrl($urlNewAccount); - $MaTemplate->MxAttribut("urlActionNewAccount", formatUrl($urlArray["id"],"Home","formLecture","",$this->recupCommunauty())); - $MaTemplate->MxAttribut("urlActionNewSubscription", formatUrl($urlArray["id"],"Home","formLectureAdh","",$this->recupCommunauty())); - - /* Création de l'URL pour rappel du mot de passe */ - $urlForgotPassword = $_SERVER['SCRIPT_NAME']; - $urlForgotPassword.= "?system=authForgotPassword"; - $urlForgotPassword = addIdToUrl($urlForgotPassword); - - $MaTemplate->MxText("blocGUEST".".auth", getMessage("UserPrintAuth")); - $MaTemplate->MxText("blocGUEST".".LOGIN", getMessage("UserPrintLogin")); - $MaTemplate->MxFormField("blocGUEST".".login", "text", "login", "", "title='".getMessage("tipUserPrintLogin")."'"); - $MaTemplate->MxText("blocGUEST".".PASSWORD", getMessage("UserPrintPassword")); - $MaTemplate->MxFormField("blocGUEST".".password", "password", "password", "", "title='".getMessage("tipUserPrintPassword")."'"); - $MaTemplate->MxAttribut("blocGUEST".".urlActionNewAccount", $urlNewAccount); - $MaTemplate->MxText("blocGUEST".".NEWACCOUNT", getMessage("UserPrintNewAccount")); - $MaTemplate->MxText("blocGUEST".".NEWSUBSCRIPTION", getMessage("UserPrintNewSubscription")); - $MaTemplate->MxAttribut("blocGUEST".".urlActionForgotPassword", $urlForgotPassword); - $MaTemplate->MxText("blocGUEST".".FORGOTPASSWORD", getMessage("UserPrintForgotPassword")); - $MaTemplate->MxAttribut("blocGUEST".".urlAction", $url); - $MaTemplate->MxAttribut("blocGUEST".".BtnEnter", getMessage("UserPrintEnter")); - $MaTemplate->MxAttribut("blocGUEST".".titleButton", getMessage("tipUserPrintEnter")); - - $MaTemplate->MxBloc("blocAUTH", "delete"); - } else { - $nodeId = $GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId; - - /* création de l'url de déconnexion */ - $urlDisco =$_SERVER['SCRIPT_NAME']; - $urlDisco.="?system=disconnectSession"; - $urlDisco=addIdToUrl($urlDisco); - - // On récupère la liste des objets pour l'EID courant (racine) - $tabObject =$this->getObjectSon(eid()); - - /* création de l'url de l'outil de gestion du compte utilisateur */ - $nodeId = $GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId; - $tabObjectNode =$this->getObjectSon($nodeId); - - for ($j=0; $j<count($tabObjectNode);$j++) - { - if ($tabObjectNode[$j][0]->getClassName()=="UserModif") - { - $objID=$tabObjectNode[$j][1]->getId(); - $objCN=$tabObjectNode[$j][0]->getClassName(); - $objMN=$tabObjectNode[$j][0]->getMethodName(); - } - } - -// var_dump($objID."\n".$objCN."\n".$objMN); - - if( isset($objID) AND isset($objCN) AND isset($objMN) ) - $MaTemplate->MxAttribut("blocAUTH".".urlAccount", formatUrl($objID, $objCN, $objMN, "", "")); - - $MaTemplate->MxAttribut("blocAUTH".".disconnectURL", $urlDisco); - $MaTemplate->MxText("blocAUTH".".firstName", $GLOBALS["SYSTEM_USER_SESSION"]->user->getFirstName()); - $MaTemplate->MxText("blocAUTH".".lastName", $GLOBALS["SYSTEM_USER_SESSION"]->user->getLastName()); -// $MaTemplate->MxText("id", $GLOBALS["SYSTEM_USER_SESSION"]->user->getId()); -// $MaTemplate->MxText("mail", $GLOBALS["SYSTEM_USER_SESSION"]->user->getMail()); -// $MaTemplate->MxText("organisation", $GLOBALS["SYSTEM_USER_SESSION"]->user->getOrganisation()); -// $MaTemplate->MxText("title", $GLOBALS["SYSTEM_USER_SESSION"]->user->getTitle()); -// $MaTemplate->MxText("postalAddress", $GLOBALS["SYSTEM_USER_SESSION"]->user->getPostalAddress()); -// $MaTemplate->MxText("postalCode", $GLOBALS["SYSTEM_USER_SESSION"]->user->getPostalCode()); -// $MaTemplate->MxText("state", $GLOBALS["SYSTEM_USER_SESSION"]->user->getState()); -// $MaTemplate->MxText("country", $GLOBALS["SYSTEM_USER_SESSION"]->user->getCountry()); - $MaTemplate->MxText("blocAUTH".".login", $GLOBALS["SYSTEM_USER_SESSION"]->user->getLogin()); -// $MaTemplate->MxText("tel", $GLOBALS["SYSTEM_USER_SESSION"]->user->getTel()); - $MaTemplate->MxText("blocAUTH".".decon", getMessage("UserPrintDecon")); -// $MaTemplate->MxAttribut("decon", getMessage("UserPrintDecon")); -// $MaTemplate->MxText("fax", $GLOBALS["SYSTEM_USER_SESSION"]->user->getFax()); -// $MaTemplate->MxText("TxtWelcome", getMessage("TxtWelcome")); - - $MaTemplate->MxBloc("blocGUEST", "delete"); - } $urlToGo = formatUrlNode("navigationNode", $Node->getId()); -// var_dump($urlToGo); /* pour l'url */ $MaTemplate->MxAttribut("nodeUrl", htmlentitiesconv($urlToGo)); - - if ( $Node->getLibelle($currentCode) != "" ) - { - if( !strstr("0.", $Node->getLibelle($currentCode)) ) - { - $lib=$Node->getLibelle($currentCode); - } - } else { - $lib = ""; - } - + $lib=$Node->getLibelle($currentCode); if ($lib=="") { - if ( $Node->getLibelle($currentCode) != "" ) - { - if( !strstr("0.", $Node->getLibelle($currentCode)) ) - $lib=$Node->getLibelle($defaultCode); - } + $lib=$Node->getLibelle($defaultCode); } - $MaTemplate->MxImage("pictoNode", $img , htmlentitiesconv($lib),""); + $MaTemplate->MxImage("pictoNode", $img ,htmlentitiesconv($lib),""); /* objet en cours */ -// if ($Node->getId()==nid()) -// $classBoostrapMenuItem = " active"; -// else -// $classBoostrapMenuItem = ""; -// /* Fin des objets en cours */ + if ($Node->getId()==nid()) + $MaTemplate->MxAttribut("style", "NavigationSelected"); + else + $MaTemplate->MxAttribut("style", "Navigation"); + /* Fin des objets en cours */ $MaTemplate->MxText("nodeName", htmlentitiesconv($lib)); -// var_dump(htmlentitiesconv($lib)); /* On affiche les noeuds suivants */ $forNode=$this->printForNode($GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId); @@ -254,49 +139,23 @@ class NavigationPrint extends Printing /* Pour le Tri/Nom */ $tabName=array(); - for ($i=0; $i<count($tabObj);$i++) { if(!is_object($tabObj[$i])) // c un obj!!!! { - if( strpos( $tabObj[$i][1]->getName($currentCode), "zz. ") === false ) + $lib=$tabObj[$i][1]->getName($currentCode); + if ($lib=="") { - if( $GLOBALS["SYSTEM_USER_SESSION"]->user->getId() != 1 ) - { - if( !in_array($tabObj[$i][1]->getName($currentCode), $GLOBALS['EXCLUDETOOLSFROMUSERMENU']) ) - { - $lib=$tabObj[$i][1]->getName($currentCode); - } else { - $lib = false; - } - } else { - if( !in_array($tabObj[$i][1]->getName($currentCode), $GLOBALS['EXCLUDETOOLSFROMGUESTMENU']) ) - { - $lib=$tabObj[$i][1]->getName($currentCode); - } else { - $lib = false; - } - } - } else { - $lib = false; + $lib=$tabObj[$i][1]->getName($defaultCode); } }else{ - if( strpos( $tabObj[$i]->getLibelle($currentCode), "zz. ") === false ) + $lib=$tabObj[$i]->getLibelle($currentCode); + if ($lib=="") { - if( $GLOBALS["SYSTEM_USER_SESSION"]->user->getId() != 1 ) - $lib=$tabObj[$i]->getLibelle($currentCode); - else - if( !in_array($tabObj[$i][1]->getName($currentCode), $GLOBALS['EXCLUDETOOLSFROMGUESTMENU']) ) - $lib=$tabObj[$i][1]->getName($currentCode); - else - $lib = false; - } else { - $lib = false; + $lib=$tabObj[$i]->getLibelle($defaultCode); } } - - if( $lib && !empty($lib) ) - $tabName[$i]=$lib; + $tabName[$i]=$lib; } asort($tabName); reset($tabName); @@ -306,34 +165,28 @@ class NavigationPrint extends Printing if(is_object($tabObj[$i])) // c un dir!!!! { /* recuperation de l'image de la langue courante */ - if (file_exists($GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/node/".strtolower($tabObj[$i]->getIcone())) && ($tabObj[$i]->getIcone()!="")) + if (file_exists("data/image/icons/node/".strtolower($tabObj[$i]->getIcone())) && ($tabObj[$i]->getIcone()!="")) { - $img=$GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/node/".strtolower($tabObj[$i]->getIcone()); + $img="data/image/icons/node/".strtolower($tabObj[$i]->getIcone()); }else{ - $img=$GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/node/defaultnode.gif"; + $img="data/image/icons/node/defaultnode.gif"; } /* on prepare l'url */ $urlToGo = formatUrlNode("navigationNode", $tabObj[$i]->getId()); /* pour l'url */ - $MaTemplate->MxAttribut("bloc1.nodeUrl", $urlToGo); - $MaTemplate->MxAttribut("bloc1.blocDropdown.nodeUrl", $urlToGo); - $MaTemplate->MxAttribut("bloc1.blocNoDropdown.nodeUrl", $urlToGo); + $MaTemplate->MxAttribut("bloc1.nodeUrl", ($urlToGo)); $lib=$tabObj[$i]->getLibelle($currentCode); - if ($lib=="") { $lib=$tabObj[$i]->getLibelle($defaultCode); } /*Fonction permettant de supprimer les numeros, le point et l'espace à l'affichage*/ -// $lib = eregi_replace("^[[:space:]]*[a-z]+[a-z]+[a-z]+[a-z]+[.)".chr(176)."][[:space:]]+", "", $lib); -// $lib = substr( $lib, strpos($lib, ". "), strlen($lib) ); - $lib = ltrim(substr( $lib, strpos($lib, ". "), strlen($lib) ), ". "); - $MaTemplate->MxImage("bloc1.pictoNode", $img , htmlentitiesconv($lib), ""); - $MaTemplate->MxImage("bloc1.blocDropdown.pictoNode", $img , htmlentitiesconv($lib), ""); - $MaTemplate->MxImage("bloc1.blocNoDropdown.pictoNode", $img , htmlentitiesconv($lib), ""); +// $lib = eregi_replace("^[[:space:]]*[a-z]+[.)".chr(176)."][[:space:]]+", "", $lib); + $lib = ltrim(substr( $lib, strpos($lib, ". "), strlen($lib) ), ". "); + $MaTemplate->MxImage("bloc1.pictoNode", $img ,htmlentitiesconv($lib),""); /* objet en cours */ $bool=false; @@ -346,81 +199,57 @@ class NavigationPrint extends Printing break; } } - - if ($tabObj[$i]->getId()==nid() || $bool==true) { - $classBoostrapMenu = " active"; - } else { - $classBoostrapMenu = ""; - } + + if ($tabObj[$i]->getId()==nid() || $bool==true) + $MaTemplate->MxAttribut("bloc1.class", "active"); + else + $MaTemplate->MxAttribut("bloc1.class", "none"); /* Fin des objets en cours */ - $MaTemplate->MxText("bloc1.nodeName", htmlentitiesconv($lib)); - $MaTemplate->MxText("bloc1.blocDropdown.nodeName", htmlentitiesconv($lib)); - $MaTemplate->MxText("bloc1.blocNoDropdown.nodeName", htmlentitiesconv($lib)); + $MaTemplate->MxText("bloc1.nodeName", htmlentitiesconv($lib)."1"); // on récupére les sous niveau... $ssLevel=$this->printForNode($tabObj[$i]->getId(), ( (($modelixeMxt=="navigationsub.mxt") || ($modelixeMxt=="navigationdiv.mxt")) && (($modelixeMxt!="navigationnode.mxt"))?"navigationdiv.mxt":"navigationsub.mxt")); - $MaTemplate->MxText("bloc1.blocDropdown.nodeDir.nodeDir", $ssLevel); - - if( $ssLevel ) { - $classBoostrapMenu = " dropdown".$classBoostrapMenu; - $MaTemplate->MxBloc("bloc1.blocNoDropdown", "delete"); - } else { - $classBoostrapMenu = $classBoostrapMenu; - $MaTemplate->MxBloc("bloc1.blocDropdown", "delete"); - } - - $MaTemplate->MxAttribut("bloc1.class", $classBoostrapMenu); + $MaTemplate->MxText("bloc1.nodeDir", $ssLevel); }else{ /* recuperation de l'image de la langue courante */ - if (file_exists($GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/object/".strtolower($tabObj[$i][1]->getIcone())) && ($tabObj[$i][1]->getIcone()!="")) + if (file_exists("data/image/icons/object/".strtolower($tabObj[$i][1]->getIcone())) && ($tabObj[$i][1]->getIcone()!="")) { - $img=$GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/object/".strtolower($tabObj[$i][1]->getIcone()); + $img="data/image/icons/object/".strtolower($tabObj[$i][1]->getIcone()); }else{ - $img=$GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/object/defaultobject.gif"; + $img="data/image/icons/object/defaultobject.gif"; } $urlToGo = formatUrl($tabObj[$i][1]->getId(), $tabObj[$i][0]->getClassName(), $tabObj[$i][0]->getMethodName(),"","",$tabObj[$i][0]->getNodeId()); /* pour l'url */ $MaTemplate->MxAttribut("bloc1.nodeUrl", $urlToGo); - $MaTemplate->MxAttribut("bloc1.blocDropdown.nodeUrl", $urlToGo); $lib=$tabObj[$i][1]->getName($currentCode); -// $lib = substr( $lib, strpos($lib, ". "), strlen($lib) ); if ($lib=="") { $lib=$tabObj[$i][1]->getName($defaultCode); } - -// $lib = eregi_replace("^[[:space:]]*[a-z]+[.)".chr(176)."][[:space:]]+", "", $lib); - $lib = ltrim(substr( $lib, strpos($lib, ". "), strlen($lib) ), ". "); - $MaTemplate->MxImage("bloc1.pictoNode", $img ,htmlentitiesconv($lib), ""); - $MaTemplate->MxImage("bloc1.blocDropdown.pictoNode", $img ,htmlentitiesconv($lib), ""); + //$page -> MxImage(string $path, string $imageFile, [string $title], [string $imageAttribut], [string $getSize]); + $MaTemplate->MxImage("bloc1.pictoNode", $img ,htmlentitiesconv($lib), ""); /* objet en cours */ - if ( ($tabObj[$i][1]->getId()==oid() ) && ( strtolower($tabObj[$i][0]->getClassName())==strtolower(className())) && (!(strpos(strtolower(methodName()), strtolower(str_replace("action","",$tabObj[$i][0]->getMethodName())))===false)) ) { - $MaTemplate->MxAttribut("bloc1.class", "active"); - $MaTemplate->MxAttribut("bloc1.blocDropdown.class", "nav-item active"); - $MaTemplate->MxAttribut("bloc1.blocNoDropdown.class", " nav-item active"); - } else { - $MaTemplate->MxAttribut("bloc1.class", ""); - $MaTemplate->MxAttribut("bloc1.blocDropdown.class", "nav-item"); - $MaTemplate->MxAttribut("bloc1.blocNoDropdown.class", "nav-item"); - } + if ( ($tabObj[$i][1]->getId()==oid() ) && ( strtolower($tabObj[$i][0]->getClassName())==strtolower(className())) && (!(strpos(strtolower(methodName()), strtolower(str_replace("action","",$tabObj[$i][0]->getMethodName())))===false)) ) + $MaTemplate->MxAttribut("bloc1.class", "active"); + else + $MaTemplate->MxAttribut("bloc1.class", "none"); /* Fin des objets en cours */ /*Fonction permettant de supprimer les numeros, le point et l'espace à l'affichage*/ // $lib = eregi_replace("^[[:space:]]*[a-z]+[.)".chr(176)."][[:space:]]+", "", $lib); - $lib = preg_replace("/^[[:space:]]*[a-z]+[.)".chr(176)."][[:space:]]+/i", "", $lib); - $MaTemplate->MxText("bloc1.nodeName", htmlentitiesconv($lib)); - $MaTemplate->MxText("bloc1.blocDropdown.nodeName", htmlentitiesconv($lib)); - $MaTemplate->MxBloc("bloc1.blocDropdown.nodeDir", "delete"); + $lib = ltrim(substr( $lib, strpos($lib, ". "), strlen($lib) ), ". "); + + $MaTemplate->MxText("bloc1.nodeName", htmlentitiesconv($lib)."2"); + $MaTemplate->MxText("bloc1.nodeDir", ""); } $MaTemplate->MxBloc("bloc1", "loop"); } - if (count($tabName)!=0) $data=$MaTemplate->MxWrite(); else @@ -432,7 +261,7 @@ class NavigationPrint extends Printing * recupere les repertoires d'un noeud * @access public */ - private function getNodeSon($nodeId) + function getNodeSon($nodeId) { $tab=$GLOBALS["SYSTEM_USER_SESSION"]->getSonOfNodeAllowed($nodeId); return $tab; @@ -442,40 +271,10 @@ class NavigationPrint extends Printing * recupere les fils d'un noeud depuis le noeud principal * @access public */ - private function getObjectSon($nodeId) + function getObjectSon($nodeId) { $tab=$GLOBALS["SYSTEM_CONTROL"]->getListObjectForNavigation($nodeId); return $tab; } - -/** -* Function permettant de modifier le contenu dans la bd et redirection -* @access private -* @return chaine entier noeud de configuration -*/ - private function recupCommunauty($get='id',$langcode="fr") - { - /* 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 */ - - $nodeId=NULL; - for ($i=0; $i<count($myTree->tabFather); $i++) - { - if ($myTree->tabFather[$i]->getIdPere()==1) - { - if( $get == 'id' ) { $nodeId=$myTree->tabFather[$i]->getId();} - elseif( $get == 'ctype' ) { $nodeId=$myTree->tabFather[$i]->getCType();} - elseif( $get == 'lib' ) {$nodeId=$myTree->tabFather[$i]->getLibelle($langcode);} - break; - } - } - if (is_null($nodeId)) - { - systemRedirect( $GLOBALS["CONF_PAGE_EXECUTION"] ); - } - /* -- Fin Recup Communauté */ - return $nodeId; - } } ?>