Merge branch 'master' of ssh://git.gamuza.fr:2222/spip/bigform

This commit is contained in:
cy_altern 2021-03-14 18:42:34 +01:00
commit 9eb8d4e85b
6 changed files with 66 additions and 2 deletions

View file

@ -51,3 +51,6 @@ $bigform($id_objet, $objet, $mode, true);
``` ```
> **ATTENTION** > **ATTENTION**
> Il faut ajouter les vérifications pour les différents types de fichiers > Il faut ajouter les vérifications pour les différents types de fichiers
> **ATTENTION pour les documents protégés**
> Il faut activer les urls propres : URLs Propres+.html

View file

@ -31,7 +31,9 @@ function bigform_upgrade($nom_meta_base_version, $version_cible) {
'charger_public' => 1 'charger_public' => 1
]; ];
$maj['create'] = [['ecrire_meta', 'bigup', serialize($config_defaut)]]; $maj['create'] = [
['maj_tables', ['spip_documents']],
['ecrire_meta', 'bigup', serialize($config_defaut)]];
$maj['1.0.1'] = [['ecrire_meta', 'bigup', serialize($config_defaut)]]; $maj['1.0.1'] = [['ecrire_meta', 'bigup', serialize($config_defaut)]];
$maj['1.0.4'] = [['maj_tables', ['spip_documents']]]; $maj['1.0.4'] = [['maj_tables', ['spip_documents']]];

View file

@ -12,3 +12,38 @@
if (!defined('_ECRIRE_INC_VERSION')) { if (!defined('_ECRIRE_INC_VERSION')) {
return; return;
} }
/**
* Branchement sur l'insertion de document pour generer le cache des images
* a la sortie du formualire
* Extensions utilisées :
* - jpg
* - png
* - webm
*
* @param Array $flux
*
* @return Array $flux
*/
function bigform_post_edition($flux){
if (
$flux['args']['table'] === 'spip_documents'
and $id_document = intval($flux['args']['id_objet'])
and $flux['args']['action'] === 'ajouter_document'
and in_array($flux['data']['extension'], ['jpg', 'png', 'webm'])
and lire_config('bigform/retailler_image') === 'oui'
) {
$url = generer_url_public("retailler_img", [
"id_document" =>intval($id_document),
"largeur" => $flux['data']['largeur'],
"hauteur" => $flux['data']['hauteur'],
"taille" => $flux['data']['taille'],
], true, false);
$ch = curl_init($url);
curl_exec($ch);
curl_close($ch);
}
return $flux;
}

View file

@ -9,6 +9,22 @@
<div> <div>
#ACTION_FORMULAIRE #ACTION_FORMULAIRE
<div class="editer_groupe">
#SET{name,retailler_image}
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
<div class="editer editer_[(#GET{name})][ (#GET{erreurs}|oui)erreur]">
<label>Activer le rataillage des images après televersement</label>
<div class="choix">
<input type="radio" class="radio" name="#GET{name}" value="" id="#GET{name}_non"[ (#ENV{#GET{name}}|!={oui}|?{checked="checked"})] >
<label for="#GET{name}_non">Non</label>
</div>
<div class="choix">
<input type="radio" class="radio" name="#GET{name}" value="oui" id="#GET{name}_oui"[ (#ENV{#GET{name}}|=={oui}|?{checked="checked"})] >
<label for="#GET{name}_oui">Oui</label>
</div>
</div>
</div>
<input type="hidden" name="_meta_casier" value="bigform" /> <input type="hidden" name="_meta_casier" value="bigform" />
<p class="boutons"><span class="image_loading">&nbsp;</span><input type="submit" class="submit" value="<:bouton_enregistrer:>" /></p> <p class="boutons"><span class="image_loading">&nbsp;</span><input type="submit" class="submit" value="<:bouton_enregistrer:>" /></p>
</div> </div>

View file

@ -1,7 +1,7 @@
<paquet <paquet
prefix="bigform" prefix="bigform"
categorie="edition" categorie="edition"
version="1.1.4" version="1.1.6"
etat="dev" etat="dev"
compatibilite="[3.2.5;3.3.*]" compatibilite="[3.2.5;3.3.*]"
logo="prive/themes/spip/images/bigform-64.png" logo="prive/themes/spip/images/bigform-64.png"
@ -21,5 +21,7 @@
<pipeline nom="autoriser" inclure="bigform_autorisations.php" /> <pipeline nom="autoriser" inclure="bigform_autorisations.php" />
<pipeline nom="declarer_tables_principales" inclure="base/bigform.php" /> <pipeline nom="declarer_tables_principales" inclure="base/bigform.php" />
<pipeline nom="post_edition" inclure="bigform_pipelines.php" />
</paquet> </paquet>

6
retailler_img.html Normal file
View file

@ -0,0 +1,6 @@
<BOUCLE_documents(DOCUMENTS){id_document}{largeur}{hauteur}{taille}{tout}>
[(#FICHIER|image_recadre{3072:1800,-,focus}|adaptive_images{3072})]
[(#FICHIER|image_recadre{2048:1200,-,focus}|adaptive_images{2048})]
[(#FICHIER|image_recadre{1024:600,-,focus}|adaptive_images{1024})]
[(#FICHIER|image_recadre{512:300,-,focus}|adaptive_images{512})]
</BOUCLE_documents>