
@ -0,0 +1,38 @@
|
||||
* text=auto !eol |
||||
/.DS_Store -text |
||||
action/supprimer_swiper.php -text |
||||
base/swiper.php -text |
||||
formulaires/configurer_swiper.html -text |
||||
formulaires/editer_swiper.html -text |
||||
formulaires/editer_swiper.php -text |
||||
lang/paquet-swiper_fr.php -text |
||||
lang/swiper_fr.php -text |
||||
modeles/swiper.html -text |
||||
/paquet.xml -text |
||||
prive/objets/contenu/swiper.html -text |
||||
prive/objets/infos/swiper.html -text |
||||
prive/objets/liste/swipers.html -text |
||||
prive/squelettes/contenu/configurer_swiper.html -text |
||||
prive/themes/spip/images/swiper-12.png -text |
||||
prive/themes/spip/images/swiper-128.png -text |
||||
prive/themes/spip/images/swiper-16.png -text |
||||
prive/themes/spip/images/swiper-24.png -text |
||||
prive/themes/spip/images/swiper-32.png -text |
||||
prive/themes/spip/images/swiper-64.png -text |
||||
prive/themes/spip/images/swiper-add-16.png -text |
||||
prive/themes/spip/images/swiper-add-24.png -text |
||||
prive/themes/spip/images/swiper-add-32.png -text |
||||
prive/themes/spip/images/swiper-del-16.png -text |
||||
prive/themes/spip/images/swiper-del-24.png -text |
||||
prive/themes/spip/images/swiper-del-32.png -text |
||||
prive/themes/spip/images/swiper-edit-16.png -text |
||||
prive/themes/spip/images/swiper-edit-24.png -text |
||||
prive/themes/spip/images/swiper-edit-32.png -text |
||||
prive/themes/spip/images/swiper-new-16.png -text |
||||
prive/themes/spip/images/swiper-new-24.png -text |
||||
prive/themes/spip/images/swiper-new-32.png -text |
||||
/swiper.html -text |
||||
/swiper_administrations.php -text |
||||
/swiper_autorisations.php -text |
||||
/swiper_pipelines.php -text |
||||
/swiper_spip.css -text |
@ -0,0 +1,41 @@
|
||||
<?php |
||||
/** |
||||
* Utilisation de l'action supprimer pour l'objet swiper |
||||
* |
||||
* @plugin Swiper |
||||
* @copyright 2017 |
||||
* @author Charles Stephan |
||||
* @licence GNU/GPL |
||||
* @package SPIP\Swiper\Action |
||||
*/ |
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) { |
||||
return; |
||||
} |
||||
|
||||
|
||||
|
||||
/** |
||||
* Action pour supprimer un·e swiper |
||||
* |
||||
* Vérifier l'autorisation avant d'appeler l'action. |
||||
* |
||||
* @param null|int $arg |
||||
* Identifiant à supprimer. |
||||
* En absence de id utilise l'argument de l'action sécurisée. |
||||
**/ |
||||
function action_supprimer_swiper_dist($arg=null) { |
||||
if (is_null($arg)){ |
||||
$securiser_action = charger_fonction('securiser_action', 'inc'); |
||||
$arg = $securiser_action(); |
||||
} |
||||
$arg = intval($arg); |
||||
|
||||
// cas suppression |
||||
if ($arg) { |
||||
sql_delete('spip_swipers', 'id_swiper=' . sql_quote($arg)); |
||||
} |
||||
else { |
||||
spip_log("action_supprimer_swiper_dist $arg pas compris"); |
||||
} |
||||
} |
@ -0,0 +1,94 @@
|
||||
<?php |
||||
/** |
||||
* Déclarations relatives à la base de données |
||||
* |
||||
* @plugin Swiper |
||||
* @copyright 2017 |
||||
* @author Charles Stephan |
||||
* @licence GNU/GPL |
||||
* @package SPIP\Swiper\Pipelines |
||||
*/ |
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) { |
||||
return; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Déclaration des alias de tables et filtres automatiques de champs |
||||
* |
||||
* @pipeline declarer_tables_interfaces |
||||
* @param array $interfaces |
||||
* Déclarations d'interface pour le compilateur |
||||
* @return array |
||||
* Déclarations d'interface pour le compilateur |
||||
*/ |
||||
function swiper_declarer_tables_interfaces($interfaces) { |
||||
|
||||
$interfaces['table_des_tables']['swipers'] = 'swipers'; |
||||
|
||||
return $interfaces; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Déclaration des objets éditoriaux |
||||
* |
||||
* @pipeline declarer_tables_objets_sql |
||||
* @param array $tables |
||||
* Description des tables |
||||
* @return array |
||||
* Description complétée des tables |
||||
*/ |
||||
function swiper_declarer_tables_objets_sql($tables) { |
||||
|
||||
$tables['spip_swipers'] = array( |
||||
'type' => 'swiper', |
||||
'principale' => 'oui', |
||||
'field'=> array( |
||||
'id_swiper' => 'bigint(21) NOT NULL', |
||||
'titre' => 'varchar(255) NOT NULL DEFAULT ""', |
||||
'maj' => 'TIMESTAMP' |
||||
), |
||||
'key' => array( |
||||
'PRIMARY KEY' => 'id_swiper', |
||||
), |
||||
'titre' => 'titre AS titre, "" AS lang', |
||||
#'date' => '', |
||||
'champs_editables' => array('titre'), |
||||
'champs_versionnes' => array('titre'), |
||||
'rechercher_champs' => array("titre" => 1), |
||||
'tables_jointures' => array(), |
||||
|
||||
|
||||
); |
||||
|
||||
return $tables; |
||||
} |
||||
|
||||
|
||||
function swiper_declarer_champs_extras($champs = array()) { |
||||
|
||||
$champs['spip_documents']['nom_lien'] = array( |
||||
'saisie' => 'input', |
||||
'options' => array( |
||||
'nom' => 'nom_lien', |
||||
'label' => _T('swiper:nom_lien'), |
||||
'sql' => "varchar(255) NOT NULL DEFAULT ''", |
||||
'defaut' => '', |
||||
), |
||||
); |
||||
|
||||
$champs['spip_documents']['url_lien'] = array( |
||||
'saisie' => 'input', |
||||
'options' => array( |
||||
'nom' => 'url_lien', |
||||
'label' => _T('swiper:url_lien'), |
||||
'sql' => "varchar(255) NOT NULL DEFAULT ''", |
||||
'defaut' => '', |
||||
), |
||||
); |
||||
|
||||
return $champs; |
||||
|
||||
} |
@ -0,0 +1,25 @@
|
||||
<div class="formulaire_spip formulaire_configurer formulaire_#FORM"> |
||||
|
||||
<h3 class="titrem"><:swiper: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{#ENV{action}} |
||||
<div class="editer-groupe"> |
||||
[(#SAISIE{oui_non, navigation, defaut=on, label=<:swiper:navigation:>})] |
||||
[(#SAISIE{oui_non, pagination, defaut=on, label=<:swiper:pagination:>})] |
||||
[(#SAISIE{oui_non, scrollbar, defaut=on, label=<:swiper:scrollbar:>})] |
||||
[(#SAISIE{textarea, swiper_options, |
||||
label=<:swiper:swiper_options:> |
||||
, rows=16 |
||||
})] |
||||
</div> |
||||
|
||||
<input type="hidden" name="_meta_casier" value="swiper" /> |
||||
<p class="boutons"><span class="image_loading"> </span><input type="submit" class="submit" value="<:bouton_enregistrer:>" /></p> |
||||
</div> |
||||
</form> |
||||
</div> |
@ -0,0 +1,20 @@
|
||||
<div class='formulaire_spip formulaire_editer formulaire_#FORM formulaire_#FORM-#ENV{id_swiper,nouveau}'> |
||||
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV**{message_ok})</p>] |
||||
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>] |
||||
|
||||
[(#ENV{editable}) |
||||
<form method="post" action="#ENV{action}"><div> |
||||
#ACTION_FORMULAIRE{#ENV{action}} |
||||
<input type="hidden" name="id_swiper" value="#ENV{id_swiper}" /> |
||||
<div class="editer-groupe"> |
||||
|
||||
[(#SAISIE{input, titre, obligatoire=oui, |
||||
label=<:swiper:champ_titre_label:>})] |
||||
|
||||
</div> |
||||
[(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ] |
||||
<!--extra--> |
||||
<p class="boutons"><input type="submit" class="submit" value="<:bouton_enregistrer:>" /></p> |
||||
</div></form> |
||||
] |
||||
</div> |
@ -0,0 +1,124 @@
|
||||
<?php |
||||
/** |
||||
* Gestion du formulaire de d'édition de swiper |
||||
* |
||||
* @plugin Swiper |
||||
* @copyright 2017 |
||||
* @author Charles Stephan |
||||
* @licence GNU/GPL |
||||
* @package SPIP\Swiper\Formulaires |
||||
*/ |
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) { |
||||
return; |
||||
} |
||||
|
||||
include_spip('inc/actions'); |
||||
include_spip('inc/editer'); |
||||
|
||||
|
||||
/** |
||||
* Identifier le formulaire en faisant abstraction des paramètres qui ne représentent pas l'objet edité |
||||
* |
||||
* @param int|string $id_swiper |
||||
* Identifiant du swiper. 'new' pour un nouveau swiper. |
||||
* @param string $retour |
||||
* URL de redirection après le traitement |
||||
* @param int $lier_trad |
||||
* Identifiant éventuel d'un swiper source d'une traduction |
||||
* @param string $config_fonc |
||||
* Nom de la fonction ajoutant des configurations particulières au formulaire |
||||
* @param array $row |
||||
* Valeurs de la ligne SQL du swiper, si connu |
||||
* @param string $hidden |
||||
* Contenu HTML ajouté en même temps que les champs cachés du formulaire. |
||||
* @return string |
||||
* Hash du formulaire |
||||
*/ |
||||
function formulaires_editer_swiper_identifier_dist($id_swiper = 'new', $retour = '', $lier_trad = 0, $config_fonc = '', $row = array(), $hidden = '') { |
||||
return serialize(array(intval($id_swiper))); |
||||
} |
||||
|
||||
/** |
||||
* Chargement du formulaire d'édition de swiper |
||||
* |
||||
* Déclarer les champs postés et y intégrer les valeurs par défaut |
||||
* |
||||
* @uses formulaires_editer_objet_charger() |
||||
* |
||||
* @param int|string $id_swiper |
||||
* Identifiant du swiper. 'new' pour un nouveau swiper. |
||||
* @param string $retour |
||||
* URL de redirection après le traitement |
||||
* @param int $lier_trad |
||||
* Identifiant éventuel d'un swiper source d'une traduction |
||||
* @param string $config_fonc |
||||
* Nom de la fonction ajoutant des configurations particulières au formulaire |
||||
* @param array $row |
||||
* Valeurs de la ligne SQL du swiper, si connu |
||||
* @param string $hidden |
||||
* Contenu HTML ajouté en même temps que les champs cachés du formulaire. |
||||
* @return array |
||||
* Environnement du formulaire |
||||
*/ |
||||
function formulaires_editer_swiper_charger_dist($id_swiper = 'new', $retour = '', $lier_trad = 0, $config_fonc = '', $row = array(), $hidden = '') { |
||||
$valeurs = formulaires_editer_objet_charger('swiper', $id_swiper, '', $lier_trad, $retour, $config_fonc, $row, $hidden); |
||||
return $valeurs; |
||||
} |
||||
|
||||
/** |
||||
* Vérifications du formulaire d'édition de swiper |
||||
* |
||||
* Vérifier les champs postés et signaler d'éventuelles erreurs |
||||
* |
||||
* @uses formulaires_editer_objet_verifier() |
||||
* |
||||
* @param int|string $id_swiper |
||||
* Identifiant du swiper. 'new' pour un nouveau swiper. |
||||
* @param string $retour |
||||
* URL de redirection après le traitement |
||||
* @param int $lier_trad |
||||
* Identifiant éventuel d'un swiper source d'une traduction |
||||
* @param string $config_fonc |
||||
* Nom de la fonction ajoutant des configurations particulières au formulaire |
||||
* @param array $row |
||||
* Valeurs de la ligne SQL du swiper, si connu |
||||
* @param string $hidden |
||||
* Contenu HTML ajouté en même temps que les champs cachés du formulaire. |
||||
* @return array |
||||
* Tableau des erreurs |
||||
*/ |
||||
function formulaires_editer_swiper_verifier_dist($id_swiper = 'new', $retour = '', $lier_trad = 0, $config_fonc = '', $row = array(), $hidden = '') { |
||||
$erreurs = array(); |
||||
|
||||
$erreurs = formulaires_editer_objet_verifier('swiper', $id_swiper, array('titre')); |
||||
|
||||
return $erreurs; |
||||
} |
||||
|
||||
/** |
||||
* Traitement du formulaire d'édition de swiper |
||||
* |
||||
* Traiter les champs postés |
||||
* |
||||
* @uses formulaires_editer_objet_traiter() |
||||
* |
||||
* @param int|string $id_swiper |
||||
* Identifiant du swiper. 'new' pour un nouveau swiper. |
||||
* @param string $retour |
||||
* URL de redirection après le traitement |
||||
* @param int $lier_trad |
||||
* Identifiant éventuel d'un swiper source d'une traduction |
||||
* @param string $config_fonc |
||||
* Nom de la fonction ajoutant des configurations particulières au formulaire |
||||
* @param array $row |
||||
* Valeurs de la ligne SQL du swiper, si connu |
||||
* @param string $hidden |
||||
* Contenu HTML ajouté en même temps que les champs cachés du formulaire. |
||||
* @return array |
||||
* Retours des traitements |
||||
*/ |
||||
function formulaires_editer_swiper_traiter_dist($id_swiper = 'new', $retour = '', $lier_trad = 0, $config_fonc = '', $row = array(), $hidden = '') { |
||||
$retours = formulaires_editer_objet_traiter('swiper', $id_swiper, '', $lier_trad, $retour, $config_fonc, $row, $hidden); |
||||
return $retours; |
||||
} |
@ -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( |
||||
|
||||
// S |
||||
'swiper_description' => 'Ce plugin repose sur le plugins Swiper by idangerous porté pour Spip. Il offre un objet éditorial plein écran ainsi que son modèle à insérer dans vos textes.', |
||||
'swiper_nom' => 'Swiper', |
||||
'swiper_slogan' => 'Mets-y les doigts', |
||||
); |
@ -0,0 +1,43 @@
|
||||
<B_DOCUMENTS> |
||||
|
||||
<div class="swiper-container[ swiper_(#ENV{id_swiper})]"> |
||||
|
||||
<div class="swiper-wrapper"> |
||||
|
||||
<BOUCLE_DOCUMENTS(DOCUMENTS){id_swiper}> |
||||
|
||||
<figure |
||||
class="swiper-slide" |
||||
style="background-image:url(#GET{small,#FICHIER})"> |
||||
|
||||
[(#REM)On laisse le fichier mais on le cache en css pour la SEO] |
||||
[(#FICHIER |
||||
|balise_img |
||||
|inserer_attribut{title,#TITRE} |
||||
|inserer_attribut{alt,[(#DESCRIPTIF|attribut_html|couper{80})]} |
||||
)] |
||||
|
||||
<figcaption> |
||||
[<span class="titre">(#TITRE)</span>] |
||||
[<br>(#DESCRIPTIF)] |
||||
[<br>(#NOM_LIEN|oui)[<a href='(#URL_LIEN)'>[(#NOM_LIEN)]</a>]] |
||||
</figcaption> |
||||
</figure> |
||||
|
||||
</BOUCLE_DOCUMENTS> |
||||
|
||||
</div> |
||||
|
||||
[(#TOTAL_BOUCLE|>{1}|oui) |
||||
[(#CONFIG{swiper/pagination}|oui) |
||||
<div class="swiper-pagination"></div>] |
||||
[(#CONFIG{swiper/navigation}|oui) |
||||
<div class="swiper-button-prev"></div> |
||||
<div class="swiper-button-next"></div>] |
||||
[(#CONFIG{swiper/scrollbar}|oui) |
||||
<div class="swiper-scrollbar"></div>] |
||||
] |
||||
|
||||
</div> |
||||
|
||||
</B_DOCUMENTS> |
@ -0,0 +1,39 @@
|
||||
<paquet |
||||
prefix="swiper" |
||||
categorie="multimedia" |
||||
version="1.0.0" |
||||
etat="dev" |
||||
compatibilite="[3.2.0;3.2.*]" |
||||
logo="prive/themes/spip/images/swiper-64.png" |
||||
documentation="" |
||||
schema="1.0.0" |
||||
> |
||||
<!-- |
||||
Paquet généré le 2017-10-25 17:28:23 |
||||
--> |
||||
|
||||
<nom>Swiper</nom> |
||||
<!-- Mets-y les doigts --> |
||||
|
||||
<auteur lien='https://www.lesmoutonssauvages.com'>Charles Stephan</auteur> |
||||
|
||||
<licence>GNU/GPL</licence> |
||||
<lib nom="Swiper" lien="https://github.com/nolimits4web/Swiper/archive/master.zip" /> |
||||
<necessite nom="saisies" compatibilite="[2.4.0;]" /> |
||||
<necessite nom="cextras" compatibilite="[3.4.1;[" /> |
||||
|
||||
<pipeline nom="autoriser" inclure="swiper_autorisations.php" /> |
||||
|
||||
<pipeline nom="declarer_tables_objets_sql" inclure="base/swiper.php" /> |
||||
<pipeline nom="declarer_tables_interfaces" inclure="base/swiper.php" /> |
||||
|
||||
<pipeline nom="declarer_champs_extras" inclure="base/swiper.php" /> |
||||
|
||||
<pipeline nom="insert_head" inclure="swiper_pipelines.php" /> |
||||
<pipeline nom="header_prive" inclure="swiper_pipelines.php" /> |
||||
<pipeline nom="insert_head_css" inclure="swiper_pipelines.php" /> |
||||
|
||||
|
||||
<menu nom="swipers" titre="swiper:titre_swipers" parent="menu_edition" icone="images/swiper-16.png" action="swipers" /> |
||||
<menu nom="swiper_creer" titre="swiper:icone_creer_swiper" parent="outils_rapides" icone="images/swiper-new-16.png" action="swiper_edit" parametres="new=oui" /> |
||||
</paquet> |
@ -0,0 +1,7 @@
|
||||
<BOUCLE_swiper(SWIPERS){id_swiper}> |
||||
[<div class="champ contenu_titre[ (#TITRE*|strlen|?{'',vide})]"> |
||||
<label><:swiper:champ_titre_label:> : </label> |
||||
<span dir="#LANG_DIR" class="#EDIT{titre} titre">(#TITRE)</span> |
||||
</div>] |
||||
|
||||
</BOUCLE_swiper> |
@ -0,0 +1,16 @@
|
||||
<BOUCLE_swiper(SWIPERS){id_swiper=#ENV{id}}> |
||||
<div class="infos"> |
||||
[(#SET{texte_objet,<:swiper:titre_swiper:>})] |
||||
<div class="numero"><:titre_cadre_numero_objet{objet=#GET{texte_objet}}:><p>#ID_SWIPER</p></div> |
||||
|
||||
<div class='nb_elements'><!--nb_elements--></div> |
||||
|
||||
[(#AUTORISER{supprimer, swiper, #ID_SWIPER}|oui) |
||||
[(#BOUTON_ACTION{ |
||||
[(#CHEMIN_IMAGE{swiper-del-24.png}|balise_img{<:swiper:supprimer_swiper:>}|concat{' ',#VAL{<:swiper:supprimer_swiper:>}|wrap{<b>}}|trim)], |
||||
#URL_ACTION_AUTEUR{supprimer_swiper, #ID_SWIPER, #URL_ECRIRE{swipers}}, |
||||
icone s24 horizontale danger swiper-del-24, <:swiper:confirmer_supprimer_swiper:>})] |
||||
] |
||||
|
||||
</div> |
||||
</BOUCLE_swiper> |
@ -0,0 +1,34 @@
|
||||
[(#SET{defaut_tri,#ARRAY{ |
||||
titre,1, |
||||
id_swiper,1, |
||||
points,-1 |
||||
}})]<B_liste_swipers> |
||||
#ANCRE_PAGINATION |
||||
<div class="liste-objets swipers"> |
||||
<table class="spip liste"> |
||||
[<caption><strong class="caption">(#ENV*{titre,#GRAND_TOTAL|singulier_ou_pluriel{swiper:info_1_swiper,swiper:info_nb_swipers}})</strong></caption>] |
||||
<thead> |
||||
<tr class="first_row"> |
||||
<th class="picto" scope="col"></th> |
||||
<th class="titre" scope="col">[(#TRI{titre,<:swiper:champ_titre_label:>,ajax})]</th> |
||||
<th class="id" scope="col">[(#TRI{id_swiper,<:info_numero_abbreviation:>,ajax})]</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<BOUCLE_liste_swipers(SWIPERS){id_mot?}{id_auteur?}{where?}{recherche?}{tri #ENV{par,num titre},#GET{defaut_tri}}{par titre}{pagination #ENV{nb,10}}> |
||||
<tr class="[(#COMPTEUR_BOUCLE|alterner{row_odd,row_even})]"> |
||||
<td class="picto">[(#CHEMIN_IMAGE{swiper-16.png}|balise_img)]</td> |
||||
<td class="titre principale">[(#LOGO_SWIPER|image_reduire{20,26})]<a href="[(#ID_SWIPER|generer_url_entite{swiper})]" title="<:info_numero_abbreviation|attribut_html:> #ID_SWIPER">[(#RANG). ]#TITRE</a></td> |
||||
<td class="id">[(#AUTORISER{modifier,swiper,#ID_SWIPER}|?{ |
||||
<a href="[(#URL_ECRIRE{swiper_edit,id_swiper=#ID_SWIPER})]">#ID_SWIPER</a>, |
||||
#ID_SWIPER |
||||
})]</td> |
||||
</tr> |
||||
</BOUCLE_liste_swipers> |
||||
</tbody> |
||||
</table> |
||||
[<p class="pagination">(#PAGINATION{prive})</p>] |
||||
</div> |
||||
</B_liste_swipers>[ |
||||
<div class="liste-objets swipers caption-wrap"><strong class="caption">(#ENV*{sinon,''})</strong></div> |
||||
]<//B_liste_swipers> |
@ -0,0 +1,7 @@
|
||||
[(#AUTORISER{configurer,_swiper}|sinon_interdire_acces)] |
||||
|
||||
<h1 class="grostitre"><:swiper:titre_page_configurer_swiper:></h1> |
||||
|
||||
<div class="ajax"> |
||||
#FORMULAIRE_CONFIGURER_SWIPER |
||||
</div> |
After Width: | Height: | Size: 602 B |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 897 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 763 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 775 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 844 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 808 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.1 KiB |
@ -0,0 +1,25 @@
|
||||
<BOUCLE_principale(SWIPERS) {id_swiper}> |
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
||||
[(#REM) Cf.: http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ |
||||
]<!--[if lt IE 7 ]> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js ie ie6"> <![endif]--> |
||||
<!--[if IE 7 ]> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js ie ie7"> <![endif]--> |
||||
<!--[if IE 8 ]> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js ie ie8"> <![endif]--> |
||||
<!--[if IE 9 ]> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js ie ie9"> <![endif]--> |
||||
<!--[if (gt IE 9)|!(IE)]><!--> <html dir="#LANG_DIR" lang="#LANG" xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" class="[(#LANG_DIR)][ (#LANG)] no-js"> <!--<![endif]--> |
||||
<head> |
||||
<script type='text/javascript'>/*<![CDATA[*/(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement);/*]]>*/</script> |
||||
<title>[(#TITRE|couper{80}|textebrut) - ][(#NOM_SITE_SPIP|textebrut)]</title> |
||||
[<meta name="description" content="(#INTRODUCTION{150}|attribut_html)" />] |
||||
[<link rel="canonical" href="(#URL_SWIPER|url_absolue)" />] |
||||
<INCLURE{fond=inclure/head} /> |
||||
[(#REM) Lien vers le flux RSS des swipers ] |
||||
<link rel="alternate" type="application/rss+xml" title="<:dernieres_swipers:>" href="#URL_PAGE{backend-swipers}" /> |
||||
</head> |
||||
|
||||
<body class="pas_surlignable page_swiper"> |
||||
|
||||
[(#MODELE{swiper,env})] |
||||
|
||||
</body> |
||||
</html> |
||||
</BOUCLE_principale> |
@ -0,0 +1,80 @@
|
||||
<?php |
||||
/** |
||||
* Fichier gérant l'installation et désinstallation du plugin Swiper |
||||
* |
||||
* @plugin Swiper |
||||
* @copyright 2017 |
||||
* @author Charles Stephan |
||||
* @licence GNU/GPL |
||||
* @package SPIP\Swiper\Installation |
||||
*/ |
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) { |
||||
return; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Fonction d'installation et de mise à jour du plugin Swiper. |
||||
* |
||||
* @param string $nom_meta_base_version |
||||
* Nom de la meta informant de la version du schéma de données du plugin installé dans SPIP |
||||
* @param string $version_cible |
||||
* Version du schéma de données dans ce plugin (déclaré dans paquet.xml) |
||||
* @return void |
||||
**/ |
||||
function swiper_upgrade($nom_meta_base_version, $version_cible) { |
||||
$maj = array(); |
||||
include_spip('inc/cextras'); |
||||
include_spip('base/upgrade'); |
||||
include_spip('base/swiper'); |
||||
|
||||
$maj['create'] = array(array('maj_tables', array('spip_swipers'))); |
||||
cextras_api_upgrade(swiper_declarer_champs_extras(), $maj['create']); |
||||
|
||||
$c = lire_config('documents_objets'); |
||||
$d = explode(",", $c); |
||||
if (!in_array("spip_swipers", $d)) |
||||
ecrire_meta('documents_objets', $c."spip_swipers,"); |
||||
|
||||
$s = lire_config('swiper'); |
||||
if (!in_array("swiper_options", $s)) |
||||
ecrire_config('swiper/swiper_options', "{\nkeyboard : true,\npagination: {\nel: '.swiper-pagination',\ntype: 'bullets'\n},\nscrollbar: {\nel: '.swiper-scrollbar',\ndraggable: true\n},\nnavigation: {\nnextEl: '.swiper-button-next',\nprevEl: '.swiper-button-prev'\n}\n}"); |
||||
|
||||
maj_plugin($nom_meta_base_version, $version_cible, $maj); |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* Fonction de désinstallation du plugin Swiper. |
||||
* |
||||
* @param string $nom_meta_base_version |
||||
* Nom de la meta informant de la version du schéma de données du plugin installé dans SPIP |
||||
* @return void |
||||
**/ |
||||
function swiper_vider_tables($nom_meta_base_version) { |
||||
|
||||
include_spip('inc/cextras'); |
||||
include_spip('base/upgrade'); |
||||
include_spip('base/swiper'); |
||||
|
||||
// sql_drop_table('spip_swipers'); |
||||
cextras_api_vider_tables(swiper_declarer_champs_extras(), $maj['create']); |
||||
|
||||
# Nettoyer les liens courants (le génie optimiser_base_disparus se chargera de nettoyer toutes les tables de liens) |
||||
// sql_delete('spip_documents_liens', sql_in('objet', array('swiper'))); |
||||
// sql_delete('spip_mots_liens', sql_in('objet', array('swiper'))); |
||||
// sql_delete('spip_auteurs_liens', sql_in('objet', array('swiper'))); |
||||
# Nettoyer les versionnages et forums |
||||
sql_delete('spip_versions', sql_in('objet', array('swiper'))); |
||||
sql_delete('spip_versions_fragments', sql_in('objet', array('swiper'))); |
||||
sql_delete('spip_forum', sql_in('objet', array('swiper'))); |
||||
|
||||
$c = lire_config('documents_objets'); |
||||
$c = str_replace('spip_swipers,', '', $c); |
||||
ecrire_meta('documents_objets', $c); |
||||
effacer_meta("swiper"); |
||||
|
||||
effacer_meta($nom_meta_base_version); |
||||
} |
@ -0,0 +1,111 @@
|
||||
<?php |
||||
/** |
||||
* Définit les autorisations du plugin Swiper |
||||
* |
||||
* @plugin Swiper |
||||
* @copyright 2017 |
||||
* @author Charles Stephan |
||||
* @licence GNU/GPL |
||||
* @package SPIP\Swiper\Autorisations |
||||
*/ |
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) { |
||||
return; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Fonction d'appel pour le pipeline |
||||
* @pipeline autoriser */ |
||||
function swiper_autoriser() { |
||||
} |
||||
|
||||
|
||||
// ----------------- |
||||
// Objet swipers |
||||
|
||||
|
||||
/** |
||||
* Autorisation de voir un élément de menu (swipers) |
||||
* |
||||
* @param string $faire Action demandée |
||||
* @param string $type Type d'objet sur lequel appliquer l'action |
||||
* @param int $id Identifiant de l'objet |
||||
* @param array $qui Description de l'auteur demandant l'autorisation |
||||
* @param array $opt Options de cette autorisation |
||||
* @return bool true s'il a le droit, false sinon |
||||
**/ |
||||
function autoriser_swipers_menu_dist($faire, $type, $id, $qui, $opt) { |
||||
return true; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Autorisation de voir le bouton d'accès rapide de création (swiper) |
||||
* |
||||
* @param string $faire Action demandée |
||||
* @param string $type Type d'objet sur lequel appliquer l'action |
||||
* @param int $id Identifiant de l'objet |
||||
* @param array $qui Description de l'auteur demandant l'autorisation |
||||
* @param array $opt Options de cette autorisation |
||||
* @return bool true s'il a le droit, false sinon |
||||
**/ |
||||
function autoriser_swipercreer_menu_dist($faire, $type, $id, $qui, $opt) { |
||||
return autoriser('creer', 'swiper', '', $qui, $opt); |
||||
} |
||||
|
||||
/** |
||||
* Autorisation de créer (swiper) |
||||
* |
||||
* @param string $faire Action demandée |
||||
* @param string $type Type d'objet sur lequel appliquer l'action |
||||
* @param int $id Identifiant de l'objet |
||||
* @param array $qui Description de l'auteur demandant l'autorisation |
||||
* @param array $opt Options de cette autorisation |
||||
* @return bool true s'il a le droit, false sinon |
||||
**/ |
||||
function autoriser_swiper_creer_dist($faire, $type, $id, $qui, $opt) { |
||||
return in_array($qui['statut'], array('0minirezo', '1comite')); |
||||
} |
||||
|
||||
/** |
||||
* Autorisation de voir (swiper) |
||||
* |
||||
* @param string $faire Action demandée |
||||
* @param string $type Type d'objet sur lequel appliquer l'action |
||||
* @param int $id Identifiant de l'objet |
||||
* @param array $qui Description de l'auteur demandant l'autorisation |
||||
* @param array $opt Options de cette autorisation |
||||
* @return bool true s'il a le droit, false sinon |
||||
**/ |
||||
function autoriser_swiper_voir_dist($faire, $type, $id, $qui, $opt) { |
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* Autorisation de modifier (swiper) |
||||
* |
||||
* @param string $faire Action demandée |
||||
* @param string $type Type d'objet sur lequel appliquer l'action |
||||
* @param int $id Identifiant de l'objet |
||||
* @param array $qui Description de l'auteur demandant l'autorisation |
||||
* @param array $opt Options de cette autorisation |
||||
* @return bool true s'il a le droit, false sinon |
||||
**/ |
||||
function autoriser_swiper_modifier_dist($faire, $type, $id, $qui, $opt) { |
||||
return in_array($qui['statut'], array('0minirezo', '1comite')); |
||||
} |
||||
|
||||
/** |
||||
* Autorisation de supprimer (swiper) |
||||
* |
||||
* @param string $faire Action demandée |
||||
* @param string $type Type d'objet sur lequel appliquer l'action |
||||
* @param int $id Identifiant de l'objet |
||||
* @param array $qui Description de l'auteur demandant l'autorisation |
||||
* @param array $opt Options de cette autorisation |
||||
* @return bool true s'il a le droit, false sinon |
||||
**/ |
||||
function autoriser_swiper_supprimer_dist($faire, $type, $id, $qui, $opt) { |
||||
return $qui['statut'] == '0minirezo' and !$qui['restreint']; |
||||
} |
@ -0,0 +1,66 @@
|
||||
<?php |
||||
/** |
||||
* Utilisations de pipelines par Swiper |
||||
* |
||||
* @plugin Swiper |
||||
* @copyright 2017 |
||||
* @author Charles Stephan |
||||
* @licence GNU/GPL |
||||
* @package SPIP\Swiper\Pipelines |
||||
*/ |
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) { |
||||
return; |
||||
} |
||||
|
||||
function swiper_configurateur() { |
||||
|
||||
$c = lire_config('swiper'); |
||||
$flux = '<script type="text/javascript">'; |
||||
$flux .= ' var swiper_options = ' . $c["swiper_options"]; |
||||
$flux .= ' , mySwipers;'; |
||||
$flux .= ' $(document).ready(function(){ '; |
||||
$flux .= ' var target = swiper_options.containerModifierClass || ".swiper-container";'; |
||||
$flux .= ' if (target.length) mySwipers = new Swiper(target, swiper_options);'; |
||||
$flux .= ' })'; |
||||
$flux .= '</script>'; |
||||
|
||||
return $flux; |
||||
|
||||
} |
||||
|
||||
function swiper_insert_head($flux) { |
||||
|
||||
$lib = find_in_path('lib/Swiper/dist/js/swiper.min.js'); |
||||
$flux .='<script src="'.$lib.'" type="text/javascript"></script>'; |
||||
$flux .= swiper_configurateur(); |
||||
|
||||
return $flux; |
||||
} |
||||
|
||||
function swiper_insert_head_css($flux) { |
||||
|
||||
$css = find_in_path('lib/Swiper/dist/css/swiper.min.css') ; |
||||
$flux .='<link rel="stylesheet" type="text/css" href="'.$css.'">' ; |
||||
|
||||
$swiper_spip_css = find_in_path('swiper_spip.css') ; |
||||
$flux .='<link rel="stylesheet" type="text/css" href="'.$swiper_spip_css.'">' ; |
||||
|
||||
return $flux; |
||||
} |
||||
|
||||
function swiper_header_prive($flux) { |
||||
|
||||
$css = find_in_path('lib/Swiper/dist/css/swiper.min.css') ; |
||||
$flux .='<link rel="stylesheet" type="text/css" href="'.$css.'">' ; |
||||
|
||||
$swiper_spip_css = find_in_path('swiper_spip.css') ; |
||||
$flux .='<link rel="stylesheet" type="text/css" href="'.$swiper_spip_css.'">' ; |
||||
|
||||
$lib = find_in_path('lib/Swiper/dist/js/swiper.min.js'); |
||||
$flux .='<script src="'.$lib.'" type="text/javascript"></script>'; |
||||
|
||||
$flux .= swiper_configurateur(); |
||||
|
||||
return $flux; |
||||
} |
@ -0,0 +1,56 @@
|
||||
.swiper-container { |
||||
height: 300px; |
||||
} |
||||
|
||||
figure.swiper-slide{ |
||||
background-size: cover; |
||||
background-position: center; |
||||
} |
||||
|
||||
figure.swiper-slide img{ |
||||
position: absolute; |
||||
top: -1000%; |
||||
} |
||||
|
||||
figure.swiper-slide figcaption { |
||||
position: relative; |
||||
text-align: left; |
||||
padding:1.5em 2.25em; |
||||
} |
||||
|
||||
figure.swiper-slide figcaption .titre, |
||||
figure.swiper-slide figcaption p, |
||||
figure.swiper-slide figcaption a{ |
||||
background: white; |
||||
padding: 0 .25em; |
||||
} |
||||
|
||||
figure.swiper-slide figcaption a { |
||||
padding: .125em .25em;; |
||||
font-size: .9em; |
||||
} |
||||
|
||||
figure.swiper-slide figcaption a:hover{ |
||||
background: #db1762; |
||||
} |
||||
|
||||
figure.swiper-slide figcaption p, |
||||
figure.swiper-slide figcaption a { |
||||
display: inline-block; |
||||
} |
||||
|
||||
figure.swiper-slide figcaption .titre{ |
||||
font-size: 2.5em; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.page_swiper figure.swiper-slide figcaption { |
||||
top:1em; |
||||
padding: 2em; |
||||
} |
||||
|
||||
.page_swiper .swiper-container { |
||||
height: 100%; |
||||
position: absolute; |
||||
width: 100%; |
||||
} |