public static function Terminer() { if (self::$startSession === 1) { GReferentiel::Sauvegarder(); GContexte::Sauvegarder(); self::EcrireSession('libellesMemorises', self::$listeLibMem); } }
protected function GetDifferentielForListeElementCreation($nomChamp) { switch ($nomChamp) { case COL_FONCTIONNALITE: $cListe = new CListeFonctionnalites($this->prefixIdClass, $this->NomListeFormate($nomChamp) . '_', $this->contexte, -1); $cListe->SetListeParente($this, $id); $mListe = $this->GetSousListe($nomChamp); $cListe->InjecterListeObjetsMetiers($mListe, true); GContexte::AjouterListe($cListe); break; } }
protected function GetDifferentielForListeElement($element, $nomChamp) { $id = $element[LISTE_ELEMENT_ID]; switch ($nomChamp) { case COL_JOUEUR: $cListe = new CListeJoueursPseudos($this->prefixIdClass, $this->NomListeFormate($nomChamp) . '__' . $id, $this->contexte); $cListe->SetListeParente($this, $id); $mListe = $this->GetSousListeElement($element, $nomChamp); $mSousListe = new MListeJoueurs(); $mSousListe = $mListe->ExtraireListe(COL_JOUEUR); $cListe->InjecterListeObjetsMetiers($mSousListe, true); GContexte::AjouterListe($cListe); } }
protected function ConstruireElemRetourInvisible(&$element) { $retourInvisible = 'contexte=' . CONT_ORIENTATION . '&cf=' . GSession::NumCheckFormulaire(); foreach ($this->champs as $nomChamp => $champ) { if ($champ[LISTE_CHAMPLISTE_RETOURINVISIBLE] === true) { if ($retourInvisible !== '') { $retourInvisible .= '&'; } $retourInvisible .= GContexte::FormaterVariable(CONT_ORIENTATION, $nomChamp) . '=' . $element[$nomChamp][LISTE_ELEMENT_VALEURCONSULT]; } } // On enregistre ce retour pour l'élément. $element[LISTE_ELEMENT_RETOUR] = to_html($retourInvisible); $divRetInv = new SBalise(BAL_DIV); $divRetInv->AddClass(LISTE_JQ_ELEMENT_PARAM); $divRetInv->SetText($element[LISTE_ELEMENT_RETOUR]); return $divRetInv; }
require_once 'cst.php'; require_once INC_GSESSION; GReponse::Debut(); $garderContextes = GSession::LirePost('garderContextes'); $initialisation = GSession::LirePost('initialisation'); $contextes = GSession::LirePost('contextes'); if ($garderContextes == NULL) { GContexte::ResetContextes(); } if ($initialisation != NULL) { GSession::InitialiserOnRechargement(); GContexte::Initialisation(true); GContexte::ResetEtatChargeContextes(); GContexte::SupprimerContextesDesactives(); GContexte::ResetReferentielsContextes(); GContexte::AjouterContextePermanent(CONT_IDENTIFICATION, true); GContexte::AjouterContextePermanent(CONT_LOCALISATION, false, true, PERIODERECH_LOCALISATION); GContexte::AjouterContextePermanent(CONT_NAVIGATION, false, true, PERIODERECH_NAVIGATION); GContexte::AjouterContextePermanent(CONT_ORIENTATION); } if ($contextes != NULL && is_array($contextes)) { while (list($i, $contexte) = each($contextes)) { GContexte::AjouterContexte($contexte); } } GContexte::ChargerContextes(); if ($initialisation != NULL) { GContexte::Initialisation(false); } GReponse::Fin();
<?php require_once 'cst.php'; require_once INC_GSESSION; require_once INC_SFORM; require_once PATH_METIER . 'mListeCommunautes.php'; $mListeCommunautes = new MListeCommunautes(false); $mListeCommunautes->AjouterColSelection(COL_ID); $mListeCommunautes->AjouterColSelection(COL_LIBELLE); $mListeCommunautes->AjouterColOrdre(COL_LIBELLE); GReferentiel::AjouterReferentiel(COL_COMMUNAUTE, $mListeCommunautes, array(COL_ID, array(COL_LIBELLE, COL_LIBELLE))); if ($dejaCharge === false) { $selectCommunaute = new SForm('selcom', 1, 1); $selectCommunaute->SetCadreInputs(1, 1, 1, 1); $select = $selectCommunaute->AjouterInputSelect(1, 1, GSession::Libelle(LIB_CON_COMMUNAUTE), '', true, GContexte::FormaterVariable($nomContexte, 'communaute')); $select->AjouterElementsFromListe(COL_COMMUNAUTE, COL_ID, array(COL_LIBELLE, COL_LIBELLE), '', GSession::Communaute(COL_ID)); GContexte::AjouterContenu(CADRE_INFO_COMMUNAUTE, $selectCommunaute); } else { GReferentiel::GetDifferentielReferentielForSelect(COL_COMMUNAUTE, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); }
$formulaireValide = false; } if ($mJoueur->Pseudo() == NULL) { GLog::LeverException(EXF_0003, GSession::Libelle(LIB_CON_PSEUDOERREUR), true); $formulaireValide = false; } if ($formulaireValide === true) { // Si un joueur existait et était supprimé on le met à jour, sinon on crée un nouveau joueur. if ($mJoueurExistant->Id() != NULL) { $mJoueurExistant->Modifier(); unset($mJoueur); $mJoueur = $mJoueurExistant; } else { $mJoueur->Ajouter(); } } // Si le joueur a bien été créé, on lui envoie un mail avec son pseudo, son mot de passe et son code d'activation. if ($mJoueur->Id() !== NULL) { $headers = 'From: "Admin"<*****@*****.**>' . "\n"; $headers .= 'Content-Type: text/plain; charset="utf8"' . "\n"; $headers .= 'Content-Transfer-Encoding: 8bit'; ini_set('SMTP', SMTP); $message = GSession::Libelle(LIBTEXT_CON_MAILMESSAGE, false, true) . "\r\n\r\n" . GSession::Libelle(LIB_CON_PSEUDO, false, true) . ' ' . $mJoueur->Pseudo() . "\r\n" . GSession::Libelle(LIB_CON_MOTDEPASSE, false, true) . ' ' . $mJoueur->MotDePasse() . "\r\n" . GSession::Libelle(LIB_CON_CODEACTIVATION, false, true) . ' ' . $mJoueur->CodeActivation(); mail($mJoueur->Login(), GSession::Libelle(LIB_CON_MAILTITRE, false, true), $message, $headers); GSession::Joueur(COL_ID, $mJoueur->Id()); GSession::Joueur(COL_PSEUDO, $mJoueur->Pseudo()); GContexte::SetContexte(CONT_ACTIVATION); } else { GLog::LeverException(EXF_0004, GSession::Libelle(LIB_CON_CREATCOMPTEERREUR), true, $formulaireValide); } $pasDeRechargement = true;
protected function GetDifferentielForListe($nomChamp) { switch ($nomChamp) { case 'champ_5': $libelle = GSession::Libelle(LIB_PRS_CHAMP, true, true); $cListe = new CListeModificationPresentation2($this->prefixIdClass, 'ModifPres2', $this->contexte, -1, -1, false, '', true, '', '', '', '', '', '', '', AJAXFONC_RECHARGER); $cListe->AjouterElement($libelle . '1', $libelle, '', $libelle); $cListe->AjouterElement($libelle . '2', $libelle, '', $libelle); $cListe->AjouterElement($libelle . '3', $libelle, '', $libelle); $cListe->AjouterElement($libelle . '4', $libelle, '', $libelle); $cListe->AjouterElement($libelle . '5', $libelle, '', $libelle); $cListe->SetListeParente($this); GContexte::AjouterListe($cListe); break; } }
require_once INC_GSESSION; require_once PATH_METIER . 'mJoueur.php'; $login = GContexte::LireVariablePost($nomContexte, 'login'); $motDePasse = GContexte::LireVariablePost($nomContexte, 'motDePasse'); $mJoueur = new MJoueur(NULL, $login, $motDePasse); $formulaireValide = true; // On vérifie qu'un compte existe pour cette adresse email. $mJoueur->ChargerFromLoginEtMotDePasse(); if ($mJoueur->Id() === NULL || $mJoueur->Supprime() === true) { GLog::LeverException(EXF_0020, GSession::Libelle(LIB_CON_COMPTENONEXISTANT), true, false); $formulaireValide = false; } else { if ($mJoueur->Banni() === true) { GLog::LeverException(EXF_0021, GSession::Libelle(LIB_CON_COMPTEBANNI), true, false); $formulaireValide = false; } } if ($formulaireValide === true) { GSession::Joueur(COL_ID, $mJoueur->Id()); GSession::Joueur(COL_PSEUDO, $mJoueur->Pseudo()); GSession::Joueur(COL_SUPERADMIN, $mJoueur->SuperAdmin()); // On vérifie si le compte a été activé ou non. if ($mJoueur->Actif() === false) { GContexte::SetContexte(CONT_ACTIVATION); } else { GContexte::SetContexte(CONT_ADMINISTRATION, false); } } else { GContexte::SupprimerContexte(CONT_CONNEXION); } $pasDeRechargement = true;
$form->FusionnerCelluleCadre(2, 3, 0, 3); $form->FusionnerCelluleCadre(3, 1, 0, 1); $form->FusionnerCelluleCadre(3, 3, 0, 1); $form->FusionnerCelluleCadre(3, 5, 0, 1); $form->FusionnerCelluleCadre(4, 1, 0, 5); $form->FusionnerCelluleCadre(5, 1, 0, 5); $img = $form->AjouterInputImage(1, 1, GSession::Libelle(LIB_GPE_ICONE), '', false, GContexte::FormaterVariable($nomContexte, COL_ICONE), PATH_IMAGES . 'Jeu/', '', GSession::Libelle(LIB_GPE_ICONEINFO), '', TYPEFICHIER_IMAGEGLOBALE_JEU, $nomContexte); $img->AjouterElementsFromListe(COL_ICONE); $form->AjouterInputText(1, 3, GSession::Libelle(LIB_GPE_NOM), '', true, GContexte::FormaterVariable($nomContexte, COL_NOM), '', 1, 100, 50, false, '', GSession::Libelle(LIB_GPE_NOMINFO), GSession::Libelle(LIB_GPE_NOMERREUR), INPUTTEXT_REGEXP_TOUT_FV); $select = $form->AjouterInputSelect(2, 3, GSession::Libelle(LIB_GPE_JEU), INPUTSELECT_TYPE_FIND, true, GContexte::FormaterVariable($nomContexte, COL_JEU), GSession::Libelle(LIB_GPE_JEUINFO), GSession::Libelle(LIB_GPE_JEUERREUR), $nomContexte . COL_JEU, $nomContexte . COL_SERVEUR . ';' . $nomContexte . COL_TYPEGROUPE); $select->AjouterElementsFromListe(COL_JEU, COL_ID, array(COL_LIBELLE, COL_LIBELLE), '', $jeuId); $select = $form->AjouterInputSelect(3, 1, GSession::Libelle(LIB_GPE_SERVEUR), '', false, GContexte::FormaterVariable($nomContexte, COL_SERVEUR), '', '', $nomContexte . COL_SERVEUR, '', $nomContexte . COL_JEU, AJAXFONC_CHARGERREFERENTIELCONTEXTE, 'contexte=' . $nomContexte); $select->AjouterElementsFromListe(COL_SERVEUR, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); $select = $form->AjouterInputSelect(3, 3, GSession::Libelle(LIB_GPE_COMMUNAUTE), '', true, GContexte::FormaterVariable($nomContexte, COL_COMMUNAUTE), '', GSession::Libelle(LIB_GPE_COMMUNAUTEERREUR)); $select->AjouterElementsFromListe(COL_COMMUNAUTE, COL_ID, array(COL_LIBELLE, COL_LIBELLE), '', GSession::Communaute(COL_ID)); $select = $form->AjouterInputSelect(3, 5, GSession::Libelle(LIB_GPE_TYPEGROUPE), '', true, GContexte::FormaterVariable($nomContexte, COL_TYPEGROUPE), GSession::Libelle(LIB_GPE_TYPEGPEINFO), GSession::Libelle(LIB_GPE_TYPEGPEERREUR), $nomContexte . COL_TYPEGROUPE, '', $nomContexte . COL_JEU, AJAXFONC_CHARGERREFERENTIELCONTEXTE, 'contexte=' . $nomContexte); $select->AjouterElementsFromListe(COL_TYPEGROUPE, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); $form->AjouterInputText(4, 1, GSession::Libelle(LIB_GPE_DESCRIPTION), '', false, GContexte::FormaterVariable($nomContexte, COL_DESCRIPTION), '', 1, 250, -1, true, '', GSession::Libelle(LIB_GPE_DESCRIPTIONINFO)); $form->AjouterInputText(5, 1, GSession::Libelle(LIB_GPE_HISTOIRE), '', false, GContexte::FormaterVariable($nomContexte, COL_HISTOIRE), '', 1, NULL, 5, true, '', GSession::Libelle(LIB_GPE_HISTOIREINFO)); $form->SetCadreBoutons(2, 1, 1, 1); $form->AjouterInputButtonAjouterAuContexte(1, 1, $nomContexte, true, GSession::Libelle(LIB_GPE_CREERGROUPE)); $org->AttacherCellule(2, 1, $form); // Cadre contenant le formulaire et son explication. $cadre = new SCadre($prefixIdClass, GSession::Libelle(LIB_GPE_CREATIONGPE), $org, true, true); GContexte::AjouterContenu(CADRE_CONTENU_CONTENU, $cadre); } else { // Rechargement des référentiels. GReferentiel::GetDifferentielReferentielFichiersForSelect(COL_ICONE); GReferentiel::GetDifferentielReferentielForSelect(COL_COMMUNAUTE, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); } }
GReferentiel::AjouterReferentiel($nomReferentiel, $mListe, array(COL_ID, array(COL_LIBELLE, COL_LIBELLE)), true); GReferentiel::GetDifferentielReferentielForSelect($nomReferentiel, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); break; case 'Groupes' . COL_SERVEUR . ',' . COL_ID: $jeu = GContexte::LireVariablePost($nomContexte, COL_JEU . ',' . COL_ID); $mListe = new MListeServeurs(); if ($jeu !== NULL) { $mListe->AjouterColSelection(COL_ID); $mListe->AjouterColSelection(COL_LIBELLE); $mListe->AjouterColOrdre(COL_LIBELLE); $mListe->AjouterFiltreEgal(COL_JEU, $jeu); $mListe->Charger(); } GReferentiel::AjouterReferentiel($nomReferentiel, $mListe, array(COL_ID, array(COL_LIBELLE, COL_LIBELLE)), true); GReferentiel::GetDifferentielReferentielForSelect($nomReferentiel, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); break; case 'Groupes' . COL_TYPEGROUPE . ',' . COL_ID: $jeu = GContexte::LireVariablePost($nomContexte, COL_JEU . ',' . COL_ID); $mListe = new MListeTypesGroupes(); if ($jeu !== NULL) { $mListe->AjouterColSelection(COL_ID); $mListe->AjouterColSelection(COL_LIBELLE); $mListe->AjouterColOrdre(COL_LIBELLE); $mListe->AjouterFiltreEgal(COL_JEU, $jeu); $mListe->Charger(); } GReferentiel::AjouterReferentiel($nomReferentiel, $mListe, array(COL_ID, array(COL_LIBELLE, COL_LIBELLE)), true); GReferentiel::GetDifferentielReferentielForSelect($nomReferentiel, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); break; } }
<?php require_once 'cst.php'; require_once INC_GSESSION; GReponse::Debut(); $contexte = GSession::LirePost('contexte'); if ($contexte != NULL) { GContexte::ModifierDansContexte($contexte); } GReponse::Fin();
<?php require_once 'cst.php'; require_once INC_GSESSION; require_once INC_SFORM; require_once PATH_METIER . 'mListeLangues.php'; $mListeLangues = new MListeLangues(false); $mListeLangues->AjouterColSelection(COL_ID); $mListeLangues->AjouterColSelection(COL_LIBELLE); $mListeLangues->AjouterColOrdre(COL_LIBELLE); GReferentiel::AjouterReferentiel(COL_LANGUE, $mListeLangues, array(COL_ID, array(COL_LIBELLE, COL_LIBELLE))); if ($dejaCharge === false) { $selectLangue = new SForm('sellan', 1, 1); $selectLangue->SetCadreInputs(1, 1, 1, 1); $select = $selectLangue->AjouterInputSelect(1, 1, GSession::Libelle(LIB_CON_LANGUE), '', true, GContexte::FormaterVariable($nomContexte, 'langue')); $select->AjouterElementsFromListe(COL_LANGUE, COL_ID, array(COL_LIBELLE, COL_LIBELLE), '', GSession::Langue(COL_ID)); GContexte::AjouterContenu(CADRE_INFO_LANGUE, $selectLangue); } else { GReferentiel::GetDifferentielReferentielForSelect(COL_LANGUE, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); }
<?php require_once 'cst.php'; require_once INC_GSESSION; GReponse::Debut(); $contexte = GSession::LirePost('contexte'); $referentiel = GSession::LirePost('ref'); if ($contexte != NULL && $referentiel != NULL) { GContexte::SupprimerDuReferentiel($contexte, $referentiel); } GReponse::Fin();
$cadre = new SCadre('', GSession::Libelle(LIB_PRS_LISTES), $cListeModificationPresentation, true, false); $vue->AttacherCellule(3, 1, $cadre); $classeur = new SClasseur('', 'presex', true, true); GContexte::AjouterOnglet('presex', GSession::Libelle(LIB_PRS_ONGLET), '', '', '', true, false); GContexte::AjouterOnglet('presex', GSession::Libelle(LIB_PRS_ONGLET), '', '', '', true, false); GContexte::AjouterOnglet('presex', GSession::Libelle(LIB_PRS_ONGLET), '', '', '', true, false); $cadre = new SCadre('', GSession::Libelle(LIB_PRS_TABONGLETS), $classeur, true, false); $vue->AttacherCellule(4, 1, $cadre); $cListeCssParties->AjouterElement(GSession::Libelle(LIB_PRS_PRESGEN, false, true), $vue); /*********************************************/ $form = new SForm($prefixIdClass, 2, 1, true, false); $form->SetCadreInputs(1, 1, 1, 1); $form->AjouterInput(1, 1, '', $cListeCssParties, false); $form->SetCadreBoutons(2, 1, 1, 1); $form->AjouterInputButtonModifierDansContexte(1, 1, $nomContexte, false, GSession::Libelle(LIB_PRS_SAUVEGARDER)); GContexte::AjouterContenu(CADRE_CONTENU_CONTENU, $form); $mListePresentationsModules = new mListePresentationsModules(); $mListePresentationsModules->AjouterColSelection(COL_RESSOURCEJS); $mListePresentationsModules->AjouterFiltreEgal(COL_PRESENTATION, $presentationModif); $numJointure = $mListePresentationsModules->AjouterJointure(COL_TYPEPRESENTATIONMODULE, COL_ID, 0, SQL_RIGHT_JOIN); $mListePresentationsModules->AjouterColSelectionPourJointure($numJointure, COL_ID); $mListePresentationsModules->AjouterFiltreEgalPourJointure($numJointure, COL_ACTIF, true); $mListePresentationsModules->Charger(); foreach ($mListePresentationsModules->GetListe() as $mPresentationModule) { if ($mPresentationModule->RessourceJS() != NULL) { GReponse::AjouterElementJS($mPresentationModule->TypePresentationModule()->Id(), PATH_SERVER_HTTP . $mPresentationModule->RessourceJS(), true); } else { GReponse::AjouterElementJS($mPresentationModule->TypePresentationModule()->Id(), '', true); } } }
<?php require_once 'cst.php'; require_once INC_GSESSION; require_once INC_SFORM; require_once INC_SCADRE; $activationInfo = new SElement(CLASSTEXTE_INFO); $activationInfo->SetText(GSession::Libelle(LIB_ACT_INFOACTIVATION)); $activationForm = new SForm('activation', 2, 1, false); $activationForm->SetCadreInputs(1, 1, 1, 1, false); $activationForm->AjouterInputText(1, 1, GSession::Libelle(LIB_ACT_CODEACTIVATION), '', true, GContexte::FormaterVariable($nomContexte, 'codeActivation'), '', 1, 40, 40, false, '', GSession::Libelle(LIB_ACT_CODEACTIVATIONINFO)); $activationForm->SetCadreBoutons(2, 1, 1, 1); $activationForm->AjouterInputButtonModifierDansContexte(1, 1, CONT_ACTIVATION, true); $activationOrg = new SOrganiseur(2, 1); $activationOrg->AttacherCellule(1, 1, $activationInfo); $activationOrg->AttacherCellule(2, 1, $activationForm); $activationCadre = new SCadre('activation', GSession::Libelle(LIB_ACT_ACTIVATIONCOMPTE), $activationOrg, true, true); GContexte::AjouterContenu(CADRE_CONTENU_CONTENU, $activationCadre);
<?php require_once 'cst.php'; require_once INC_GSESSION; require_once INC_SFORM; require_once PATH_METIER . 'mJoueur.php'; $codeActivation = GContexte::LireVariablePost($nomContexte, 'codeActivation'); $mJoueur = new MJoueur(GSession::Joueur(COL_ID)); $mJoueur->AjouterColSelection(COL_CODEACTIVATION); $compteActive = false; if ($mJoueur->Charger() !== false) { if ($mJoueur->CodeActivation() !== $codeActivation) { GLog::LeverException(EXF_0030, GSession::Libelle(LIB_ACT_CODEACTIVATIONFAUX), true, false); } else { $mJoueur->Actif(true); $compteActive = $mJoueur->Modifier(); } } if ($compteActive === false) { GLog::LeverException(EXF_0031, GSession::Libelle(LIB_ACT_ACTIVCOMPTEERREUR), true, false); } else { GContexte::SetContexte(CONT_AIDE, true); } $pasDeRechargement = true;
<?php require_once 'cst.php'; require_once INC_GSESSION; $groupe = GSession::Groupe(COL_ID); if ($groupe !== NULL && GDroit::ADroitPopErreur(FONC_PRS_CREERMODIFIER) === true) { $presActive = GContexte::LirePost(COL_PRESENTATION . 'active'); if ($presActive === NULL) { $presModif = GContexte::LirePost(COL_PRESENTATION . 'modif'); // Cas où l'on modifie la présentation modifiée. if ($presModif !== '') { GSession::PresentationModif($presModif); GReponse::AjouterElementClasseurRechargement('pres'); // A faire: // - Rechargement des onglets ou pas? } } else { if ($presActive !== '') { require_once PATH_METIER . 'mPresentationGroupe.php'; require_once PATH_METIER . 'mPresentation.php'; require_once PATH_METIER . 'mGroupe.php'; $anciennePresActive = GSession::PresentationActive(); // Suppression de l'ancienne présentation pour le groupe. $mPresentationGroupe = new MPresentationGroupe($anciennePresActive, $groupe); $retour = $mPresentationGroupe->Supprimer(); if ($retour !== false) { // Ajout de la nouvelle présentation pour le groupe. $mPresentationGroupe->Presentation($presActive); $retour = $mPresentationGroupe->Ajouter(); if ($retour !== false) { GSession::PresentationActive($presActive, true);
if (GSession::IsRequeteGet() === true) { // TO DO.. } else { $menuId = GContexte::LireVariablePost($nomContexte, COL_ID, false); if ($menuId === NULL) { $menuId = GContexte::LireVariableSession($nomContexte, COL_ID, false); } if ($menuId !== NULL) { $mMenu = new MMenu($menuId); $mListeMenusContextes = $mMenu->ListeMenusContextes(); $mListeMenusContextes->Charger(); $listeMenusContextes = $mListeMenusContextes->GetListe(); if (count($listeMenusContextes) === 0) { GContexte::SetContexte(CONT_VIDE); } else { GContexte::ResetContextes(); foreach ($listeMenusContextes as $mMenuContexte) { $nom = $mMenuContexte->Contexte()->Nom(); $rechargement = true; switch ($nom) { case CONT_ADMINISTRATION: $rechargement = false; break; } GContexte::AjouterContexte($nom, $rechargement); } } } //else // GContexte::SetContexte(CONT_VIDE); }
<?php require_once 'cst.php'; require_once PATH_METIER . 'mListeGroupes.php'; require_once PATH_METIER . 'mListeJeux.php'; require_once PATH_METIER . 'mCommunaute.php'; require_once PATH_METIER . 'mTypeGroupe.php'; require_once PATH_METIER . 'mTypeJeu.php'; require_once PATH_METIER . 'mServeur.php'; require_once PATH_METIER . 'mEtatRecrutement.php'; if (GDroit::EstConnecte(true) === true) { $groupe = GContexte::LirePost(COL_ID); // Groupe vide. if ($groupe == NULL) { GSession::Groupe(COL_ID, NULL, true); GSession::Groupe(COL_NOM, NULL, true); } else { // On stocke en session les informations du groupe. $mGroupe = new MGroupe($groupe); $mGroupe->AjouterColSelection(COL_NOM); $mGroupe->AjouterColSelection(COL_DESCRIPTION); $mGroupe->AjouterColSelection(COL_JEU); $mGroupe->AjouterColSelection(COL_TYPEGROUPE); $mJeu = $mGroupe->AjouterJointure(COL_JEU, COL_ID); $mJeu->AjouterColSelection(COL_LIBELLE); $mGroupe->Charger(); GSession::Groupe(COL_ID, $groupe, true); GSession::Groupe(COL_NOM, $mGroupe->Nom(), true); GSession::Groupe(COL_DESCRIPTION, $mGroupe->Description(), true); GSession::Groupe(COL_TYPEGROUPE, $mGroupe->TypeGroupe()->Id(), true); GSession::Groupe(COL_JEU, $mGroupe->Jeu()->Id(), true);
<?php require_once 'cst.php'; $bal = new SBalise(BAL_DIV); $bal->SetText('accueil<br/><br/><br/><br/>'); GContexte::AjouterContenu(CADRE_CONTENU_CONTENU, $bal);
<?php require_once 'cst.php'; require_once INC_GSESSION; GReponse::Debut(); $contexte = GSession::LirePost('contexte'); if ($contexte != NULL) { GContexte::SupprimerDuContexte($contexte); } GReponse::Fin();
GReferentiel::AjouterReferentiel($nomReferentiel, $mListe, array(COL_ID, array(COL_LIBELLE, COL_LIBELLE)), true); GReferentiel::GetDifferentielReferentielForSelect($nomReferentiel, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); break; case COL_SERVEUR: $jeu = GContexte::LireVariablePost($nomContexte, COL_JEU); $mListe = new MListeServeurs(); if ($jeu !== NULL) { $mListe->AjouterColSelection(COL_ID); $mListe->AjouterColSelection(COL_LIBELLE); $mListe->AjouterColOrdre(COL_LIBELLE); $mListe->AjouterFiltreEgal(COL_JEU, $jeu); $mListe->Charger(); } GReferentiel::AjouterReferentiel($nomReferentiel, $mListe, array(COL_ID, array(COL_LIBELLE, COL_LIBELLE)), true); GReferentiel::GetDifferentielReferentielForSelect($nomReferentiel, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); break; case COL_TYPEGROUPE: $jeu = GContexte::LireVariablePost($nomContexte, COL_JEU); $mListe = new MListeTypesGroupes(); if ($jeu !== NULL) { $mListe->AjouterColSelection(COL_ID); $mListe->AjouterColSelection(COL_LIBELLE); $mListe->AjouterColOrdre(COL_LIBELLE); $mListe->AjouterFiltreEgal(COL_JEU, $jeu); $mListe->Charger(); } GReferentiel::AjouterReferentiel($nomReferentiel, $mListe, array(COL_ID, array(COL_LIBELLE, COL_LIBELLE)), true); GReferentiel::GetDifferentielReferentielForSelect($nomReferentiel, COL_ID, array(COL_LIBELLE, COL_LIBELLE)); break; } }
$creerJoueurForm->AjouterInputText(1, 1, GSession::Libelle(LIB_CON_EMAIL), '', true, GContexte::FormaterVariable(CONT_CONNEXION, 'login'), '', 1, 70, 70, false, '', GSession::Libelle(LIB_CON_EMAILINFO), GSession::Libelle(LIB_CON_EMAILERREUR), INPUTTEXT_REGEXP_EMAIL_FV); $creerJoueurForm->AjouterInputText(2, 1, GSession::Libelle(LIB_CON_MOTDEPASSE), INPUTTEXT_TYPE_PASSWORD, true, GContexte::FormaterVariable(CONT_CONNEXION, 'motDePasse'), '', 5, 20, 20, false, '', GSession::Libelle(LIB_CON_MOTDEPASSEINFO), GSession::Libelle(LIB_CON_MOTDEPASSEERREUR)); $creerJoueurForm->AjouterInputText(3, 1, GSession::Libelle(LIB_CON_PSEUDO), '', true, GContexte::FormaterVariable(CONT_CONNEXION, 'pseudo'), '', 1, 30, 30, false, '', GSession::Libelle(LIB_CON_PSEUDOINFO), GSession::Libelle(LIB_CON_PSEUDOERREUR)); $label = $creerJoueurForm->AjouterInputLabel(6, 1, GSession::Libelle(LIB_CON_DATENAISSANCE)); $label->AjouterInputText(GSession::Libelle(LIB_CON_ANNEE), '', false, GContexte::FormaterVariable(CONT_CONNEXION, 'annee'), '', 1, 4, 4, false, '', '', '', INPUTTEXT_REGEXP_DECIMAL_FV, 1900, intval(date('Y'))); $label->AjouterInputText(GSession::Libelle(LIB_CON_MOIS), '', false, GContexte::FormaterVariable(CONT_CONNEXION, 'mois'), '', 1, 2, 2, false, '', '', '', INPUTTEXT_REGEXP_DECIMAL_FV, 1, 12); $label->AjouterInputText(GSession::Libelle(LIB_CON_JOUR), '', false, GContexte::FormaterVariable(CONT_CONNEXION, 'jour'), '', 1, 2, 2, false, '', '', '', INPUTTEXT_REGEXP_DECIMAL_FV, 1, 31); $creerJoueurForm->SetCadreBoutons(2, 1, 1, 2); $creerJoueurForm->AjouterInputButtonValiderAjaxContexte(1, 1, CONT_CONNEXION, 'CreerJoueur'); $creerJoueurForm->AjouterInputButtonAnnuler(1, 2); $connexionForm = new SForm('connexion', 1, 2); $connexionForm->SetCadreInputs(1, 1, 1, 2); $select = $connexionForm->AjouterInputNewText(1, 1, GSession::Libelle(LIB_CON_EMAIL), true, GContexte::FormaterVariable(CONT_CONNEXION, 'login'), '', 1, 70, 20, false, '', '', '', INPUTTEXT_REGEXP_EMAIL_FV); $select->AjouterFormulaire(GSession::Libelle(LIB_CON_CREERCOMPTE), $creerJoueurForm); $connexionForm->AjouterInputText(1, 2, GSession::Libelle(LIB_CON_MOTDEPASSE), INPUTTEXT_TYPE_PASSWORD, true, GContexte::FormaterVariable(CONT_CONNEXION, 'motDePasse'), '', 5, 20, 10, false, '', '', ''); $connexionForm->SetCadreBoutons(1, 2, 1, 1); $bouton = $connexionForm->AjouterInputButton(1, 1, '', GSession::Libelle(LIB_CON_CONNEXION), GSession::Libelle(LIB_CON_CONNEXION), true, AJAXFONC_CHARGERCONTEXTES, true, true); $bouton->AjouterParamRetour('contextes[0]', CONT_CONNEXION); GContexte::AjouterContenu(CADRE_INFO_JOUEUR, $connexionForm); } else { if (GDroit::EstConnecte(false) === true && (GSession::Connecte() === false || $dejaCharge === false)) { GSession::Connecte(true); $connecteForm = new SForm('connecte', 1, 2); $connecteForm->SetCadreInputs(1, 1, 1, 1); $connecteForm->AjouterInputInfo(1, 1, GSession::Libelle(LIB_CON_PSEUDO), GSession::Joueur(COL_PSEUDO), true); $connecteForm->SetCadreBoutons(1, 2, 1, 1); $bouton = $connecteForm->AjouterInputButton(1, 1, '', GSession::Libelle(LIB_CON_DECONNEXION), GSession::Libelle(LIB_CON_DECONNEXION), true, AJAXFONC_CHARGERCONTEXTES, true, true); $bouton->AjouterParamRetour('contextes[0]', CONT_DECONNEXION); GContexte::AjouterContenu(CADRE_INFO_JOUEUR, $connecteForm); } }
} else { $auto = GSession::LirePost('auto'); // Cas du rechargement automatique. if ($auto !== NULL && $auto !== '') { GContexte::ChargerContextes(true); } else { $contexte = GSession::LirePost('contexte'); // Cas du rechargement de tous les contextes. if ($contexte === NULL || $contexte === '') { GContexte::ChargerContextes(); } else { $page = GContexte::LireVariablePost($contexte, 'page'); $etage = GContexte::LireVariablePost($contexte, 'etage'); $contenu = GContexte::LireVariablePost($contexte, 'contenu'); // Cas du changement de page pour une liste. if ($contexte !== NULL && $page !== NULL && $page !== '') { SListe::SetChangementPage($page); } else { if ($contexte !== NULL && $etage !== NULL && $etage !== '') { SListe::SetChargementEtage($etage); } else { if ($contexte !== NULL && $contenu !== NULL && $contenu !== '') { SListe::SetChargementContenu($contenu); } } } GContexte::ChargerContexte($contexte); } } } GReponse::Fin();
<?php require_once 'cst.php'; require_once INC_GSESSION; GReponse::Debut(); $contexte = GSession::LirePost('contexte'); $referentiel = GSession::LirePost('ref'); if ($contexte != NULL && $referentiel != NULL) { GContexte::AjouterAuReferentiel($contexte, $referentiel); } GReponse::Fin();
<?php require_once 'cst.php'; require_once INC_GSESSION; require_once INC_SCADRE; require_once INC_SCLASSEUR; if (GDroit::ADroitPopErreur(DROIT_ADMIN) === true) { $ongletContexte = GContexte::LireVariablePost($nomContexte, 'ongletContexte'); $ancienOngletContexte = GContexte::LireVariableSession($nomContexte, 'ongletContexte'); // Si on a changé d'onglet ou que l'on recharge toute la page. if ($ancienOngletContexte !== $ongletContexte) { GContexte::DesactiverContexte($ancienOngletContexte); GContexte::EcrireVariableSession($nomContexte, 'ongletContexte', $ongletContexte); GContexte::AjouterContexte($ongletContexte, true, false); } else { GContexte::ChargerContexte($ancienOngletContexte); } }
<?php require_once 'cst.php'; require_once INC_GSESSION; GReponse::Debut(); $contexte = GSession::LirePost('contexte'); $referentiel = GSession::LirePost('ref'); if ($contexte != NULL && $referentiel != NULL) { GContexte::ChargerReferentielContexte($contexte, $referentiel); } GReponse::Fin();
<?php require_once 'cst.php'; require_once PATH_METIER . 'mListeMonnaies.php'; require_once PATH_COMPOSANTS . 'cListeMonnaiesAdmin.php'; if (GDroit::ADroitPopErreur(DROIT_ADMIN) === true) { $prefixIdClass = PIC_ADM; $cListe = new CListeMonnaiesAdmin($prefixIdClass, 'MonnaiesAdmin', $nomContexte); $mListe = new MListeMonnaies(); $mListe->AjouterColSelection(COL_ID); $mListe->AjouterColSelection(COL_LIBELLE); $mListe->AjouterColSelection(COL_SYMBOLE); $mListe->AjouterColSelection(COL_ACTIVE); $cListe->InjecterListeObjetsMetiers($mListe); if ($dejaCharge === false) { GContexte::AjouterContenu(CADRE_CONTENU_CONTENU, $cListe); } else { GContexte::AjouterListe($cListe); } }
public static function ChargerContexte($nomContexte, $forcage = false) { $contexte = self::$contextes[$nomContexte]; $dejaCharge = $contexte[CONTEXTE_CHARGE]; $rechargement = $contexte[CONTEXTE_RECHARGEMENT]; $rechargementInitialisation = $contexte[CONTEXTE_RECHARGEMENTINITIALISATION]; self::$listes = array(); self::$contenus = array(); self::$onglets = array(); self::$contextesARechargerBis = array(); // Ne charge le contexte que si: // - on est dans le cas d'un rechargement automatique. // - on charge la suite du contexte (dans le cas d'un contexte trop volumineux pour être chargé en une fois). // - il n'a pas été chargé et l'utilisateur charge la page pour la première fois ou a appuyé sur F5. // - on est dans le cas d'un rechargement et le contexte accepte le rechargement. if ($forcage === true || ($dejaCharge === true && $rechargement === true || $dejaCharge === false) && ($rechargementInitialisation === true && self::$initialisation === true || self::$initialisation === false)) { if ($dejaCharge === false) { self::$contextes[$nomContexte][CONTEXTE_CHARGE] = true; } self::ContexteCourant($nomContexte); if ($contexte[CONTEXTE_RECHARGEMENTPERIODE] >= 1) { self::$contextes[$nomContexte][CONTEXTE_DERNIERRECHARGEMENT] = time(); } switch (self::NomContexteGeneral($nomContexte)) { case CONT_ACCUEIL: include PATH_FONCTIONS . 'Accueil/fChargerAccueil.php'; break; case CONT_ACTIVATION: include PATH_FONCTIONS . 'Joueur/fChargerActivation.php'; break; case CONT_ADMINISTRATION: include PATH_FONCTIONS . 'Administration/fChargerAdministration.php'; break; case CONT_AIDE: include PATH_FONCTIONS . 'Aide/fChargerAide.php'; break; case CONT_COMMUNAUTE: include PATH_FONCTIONS . 'Communaute/fChargerCommunautesAdmin.php'; break; case CONT_CONNEXION: include PATH_FONCTIONS . 'Connexion/fConnexion.php'; //self::RechargerContexte(CONT_IDENTIFICATION, true); self::RechargerContexte(CONT_NAVIGATION, true); break; case CONT_CONTEXTE: include PATH_FONCTIONS . 'Contexte/fChargerContextesAdmin.php'; break; case CONT_DECONNEXION: include PATH_FONCTIONS . 'Connexion/fDeconnexion.php'; //self::RechargerContexte(CONT_IDENTIFICATION, true); self::RechargerContexte(CONT_NAVIGATION, true); break; case CONT_CATEGORIE: include PATH_FONCTIONS . 'Forum/Categories/fChargerCategories.php'; break; case CONT_ETATRECRUTEMENT: include PATH_FONCTIONS . 'Recrutement/fChargerEtatsRecrutement.php'; break; case CONT_FONCTIONNALITE: include PATH_FONCTIONS . 'Fonctionnalite/fChargerFonctionnalitesAdmin.php'; break; case CONT_FORUM: include PATH_FONCTIONS . 'Forum/fChargerForums.php'; break; case CONT_GRADECOMMUNAUTE: include PATH_FONCTIONS . 'Droit/fChargerGradeCommunautesAdmin.php'; break; case CONT_GRADECOMMUNAUTEJEU: include PATH_FONCTIONS . 'Droit/fChargerGradeCommunautesJeuxAdmin.php'; break; case CONT_GRADEJEU: include PATH_FONCTIONS . 'Droit/fChargerGradeJeuxAdmin.php'; break; case CONT_GRADEGLOBAL: include PATH_FONCTIONS . 'Droit/fChargerGradesGlobauxAdmin.php'; break; case CONT_GRADEGROUPE: include PATH_FONCTIONS . 'Droit/fChargerGradesGroupesAdmin.php'; break; case CONT_GROUPE: include PATH_FONCTIONS . 'Groupe/fChargerGroupes.php'; break; case CONT_IDENTIFICATION: include PATH_FONCTIONS . 'Connexion/fChargerConnexion.php'; break; case CONT_JEU: include PATH_FONCTIONS . 'Jeu/fChargerJeu.php'; break; case CONT_LANGUE: include PATH_FONCTIONS . 'Langue/fChargerLanguesAdmin.php'; break; case CONT_LIBELLELIBRE: include PATH_FONCTIONS . 'Libelle/fChargerLibellesLibresAdmin.php'; break; case CONT_LIBELLETEXTELIBRE: include PATH_FONCTIONS . 'Libelle/fChargerLibellesTextesLibresAdmin.php'; break; case CONT_LOCALISATION: include PATH_FONCTIONS . 'Communaute/fChargerCommunautes.php'; include PATH_FONCTIONS . 'Langue/fChargerLangues.php'; include PATH_FONCTIONS . 'Groupe/fChargerGroupeConnexion.php'; break; case CONT_MENU: include PATH_FONCTIONS . 'Menu/fChargerMenusAdmin.php'; break; case CONT_MESSAGE: include PATH_FONCTIONS . 'Forum/Messages/fChargerMessages.php'; break; case CONT_MONNAIE: include PATH_FONCTIONS . 'Monnaie/fChargerMonnaiesAdmin.php'; break; case CONT_NAVIGATION: include PATH_FONCTIONS . 'Menu/fChargerNavigation.php'; break; case CONT_NOUVGROUPE: include PATH_FONCTIONS . 'Groupe/fChargerNouveauGroupe.php'; break; case CONT_NOUVJEU: include PATH_FONCTIONS . 'Jeu/fChargerNouveauJeu.php'; break; case CONT_ORIENTATION: include PATH_FONCTIONS . 'General/fChargerOrientation.php'; break; case CONT_PRESENTATION: include PATH_FONCTIONS . 'Presentation/fChargerPresentation.php'; break; case CONT_PRESENTATIONMODULE: $module = self::NomContexteSuffixe($nomContexte); include PATH_FONCTIONS . 'Presentation/fChargerPresentationModule' . $module . '.php'; break; case CONT_SUJET: include PATH_FONCTIONS . 'Forum/Sujets/fChargerSujets.php'; break; case CONT_SUPERGRADE: include PATH_FONCTIONS . 'Droit/fChargerSuperGradesAdmin.php'; break; case CONT_TYPEGROUPE: include PATH_FONCTIONS . 'Groupe/fChargerTypesGroupesAdmin.php'; break; case CONT_TYPEJEU: include PATH_FONCTIONS . 'Jeu/fChargerTypesJeuxAdmin.php'; break; case CONT_TYPELIBELLE: include PATH_FONCTIONS . 'Libelle/fChargerTypesLibellesAdmin.php'; break; case CONT_TYPEPRESENTATIONMODULE: include PATH_FONCTIONS . 'Presentation/fChargerTypesPresentationsModulesAdmin.php'; break; case CONT_VERSION: include PATH_FONCTIONS . 'Version/fChargerVersionsAdmin.php'; break; case CONT_VIDE: include PATH_FONCTIONS . 'General/fChargerVide.php'; break; default: return; } if ($dejaCharge !== true) { $contenus = self::$contenus; while (list($cadre, $contenu) = each($contenus)) { GReponse::AjouterElementContenu($cadre, $contenu); } $onglets = self::$onglets; while (list($i, $onglet) = each($onglets)) { GReponse::AjouterElementOnglet($onglet[CONTEXTE_ONGLET_CLASSEUR], $onglet[CONTEXTE_ONGLET_NOM], $onglet[CONTEXTE_ONGLET_CONTENU], $onglet[CONTEXTE_ONGLET_FONCCHARG], $onglet[CONTEXTE_ONGLET_PARAM], $onglet[CONTEXTE_ONGLET_CHARGE], $onglet[CONTEXTE_ONGLET_ACTIVER]); } } else { self::$listesDejaRechargees = array(); foreach (self::$listes as $liste) { self::MiseAJourListe($liste); } foreach (self::$contenus as $cadre => $contenu) { GReponse::AjouterElementContenu($cadre, $contenu); } foreach (self::$onglets as $onglet) { GReponse::AjouterElementOnglet($onglet[CONTEXTE_ONGLET_CLASSEUR], $onglet[CONTEXTE_ONGLET_NOM], $onglet[CONTEXTE_ONGLET_CONTENU], $onglet[CONTEXTE_ONGLET_FONCCHARG], $onglet[CONTEXTE_ONGLET_PARAM], $onglet[CONTEXTE_ONGLET_CHARGE], $onglet[CONTEXTE_ONGLET_ACTIVER]); } } self::RechargerContextes(true); } }