première version utilisable
This commit is contained in:
parent
758d136e14
commit
769fcc3677
16 changed files with 316 additions and 1 deletions
|
@ -1,2 +1,9 @@
|
||||||
# bigform
|
# Plugin bigform
|
||||||
|
> plugin proposant un formulaire CVT pour le plugin bigup
|
||||||
|
|
||||||
|
Usage :
|
||||||
|
|
||||||
|
```html
|
||||||
|
#FORMULAIRE_BIGFORM{objet, id_objet, mode, args}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
21
bigform_autorisations.php
Normal file
21
bigform_autorisations.php
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Définit les autorisations du plugin BigForm
|
||||||
|
*
|
||||||
|
* @plugin BigForm
|
||||||
|
* @copyright 2019
|
||||||
|
* @author tofulm
|
||||||
|
* @licence GNU/GPL
|
||||||
|
* @package SPIP\Bigform\Autorisations
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction d'appel pour le pipeline
|
||||||
|
* @pipeline autoriser */
|
||||||
|
function bigform_autoriser() {
|
||||||
|
}
|
14
bigform_fonctions.php
Normal file
14
bigform_fonctions.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Fonctions utiles au plugin BigForm
|
||||||
|
*
|
||||||
|
* @plugin BigForm
|
||||||
|
* @copyright 2019
|
||||||
|
* @author tofulm
|
||||||
|
* @licence GNU/GPL
|
||||||
|
* @package SPIP\Bigform\Fonctions
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
|
return;
|
||||||
|
}
|
14
bigform_options.php
Normal file
14
bigform_options.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Options au chargement du plugin BigForm
|
||||||
|
*
|
||||||
|
* @plugin BigForm
|
||||||
|
* @copyright 2019
|
||||||
|
* @author tofulm
|
||||||
|
* @licence GNU/GPL
|
||||||
|
* @package SPIP\Bigform\Options
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
|
return;
|
||||||
|
}
|
14
bigform_pipelines.php
Normal file
14
bigform_pipelines.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Utilisations de pipelines par BigForm
|
||||||
|
*
|
||||||
|
* @plugin BigForm
|
||||||
|
* @copyright 2019
|
||||||
|
* @author tofulm
|
||||||
|
* @licence GNU/GPL
|
||||||
|
* @package SPIP\Bigform\Pipelines
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
|
return;
|
||||||
|
}
|
106
fabrique_bigform.php
Normal file
106
fabrique_bigform.php
Normal file
File diff suppressed because one or more lines are too long
19
formulaires/bigform.html
Normal file
19
formulaires/bigform.html
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<div class="formulaire_spip formulaire_#FORM">
|
||||||
|
|
||||||
|
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||||
|
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||||||
|
|
||||||
|
<form name="formulaire_#FORM" action="#ENV{action}" method="post" enctype="multipart/form-data"><div>
|
||||||
|
#ACTION_FORMULAIRE{#ENV{action}}
|
||||||
|
|
||||||
|
[(#SAISIE{bigup, fichiers,
|
||||||
|
form, formulaire_args,
|
||||||
|
label=Des images (par mime type),
|
||||||
|
accept=image/*,
|
||||||
|
multiple=oui})]
|
||||||
|
|
||||||
|
|
||||||
|
<p class="boutons"><input type="submit" class="submit" value="Envoyer" ></p>
|
||||||
|
</div></form>
|
||||||
|
|
||||||
|
</div>
|
36
formulaires/bigform.php
Normal file
36
formulaires/bigform.php
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
if (!defined('_ECRIRE_INC_VERSION')){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
include_spip('inc/cvtupload');
|
||||||
|
|
||||||
|
|
||||||
|
function formulaires_bigform_charger_dist($objet, $id_objet, $mode = 'auto', $args = array()) {
|
||||||
|
$valeurs = [
|
||||||
|
'_bigup_rechercher_fichiers' => true,
|
||||||
|
];
|
||||||
|
|
||||||
|
return $valeurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formulaires_bigform_verifier_dist($objet, $id_objet, $mode = 'auto', $args = array()) {
|
||||||
|
$erreurs = array();
|
||||||
|
return $erreurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formulaires_bigform_traiter_dist($objet = 'article', $id_objet = 0, $mode = 'auto', $args = array()) {
|
||||||
|
|
||||||
|
include_spip('inc/joindre_document');
|
||||||
|
set_request('joindre_upload','ok');
|
||||||
|
$files = joindre_trouver_fichier_envoye();
|
||||||
|
$Tid_doc = [];
|
||||||
|
|
||||||
|
if (count($files)) {
|
||||||
|
$ajouter_document = charger_fonction('ajouter_documents', 'action');
|
||||||
|
$Tid_doc = $ajouter_document('new', $files, $objet, $id_objet,$mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
16
formulaires/configurer_bigform.html
Normal file
16
formulaires/configurer_bigform.html
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<div class="formulaire_spip formulaire_configurer formulaire_#FORM">
|
||||||
|
|
||||||
|
<h3 class="titrem"><:bigform:cfg_titre_parametrages:></h3>
|
||||||
|
|
||||||
|
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||||||
|
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||||
|
|
||||||
|
<form method="post" action="#ENV{action}">
|
||||||
|
<div>
|
||||||
|
#ACTION_FORMULAIRE
|
||||||
|
|
||||||
|
<input type="hidden" name="_meta_casier" value="bigform" />
|
||||||
|
<p class="boutons"><span class="image_loading"> </span><input type="submit" class="submit" value="<:bouton_enregistrer:>" /></p>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
20
lang/bigform_fr.php
Normal file
20
lang/bigform_fr.php
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
// This is a SPIP language file -- Ceci est un fichier langue de SPIP
|
||||||
|
|
||||||
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$GLOBALS[$GLOBALS['idx_lang']] = array(
|
||||||
|
|
||||||
|
// B
|
||||||
|
'bigform_titre' => 'BigForm',
|
||||||
|
|
||||||
|
// C
|
||||||
|
'cfg_exemple' => 'Exemple',
|
||||||
|
'cfg_exemple_explication' => 'Explication de cet exemple',
|
||||||
|
'cfg_titre_parametrages' => 'Paramétrages',
|
||||||
|
|
||||||
|
// T
|
||||||
|
'titre_page_configurer_bigform' => 'BigForm',
|
||||||
|
);
|
14
lang/paquet-bigform_fr.php
Normal file
14
lang/paquet-bigform_fr.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
// This is a SPIP language file -- Ceci est un fichier langue de SPIP
|
||||||
|
|
||||||
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$GLOBALS[$GLOBALS['idx_lang']] = array(
|
||||||
|
|
||||||
|
// B
|
||||||
|
'bigform_description' => '',
|
||||||
|
'bigform_nom' => 'BigForm',
|
||||||
|
'bigform_slogan' => '',
|
||||||
|
);
|
27
paquet.xml
Normal file
27
paquet.xml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<paquet
|
||||||
|
prefix="bigform"
|
||||||
|
categorie="edition"
|
||||||
|
version="1.0.0"
|
||||||
|
etat="dev"
|
||||||
|
compatibilite="[3.2.6-dev;3.3.*]"
|
||||||
|
logo="prive/themes/spip/images/bigform-64.png"
|
||||||
|
documentation=""
|
||||||
|
>
|
||||||
|
<!--
|
||||||
|
Paquet généré le 2019-12-04 16:30:14
|
||||||
|
-->
|
||||||
|
|
||||||
|
<nom>BigForm</nom>
|
||||||
|
|
||||||
|
<auteur lien='https://gamuza.fr'>tofulm</auteur>
|
||||||
|
<credit lien="https://thenounproject.com/jevgeni.striganov/">Logo : jevgeni striganov</credit>
|
||||||
|
|
||||||
|
<licence>GNU/GPL</licence>
|
||||||
|
|
||||||
|
<necessite nom="bigup" compatibilite="[1.0.0;[" />
|
||||||
|
<!--<necessite nom="cvtupload" compatibilite="[1.17.0;[" />-->
|
||||||
|
|
||||||
|
<pipeline nom="autoriser" inclure="bigform_autorisations.php" />
|
||||||
|
|
||||||
|
|
||||||
|
</paquet>
|
7
prive/squelettes/contenu/configurer_bigform.html
Normal file
7
prive/squelettes/contenu/configurer_bigform.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[(#AUTORISER{configurer,_bigform}|sinon_interdire_acces)]
|
||||||
|
|
||||||
|
<h1 class="grostitre"><:bigform:titre_page_configurer_bigform:></h1>
|
||||||
|
|
||||||
|
<div class="ajax">
|
||||||
|
#FORMULAIRE_CONFIGURER_BIGFORM
|
||||||
|
</div>
|
BIN
prive/themes/spip/images/bigform-128.png
Normal file
BIN
prive/themes/spip/images/bigform-128.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
BIN
prive/themes/spip/images/bigform-32.png
Normal file
BIN
prive/themes/spip/images/bigform-32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
prive/themes/spip/images/bigform-64.png
Normal file
BIN
prive/themes/spip/images/bigform-64.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
Loading…
Add table
Reference in a new issue