Gestion des formulaires d'édition d'articles et de groupes
This commit is contained in:
parent
ed24271de0
commit
bb5c4f1a9b
13 changed files with 1227 additions and 148 deletions
|
@ -2,24 +2,16 @@
|
||||||
<BOUCLE_tags(GROUPES_MOTS){grigri = tags}>#SET{id_grpe_tags, #ID_GROUPE} </BOUCLE_tags>
|
<BOUCLE_tags(GROUPES_MOTS){grigri = tags}>#SET{id_grpe_tags, #ID_GROUPE} </BOUCLE_tags>
|
||||||
<BOUCLE_grpes_importants(GROUPES_MOTS){obligatoire=oui}>#SET{grpes_importants,#GET{grpes_importants}|push{#ID_GROUPE}} </BOUCLE_grpes_importants>
|
<BOUCLE_grpes_importants(GROUPES_MOTS){obligatoire=oui}>#SET{grpes_importants,#GET{grpes_importants}|push{#ID_GROUPE}} </BOUCLE_grpes_importants>
|
||||||
|
|
||||||
#SET{id_mot_statut_bien,0}
|
|
||||||
<BOUCLE_statut_bien(GROUPES_MOTS){grigri == statut_bien}>
|
|
||||||
<BOUCLE_articles(MOTS){id_article}{id_groupe}{doublons}>
|
|
||||||
#SET{id_mot_statut_bien, #ID_MOT}
|
|
||||||
</BOUCLE_articles>
|
|
||||||
</BOUCLE_statut_bien>
|
|
||||||
|
|
||||||
<BOUCLE_article(ARTICLES){id_article}{statut}>
|
<BOUCLE_article(ARTICLES){id_article}{statut}>
|
||||||
|
|
||||||
[(#AUTORISER{modifier, article, #ID_ARTICLE})
|
|
||||||
[(#INFO_STATUT{article,#ID_ARTICLE}|=={publie}|non)
|
|
||||||
<a class="btn pull-right btn_une" href="#URL_PAGE{editer_bien,id_article=#ID_ARTICLE }"><i class="fas fa-edit"></i> Éditer</a>
|
|
||||||
]
|
|
||||||
]
|
|
||||||
|
|
||||||
<?php if (isset($GLOBALS['visiteur_session']['statut']) AND $GLOBALS['visiteur_session']['statut'] == '0minirezo') { ?>
|
<section class="section-top section-bottom container">
|
||||||
[(#INCLURE{fond=inclure/bouton_une,id_article=#ENV{id_article}})]
|
|
||||||
<?php } ?>
|
[(#AUTORISER{modifier, article, #ID_ARTICLE})
|
||||||
|
<div class="boutons a-droite">
|
||||||
|
<a class="btn" href="#URL_PAGE{editer_article,id_article=#ID_ARTICLE }"><i class="fas fa-edit"></i> Éditer</a>
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
|
||||||
<h1 class="h1-like #EDIT{titre}">#TITRE</h1>
|
<h1 class="h1-like #EDIT{titre}">#TITRE</h1>
|
||||||
|
|
||||||
|
@ -49,7 +41,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
</BOUCLE_gis>
|
|
||||||
</BOUCLE_article>
|
</BOUCLE_article>
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
[(#ENV{id_article}|?{
|
[(#ENV{id_article}|?{
|
||||||
[(#INCLURE{fond=inclure/bouton_supprimer,id_article=#ENV{id_article}})]
|
<h1>Éditer un article</h1>
|
||||||
[(#INCLURE{fond=inclure/bouton_une,id_article=#ENV{id_article}})]
|
|
||||||
<h1>Éditer l'article n°[(#ENV{id_article})]</h1>
|
|
||||||
,
|
,
|
||||||
<h1>Rédiger un article</h1>
|
<h1>Rédiger un article</h1>
|
||||||
})]
|
})]
|
||||||
|
@ -14,7 +12,7 @@
|
||||||
[(#ENV{id_article}|oui)
|
[(#ENV{id_article}|oui)
|
||||||
[(#AUTORISER{modifier, article, #ENV{id_article}}|?{
|
[(#AUTORISER{modifier, article, #ENV{id_article}}|?{
|
||||||
<div class="ajax">
|
<div class="ajax">
|
||||||
[(#FORMULAIRE_EDITER_ARTICLE{#ENV{id_article}})]<br>
|
[(#FORMULAIRE_EDITER_POST{#ENV{id_article}})]<br>
|
||||||
</div>
|
</div>
|
||||||
,
|
,
|
||||||
<div class="reponse_formulaire reponse_formulaire_erreur">Votre compte ne fait pas partie des auteurs autorisés à modifier cet article.</div>
|
<div class="reponse_formulaire reponse_formulaire_erreur">Votre compte ne fait pas partie des auteurs autorisés à modifier cet article.</div>
|
||||||
|
@ -23,7 +21,7 @@
|
||||||
[(#ENV{id_article}|non)
|
[(#ENV{id_article}|non)
|
||||||
[(#AUTORISER{creer, article}|?{
|
[(#AUTORISER{creer, article}|?{
|
||||||
<div class="ajax">
|
<div class="ajax">
|
||||||
[(#FORMULAIRE_EDITER_ARTICLE)]
|
[(#FORMULAIRE_EDITER_POST)]
|
||||||
</div>
|
</div>
|
||||||
,
|
,
|
||||||
<div class="reponse_formulaire reponse_formulaire_erreur">Votre compte n'a pas les droits suffisants pour créer un article.</div>
|
<div class="reponse_formulaire reponse_formulaire_erreur">Votre compte n'a pas les droits suffisants pour créer un article.</div>
|
||||||
|
@ -37,7 +35,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="ou col-lg-2 text-center"><h2>ou</h2></div>
|
<div class="ou col-lg-2 text-center"><h2>ou</h2></div>
|
||||||
<div class="creer_associer_compte bloc_connexion col-lg-5">
|
<div class="creer_associer_compte bloc_connexion col-lg-5">
|
||||||
[(#FORMULAIRE_INSCRIPTION{#SELF})]
|
[(#FORMULAIRE_INSCRIPTION{6forum,0,#SELF})]
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
]
|
]
|
||||||
|
|
44
content/editer_groupe.html
Normal file
44
content/editer_groupe.html
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<section class="section-top section-bottom">
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
[(#ENV{id_article}|?{
|
||||||
|
<h1>Mettre à jour un groupe</h1>
|
||||||
|
,
|
||||||
|
<h1>Créer un nouveau groupe</h1>
|
||||||
|
})]
|
||||||
|
|
||||||
|
[(#SESSION{id_auteur}|oui)
|
||||||
|
[(#ENV{id_article}|oui)
|
||||||
|
[(#AUTORISER{modifier, article, #ENV{id_article}}|?{
|
||||||
|
<div class="ajax">
|
||||||
|
[(#FORMULAIRE_EDITER_GROUPE{#ENV{id_article}})]<br>
|
||||||
|
</div>
|
||||||
|
,
|
||||||
|
<div class="reponse_formulaire reponse_formulaire_erreur">Votre compte ne fait pas partie des auteurs autorisés à modifier cet article.</div>
|
||||||
|
})]
|
||||||
|
]
|
||||||
|
[(#ENV{id_article}|non)
|
||||||
|
[(#AUTORISER{creer, article}|?{
|
||||||
|
<div class="ajax">
|
||||||
|
[(#FORMULAIRE_EDITER_GROUPE)]
|
||||||
|
</div>
|
||||||
|
,
|
||||||
|
<div class="reponse_formulaire reponse_formulaire_erreur">Votre compte n'a pas les droits suffisants pour créer un article.</div>
|
||||||
|
})]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
[(#SESSION{id_auteur}|non)
|
||||||
|
<div class="row mt-4">
|
||||||
|
<div class="se_connecter bloc_connexion col-lg-5">
|
||||||
|
[(#FORMULAIRE_LOGIN{#SELF})]
|
||||||
|
</div>
|
||||||
|
<div class="ou col-lg-2 text-center"><h2>ou</h2></div>
|
||||||
|
<div class="creer_associer_compte bloc_connexion col-lg-5">
|
||||||
|
[(#FORMULAIRE_INSCRIPTION{#SELF})]
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</section>
|
|
@ -29,6 +29,12 @@ a, a:hover {
|
||||||
color: $couleur-liens;
|
color: $couleur-liens;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* images */
|
||||||
|
img{
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
/* body */
|
/* body */
|
||||||
body{
|
body{
|
||||||
background: $bg-body;
|
background: $bg-body;
|
||||||
|
@ -60,8 +66,6 @@ body{
|
||||||
width: 200px;
|
width: 200px;
|
||||||
transition: all 1s ease;
|
transition: all 1s ease;
|
||||||
img{
|
img{
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
transition: all 1s ease;
|
transition: all 1s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,13 +203,6 @@ body{
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.photo_article{
|
|
||||||
img{
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.bloc-textes{
|
.bloc-textes{
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
@ -227,9 +224,6 @@ body{
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
img{
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
.formulaire_nous_contacter{
|
.formulaire_nous_contacter{
|
||||||
background: none;
|
background: none;
|
||||||
input, textarea{
|
input, textarea{
|
||||||
|
@ -396,22 +390,41 @@ body{
|
||||||
|
|
||||||
.asso-image{
|
.asso-image{
|
||||||
margin: 1.5rem 0;
|
margin: 1.5rem 0;
|
||||||
img{
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/**************** TOUS LES FORMULAIRES DE CONNEXION *******************/
|
/**************** TOUS LES FORMULAIRES DE CONNEXION *******************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
||||||
.boutons .submit {
|
.formulaire_spip .boutons, .boutons{
|
||||||
font-size: 1.5rem;
|
margin: 1rem 0;
|
||||||
|
.btn{
|
||||||
|
font-size: 1.2rem;
|
||||||
line-height: 1rem;
|
line-height: 1rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
border: solid 1px $light;
|
border: solid 1px $light;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
|
margin-left: 1rem;
|
||||||
|
background: $dark;
|
||||||
|
color: $light;
|
||||||
|
&:hover{
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.a-droite{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.btn_supprimer{
|
||||||
|
background: none;
|
||||||
|
color: $red;
|
||||||
|
border: solid 1px $red;
|
||||||
|
&:hover{
|
||||||
|
background: rgb(214, 72, 72)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.submit {
|
||||||
background-color: #4f56cd;
|
background-color: #4f56cd;
|
||||||
color: $light;
|
color: $light;
|
||||||
&:hover{
|
&:hover{
|
||||||
|
@ -419,10 +432,9 @@ body{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.btn.pull-right, .une_OK {
|
|
||||||
margin-left: 2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.formulaire_spip{
|
.formulaire_spip{
|
||||||
background: $fond-formulaires;
|
background: $fond-formulaires;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
|
@ -439,7 +451,7 @@ body{
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/*************** FORMULAIRE DE SAISIE D'ARTICLE ***********************/
|
/*************** FORMULAIRE DE SAISIE D'ARTICLE ***********************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
.formulaire_editer_article {
|
.formulaire_editer_post {
|
||||||
clear: none;
|
clear: none;
|
||||||
.resume textarea { min-height: 25rem; }
|
.resume textarea { min-height: 25rem; }
|
||||||
.upload_vignette {
|
.upload_vignette {
|
||||||
|
@ -451,27 +463,44 @@ body{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.photo_article {
|
||||||
|
|
||||||
.photo_bien {
|
|
||||||
justify-content: left;
|
justify-content: left;
|
||||||
|
display: flex;
|
||||||
.une_photo {
|
.une_photo {
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
max-width: 320px;
|
max-width: 320px;
|
||||||
}
|
}
|
||||||
|
.btn_poubelle{
|
||||||
|
color: red;
|
||||||
|
:hover{
|
||||||
|
color: #ee9e9e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn_une{
|
||||||
|
color: black;
|
||||||
|
:hover{
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
}
|
||||||
.boutons_actions {
|
.boutons_actions {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
background-color: #e0e0e0;
|
||||||
i.green {
|
i.green {
|
||||||
padding: .6rem 1.5rem;
|
padding: .6rem;
|
||||||
|
color: rgb(28, 158, 28);
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
.premier-plan{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
legend {
|
legend {
|
||||||
|
@ -479,6 +508,22 @@ body{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.photo-premier-plan{
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
border: solid 1px #BBB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container fieldset {
|
||||||
|
clear: none;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
border: solid 1px #BBB;
|
||||||
|
padding: 1.5rem;
|
||||||
|
background-color:#FCFCFC;
|
||||||
|
&> div{
|
||||||
|
margin-bottom: 1.2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/****************************** spip_admin ****************************/
|
/****************************** spip_admin ****************************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
137
css/mon_site.css
137
css/mon_site.css
|
@ -11858,6 +11858,12 @@ a, a:hover {
|
||||||
color: #dc7544;
|
color: #dc7544;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* images */
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
/* body */
|
/* body */
|
||||||
body {
|
body {
|
||||||
background: url("../images/bg-web.jpg");
|
background: url("../images/bg-web.jpg");
|
||||||
|
@ -11895,8 +11901,6 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu-principal .navbar-brand img {
|
#menu-principal .navbar-brand img {
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
-webkit-transition: all 1s ease;
|
-webkit-transition: all 1s ease;
|
||||||
transition: all 1s ease;
|
transition: all 1s ease;
|
||||||
}
|
}
|
||||||
|
@ -12052,11 +12056,6 @@ body {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.liste-articles .photo_article img {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.liste-articles .bloc-textes {
|
.liste-articles .bloc-textes {
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
-webkit-box-flex: 1;
|
-webkit-box-flex: 1;
|
||||||
|
@ -12082,10 +12081,6 @@ body {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#nous-contacter img {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nous-contacter .formulaire_nous_contacter {
|
#nous-contacter .formulaire_nous_contacter {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
|
@ -12293,33 +12288,58 @@ body {
|
||||||
margin: 1.5rem 0;
|
margin: 1.5rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.asso-image img {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/**************** TOUS LES FORMULAIRES DE CONNEXION *******************/
|
/**************** TOUS LES FORMULAIRES DE CONNEXION *******************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
.boutons .submit {
|
.formulaire_spip .boutons, .boutons {
|
||||||
font-size: 1.5rem;
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_spip .boutons .btn, .boutons .btn {
|
||||||
|
font-size: 1.2rem;
|
||||||
line-height: 1rem;
|
line-height: 1rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
border: solid 1px #f8f9fa;
|
border: solid 1px #f8f9fa;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
|
margin-left: 1rem;
|
||||||
|
background: #595959;
|
||||||
|
color: #f8f9fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_spip .boutons .btn:hover, .boutons .btn:hover {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_spip .boutons.a-droite, .boutons.a-droite {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-orient: horizontal;
|
||||||
|
-webkit-box-direction: normal;
|
||||||
|
flex-direction: row;
|
||||||
|
-webkit-box-pack: end;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_spip .boutons .btn_supprimer, .boutons .btn_supprimer {
|
||||||
|
background: none;
|
||||||
|
color: #dc3545;
|
||||||
|
border: solid 1px #dc3545;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_spip .boutons .btn_supprimer:hover, .boutons .btn_supprimer:hover {
|
||||||
|
background: #d64848;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_spip .boutons .submit, .boutons .submit {
|
||||||
background-color: #4f56cd;
|
background-color: #4f56cd;
|
||||||
color: #f8f9fa;
|
color: #f8f9fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.boutons .submit:hover {
|
.formulaire_spip .boutons .submit:hover, .boutons .submit:hover {
|
||||||
background-color: #7276ee;
|
background-color: #7276ee;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn.pull-right, .une_OK {
|
|
||||||
margin-left: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formulaire_spip {
|
.formulaire_spip {
|
||||||
background: rgba(255, 255, 255, 0.8);
|
background: rgba(255, 255, 255, 0.8);
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
|
@ -12338,34 +12358,36 @@ body {
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/*************** FORMULAIRE DE SAISIE D'ARTICLE ***********************/
|
/*************** FORMULAIRE DE SAISIE D'ARTICLE ***********************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
.formulaire_editer_article {
|
.formulaire_editer_post {
|
||||||
clear: none;
|
clear: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formulaire_editer_article .resume textarea {
|
.formulaire_editer_post .resume textarea {
|
||||||
min-height: 25rem;
|
min-height: 25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formulaire_editer_article .upload_vignette label {
|
.formulaire_editer_post .upload_vignette label {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formulaire_editer_article .upload_vignette .ajaxbloc {
|
.formulaire_editer_post .upload_vignette .ajaxbloc {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 992px) {
|
@media (min-width: 992px) {
|
||||||
.formulaire_editer_article .upload_vignette .ajaxbloc {
|
.formulaire_editer_post .upload_vignette .ajaxbloc {
|
||||||
clear: initial;
|
clear: initial;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.formulaire_editer_article .photo_bien {
|
.formulaire_editer_post .photo_article {
|
||||||
-webkit-box-pack: left;
|
-webkit-box-pack: left;
|
||||||
justify-content: left;
|
justify-content: left;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formulaire_editer_article .photo_bien .une_photo {
|
.formulaire_editer_post .photo_article .une_photo {
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -12375,25 +12397,70 @@ body {
|
||||||
max-width: 320px;
|
max-width: 320px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formulaire_editer_article .photo_bien .boutons_actions {
|
.formulaire_editer_post .photo_article .btn_poubelle {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_editer_post .photo_article .btn_poubelle :hover {
|
||||||
|
color: #ee9e9e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_editer_post .photo_article .btn_une {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_editer_post .photo_article .btn_une :hover {
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_editer_post .photo_article .boutons_actions {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
background-color: #e0e0e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formulaire_editer_article .photo_bien .boutons_actions i.green {
|
.formulaire_editer_post .photo_article .boutons_actions i.green {
|
||||||
padding: .6rem 1.5rem;
|
padding: .6rem;
|
||||||
|
color: #1c9e1c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formulaire_editer_article .photo_bien .boutons_actions a {
|
.formulaire_editer_post .photo_article .boutons_actions a {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formulaire_editer_article legend {
|
.formulaire_editer_post .photo_article .boutons_actions .premier-plan {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-orient: horizontal;
|
||||||
|
-webkit-box-direction: normal;
|
||||||
|
flex-direction: row;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formulaire_editer_post legend {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.photo-premier-plan {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
border: solid 1px #BBB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container fieldset {
|
||||||
|
clear: none;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
border: solid 1px #BBB;
|
||||||
|
padding: 1.5rem;
|
||||||
|
background-color: #FCFCFC;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container fieldset > div {
|
||||||
|
margin-bottom: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/****************************** spip_admin ****************************/
|
/****************************** spip_admin ****************************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
|
@ -19,8 +19,10 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div class="colophon">
|
<div class="footer-options">
|
||||||
<ul class="nav container">
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<ul class="nav">
|
||||||
<li class="separ">
|
<li class="separ">
|
||||||
<a rel="contents" href="#URL_PAGE{plan}">
|
<a rel="contents" href="#URL_PAGE{plan}">
|
||||||
<i class="fas fa-map"></i> <:plan_site:>
|
<i class="fas fa-map"></i> <:plan_site:>
|
||||||
|
@ -38,6 +40,8 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</BOUCLE_contact>
|
</BOUCLE_contact>
|
||||||
|
</ul>
|
||||||
|
<ul class="nav">
|
||||||
<?php
|
<?php
|
||||||
if (isset($GLOBALS['visiteur_session']['id_auteur']) AND $GLOBALS['visiteur_session']['id_auteur']) {
|
if (isset($GLOBALS['visiteur_session']['id_auteur']) AND $GLOBALS['visiteur_session']['id_auteur']) {
|
||||||
?> <li class="separ">
|
?> <li class="separ">
|
||||||
|
@ -51,19 +55,26 @@ if (isset($GLOBALS['visiteur_session']['id_auteur']) AND $GLOBALS['visiteur_sess
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="separ">
|
<li class="separ">
|
||||||
<a class="" href="[(#URL_PAGE{editer_bien})]" title="Rédiger un article">
|
<a class="" href="[(#URL_PAGE{editer_article})]" title="Rédiger un article">
|
||||||
<i class="fas fa-plus-square"></i> Rédiger un article
|
<i class="fas fa-plus-square"></i> Rédiger un article
|
||||||
</a>
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="separ">
|
||||||
|
<a class="" href="[(#URL_PAGE{editer_groupe})]" title="Gérer mes groupes">
|
||||||
|
<i class="fas fa-globe"></i> Gérer mes groupes
|
||||||
|
</a>
|
||||||
</li><?php
|
</li><?php
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
?> <li class="separ">
|
?> <li class="separ">
|
||||||
<a href="[(#URL_PAGE{editer_bien}|parametre_url{url,#SELF|parametre_url{url,''}})]" rel="nofollow" class='login_modal' title="Connexion">
|
<a href="[(#URL_PAGE{editer_article}|parametre_url{url,#SELF|parametre_url{url,''}})]" rel="nofollow" class='login_modal' title="Connexion">
|
||||||
<i class="fas fa-sign-in"></i> Connexion
|
<i class="fas fa-sign-in"></i> Connexion
|
||||||
</a>
|
</a>
|
||||||
</li><?php
|
</li><?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
</ul>
|
||||||
|
<ul class="nav">
|
||||||
<li class="generator">
|
<li class="generator">
|
||||||
<!--small></small-->
|
<!--small></small-->
|
||||||
<a href="http://gamuza.fr" rel="generator" title="Site réalisé par Gamuza" class="spip_out">[(#CHEMIN{images/gamuza_blanc.svg}|balise_img{GAMUZA}|image_reduire{70,70})]</a>
|
<a href="http://gamuza.fr" rel="generator" title="Site réalisé par Gamuza" class="spip_out">[(#CHEMIN{images/gamuza_blanc.svg}|balise_img{GAMUZA}|image_reduire{70,70})]</a>
|
||||||
|
@ -71,4 +82,6 @@ else {
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
164
formulaires/editer_groupe.html
Normal file
164
formulaires/editer_groupe.html
Normal file
|
@ -0,0 +1,164 @@
|
||||||
|
<link rel="stylesheet" href="[(#CHEMIN{css/tag_editor.css}|compacte|timestamp)]">
|
||||||
|
<div class="formulaire_spip formulaire_#FORM ajax">
|
||||||
|
|
||||||
|
<form name="formulaire_#FORM" action="#ENV{action}" method="post" enctype="multipart/form-data">
|
||||||
|
|
||||||
|
#ACTION_FORMULAIRE{#ENV{action}}
|
||||||
|
|
||||||
|
<div class="boutons a-droite">
|
||||||
|
[(#ENV{id_article}|>{0}|oui)
|
||||||
|
[(#INCLURE{fond=inclure/bouton_supprimer,id_article=#ENV{id_article}})]
|
||||||
|
]
|
||||||
|
<a class="btn" href="[(#URL_PAGE{groupe}|parametre_url{id_article,#ENV{id_article}}|parametre_url{statut,#ENV{statut}})]">
|
||||||
|
<i class="fas fa-search"></i> Voir la page du groupe</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||||
|
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-9">
|
||||||
|
<fieldset>
|
||||||
|
<div class="pays">
|
||||||
|
<label for="id_rubrique">Pays</label>
|
||||||
|
<select id="id_rubrique" name="id_rubrique" class="chosen">
|
||||||
|
<option value=""> </option>
|
||||||
|
<BOUCLE_pays(RUBRIQUES){id_parent = #CONFIG{balint/id_rub_groupes}}{tout}{par titre}>
|
||||||
|
<option value="#ID_RUBRIQUE" [(#ID_RUBRIQUE|=={#RUBRIQUE_SELECTED}|oui) selected="selected"]>#TITRE</option>
|
||||||
|
</BOUCLE_pays>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="ville">
|
||||||
|
<label for="surtitre">Ville</label>
|
||||||
|
<input class="text" type="text" name="surtitre" value="#ENV{surtitre}">
|
||||||
|
</div>
|
||||||
|
<div class="titre">
|
||||||
|
<label for="titre">Nom du groupe</label>
|
||||||
|
<input class="text" type="text" name="titre" value="#ENV{titre}">
|
||||||
|
</div>
|
||||||
|
<div class="soustitre">
|
||||||
|
<label for="soustitre">Adresse des réunions</label>
|
||||||
|
<input class="text" type="text" name="soustitre" value="#ENV{soustitre}">
|
||||||
|
</div>
|
||||||
|
<div class="dates">
|
||||||
|
<label for="descriptif">Dates et horaires</label>
|
||||||
|
<textarea class="text" type="text" name="descriptif">#ENV{descriptif}</textarea>
|
||||||
|
</div>
|
||||||
|
<div class="texte">
|
||||||
|
<label for="texte">Informations complémentaires</label>
|
||||||
|
<textarea class="text" type="text" name="texte">#ENV{texte}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[(#REM) champ_1 en attente
|
||||||
|
<div class="champ_1">
|
||||||
|
<label for="champ_1">champ_1</label>
|
||||||
|
<textarea id="champ_1" name="champ_1" placeholder="Le champ_1...">#ENV{champ_1}</textarea>
|
||||||
|
OU
|
||||||
|
<input class="text" type="text" name="champ_1" value="#ENV{champ_1}" placeholder="Le champ_1">
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
[(#REM) champ_2 en attente
|
||||||
|
<div class="champ_2">
|
||||||
|
<label for="champ_2">Intervenants</label>
|
||||||
|
<textarea id="champ_2" name="champ_2" placeholder="le champ_2...">#ENV{champ_2}</textarea>
|
||||||
|
OU
|
||||||
|
<input class="text" type="text" name="champ_2" value="#ENV{champ_2}" placeholder="Le champ_2">
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
[(#REM) les champs non utilisés
|
||||||
|
<div class="references">
|
||||||
|
<label for="references">Références utilisées</label>
|
||||||
|
<textarea id="references" name="descriptif">#ENV{descriptif}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ressources">
|
||||||
|
<label for="ressources">Ressources pour aller plus loin</label>
|
||||||
|
<textarea id="ressources" name="chapo">#ENV{chapo}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="credits">
|
||||||
|
<label for="credits">Crédits</label>
|
||||||
|
<textarea id="credits" name="surtitre">#ENV{surtitre}</textarea>
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="upload_vignette">
|
||||||
|
<legend><i class="fas fa-image"></i> Photos</legend>
|
||||||
|
<label for=""><small>largeur conseillée: entre 1024 et 2048 pixels</small></label>
|
||||||
|
<div class="ajax">
|
||||||
|
<INCLURE{fond=inclure/bigform,env}>
|
||||||
|
</div>
|
||||||
|
<INCLURE{fond=inclure/photos_article,env,id_article=#ENV{id_article},ajax=les_photos}>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
[(#REM)
|
||||||
|
<fieldset>
|
||||||
|
<legend><i class="fas fa-globe"></i> Localisation</legend>
|
||||||
|
|
||||||
|
[(#SAISIE{carte,editer_gis_oui,env})]
|
||||||
|
|
||||||
|
[(#SAISIE{input,lat,
|
||||||
|
label=<:gis:lat:>,
|
||||||
|
defaut=#ENV{lat,#CONFIG{gis/lat,0}},
|
||||||
|
obligatoire=oui})]
|
||||||
|
[(#SAISIE{input,lon,
|
||||||
|
label=<:gis:lon:>,
|
||||||
|
defaut=#ENV{lon,#CONFIG{gis/lon,0}},
|
||||||
|
obligatoire=oui})]
|
||||||
|
</fieldset>
|
||||||
|
]
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-lg-3">
|
||||||
|
|
||||||
|
[(#SET{T_id_auteurs, #ENV{T_id_auteurs}|sinon{#ARRAY}})]
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend><i class="fas fa-users"></i> Responsables</legend>
|
||||||
|
<label for="auteurs">Animateurs du groupe</label>
|
||||||
|
<select id="auteurs" name="Tauteurs[]" class="chosen" multiple>
|
||||||
|
<option value=""> </option>
|
||||||
|
<BOUCLE_auteurs(AUTEURS){tous}>
|
||||||
|
<option value="#ID_AUTEUR" [(#ID_AUTEUR|in_array{#GET{T_id_auteurs}}|oui) selected]>#NOM</option>
|
||||||
|
</BOUCLE_auteurs>
|
||||||
|
</select>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<div class="boutons text-center">
|
||||||
|
<button type="submit" class="submit btn">
|
||||||
|
<i class="fas fa-save"></i> Enregistrer</a>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="[(#CHEMIN{js/tag_editor.min.js}|timestamp)]" type="text/javascript"></script>
|
||||||
|
<script src="[(#CHEMIN{js/caret.min.js}|timestamp)]" type="text/javascript"></script>
|
||||||
|
<script src="[(#CHEMIN{js/editer_article.js}|compacte|timestamp)]" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var T_hashtag = [
|
||||||
|
<BOUCLE_gp_mots(GROUPES_MOTS){grigri=tags}>
|
||||||
|
<BOUCLE_htags(MOTS){id_groupe}>
|
||||||
|
"#TITRE",
|
||||||
|
</BOUCLE_htags>
|
||||||
|
</BOUCLE_gp_mots>
|
||||||
|
]
|
||||||
|
|
||||||
|
var T_hastag_ini = [
|
||||||
|
<BOUCLE_gp_mots2(GROUPES_MOTS){grigri=tags}>
|
||||||
|
<BOUCLE_htags2(MOTS){id_groupe}>
|
||||||
|
<BOUCLE_art(ARTICLES){id_article}{id_mot}>
|
||||||
|
"#_htags2:TITRE",
|
||||||
|
</BOUCLE_art>
|
||||||
|
</BOUCLE_htags2>
|
||||||
|
</BOUCLE_gp_mots2>
|
||||||
|
]
|
||||||
|
</script>
|
273
formulaires/editer_groupe.php
Normal file
273
formulaires/editer_groupe.php
Normal file
|
@ -0,0 +1,273 @@
|
||||||
|
<?php
|
||||||
|
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||||
|
|
||||||
|
function formulaires_editer_groupe_charger_dist($id_article=0, $redirect=''){
|
||||||
|
|
||||||
|
$erreurs = array();
|
||||||
|
include_spip('inc/autoriser');
|
||||||
|
if (! autoriser("creer","article")) {
|
||||||
|
$erreurs['message_erreur'] = "Vous devez être connecté pour utiliser ce formulaire.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pour récupérer les champs renseignés en cas d'erreur
|
||||||
|
|
||||||
|
$id_rubrique = intval(_request('id_rubrique'));
|
||||||
|
$titre = _request('titre');
|
||||||
|
$texte = _request('texte');
|
||||||
|
$soustitre = _request('soustitre');
|
||||||
|
$surtitre = _request('surtitre');
|
||||||
|
$descriptif = _request('descriptif');
|
||||||
|
|
||||||
|
$valeurs = array();
|
||||||
|
$valeurs['titre'] = $titre;
|
||||||
|
$valeurs['texte'] = $texte;
|
||||||
|
$valeurs['soustitre'] = $soustitre;
|
||||||
|
$valeurs['rubrique_selected'] = $id_rubrique;
|
||||||
|
$valeurs['descriptif'] = $descriptif;
|
||||||
|
$valeurs['statut'] = $statut;
|
||||||
|
|
||||||
|
if (intval($id_article)) {
|
||||||
|
if (! autoriser("modifier","article", $id_article)) {
|
||||||
|
$erreurs['message_erreur'] = "Vous n'êtes pas autorisé à modifier cet article.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
$valeurs = sql_fetsel('*', 'spip_articles', 'id_article='.intval($id_article));
|
||||||
|
|
||||||
|
$where = array(
|
||||||
|
'id_objet='.intval($id_article),
|
||||||
|
'objet="article"',
|
||||||
|
);
|
||||||
|
$res = sql_allfetsel('id_auteur','spip_auteurs_liens',$where);
|
||||||
|
|
||||||
|
$valeurs['T_id_auteurs'] = array_column($res,'id_auteur');
|
||||||
|
|
||||||
|
$valeurs['rubrique_selected'] = sql_getfetsel('id_rubrique','spip_articles','id_article='. $id_article);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$valeurs['T_id_auteurs'] = array();
|
||||||
|
$valeurs['id_article'] = -1 * intval(session_get('id_auteur'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (intval($id_article)) {
|
||||||
|
$from = array(
|
||||||
|
'spip_gis as G',
|
||||||
|
'spip_gis_liens as L',
|
||||||
|
'spip_articles as A'
|
||||||
|
);
|
||||||
|
$where = array(
|
||||||
|
'L.id_objet='.intval($id_article),
|
||||||
|
'L.objet="article"',
|
||||||
|
'L.id_gis=G.id_gis'
|
||||||
|
);
|
||||||
|
$res = sql_fetsel('G.lat, G.lon', $from, $where);
|
||||||
|
if (count($res)) {
|
||||||
|
$valeurs['lat'] = $res['lat'];
|
||||||
|
$valeurs['lon'] = $res['lon'];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// recup gis
|
||||||
|
|
||||||
|
$valeurs['_bigup_rechercher_fichiers'] = true;
|
||||||
|
|
||||||
|
return $valeurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formulaires_editer_groupe_verifier_dist($id_article=0, $redirect=''){
|
||||||
|
$erreurs = array();
|
||||||
|
|
||||||
|
include_spip('inc/autoriser');
|
||||||
|
if (! autoriser("creer","article")) {
|
||||||
|
$erreurs['message_erreur'] = "Vous devez être connecté pour utiliser ce formulaire.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
if (intval($id_article)) {
|
||||||
|
if (! autoriser("modifier","article", $id_article)) {
|
||||||
|
$erreurs['message_erreur'] = "Vous n'êtes pas autorisé à modifier cet article.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// il faut au minimum titre (nom), surtitre (ville) et id_rubrique (pays) pour créer un article
|
||||||
|
if (_request('titre') == '' OR _request('surtitre') == '' OR _request('id_rubrique') == ''){
|
||||||
|
$erreurs['message_erreur'] = "Il faut obligatoirement un pays, une ville et un nom pour créer un groupe.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
// la rubrique choisie doit être une sous-rubrique du secteur défini en config
|
||||||
|
$id_rubrique = intval(_request('id_rubrique'));
|
||||||
|
$id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.$id_rubrique);
|
||||||
|
if ($id_secteur != lire_config('balint/id_rub_groupes')) {
|
||||||
|
$erreurs['message_erreur'] = "La rubrique choisie comme pays ne correspond au secteur défini pour les groupes dans les options de configuration.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
$bigform = charger_fonction('bigform_verifier','inc');
|
||||||
|
$options = ['mime' => 'image_web','taille_max'=>'2000','largeur_max'=>'2048','hauteur_max'=>'2048'];
|
||||||
|
$bigform($options,$erreurs);
|
||||||
|
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formulaires_editer_groupe_traiter_dist($id_article=0, $redirect=''){
|
||||||
|
$new = $id_article;
|
||||||
|
if (!intval($id_article)) {
|
||||||
|
|
||||||
|
$id_rubrique = intval(_request('id_rubrique'));
|
||||||
|
include_spip('action/editer_article');
|
||||||
|
$set = array(
|
||||||
|
'statut' => 'publie'
|
||||||
|
);
|
||||||
|
$id_article = article_inserer($id_rubrique,$set);
|
||||||
|
}
|
||||||
|
|
||||||
|
// enregistrement de l'image
|
||||||
|
if (!intval($new)) {
|
||||||
|
$where = array(
|
||||||
|
'objet="article"',
|
||||||
|
'id_objet='.intval(session_get('id_auteur')) * -1
|
||||||
|
);
|
||||||
|
sql_updateq('spip_documents_liens',array('id_objet' => intval($id_article)), $where);
|
||||||
|
}
|
||||||
|
|
||||||
|
// maj de l'article
|
||||||
|
$set = array(
|
||||||
|
'titre' => _request('titre'),
|
||||||
|
'texte' => _request('texte'),
|
||||||
|
'soustitre' => _request('soustitre'),
|
||||||
|
'date' => date("Y-m-d H:i:s"),
|
||||||
|
// 'champ_1' => _request('champ_1'),
|
||||||
|
// 'champ_2' => _request('champ_2'),
|
||||||
|
'descriptif' => _request('descriptif'),
|
||||||
|
// 'chapo' => _request('chapo'),
|
||||||
|
'surtitre' => _request('surtitre')
|
||||||
|
);
|
||||||
|
sql_updateq('spip_articles',$set,'id_article='.intval($id_article));
|
||||||
|
|
||||||
|
// maj rubrique si besoin
|
||||||
|
$id_rubrique = intval(_request('id_rubrique'));
|
||||||
|
$id_rub = sql_getfetsel('id_rubrique', 'spip_articles', 'id_article='.$id_article);
|
||||||
|
if ($id_rub != $id_rubrique) {
|
||||||
|
include_spip('action/editer_article');
|
||||||
|
article_instituer($id_article, array('id_parent' => $id_rubrique));
|
||||||
|
}
|
||||||
|
|
||||||
|
// maj association article -> auteurs
|
||||||
|
include_spip('action/editer_liens');
|
||||||
|
$where = array(
|
||||||
|
'id_objet='.intval($id_article),
|
||||||
|
'objet="article"',
|
||||||
|
);
|
||||||
|
$ids_auteurs = sql_allfetsel('id_auteur', 'spip_auteurs_liens', $where);
|
||||||
|
$ids_auteurs = array_column($ids_auteurs, 'id_auteur');
|
||||||
|
$Tauteurs = _request('Tauteurs');
|
||||||
|
|
||||||
|
if (count($Tauteurs)) {
|
||||||
|
$associer = array_diff($Tauteurs, $ids_auteurs);
|
||||||
|
$dissocier = array_diff($ids_auteurs, $Tauteurs);
|
||||||
|
|
||||||
|
objet_associer( array('auteur' => $associer),array('article' => intval($id_article) ));
|
||||||
|
objet_dissocier( array('auteur' => $dissocier) , array('article' =>intval($id_article) ));
|
||||||
|
}
|
||||||
|
|
||||||
|
// maj des mots fermes
|
||||||
|
$T_id_groupe = sql_allfetsel('id_groupe','spip_groupes_mots','grigri!="tags"');
|
||||||
|
$T_id_groupe = array_column($T_id_groupe,'id_groupe');
|
||||||
|
|
||||||
|
foreach ($T_id_groupe as $id_groupe) {
|
||||||
|
$from = array(
|
||||||
|
'spip_mots as M',
|
||||||
|
'spip_mots_liens as L'
|
||||||
|
);
|
||||||
|
$where = array(
|
||||||
|
'L.id_objet='.intval($id_article),
|
||||||
|
'L.objet="article"',
|
||||||
|
'L.id_mot=M.id_mot',
|
||||||
|
'M.id_groupe='.$id_groupe
|
||||||
|
);
|
||||||
|
|
||||||
|
$ids_mots = sql_allfetsel('M.id_mot AS id_mot', $from, $where);
|
||||||
|
$ids_mots = array_column($ids_mots, 'id_mot');
|
||||||
|
$coches = _request('id_groupe_'.$id_groupe);
|
||||||
|
if (count($coches)) {
|
||||||
|
$associer = array_diff($coches, $ids_mots);
|
||||||
|
$dissocier = array_diff($ids_mots, $coches);
|
||||||
|
|
||||||
|
objet_associer(array('mot' => $associer),array('article' => intval($id_article)));
|
||||||
|
objet_dissocier(array('mot' => $dissocier), array('article' => intval($id_article)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
include_spip('action/editer_objet');
|
||||||
|
// GIS
|
||||||
|
$lat_def = lire_config('gis/lat');
|
||||||
|
$lon_def = lire_config('gis/lon');
|
||||||
|
$lat = _request('lat');
|
||||||
|
$lon = _request('lon');
|
||||||
|
// 1. recup id_gis si present
|
||||||
|
$from = array(
|
||||||
|
'spip_gis as G',
|
||||||
|
'spip_gis_liens as L',
|
||||||
|
'spip_articles as A'
|
||||||
|
);
|
||||||
|
$where = array(
|
||||||
|
'L.id_objet='.intval($id_article),
|
||||||
|
'L.objet="article"',
|
||||||
|
'L.id_gis=G.id_gis'
|
||||||
|
);
|
||||||
|
$id_gis = sql_getfetsel('G.id_gis', $from, $where);
|
||||||
|
$set = array(
|
||||||
|
'titre' => _request('titre'),
|
||||||
|
'lat' => $lat,
|
||||||
|
'lon' => $lon,
|
||||||
|
'zoom' => 15
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!$id_gis) {
|
||||||
|
$id_gis = sql_insertq('spip_gis',$set);
|
||||||
|
$set = array(
|
||||||
|
'id_gis' => $id_gis,
|
||||||
|
'id_objet' => intval($id_article),
|
||||||
|
'objet' => 'article'
|
||||||
|
);
|
||||||
|
sql_insertq('spip_gis_liens',$set);
|
||||||
|
} else {
|
||||||
|
if ($lat !== $lat_def and $lon !== $lon_def) {
|
||||||
|
objet_modifier('gis', $id_gis, $set);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SEO title et description: créer ou mettre à jour, y compris si les valeurs postées sont vides (= vidage du champ)
|
||||||
|
$id_article = intval($id_article);
|
||||||
|
$seo_titre = _request('seo_titre');
|
||||||
|
$set = array('id_objet' => $id_article, 'objet' => 'article', 'meta_name' => 'title', 'meta_content' => $seo_titre);
|
||||||
|
$where = array("id_objet = $id_article", "objet = 'article'", "meta_name = 'title'");
|
||||||
|
$res = sql_getfetsel('meta_content', 'spip_seo', $where);
|
||||||
|
if ((!$res AND $seo_titre != '')
|
||||||
|
OR ($res != $seo_titre)) {
|
||||||
|
sql_replace('spip_seo', $set, $where);
|
||||||
|
}
|
||||||
|
$seo_descriptif = _request('seo_descriptif');
|
||||||
|
$set = array('id_objet' => $id_article, 'objet' => 'article', 'meta_name' => 'description', 'meta_content' => $seo_descriptif);
|
||||||
|
$where = array("id_objet = $id_article", "objet = 'article'", "meta_name = 'description'");
|
||||||
|
$res = sql_getfetsel('meta_content', 'spip_seo', $where);
|
||||||
|
if ((!$res AND $seo_descriptif != '')
|
||||||
|
OR ($res != $seo_descriptif)) {
|
||||||
|
sql_replace('spip_seo', $set, $where);
|
||||||
|
}
|
||||||
|
|
||||||
|
include_spip('inc/invalideur');
|
||||||
|
suivre_invalideur("id='id_article/1'");
|
||||||
|
|
||||||
|
$retour = array();
|
||||||
|
$retour['message_ok'] = "Le groupe est bien enregistré.";
|
||||||
|
|
||||||
|
//$retour['redirect'] = 'spip.php?page=article&id_article='.$id_article;
|
||||||
|
|
||||||
|
$bigform = charger_fonction('bigform_traiter','inc');
|
||||||
|
$bigform($id_article, 'article');
|
||||||
|
|
||||||
|
|
||||||
|
return $retour;
|
||||||
|
}
|
197
formulaires/editer_post.html
Normal file
197
formulaires/editer_post.html
Normal file
|
@ -0,0 +1,197 @@
|
||||||
|
<link rel="stylesheet" href="[(#CHEMIN{css/tag_editor.css}|compacte|timestamp)]">
|
||||||
|
<div class="formulaire_spip formulaire_#FORM ajax">
|
||||||
|
|
||||||
|
<form name="formulaire_#FORM" action="#ENV{action}" method="post" enctype="multipart/form-data">
|
||||||
|
|
||||||
|
#ACTION_FORMULAIRE{#ENV{action}}
|
||||||
|
<div class="boutons a-droite">
|
||||||
|
[(#ENV{id_article}|>{0}|oui)
|
||||||
|
[(#INCLURE{fond=inclure/bouton_supprimer,id_article=#ENV{id_article}})]
|
||||||
|
]
|
||||||
|
<a class="btn" href="[(#URL_PAGE{article}|parametre_url{id_article,#ENV{id_article}}|parametre_url{statut,#ENV{statut}})]">
|
||||||
|
<i class="fas fa-search"></i> Voir l'article</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||||
|
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-9">
|
||||||
|
<fieldset>
|
||||||
|
<legend><i class="fas fa-pencil"></i> Texte</legend>
|
||||||
|
<div class="titre">
|
||||||
|
<label for="titre">Titre</label>
|
||||||
|
<input class="text" type="text" name="titre" value="#ENV{titre}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="soustitre">
|
||||||
|
<label for="soustitre">Sous-titre</label>
|
||||||
|
<input class="text" type="text" name="soustitre" value="#ENV{soustitre}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="texte">
|
||||||
|
<label for="texte">Texte</label>
|
||||||
|
<textarea class="text" type="text" name="texte">#ENV{texte}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[(#SAISIE{input,date_agenda,label=Date affichée dans l'agenda,obligatoire=non})]
|
||||||
|
|
||||||
|
<div class="descriptif">
|
||||||
|
<label for="descriptif">Résumé</label>
|
||||||
|
<textarea class="text" type="text" name="descriptif">#ENV{descriptif}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[(#REM) champ_1 en attente
|
||||||
|
<div class="champ_1">
|
||||||
|
<label for="champ_1">champ_1</label>
|
||||||
|
<textarea id="champ_1" name="champ_1" placeholder="Le champ_1...">#ENV{champ_1}</textarea>
|
||||||
|
OU
|
||||||
|
<input class="text" type="text" name="champ_1" value="#ENV{champ_1}" placeholder="Le champ_1">
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
[(#REM) champ_2 en attente
|
||||||
|
<div class="champ_2">
|
||||||
|
<label for="champ_2">Intervenants</label>
|
||||||
|
<textarea id="champ_2" name="champ_2" placeholder="le champ_2...">#ENV{champ_2}</textarea>
|
||||||
|
OU
|
||||||
|
<input class="text" type="text" name="champ_2" value="#ENV{champ_2}" placeholder="Le champ_2">
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
[(#REM) les champs non utilisés
|
||||||
|
<div class="references">
|
||||||
|
<label for="references">Références utilisées</label>
|
||||||
|
<textarea id="references" name="descriptif">#ENV{descriptif}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ressources">
|
||||||
|
<label for="ressources">Ressources pour aller plus loin</label>
|
||||||
|
<textarea id="ressources" name="chapo">#ENV{chapo}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="credits">
|
||||||
|
<label for="credits">Crédits</label>
|
||||||
|
<textarea id="credits" name="surtitre">#ENV{surtitre}</textarea>
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="upload_vignette">
|
||||||
|
<legend><i class="fas fa-image"></i> Photos</legend>
|
||||||
|
<label for=""><small>largeur conseillée: entre 1024 et 2048 pixels</small></label>
|
||||||
|
<div class="ajax">
|
||||||
|
<INCLURE{fond=inclure/bigform,env}>
|
||||||
|
</div>
|
||||||
|
<INCLURE{fond=inclure/photos_article,env,id_article=#ENV{id_article},ajax=les_photos}>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
[(#REM)
|
||||||
|
<fieldset>
|
||||||
|
<legend><i class="fas fa-globe"></i> Localisation</legend>
|
||||||
|
|
||||||
|
[(#SAISIE{carte,editer_gis_oui,env})]
|
||||||
|
|
||||||
|
[(#SAISIE{input,lat,
|
||||||
|
label=<:gis:lat:>,
|
||||||
|
defaut=#ENV{lat,#CONFIG{gis/lat,0}},
|
||||||
|
obligatoire=oui})]
|
||||||
|
[(#SAISIE{input,lon,
|
||||||
|
label=<:gis:lon:>,
|
||||||
|
defaut=#ENV{lon,#CONFIG{gis/lon,0}},
|
||||||
|
obligatoire=oui})]
|
||||||
|
</fieldset>
|
||||||
|
]
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-lg-3 formulaire-col-droite">
|
||||||
|
<BOUCLE_doc(DOCUMENTS){id_article}{extension==jpg|png|gif}{statut in prop,prepa,publie}{credits=une}>
|
||||||
|
<div class="photo-premier-plan">
|
||||||
|
[(#FICHIER|image_recadre{320:180,-,focus}|image_reduire{320,180})]
|
||||||
|
</div>
|
||||||
|
</BOUCLE_doc>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend><i class="fas fa-newspaper-o"></i> Statut</legend>
|
||||||
|
<select id="statut" name="statut" class="chosen">
|
||||||
|
<option value="publie" [(#ENV{statut,publie}|=={publie}|oui) selected="selected"]>Publié</option>
|
||||||
|
<option value="prepa" [(#ENV{statut}|=={prepa}|oui) selected="selected"]>Brouillon</option>
|
||||||
|
</select>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend><i class="fas fa-globe"></i> Groupe</legend>
|
||||||
|
|
||||||
|
<select id="id_groupe" name="id_groupe" class="chosen">
|
||||||
|
<option value=""> </option>
|
||||||
|
<BOUCLE_pays(RUBRIQUES){id_parent = #CONFIG{balint/id_rub_groupes}}>
|
||||||
|
<BOUCLE_villes(ARTICLES){id_rubrique = #ID_RUBRIQUE}{tout}{fusion surtitre}{par surtitre}>
|
||||||
|
<optgroup label="#SURTITRE">
|
||||||
|
<BOUCLE_groupes(ARTICLES){surtitre = #SURTITRE}{tout}>
|
||||||
|
<option value="#ID_ARTICLE" [(#ENV{id_groupe}|=={#ID_ARTICLE}|oui) selected="selected"]>#TITRE</option>
|
||||||
|
</BOUCLE_groupes>
|
||||||
|
</optgroup>
|
||||||
|
</BOUCLE_villes>
|
||||||
|
</BOUCLE_pays>
|
||||||
|
</select>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<B_mots_fermes>
|
||||||
|
<fieldset class="mots_fermes">
|
||||||
|
<legend><i class="fas fa-thumb-tack"></i> Emplacements</legend>
|
||||||
|
<BOUCLE_mots_fermes(GROUPES_MOTS){grigri != tags}{si #SESSION{statut}|=={0minirezo}}>
|
||||||
|
<div class="">
|
||||||
|
<select id="id_groupe_#ID_GROUPE" name="id_groupe_#ID_GROUPE[]" class="chosen" [(#UNSEUL|=={non}|oui) multiple]>
|
||||||
|
[(#UNSEUL|=={oui}|oui)
|
||||||
|
<option value=""> </option>
|
||||||
|
]
|
||||||
|
<BOUCLE_mot(MOTS){id_groupe}{par rang}>
|
||||||
|
#SET{selected,''}
|
||||||
|
<BOUCLE_arts(ARTICLES){id_article?}{id_mot?}>
|
||||||
|
[(#ID_MOT|oui) #SET{selected, selected}]
|
||||||
|
</BOUCLE_arts>
|
||||||
|
|
||||||
|
<option value="#ID_MOT" #GET{selected}>#TITRE</option>
|
||||||
|
</BOUCLE_mot>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</BOUCLE_mots_fermes>
|
||||||
|
</fieldset>
|
||||||
|
</B_mots_fermes>
|
||||||
|
|
||||||
|
<div class="boutons text-center">
|
||||||
|
<button type="submit" class="submit btn">
|
||||||
|
<i class="fas fa-save"></i> Enregistrer</a>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="[(#CHEMIN{js/tag_editor.min.js}|timestamp)]" type="text/javascript"></script>
|
||||||
|
<script src="[(#CHEMIN{js/caret.min.js}|timestamp)]" type="text/javascript"></script>
|
||||||
|
<script src="[(#CHEMIN{js/editer_article.js}|compacte|timestamp)]" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var T_hashtag = [
|
||||||
|
<BOUCLE_gp_mots(GROUPES_MOTS){grigri=tags}>
|
||||||
|
<BOUCLE_htags(MOTS){id_groupe}>
|
||||||
|
"#TITRE",
|
||||||
|
</BOUCLE_htags>
|
||||||
|
</BOUCLE_gp_mots>
|
||||||
|
]
|
||||||
|
|
||||||
|
var T_hastag_ini = [
|
||||||
|
<BOUCLE_gp_mots2(GROUPES_MOTS){grigri=tags}>
|
||||||
|
<BOUCLE_htags2(MOTS){id_groupe}>
|
||||||
|
<BOUCLE_art(ARTICLES){id_article}{id_mot}>
|
||||||
|
"#_htags2:TITRE",
|
||||||
|
</BOUCLE_art>
|
||||||
|
</BOUCLE_htags2>
|
||||||
|
</BOUCLE_gp_mots2>
|
||||||
|
]
|
||||||
|
</script>
|
260
formulaires/editer_post.php
Normal file
260
formulaires/editer_post.php
Normal file
|
@ -0,0 +1,260 @@
|
||||||
|
<?php
|
||||||
|
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||||
|
|
||||||
|
function formulaires_editer_post_charger_dist($id_article=0, $redirect=''){
|
||||||
|
|
||||||
|
$erreurs = array();
|
||||||
|
include_spip('inc/autoriser');
|
||||||
|
if (! autoriser("creer","article")) {
|
||||||
|
$erreurs['message_erreur'] = "Vous devez être connecté pour utiliser ce formulaire.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pour récupérer les champs renseignés en cas d'erreur
|
||||||
|
|
||||||
|
$id_rubrique = intval(_request('id_rubrique'));
|
||||||
|
$titre = _request('titre');
|
||||||
|
$texte = _request('texte');
|
||||||
|
$soustitre = _request('soustitre');
|
||||||
|
$date_agenda = _request('date_agenda');
|
||||||
|
$descriptif = _request('descriptif');
|
||||||
|
$statut = _request('statut');
|
||||||
|
$id_groupe = _request('id_groupe');
|
||||||
|
|
||||||
|
$valeurs = array();
|
||||||
|
$valeurs['titre'] = $titre;
|
||||||
|
$valeurs['texte'] = $texte;
|
||||||
|
$valeurs['soustitre'] = $soustitre;
|
||||||
|
$valeurs['date_agenda'] = $date_agenda;
|
||||||
|
$valeurs['descriptif'] = $descriptif;
|
||||||
|
$valeurs['statut'] = $statut;
|
||||||
|
$valeurs['id_groupe'] = $id_groupe;
|
||||||
|
|
||||||
|
if (intval($id_article)) {
|
||||||
|
if (! autoriser("modifier","article", $id_article)) {
|
||||||
|
$erreurs['message_erreur'] = "Vous n'êtes pas autorisé à modifier cet article.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
$valeurs = sql_fetsel('*', 'spip_articles', 'id_article='.intval($id_article));
|
||||||
|
$where = array(
|
||||||
|
'id_objet='.intval($id_article),
|
||||||
|
'objet="article"',
|
||||||
|
);
|
||||||
|
$res = sql_allfetsel('id_auteur','spip_auteurs_liens',$where);
|
||||||
|
$valeurs['T_id_auteurs'] = array_column($res,'id_auteur');
|
||||||
|
$valeurs['rubrique_selected'] = sql_getfetsel('id_rubrique','spip_articles','id_article='. $id_article);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$valeurs['T_id_auteurs'] = array();
|
||||||
|
$valeurs['id_article'] = -1 * intval(session_get('id_auteur'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (intval($id_article)) {
|
||||||
|
$from = array(
|
||||||
|
'spip_gis as G',
|
||||||
|
'spip_gis_liens as L',
|
||||||
|
'spip_articles as A'
|
||||||
|
);
|
||||||
|
$where = array(
|
||||||
|
'L.id_objet='.intval($id_article),
|
||||||
|
'L.objet="article"',
|
||||||
|
'L.id_gis=G.id_gis'
|
||||||
|
);
|
||||||
|
$res = sql_fetsel('G.lat, G.lon', $from, $where);
|
||||||
|
if (count($res)) {
|
||||||
|
$valeurs['lat'] = $res['lat'];
|
||||||
|
$valeurs['lon'] = $res['lon'];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// recup gis
|
||||||
|
|
||||||
|
$valeurs['_bigup_rechercher_fichiers'] = true;
|
||||||
|
return $valeurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formulaires_editer_post_verifier_dist($id_article=0, $redirect=''){
|
||||||
|
$erreurs = array();
|
||||||
|
|
||||||
|
include_spip('inc/autoriser');
|
||||||
|
if (! autoriser("creer","article")) {
|
||||||
|
$erreurs['message_erreur'] = "Vous devez être connecté pour utiliser ce formulaire.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
if (intval($id_article)) {
|
||||||
|
if (! autoriser("modifier","article", $id_article)) {
|
||||||
|
$erreurs['message_erreur'] = "Vous n'êtes pas autorisé à modifier cet article.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// il faut au minimum titre et un texte pour créer un article
|
||||||
|
if (_request('titre') == '' OR _request('texte') == ''){
|
||||||
|
$erreurs['message_erreur'] = "Il faut obligatoirement un titre et un texte pour créer un article.";
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$bigform = charger_fonction('bigform_verifier','inc');
|
||||||
|
$options = ['mime' => 'image_web','taille_max'=>'2000','largeur_max'=>'2048','hauteur_max'=>'2048'];
|
||||||
|
$bigform($options,$erreurs);
|
||||||
|
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formulaires_editer_post_traiter_dist($id_article = 0, $redirect = ''){
|
||||||
|
$new = $id_article;
|
||||||
|
|
||||||
|
$id_rubrique = lire_config('balint/id_rub_articles');
|
||||||
|
|
||||||
|
if (!intval($id_article)) {
|
||||||
|
|
||||||
|
include_spip('action/editer_article');
|
||||||
|
$set = array(
|
||||||
|
'statut' => 'prepa'
|
||||||
|
);
|
||||||
|
$id_article = article_inserer($id_rubrique,$set);
|
||||||
|
}
|
||||||
|
|
||||||
|
// enregistrement de l'image
|
||||||
|
if (!intval($new)) {
|
||||||
|
$where = array(
|
||||||
|
'objet="article"',
|
||||||
|
'id_objet='.intval(session_get('id_auteur')) * -1
|
||||||
|
);
|
||||||
|
sql_updateq('spip_documents_liens',array('id_objet' => intval($id_article)), $where);
|
||||||
|
}
|
||||||
|
|
||||||
|
// maj de l'article
|
||||||
|
$set = array(
|
||||||
|
'titre' => _request('titre'),
|
||||||
|
'texte' => _request('texte'),
|
||||||
|
'soustitre' => _request('soustitre'),
|
||||||
|
'date' => date("Y-m-d H:i:s"),
|
||||||
|
'descriptif' => _request('descriptif'),
|
||||||
|
'date_agenda' => _request('date_agenda'),
|
||||||
|
'statut' => _request('statut'),
|
||||||
|
'id_groupe' => _request('id_groupe')
|
||||||
|
// 'champ_1' => _request('champ_1'),
|
||||||
|
// 'champ_2' => _request('champ_2'),
|
||||||
|
// 'chapo' => _request('chapo'),
|
||||||
|
// 'surtitre' => _request('surtitre')
|
||||||
|
);
|
||||||
|
sql_updateq('spip_articles',$set,'id_article='.intval($id_article));
|
||||||
|
|
||||||
|
// maj association article -> auteurs
|
||||||
|
include_spip('action/editer_liens');
|
||||||
|
$where = array(
|
||||||
|
'id_objet='.intval($id_article),
|
||||||
|
'objet="article"',
|
||||||
|
);
|
||||||
|
$ids_auteurs = sql_allfetsel('id_auteur', 'spip_auteurs_liens', $where);
|
||||||
|
$ids_auteurs = array_column($ids_auteurs, 'id_auteur');
|
||||||
|
$Tauteurs = _request('Tauteurs');
|
||||||
|
if (count($Tauteurs)) {
|
||||||
|
$associer = array_diff($Tauteurs, $ids_auteurs);
|
||||||
|
$dissocier = array_diff($ids_auteurs, $Tauteurs);
|
||||||
|
|
||||||
|
objet_associer( array('auteur' => $associer),array('article' => intval($id_article) ));
|
||||||
|
objet_dissocier( array('auteur' => $dissocier) , array('article' =>intval($id_article) ));
|
||||||
|
}
|
||||||
|
|
||||||
|
// maj des mots fermes
|
||||||
|
$T_id_groupe = sql_allfetsel('id_groupe','spip_groupes_mots','grigri!="tags"');
|
||||||
|
$T_id_groupe = array_column($T_id_groupe,'id_groupe');
|
||||||
|
|
||||||
|
foreach ($T_id_groupe as $id_groupe) {
|
||||||
|
$from = array(
|
||||||
|
'spip_mots as M',
|
||||||
|
'spip_mots_liens as L'
|
||||||
|
);
|
||||||
|
$where = array(
|
||||||
|
'L.id_objet='.intval($id_article),
|
||||||
|
'L.objet="article"',
|
||||||
|
'L.id_mot=M.id_mot',
|
||||||
|
'M.id_groupe='.$id_groupe
|
||||||
|
);
|
||||||
|
|
||||||
|
$ids_mots = sql_allfetsel('M.id_mot AS id_mot', $from, $where);
|
||||||
|
$ids_mots = array_column($ids_mots, 'id_mot');
|
||||||
|
$coches = _request('id_groupe_'.$id_groupe);
|
||||||
|
if (count($coches)) {
|
||||||
|
$associer = array_diff($coches, $ids_mots);
|
||||||
|
$dissocier = array_diff($ids_mots, $coches);
|
||||||
|
|
||||||
|
objet_associer(array('mot' => $associer),array('article' => intval($id_article)));
|
||||||
|
objet_dissocier(array('mot' => $dissocier), array('article' => intval($id_article)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
include_spip('action/editer_objet');
|
||||||
|
// GIS
|
||||||
|
$lat_def = lire_config('gis/lat');
|
||||||
|
$lon_def = lire_config('gis/lon');
|
||||||
|
$lat = _request('lat');
|
||||||
|
$lon = _request('lon');
|
||||||
|
// 1. recup id_gis si present
|
||||||
|
$from = array(
|
||||||
|
'spip_gis as G',
|
||||||
|
'spip_gis_liens as L',
|
||||||
|
'spip_articles as A'
|
||||||
|
);
|
||||||
|
$where = array(
|
||||||
|
'L.id_objet='.intval($id_article),
|
||||||
|
'L.objet="article"',
|
||||||
|
'L.id_gis=G.id_gis'
|
||||||
|
);
|
||||||
|
$id_gis = sql_getfetsel('G.id_gis', $from, $where);
|
||||||
|
$set = array(
|
||||||
|
'titre' => _request('titre'),
|
||||||
|
'lat' => $lat,
|
||||||
|
'lon' => $lon,
|
||||||
|
'zoom' => 15
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!$id_gis) {
|
||||||
|
$id_gis = sql_insertq('spip_gis',$set);
|
||||||
|
$set = array(
|
||||||
|
'id_gis' => $id_gis,
|
||||||
|
'id_objet' => intval($id_article),
|
||||||
|
'objet' => 'article'
|
||||||
|
);
|
||||||
|
sql_insertq('spip_gis_liens',$set);
|
||||||
|
} else {
|
||||||
|
if ($lat !== $lat_def and $lon !== $lon_def) {
|
||||||
|
objet_modifier('gis', $id_gis, $set);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SEO title et description: créer ou mettre à jour, y compris si les valeurs postées sont vides (= vidage du champ)
|
||||||
|
$id_article = intval($id_article);
|
||||||
|
$seo_titre = _request('seo_titre');
|
||||||
|
$set = array('id_objet' => $id_article, 'objet' => 'article', 'meta_name' => 'title', 'meta_content' => $seo_titre);
|
||||||
|
$where = array("id_objet = $id_article", "objet = 'article'", "meta_name = 'title'");
|
||||||
|
$res = sql_getfetsel('meta_content', 'spip_seo', $where);
|
||||||
|
if ((!$res AND $seo_titre != '')
|
||||||
|
OR ($res != $seo_titre)) {
|
||||||
|
sql_replace('spip_seo', $set, $where);
|
||||||
|
}
|
||||||
|
$seo_descriptif = _request('seo_descriptif');
|
||||||
|
$set = array('id_objet' => $id_article, 'objet' => 'article', 'meta_name' => 'description', 'meta_content' => $seo_descriptif);
|
||||||
|
$where = array("id_objet = $id_article", "objet = 'article'", "meta_name = 'description'");
|
||||||
|
$res = sql_getfetsel('meta_content', 'spip_seo', $where);
|
||||||
|
if ((!$res AND $seo_descriptif != '')
|
||||||
|
OR ($res != $seo_descriptif)) {
|
||||||
|
sql_replace('spip_seo', $set, $where);
|
||||||
|
}
|
||||||
|
|
||||||
|
include_spip('inc/invalideur');
|
||||||
|
suivre_invalideur("id='id_article/1'");
|
||||||
|
|
||||||
|
$retour = array();
|
||||||
|
$retour['message_ok'] = "L'article est bien enregistré.";
|
||||||
|
|
||||||
|
$bigform = charger_fonction('bigform_traiter','inc');
|
||||||
|
$bigform($id_article, 'article');
|
||||||
|
|
||||||
|
|
||||||
|
return $retour;
|
||||||
|
}
|
|
@ -140,7 +140,7 @@ function formulaires_inscription_traiter_dist($mode = '', $id = 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. On cree l'auteur en BDD :
|
// 1. On cree l'auteur en BDD :
|
||||||
// statut = 1comite
|
// statut = 6forum
|
||||||
$nom = _request('nom_inscription');
|
$nom = _request('nom_inscription');
|
||||||
$mail_complet = _request('mail_inscription');
|
$mail_complet = _request('mail_inscription');
|
||||||
$password = _request('password');
|
$password = _request('password');
|
||||||
|
@ -153,7 +153,7 @@ function formulaires_inscription_traiter_dist($mode = '', $id = 0) {
|
||||||
// on modifie aussi le statut
|
// on modifie aussi le statut
|
||||||
$set = array(
|
$set = array(
|
||||||
'pass' => $password,
|
'pass' => $password,
|
||||||
'statut' => '1comite'
|
'statut' => '6forum'
|
||||||
);
|
);
|
||||||
auteur_modifier($id_auteur, $set);
|
auteur_modifier($id_auteur, $set);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<a class="btn pull-right btn_une" href="[(#URL_ACTION_AUTEUR{supprimer_bien,#ENV{id_article}})]"
|
<a class="btn btn_supprimer" href="[(#URL_ACTION_AUTEUR{supprimer_article,#ENV{id_article}})]"
|
||||||
onclick="if (!confirm('Etes vous certain de vouloir effacer ce bien ?')) return false;">
|
onclick="if (!confirm('Etes vous certain de vouloir effacer cet article ?')) return false;">
|
||||||
<i class="fas fa-trash"></i> Supprimer
|
<i class="fas fa-trash"></i> Supprimer
|
||||||
</a>
|
</a>
|
||||||
|
|
26
inclure/photos_article.html
Normal file
26
inclure/photos_article.html
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#CACHE{0}
|
||||||
|
[(#ENV{id_article}|=={0}|oui) [(#SESSION{id_auteur}|mult{-1}|setenv{id_article})] ]
|
||||||
|
|
||||||
|
<div class="photo_article row" id="les_photos">
|
||||||
|
<BOUCLE_doc(DOCUMENTS){id_article}{extension==jpg|png|gif}{statut in prop,prepa,publie}{par id_document}>
|
||||||
|
<div class="une_photo col">
|
||||||
|
[(#FICHIER|image_recadre{320:180,-,focus}|image_reduire{320,180})]
|
||||||
|
|
||||||
|
[(#SESSION{statut}|=={0minirezo}|oui)
|
||||||
|
<div class="boutons_actions">
|
||||||
|
<a class="btn btn_poubelle" href="[(#URL_ACTION_AUTEUR{supprimer_photo, [(#ID_DOCUMENT)]-[(#ENV{id_article})]})]" title="Supprimer la photo">
|
||||||
|
<i class="fas fa-trash red"></i>
|
||||||
|
</a>
|
||||||
|
[(#CREDITS*|=={une}|?{
|
||||||
|
<div class="premier-plan"><i class="fas fa-check green"></i> Au premier plan</div>
|
||||||
|
,
|
||||||
|
<a class="btn btn_une" href="[(#URL_ACTION_AUTEUR{promouvoir_photo, [(#ID_DOCUMENT)]-[(#ENV{id_article})]})]" title="Mettre en première photo">
|
||||||
|
<i class="fas fa-check"></i> Mettre au premier plan
|
||||||
|
</a>
|
||||||
|
})]
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
[<div class="titre_img #EDIT{titre}">(#TITRE|sinon{[(#SESSION{statut}|=={0minirezo}|oui)<i>Double cliquez pour ajouter un titre</i>]})</div>]
|
||||||
|
</div>
|
||||||
|
</BOUCLE_doc>
|
||||||
|
</div>
|
Loading…
Add table
Reference in a new issue