function affiche_mon_compte(cible_mon_compte)
{
if (typeof cible_mon_compte == 'undefined') {
cible_mon_compte='main';
}
chargement(cible_mon_compte);
var urlajax = urlwwwMembres+'inscription.php';
googlestat(urlajax);
new Ajax.Updater(cible_mon_compte, urlajax, {method:'post', parameters: {action:'modif'} });
}
function affiche_mon_profil(cible_mon_profil)
{
if (typeof cible_mon_profil == 'undefined') {
cible_mon_profil='content_Profil';
}
//content = 'content_'+cible;
//$('header_'+cible).innerHTML= 'Mon profil';
chargement(cible_mon_profil);
var urlajax = urlwwwCompte+'refresh_profil.php';
googlestat(urlajax);
new Ajax.Updater(cible_mon_profil, urlajax, {method:'post', parameters: {action:'modif'} });
}
function gestion_mes_fichier(cible_mes_fichiers)
{
if (typeof cible_mes_fichiers == 'undefined') {
cible_mes_fichiers='main';
}
chargement(cible_mes_fichiers);
var urlajax = urlwwwCompte+'gestion_mes_fichiers.php';
googlestat(urlajax);
new Ajax.Updater(cible_mes_fichiers, urlajax, {method:'post', parameters: {} });
}
function modif_inscription()
{
formId = 'form_inscription_1001rss';
valeur = Form.serialize(formId);
form = valeur.toQueryParams();
var msg = '';
if(form["passwordn"].length>0)
{
if(form["passwordn"] != form["verif_passwordn"])
{
msg += 'Votre mot de passe est différent
';
}
}
if(form["email"].length == 0)
{
msg += 'Vous devez préciser un mail
';
}
if(validateEmail(form["email"]) == false)
{
msg += 'Votre mail n\'est pas valide
';
}
if(msg.length == 0)
{
//fonction inscription
chargement($('retour_message'),6);
url = urlwwwMembres+'action_membre.php';
//$('retour_message'),
new Ajax.Request( url, {
evalScripts: true,
method:'post',
parameters: form,
onSuccess: function(transport) {
retour = transport.responseText;
switch (retour)
{
case '1':
msg = 'Nous avons bien enregistré les modifications de votre profil
';
$('retour_message').innerHTML = msg;
$('form_inscription_1001rss').hide();
affiche_mon_profil();
break;
case '2':
msg = 'Une erreur s\'est produite lors de la modification de votre profil
';
break;
default:
msg = 'Une erreur s\'est produite lors de la modification de votre profil
';
break;
}
$('retour_message').innerHTML = msg;
}
});
//modalAjax.close();
return true;
}
else
{
//alert(msg);
$('retour_message').update(msg);
return false;
}
}
function supprime_fichier_user(fichier,cible)
{
alert(fichier);
if (typeof cible == 'undefined') {
alert(cible);
}
chargement(cible);
var urlajax = urlwwwCompte+'supprime_fichier.php';
new Ajax.Updater(cible, urlajax, {method:'post', parameters: {fichier:fichier} });
}
function affiche_liste_favoris(cible_liste_favoris)
{
if (typeof cible_liste_favoris == 'undefined') {
cible_liste_favoris = 'content_MesFavoris';
}
chargement(cible_liste_favoris);
var urlajax = urlwwwCompte+'affiche_liste_favoris.php';
googlestat(urlajax);
var cont = new Ajax.Request(urlajax, {asynchronous: true, evalScripts: true, method: 'post',
onComplete:function(transport){
$(cible_liste_favoris).innerHTML = transport.responseText;
}
});
if(cont.transport.responseText)
{
}
}
function affiche_mes_favoris(cible_mes_favoris)
{
if (typeof cible_mes_favoris == 'undefined') {
cible_mes_favoris='main';
}
chargement(cible_mes_favoris);
var urlajax = urlwwwCompte+'mes_favoris.php';
googlestat(urlajax);
var cron = new Ajax.Request(urlajax, {method:'post', parameters: {},onComplete:function(transport){
$(cible_mes_favoris).innerHTML = cron.transport.responseText;
affiche_liste_favoris();
affiche_lecteur_favoris();
}
});
}
function affiche_lecteur_favoris(page,id_flux)
{
if (typeof id_flux == 'undefined') {
id_flux = '';
$('save_action').value = "flux";
}
if (typeof page == 'undefined' || page=='') {
page = 1;
}
if(id_flux != "")
{
$('save_id_flux').value = id_flux;
}
cat = $('save_id_rep').value;
cibleLecteur = $('content_LecteurFavorisRSS');
log.profile( 'chargement des fluxs' );
chargement(cibleLecteur);
var url = urlwwwCompte+'lecteurRss_favoris.php';
var form = 'form_lecteur_1001rss';
var valeur = Form.serialize(form);
var form = valeur.toQueryParams();
form["id_cat"]=cat;
form["id_flux"]=id_flux;
form["page"]=page;
form["favoris"]=1;
googlestat(url);
new Ajax.Request(url, {method: 'post',parameters: form,
onFailure:function(e){
log.error('Erreur de refresh flux');},
onComplete: function(transport) {
log.profile( 'chargement des fluxs' );
preview = transport.responseText;
cibleLecteur.innerHTML = preview;
}});
}
function supprime_favoris(id_flux)
{
type='favoris';
var url = urlwwwSysteme+'actionFavorisFlux.php';
new Ajax.Request(url, {method:'post', parameters: {id_flux:id_flux,type:type},
onComplete:function(transport){
affiche_mes_favoris('main');
}
});
}
function rss_validator(cible_validator)
{
if (typeof cible_validator == 'undefined') {
cible_validator='main';
}
chargement(cible_validator);
var urlajax = urlwwwCompte+'rss_validator.php';
googlestat(urlajax);
new Ajax.Updater(cible_validator, urlajax, {method:'post', parameters: {} });
}
function personnaliser_parseur(cible_parseur)
{
if (typeof cible_parseur == 'undefined') {
cible_parseur='main';
}
chargement(cible_parseur);
var urlajax = urlwwwCompte+'perso_parseur.php';
googlestat(urlajax);
new Ajax.Updater(cible_parseur, urlajax, {method:'post', parameters: {} });
}
function gestion_site(cible_site)
{
if (typeof cible_site == 'undefined') {
cible_site='main';
}
chargement(cible_site);
var urlajax = urlwwwCompte+'gestion_site/gestion_site.php';
googlestat(urlajax);
new Ajax.Updater(cible_site, urlajax, {method:'post', parameters: {} });
}
function recherche_site()
{
search_site = $('search_site').value;
//alert(search_site);
content = 'resultat_site';
chargement(content);
var urlajax = urlwwwCompte+'recherche_site.php';
new Ajax.Updater(content, urlajax, {method:'post', parameters: {search_site:search_site} });
}
function info_recup_site(id_site)
{
content = 'resultat_site';
chargement(content);
var urlajax = urlwwwCompte+'gestion_site/info_recup_site.php';
new Ajax.Updater(content, urlajax, {method:'post', evalScripts: true, parameters: {id_site:id_site} });
}
function check_hash_site(hash,url_site,id_site)
{
var url = urlwwwSysteme+'check_hash_site.php';
$('action_verif').show();
log.profile( 'verification site' );
new Ajax.Request(url, {method:'post', asynchronous:true, evalScripts: true, parameters: {hash:hash, url_site:url_site, id_site:id_site},
onFailure:function(e){
log.error('verification site');
$('action_verif').hide();
},
onComplete:function(transport){
var resultat = transport.responseText;
if(resultat == 1)
{
$('verif_site').src = urlimages+'check.gif';
setTimeout("modalAjax.close()",autoCloseTimeOut);
gestion_site();
}
else
{
$('verif_site').src = urlimages+'interdit.gif';
}
$('action_verif').hide();
log.profile( 'verification site' );
}
});
}
function action_site_user()
{
values = Form.serialize('formSite');
paramValues = values.toQueryParams();
cible = $('messageRetour');
chargement(cible);
var url = urlAdmin+'modifierSite.php';
var url = urlwwwCompte+'gestion_site/modifierSite.php';
new Ajax.Updater(cible,url, {method:'post', evalScripts: true, parameters: paramValues});
}
function action_flux_user()
{
values = Form.serialize('formFlux');
paramValues = values.toQueryParams();
cible = $('messageRetour');
chargement(cible);
var url = urlwwwCompte+'gestion_site/modifFluxRss.php';
new Ajax.Updater(cible,url, {method:'post', evalScripts: true, parameters: paramValues});
}
function affiche_lien_partenaire(id_site)
{
if (typeof cible_lien_partenaire == 'undefined') {
cible_lien_partenaire = 'content_infoSite';
}
chargement(cible_lien_partenaire);
var url = urlwwwCompte+'gestion_site/lien_partenaire.php';
var cont = new Ajax.Request(url, {asynchronous: true, evalScripts: true, method: 'post', parameters:{id_site:id_site},
onComplete:function(transport){
$(cible_lien_partenaire).innerHTML = cont.transport.responseText;
}
});
if(cont.transport.responseText)
{
}
}
function affiche_statistique(id_site)
{
if (typeof cible_statistique == 'undefined') {
cible_statistique = 'content_infoSite';
}
chargement(cible_statistique);
var url = urlwwwCompte+'gestion_site/statisques.php';
var cont = new Ajax.Request(url, {asynchronous: true, evalScripts: true, method: 'post', parameters:{id_site:id_site},
onComplete:function(transport){
$(cible_statistique).innerHTML = cont.transport.responseText;
}
});
if(cont.transport.responseText)
{
}
}
function affiche_messagerie()
{
if (typeof cibleMessagerie == 'undefined') {
cibleMessagerie='main';
}
chargement(cibleMessagerie);
var urlajax = urlwwwCompte+'messagerie/messagerie.php';
googlestat(urlajax);
var cont = new Ajax.Request(urlajax, {method:'post', parameters: {},
onComplete:function(transport){
$(cibleMessagerie).innerHTML = cont.transport.responseText;
}
});
}
function envoyer_message()
{
var form = 'form_envoi_message';
var valeur = Form.serialize(form);
var form = valeur.toQueryParams();
listecontact.update();
var oEditorContenu = FCKeditorAPI.GetInstance("message") ;
var valeur_contenu = oEditorContenu.GetHTML() ;
form["message"] = valeur_contenu;
form["action"] = "envoi_message";
form["listeContact"] = $F('ListeContactInput');
var url = urlwwwCompte+'messagerie/envoi_message.php';
log.info( 'envoi message' );
log.profile( 'envoi message' );
googlestat(url);
new Ajax.Request(url, {method:'post', asynchronous:true, evalScripts: true, parameters: form,
onFailure:function(e){
log.error('erreur envoie message');
},
onComplete:function(transport){
var resultat = transport.responseText;
if(resultat == 1)
{
setTimeout("modalAjax.close()",autoCloseTimeOut);
refresh_liste_message(1,1);
//affiche_messagerie();
}
else
{
$('retourMessage').innerHTML = resultat;
}
log.profile( 'envoi message' );
}
});
}
function refresh_liste_message(page,type_message)
{
if (typeof cibleMessage == 'undefined') {
cibleMessage = 'content_MesMessages';
}
if (typeof page == 'undefined') {
page=1;
}
if (typeof type_message == 'undefined') {
type_message=0;
}
chargement(cibleMessage);
var urlajax = urlwwwCompte+'messagerie/refresh_mes_messages.php';
googlestat(urlajax);
var cont = new Ajax.Request(urlajax, {asynchronous: true, evalScripts: true, method: 'post', parameters:{page:page,type_message:type_message},
onComplete:function(transport){
$(cibleMessage).innerHTML = cont.transport.responseText;
}
});
if(cont.transport.responseText)
{
}
}
function refresh_lire_message(type_message,id_message)
{
if (typeof cible_lire_message == 'undefined') {
cible_lire_message = 'content_LecteurMessage';
}
if (typeof type_message == 'undefined') {
type_message=0;
}
if (typeof id_message == 'undefined') {
id_message=0;
}
chargement(cible_lire_message);
var urlajax = urlwwwCompte+'messagerie/lire_messages.php';
googlestat(urlajax);
var cont = new Ajax.Request(urlajax, {asynchronous: true, evalScripts: true, method: 'post', parameters:{type_message:type_message,id_message:id_message},
onComplete:function(transport){
verif_message();
$(cible_lire_message).innerHTML = cont.transport.responseText;
}
});
if(cont.transport.responseText)
{
}
}
function supprime_message(type_message,id_message)
{
if (typeof type_message == 'undefined') {
type_message=0;
}
if (typeof id_message == 'undefined') {
id_message=0;
}
var urlajax = urlwwwCompte+'messagerie/supprime_messages.php';
googlestat(urlajax);
var cont = new Ajax.Request(urlajax, {asynchronous: true, evalScripts: true, method: 'post', parameters:{type_message:type_message,id_message:id_message},
onComplete:function(transport){
refresh_liste_message(1,type_message);
}
});
if(cont.transport.responseText)
{
}
}
function archiver_message(type_message,id_message)
{
if (typeof type_message == 'undefined') {
type_message=0;
}
if (typeof id_message == 'undefined') {
id_message=0;
}
var urlajax = urlwwwCompte+'messagerie/archiver_message.php';
googlestat(urlajax);
var cont = new Ajax.Request(urlajax, {asynchronous: true, evalScripts: true, method: 'post', parameters:{type_message:type_message,id_message:id_message},
onComplete:function(transport){
refresh_liste_message(1,type_message);
}
});
if(cont.transport.responseText)
{
}
}
function dearchiver_message(type_message,id_message)
{
if (typeof type_message == 'undefined') {
type_message=0;
}
if (typeof id_message == 'undefined') {
id_message=0;
}
var urlajax = urlwwwCompte+'messagerie/dearchiver_message.php';
googlestat(urlajax);
var cont = new Ajax.Request(urlajax, {asynchronous: true, evalScripts: true, method: 'post', parameters:{type_message:type_message,id_message:id_message},
onComplete:function(transport){
refresh_liste_message(1,type_message);
}
});
if(cont.transport.responseText)
{
}
}
function affiche_carnet_adresse(cible_carnet_adresse)
{
if (typeof cible_carnet_adresse == 'undefined') {
cible_carnet_adresse='main';
}
chargement(cible_carnet_adresse);
var urlajax = urlwwwCompte+'carnet_adresse.php';
googlestat(urlajax);
new Ajax.Updater(cible_carnet_adresse, urlajax, {method:'post', parameters: {} });
}
function ajouter_contact(id_user,id_contact,username)
{
//alert(id_user+id_contact+username);
action='ajout';
var url = urlwwwSysteme+'actionContact.php';
if( $('nb_contact_attente') )input_postit = $('nb_contact_attente').innerHTML;
googlestat(url);
new Ajax.Request(url, {method:'post', parameters: {action:action,id_user:id_user,id_contact:id_contact,username:username},
onComplete:function(transport){
if( $('nb_contact_attente') )$('nb_contact_attente').innerHTML = parseInt(input_postit)+1;
refresh_contact();
}
});
}
function supprime_contact(id_user_contact)
{
action='supprime';
var url = urlwwwSysteme+'actionContact.php';
googlestat(url);
new Ajax.Request(url, {method:'post', parameters: {action:action,id_user_contact:id_user_contact},
onComplete:function(transport){
affiche_carnet_adresse();
}
});
}
function change_etat_contact(id_user_contact,etat,id_contact,id_user)
{
action='etat';
var url = urlwwwSysteme+'actionContact.php';
googlestat(url);
new Ajax.Request(url, {method:'post', parameters: {action:action,id_user_contact:id_user_contact,etat:etat,id_contact:id_contact,id_user:id_user},
onComplete:function(transport){
affiche_carnet_adresse();
}
});
}
function refresh_contact()
{
cible_contact = $('liste_favoris_attente');
chargement(cible);
var urlajax = urlwwwCompte+'refresh_contact.php';
googlestat(urlajax);
new Ajax.Updater(cible_contact, urlajax, {method:'post', parameters: {} });
}