Utiliser le nouveau pipeline pour ajouter un formulaire de gestion des rôles. Nécessite la dernière version de sélections éditoriales.
parent
76a7da6402
commit
70bb572017
@ -1,11 +1,16 @@
|
||||
* text=auto !eol
|
||||
base/roles_selections.php -text
|
||||
formulaires/editer_roles_selection.html -text
|
||||
formulaires/editer_roles_selection.php -text
|
||||
lang/paquet-roles_selections_fr.php -text
|
||||
lang/roles_selections_fr.php -text
|
||||
/paquet.xml -text
|
||||
prive/objets/editer/roles_selections.html -text
|
||||
prive/objets/liste/selections_roles_associer.html -text
|
||||
prive/objets/liste/selections_roles_lies.html -text
|
||||
prive/style_prive_plugin_roles_selections.html -text
|
||||
prive/themes/spip/images/roles_selections-128.png -text
|
||||
prive/themes/spip/images/roles_selections-32.png -text
|
||||
prive/themes/spip/images/roles_selections-64.png -text
|
||||
/roles_selections_administrations.php -text
|
||||
/roles_selections_pipelines.php -text
|
||||
|
@ -0,0 +1,31 @@
|
||||
<div class="formulaire_spip formulaire_editer formulaire_#FORM[ (#ENV{editable}|non)non_editable]">
|
||||
|
||||
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV**{message_ok})</p>]
|
||||
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||
|
||||
<BOUCLE_editable(CONDITION){si #ENV{editable}}>
|
||||
<form method='post' action='#ENV{action}'><div>
|
||||
[(#REM) declarer les hidden qui declencheront le service du formulaire
|
||||
parametre : url d'action ]
|
||||
#ACTION_FORMULAIRE
|
||||
|
||||
<div class="editer-groupe submit">
|
||||
<B_roles>
|
||||
<div class="roles">
|
||||
<strong class="caption">[(#TOTAL_BOUCLE|singulier_ou_pluriel{roles:role_titre,roles:roles_titre})] :</strong>
|
||||
<BOUCLE_roles(selections_liens){id_selection}{objet}{id_objet}{par role}{", "}>[(#ROLE|role{selections})]</BOUCLE_roles>
|
||||
</div>
|
||||
</B_roles>
|
||||
<INCLURE{fond=formulaires/inc-editer_liens_actions_roles,
|
||||
env,
|
||||
id=#ID_SELECTION,
|
||||
cle=selection-#ID_SELECTION-#OBJET-#ID_OBJET}
|
||||
>
|
||||
</div>
|
||||
|
||||
[(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
|
||||
<!--extra-->
|
||||
</div></form>
|
||||
</BOUCLE_editable>
|
||||
|
||||
</div>
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/*
|
||||
* Gestion du formulaire d'édition des rôles d'une sélection éditoriale
|
||||
*
|
||||
**/
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Chargement des valeurs
|
||||
*
|
||||
* @param string|int $id_selection
|
||||
* @param string $objet
|
||||
* @param string|int $id_objet
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function formulaires_editer_roles_selection_charger_dist($id_selection, $objet, $id_objet) {
|
||||
|
||||
// Récupèrer les valeurs de editer_liens
|
||||
$charger_editer_liens = charger_fonction('charger', 'formulaires/editer_liens');
|
||||
$valeurs = $charger_editer_liens('selection', $objet, $id_objet, array('id_selection' => $id_selection));
|
||||
|
||||
return $valeurs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Traiter le post des informations d'édition de liens
|
||||
*
|
||||
* @param string|int $id_selection
|
||||
* @param string $objet
|
||||
* @param string|int $id_objet
|
||||
* @param array $options
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function formulaires_editer_roles_selection_traiter_dist($id_selection, $objet, $id_objet) {
|
||||
|
||||
// Récupérer les traitements de editer_liens
|
||||
$traiter_editer_liens = charger_fonction('traiter', 'formulaires/editer_liens');
|
||||
$retours = $traiter_editer_liens('selection', $objet, $id_objet, array('id_selection' => $id_selection));
|
||||
|
||||
return $retours;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
[(#REM)
|
||||
|
||||
Petit formulaire pour éditer les rôles d'une sélection
|
||||
|
||||
Paramètres :
|
||||
**obligatoires
|
||||
|
||||
- **id_selection
|
||||
- **objet
|
||||
- **id_objet
|
||||
]
|
||||
<div class="ajax">
|
||||
#FORMULAIRE_EDITER_ROLES_SELECTION{#ENV{id_selection}, #ENV{objet}, #ENV{id_objet}}
|
||||
</div>
|
@ -0,0 +1,34 @@
|
||||
[(#REM)<style>/*
|
||||
Ce squelette definit les styles de l'espace prive
|
||||
|
||||
Note: l'entete "Vary:" sert a repousser l'entete par
|
||||
defaut "Vary: Cookie,Accept-Encoding", qui est (un peu)
|
||||
genant en cas de "rotation du cookie de session" apres
|
||||
un changement d'IP (effet de clignotement).
|
||||
|
||||
ATTENTION: il faut absolument le charset sinon Firefox croit que
|
||||
c'est du text/html !
|
||||
*/]#CACHE{3600*100,cache-client}
|
||||
#HTTP_HEADER{Content-Type: text/css; charset=utf-8}
|
||||
#HTTP_HEADER{Vary: Accept-Encoding}
|
||||
/*
|
||||
Valeurs par defaut :
|
||||
#SET{claire,##ENV{couleur_claire,edf3fe}} [claire: (#GET{claire});]
|
||||
#SET{foncee,##ENV{couleur_foncee,3874b0}} [foncee: (#GET{foncee});]
|
||||
#SET{left,#ENV{ltr}|choixsiegal{left,left,right}} [left: (#GET{left});]
|
||||
#SET{right,#ENV{ltr}|choixsiegal{left,right,left}} [right: (#GET{right});]
|
||||
#SET{rtl,#ENV{ltr}|choixsiegal{left,'',_rtl}} [rtl: (#GET{rtl});]
|
||||
#SET{dir,#ENV{ltr}|choixsiegal{left,ltr,rtl}} [dir: (#GET{dir});]
|
||||
*/
|
||||
/* Formulaire */
|
||||
.formulaire_editer_roles_selection {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
background-color: transparent;
|
||||
text-align: left;
|
||||
}
|
||||
.formulaire_editer_roles_selection div {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Utitlisation des pipelines par le plugin Rôles de sélections éditoriales
|
||||
*
|
||||
* @plugin Rôles de sélections éditoriales
|
||||
* @copyright 2018
|
||||
* @author Rôles de sélections éditoriales
|
||||
* @licence GNU/GPL
|
||||
* @package SPIP\Roles_selections\Pipelines
|
||||
*/
|
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Affichage des boutons d'action d'une sélection
|
||||
*
|
||||
* => Ajout du formulaire d'édition des rôles
|
||||
*
|
||||
* @param array $flux
|
||||
* Tableau avec le contexte et le HTML initial
|
||||
* @return array
|
||||
* Flux modifié
|
||||
*/
|
||||
function roles_selections_afficher_actions_selection($flux){
|
||||
|
||||
if (
|
||||
!empty($flux['args']['id_selection'])
|
||||
and !empty($flux['args']['objet'])
|
||||
and !empty($flux['args']['id_objet'])
|
||||
) {
|
||||
$contexte = array(
|
||||
'id_selection' => $flux['args']['id_selection'],
|
||||
'objet' => $flux['args']['objet'],
|
||||
'id_objet' => $flux['args']['id_objet'],
|
||||
);
|
||||
if ($editer_roles = recuperer_fond('prive/objets/editer/roles_selections', $contexte)) {
|
||||
$flux['data'] .= $editer_roles;
|
||||
}
|
||||
}
|
||||
|
||||
return $flux;
|
||||
}
|
Loading…
Reference in New Issue