Example #1
0
 static function genHelpFromText($contenu, $size = '400', $bgcolor = '', $fgcolor = '')
 {
     // Chargement du template ModeliXe.
     $mod = new ModeliXe("help.html");
     $mod->SetModeliXe();
     if (getDefine('HELPBGCOLOR') and !$bgcolor) {
         $bgcolor = getDefine('HELPBGCOLOR');
     }
     if (getDefine('HELPFGCOLOR') and !$fgcolor) {
         $fgcolor = getDefine('HELPFGCOLOR');
     }
     $text = preg_replace("/(\r\n|\n|\r)/", " ", nl2br($contenu));
     $textF = str_replace("'", "\\'", $text);
     $text = str_replace('"', '\\"', $textF);
     $mod->MxText("infoBulle", "onClick=\"return overlib('{$text}', " . "WIDTH, {$size}, BGCOLOR,'{$bgcolor}', FGCOLOR, '{$fgcolor}', STICKY, " . "CAPTION, '" . NOMAPPLICATION . " : Aide', CLOSECLICK, HAUTO, VAUTO, SHADOW );\" " . "onClick=\"return nd();\"");
     return $mod->MxWrite("1");
 }
Example #2
0
 function getGroupes($uid, $equipes, $fonctions, $orgs, $groupes)
 {
     // Recuperation des groupes forcés par xham (methode definie dans abstractuser)
     $this->getGroupe($uid);
     // Recuperation des données diverses ldap
     for ($i = 0; isset($equipes[$i]); $i++) {
         $tabE[XhamUserLdap::calcCN($equipes[$i])] = $equipes[$i];
         $result = ldap_search($this->conne, LDAP_BASE, "(cn=" . XhamUserLdap::calcCN($equipes[$i]) . ")");
         $info = ldap_get_entries($this->conne, $result);
         for ($j = 0; isset($info[$j]); $j++) {
             for ($k = 0; isset($info[$j]["chhatcodeuf"][$k]); $k++) {
                 $this->informations['uf'][] = $info[$j]["chhatcodeuf"][$k];
             }
         }
     }
     for ($i = 0; isset($groupes[$i]); $i++) {
         $tabG[XhamUserLdap::calcCN($groupes[$i]['dn'])] = $groupes[$i]['dn'];
     }
     for ($i = 0; isset($orgs[$i]); $i++) {
         $tabO[XhamUserLdap::calcCN($orgs[$i])] = $orgs[$i];
     }
     for ($i = 0; isset($fonctions[$i]); $i++) {
         $tabF[XhamUserLdap::calcCN($fonctions[$i])] = $fonctions[$i];
     }
     // Recuperation de l'ensemble des groupes appartenant à xham pour cette appli
     $res = XhamTools::getListeGroupes();
     for ($i = 0; isset($res['nomgroupe'][$i]); $i++) {
         // print $res['nomgroupe'][$i]."<br>" ;
         $tab = explode('&', $res['nomgroupe'][$i]);
         $bool = 1;
         while (list($key, $val) = each($tab)) {
             if (!isset($tabO[$val]) and !isset($tabF[$val]) and !isset($tabE[$val]) and $val != $uid and !isset($tabG[$val])) {
                 $bool = 0;
             }
         }
         if ($bool) {
             if ($this->lg) {
                 $this->lg .= "," . $res['idgroupe'][$i];
             } else {
                 $this->lg = $res['idgroupe'][$i];
             }
         }
     }
     // eko ( $this->lg ) ;
     // print "<br><br>".$this->lg ;
     //GROUPEEVERYBODY
     $gd = getDefine('GROUPEEVERYBODY', 'everybody');
     //eko($gd);
     for ($i = 0; isset($res['nomgroupe'][$i]); $i++) {
         if ($res['nomgroupe'][$i] == $gd) {
             if ($this->lg) {
                 $this->lg .= "," . $res['idgroupe'][$i];
             } else {
                 $this->lg = $res['idgroupe'][$i];
             }
         }
     }
     return $this->lg;
 }