commit
ffb3ade118
12 changed files with 448 additions and 0 deletions
@ -0,0 +1,6 @@
|
||||
/* les surcharges du squelettes-dist 3.3 pour avoir l'affichage des documents idem la 3.2 */ |
||||
|
||||
.spip_documents_left.spip_documents, |
||||
.spip_documents_right.spip_documents { |
||||
max-width: 100%; |
||||
} |
@ -0,0 +1,23 @@
|
||||
<?php |
||||
/** |
||||
* Options au chargement du plugin Modèles de documents 3.2 |
||||
* |
||||
* @plugin Modèles de documents 3.2 |
||||
* @copyright 2021 |
||||
* @author spip team |
||||
* @licence GNU/GPL |
||||
* @package SPIP\Historique_spip32_documents\Options |
||||
*/ |
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) { |
||||
return; |
||||
} |
||||
|
||||
if (!defined('_LEGACY_ACTIVE_IMG_DOC_EMB')) { |
||||
define ('_LEGACY_ACTIVE_IMG_DOC_EMB', 1); |
||||
} |
||||
|
||||
function historique_spip32_documents_insert_head_css($flux){ |
||||
$flux .= "\r\n".'<link rel="stylesheet" href="'.find_in_path('css/historique_spip32_documents.css').'" type="text/css" media="all" />'."\r\n"; |
||||
return $flux; |
||||
} |
@ -0,0 +1,12 @@
|
||||
<?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( |
||||
|
||||
// H |
||||
'historique_spip32_documents_titre' => 'Modèles de documents 3.2', |
||||
); |
@ -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( |
||||
|
||||
// H |
||||
'historique_spip32_documents_description' => 'Plugin de compatibilité : rétablir les modèles de documents de la version 3.2 de SPIP', |
||||
'historique_spip32_documents_nom' => 'Modèles de documents SPIP 3.2', |
||||
'historique_spip32_documents_slogan' => '', |
||||
); |
@ -0,0 +1,48 @@
|
||||
<BOUCLE_doc (DOCUMENTS) {id_document} {tout}> |
||||
[<!--(#REM) |
||||
|
||||
Modele pour <doc> en dl/dt/dd |
||||
cf. http://pompage.net/pompe/listesdefinitions/ |
||||
|
||||
La largeur de la legende est egale a la largeur de l'image |
||||
avec un minimum de 120px, et un maximum de 350px. |
||||
|
||||
Dans le cas d'une simple image (mode=image), on affiche |
||||
le document lui-meme, sans lien de telechargement |
||||
-->] |
||||
[(#ENV{mode_force,#MODE}|=={image}|oui) |
||||
#SET{fichier,#URL_DOCUMENT} |
||||
#SET{width,#LARGEUR} |
||||
#SET{height,#HAUTEUR} |
||||
#SET{url,#ENV{lien}} |
||||
] |
||||
[(#ENV{mode_force,#MODE}|=={image}|non) |
||||
[(#SET{fichier,[(#LOGO_DOCUMENT|extraire_attribut{src})]})] |
||||
[(#SET{width,[(#LOGO_DOCUMENT|extraire_attribut{width})]})] |
||||
[(#SET{height,[(#LOGO_DOCUMENT|extraire_attribut{height})]})] |
||||
#SET{url,#ENV{lien,#URL_DOCUMENT}} |
||||
][<!--(#REM) |
||||
|
||||
|
||||
Si largeur ou hauteur fournit en parametre, redimensionner |
||||
|
||||
-->][ |
||||
(#ENV{largeur,0}|ou{#ENV{hauteur,0}}) |
||||
#SET{fichier,#GET{fichier}|image_reduire{#ENV{largeur,0},#ENV{hauteur,0}}} |
||||
#SET{width,#GET{fichier}|largeur} |
||||
#SET{height,#GET{fichier}|hauteur} |
||||
#SET{fichier,#GET{fichier}|extraire_attribut{src}} |
||||
] |
||||
[(#SET{title,[(#TYPE_DOCUMENT) - [(#TAILLE|taille_en_octets)]]})] |
||||
[(#MEDIA|=={image}|oui) #SET{title,#TITRE|sinon{#GET{title}}] |
||||
<dl class='spip_document_#ID_DOCUMENT spip_documents[ spip_documents_(#ENV{align})][ (#ENV{class})] spip_lien_ok'[ |
||||
style='float:(#ENV{align}|match{left|right});']> |
||||
<dt>[<a href="(#GET{url})"[ |
||||
class="(#ENV{lien_class})"] title='[(#GET{title}|attribut_html)]'[ |
||||
(#ENV{lien}|?{'',type="#MIME_TYPE"})]>]<img src='#GET{fichier}' width='#GET{width}' height='#GET{height}' alt='' />[(#GET{url}|?{</a>})]</dt>[ |
||||
<dt class='#EDIT{titre} spip_doc_titre'[ style='width:(#GET{width}|min{350}|max{120})px;']><strong>(#TITRE)</strong></dt>][ |
||||
<dd class='#EDIT{descriptif} spip_doc_descriptif'[ style='width:(#GET{width}|min{350}|max{120})px;']>(#DESCRIPTIF|PtoBR)[(#NOTES|PtoBR)]</dd>] |
||||
</dl> |
||||
|
||||
</BOUCLE_doc> |
||||
#FILTRE{trim} |
@ -0,0 +1,59 @@
|
||||
<?php |
||||
/***************************************************************************\ |
||||
* SPIP, Systeme de publication pour l'internet * |
||||
* * |
||||
* Copyright (c) 2001-2020 * |
||||
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
||||
* * |
||||
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
||||
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
||||
\***************************************************************************/ |
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) { |
||||
return; |
||||
} |
||||
|
||||
if (!defined('_BOUTON_MODE_IMAGE')) { |
||||
define('_BOUTON_MODE_IMAGE', true); |
||||
} |
||||
|
||||
include_spip('inc/documents'); // pour la fonction affiche_raccourci_doc |
||||
function medias_raccourcis_doc( |
||||
$id_document, |
||||
$titre, |
||||
$descriptif, |
||||
$inclus, |
||||
$largeur, |
||||
$hauteur, |
||||
$mode, |
||||
$vu, |
||||
$media = null |
||||
) { |
||||
$raccourci = ''; |
||||
$doc = 'doc'; |
||||
|
||||
if ($mode == 'image' and (strlen($descriptif . $titre) == 0)) { |
||||
$doc = 'img'; |
||||
} |
||||
|
||||
// Affichage du raccourci <doc...> correspondant |
||||
$raccourci = |
||||
affiche_raccourci_doc($doc, $id_document, 'left') |
||||
. affiche_raccourci_doc($doc, $id_document, 'center') |
||||
. affiche_raccourci_doc($doc, $id_document, 'right'); |
||||
if ($mode == 'document' |
||||
and ($inclus == 'embed' or $inclus == 'image') |
||||
and (($largeur > 0 and $hauteur > 0) |
||||
or in_array($media, array('video', 'audio'))) |
||||
) { |
||||
$raccourci = |
||||
'<span>' . _T('medias:info_inclusion_vignette') . '</span>' |
||||
. $raccourci |
||||
. '<span>' . _T('medias:info_inclusion_directe') . '</span>' |
||||
. affiche_raccourci_doc('emb', $id_document, 'left') |
||||
. affiche_raccourci_doc('emb', $id_document, 'center') |
||||
. affiche_raccourci_doc('emb', $id_document, 'right'); |
||||
} |
||||
|
||||
return "<div class='raccourcis'>" . $raccourci . '</div>'; |
||||
} |
@ -0,0 +1,3 @@
|
||||
<BOUCLE_ext(DOCUMENTS types_documents) {id_document} {tout}> |
||||
<INCLURE{fond=modeles/#EXTENSION|trouver_modele_emb{#MIME_TYPE}}{id=#ID_DOCUMENT}{env}{emb=' '}/> |
||||
</BOUCLE_ext> |
@ -0,0 +1,30 @@
|
||||
<?php |
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) { |
||||
return; |
||||
} |
||||
|
||||
/** |
||||
* Trouver le fond pour embarquer un document |
||||
* - avec une extension |
||||
* - avec un mime_type donne |
||||
* |
||||
* => modeles/emb_html.html si il existe |
||||
* => modeles/text_html.html si il existe, |
||||
* => modeles/text.html sinon |
||||
* |
||||
* @param $extension |
||||
* @param $mime_type |
||||
* @return mixed |
||||
*/ |
||||
function trouver_modele_emb($extension, $mime_type) { |
||||
if ($extension and trouve_modele($fond = 'emb_' . $extension)) { |
||||
return $fond; |
||||
} |
||||
$fond = preg_replace(',\W,', '_', $mime_type); |
||||
if (trouve_modele($fond)) { |
||||
return $fond; |
||||
} else { |
||||
return preg_replace(',\W.*$,', '', $mime_type); |
||||
} |
||||
} |
@ -0,0 +1,49 @@
|
||||
<BOUCLE_tous (DOCUMENTS types_documents) {id_document=#ID} {tout}>[ |
||||
|
||||
(#REM) Cas <imageXX> : equivalent a <imgXX> pour une image en mode image |
||||
|
||||
][(#INCLUS|=={image}|et{#ENV{emb,''}|non}|oui) |
||||
<span class='spip_document_#ID_DOCUMENT spip_documents[ spip_documents_(#ENV{align})][ (#ENV{class})] spip_lien_ok'[ |
||||
style='float:(#ENV{align}|match{left|right});']>[ |
||||
<a href="(#ENV{lien})"[ |
||||
class="(#ENV{lien_class})"]>]<img src='#URL_DOCUMENT'[ |
||||
width="(#LARGEUR|?{#LARGEUR})"][ |
||||
height="(#HAUTEUR|?{#HAUTEUR})"][ |
||||
title="(#TITRE|attribut_html)"] |
||||
alt="[(#TITRE|attribut_html)]" />[(#ENV{lien}|?{</a>})]</span> |
||||
][ |
||||
|
||||
(#REM) Cas <embXX> : on est appele ici avec emb=' ' : on veut la legende |
||||
equivalent a un <docXX> pour une image en mode image |
||||
|
||||
][(#INCLUS|=={image}|et{#ENV{emb,''}|oui}|oui) |
||||
#SET{fichier,#URL_DOCUMENT} |
||||
#SET{width,#LARGEUR} |
||||
#SET{height,#HAUTEUR} |
||||
#SET{url,#ENV{lien}} |
||||
<dl class='spip_document_#ID_DOCUMENT spip_documents[ spip_documents_(#ENV{align})][ (#ENV{class})] spip_lien_ok'[ |
||||
style='float:(#ENV{align}|match{left|right});[width:(#GET{width}|max{120})]px;']> |
||||
<dt>[<a href="(#GET{url})"[ class="(#ENV{lien_class})"] title='#TYPE_DOCUMENT - [(#TAILLE|taille_en_octets|texte_backend)]'[ type="(#ENV{lien}|?{#ENV{lien_mime},#MIME_TYPE})"]>]<img src='#GET{fichier}' width='#GET{width}' height='#GET{height}' alt='' />[(#GET{url}|?{</a>})]</dt>[ |
||||
<dt class='#EDIT{titre} spip_doc_titre'[ style='width:(#GET{width}|min{350}|max{120})px;']><strong>(#TITRE)</strong></dt>][ |
||||
<dd class='#EDIT{descriptif} spip_doc_descriptif'[ style='width:(#GET{width}|min{350}|max{120})px;']>(#DESCRIPTIF|PtoBR)[(#NOTES|PtoBR)]</dd>] |
||||
</dl> |
||||
][ |
||||
|
||||
(#REM) Cas des images qu'il faut embed (svg) |
||||
][ |
||||
(#INCLUS|=={embed}|oui) |
||||
<div class='spip_document_#ID_DOCUMENT spip_documents[ spip_documents_(#ENV{align})]'[ |
||||
style='[(#ENV{align}|match{^(left|right)$}|?{' '})float:#ENV{align};] (#ENV{align,center}|=={center}|?{'',' '})']> |
||||
<object data='#URL_DOCUMENT' |
||||
type='#MIME_TYPE'[ |
||||
width='(#ENV{largeur}?{'', #LARGEUR})'][ |
||||
height='(#ENV{hauteur}?{'', #HAUTEUR})'] |
||||
[(#ENV*|env_to_attributs)] > |
||||
<param name='src' value='#URL_DOCUMENT' /> |
||||
[(#ID_DOCUMENT|appliquer_filtre{#MIME_TYPE})] |
||||
</object>[ |
||||
<div class='#EDIT{titre} spip_doc_titre'><strong>(#TITRE)</strong></div> |
||||
][ |
||||
<div class='#EDIT{descriptif} spip_doc_descriptif'>(#DESCRIPTIF|PtoBR)[(#NOTES|PtoBR)]</div> |
||||
]</div>] |
||||
</BOUCLE_tous> |
@ -0,0 +1,53 @@
|
||||
<BOUCLE_document (DOCUMENTS) {id_document} {mode?} {tout}> |
||||
[(#REM) |
||||
|
||||
Modele pour <img> |
||||
|
||||
Si on est en mode "image" ou "vignette", ou appele avec embed=oui, |
||||
on affiche l'image complete ; sinon le logo |
||||
|
||||
Si un lien est passe #ENV{lien} on ajoute le a href |
||||
ou on truque le #URL_DOCUMENT |
||||
|
||||
Si une code de langue est passe #ENV{langue} ex: <img12|langue=en> |
||||
on ajoute l'attribut lang la balise img et eventuellement sur la balise a |
||||
|
||||
Dans le cas mode "image ou vignette", le contenu de l'attribut |
||||
alt et title se construit selon le schema suivant : |
||||
- prend la valeur de alt passe en environnement par le biais |
||||
d'un parametre sur la balise ex: <img12|alt=xxx> |
||||
- sinon on prend le titre |
||||
- sinon si #ENV{lien} est passe on prend #ENV{lien} ou Document si lien vers #URL_DOCUMENT |
||||
- sinon alt vide |
||||
|
||||
Dans le cas mode "document", le contenu de l'attribut |
||||
alt et title se construit selon le meme schema a ceci pres |
||||
qu'on ajoute #TYPE_DOCUMENT - #TAILLE |
||||
sauf si #ENV{lien} est passe |
||||
|
||||
] |
||||
[(#SET{ |
||||
image, |
||||
#ENV{mode_force,#MODE}|match{'image|vignette'} |
||||
|sinon{#ENV{embed}} |
||||
|oui |
||||
})][ |
||||
|
||||
(#REM) image complete ? |
||||
|
||||
][(#GET{image}) |
||||
<span class='spip_document_#ID_DOCUMENT spip_documents[ spip_documents_(#ENV{align})][ (#ENV{class})] spip_lien_ok'[ |
||||
style='float:(#ENV{align}|match{left|right});']> |
||||
[<a href="(#ENV{lien})"[ class="(#ENV{lien_class})"]>]<img src='#URL_DOCUMENT'[ width="(#LARGEUR)"][ height="(#HAUTEUR)"] alt="[(#TITRE|texte_backend)]"[ title="(#TITRE|texte_backend)"] />[(#ENV{lien}|?{</a>})]</span> |
||||
][ |
||||
|
||||
(#REM) sinon logo document + lien + alt + title etc |
||||
|
||||
][(#GET{image}|non) |
||||
[(#SET{fichier,[(#LOGO_DOCUMENT|extraire_attribut{src})]})] |
||||
[(#SET{width,[(#LOGO_DOCUMENT|extraire_attribut{width})]})] |
||||
[(#SET{height,[(#LOGO_DOCUMENT|extraire_attribut{height})]})] |
||||
<span class='spip_document_#ID_DOCUMENT spip_documents[ spip_documents_(#ENV{align})][ (#ENV{class})] spip_lien_ok'[ |
||||
style='float:(#ENV{align}|match{left|right});[ width:(#GET{width})px;]']><a href="[(#ENV{lien}|sinon{#URL_DOCUMENT})]"[ |
||||
(#ENV{lien}|?{'',type="#MIME_TYPE"})][ title="(#TITRE|texte_backend)"]><img src='#GET{fichier}' width='#GET{width}' height='#GET{height}' alt='[(#TITRE|strlen|?{#TITRE {#TYPE_DOCUMENT},#TYPE_DOCUMENT}|attribut_html)]' /></a></span> |
||||
]</BOUCLE_document> |
@ -0,0 +1,21 @@
|
||||
<paquet |
||||
prefix="historique_spip32_documents" |
||||
categorie="outil" |
||||
version="1.0.1" |
||||
etat="dev" |
||||
compatibilite="[3.3.0-dev;3.3.*]" |
||||
logo="prive/themes/spip/images/historique_spip32_documents-xx.svg" |
||||
documentation="" |
||||
> |
||||
<nom>Modèles de documents SPIP 3.2</nom> |
||||
|
||||
<auteur>spip team</auteur> |
||||
<credit lien="https://www.flaticon.com">Logo : Dave Gandy, Those Icons pour Flaticon</credit> |
||||
|
||||
<licence>GNU/GPL</licence> |
||||
|
||||
<necessite nom="medias" compatibilite="[2.30.0;]" /> |
||||
|
||||
<pipeline nom="insert_head_css" inclure="historique_spip32_documents_options.php" /> |
||||
|
||||
</paquet> |
Loading…
Reference in new issue