champs extras sur les transcriptions
This commit is contained in:
parent
28b4cdc0f8
commit
187470d626
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return;
|
||||
|
||||
// des champs extras
|
||||
function librealire_declarer_champs_extras($champs = array()) {
|
||||
$champs['spip_articles']['transcriptions'] = array(
|
||||
'saisie' => 'fieldset',
|
||||
'options' => array(
|
||||
'nom' => _T('librealire:transcriptions'),
|
||||
'label' => _T('librealire:transcriptions_label'),
|
||||
'explication' => 'Utilisez les raccourcis typo courant de SPIP (lien = [texte du lien->url])...'
|
||||
),
|
||||
'saisies' => array(
|
||||
'titre_t' => array(
|
||||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom'=>'titre_t',
|
||||
'sql' => "text NOT NULL DEFAULT ''",
|
||||
'rechercher' => true,
|
||||
'label' => _T('librealire:titre_t'),
|
||||
'explication' => _T('librealire:titre_t_explications'),
|
||||
'obligatoire' => false
|
||||
)
|
||||
),
|
||||
'source' => array(
|
||||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom'=>'source',
|
||||
'sql' => "text NOT NULL DEFAULT ''",
|
||||
'rechercher' => true,
|
||||
'label' => _T('librealire:source'),
|
||||
'explication' => _T('librealire:origine_explications'),
|
||||
'obligatoire' => false
|
||||
)
|
||||
),
|
||||
'lieu' => array(
|
||||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom'=>'lieu',
|
||||
'sql' => "text NOT NULL DEFAULT ''",
|
||||
'rechercher' => true,
|
||||
'label' => _T('librealire:lieu'),
|
||||
'explication' => _T('librealire:lieu_explications'),
|
||||
'obligatoire' => false
|
||||
)
|
||||
),
|
||||
'date_t' => array(
|
||||
'saisie' => 'date',
|
||||
'options' => array(
|
||||
'nom'=>'date_t',
|
||||
'sql' => "text NOT NULL DEFAULT ''",
|
||||
'rechercher' => true,
|
||||
'label' => _T('librealire:date_t'),
|
||||
'explication' => _T('librealire:date_t_explications'),
|
||||
'obligatoire' => false
|
||||
)
|
||||
),
|
||||
'duree' => array(
|
||||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom'=>'duree',
|
||||
'sql' => "text NOT NULL DEFAULT ''",
|
||||
'rechercher' => false,
|
||||
'label' => _T('librealire:duree'),
|
||||
'explication' => _T('librealire:duree_explications'),
|
||||
'obligatoire' => false
|
||||
)
|
||||
),
|
||||
'liens' => array(
|
||||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom'=>'liens',
|
||||
'sql' => "text NOT NULL DEFAULT ''",
|
||||
'rechercher' => false,
|
||||
'label' => _T('librealire:liens'),
|
||||
'explication' => _T('librealire:liens_explications'),
|
||||
'obligatoire' => false
|
||||
)
|
||||
),
|
||||
'evenement' => array(
|
||||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom'=>'evenement',
|
||||
'sql' => "text NOT NULL DEFAULT ''",
|
||||
'rechercher' => false,
|
||||
'label' => _T('librealire:evenement'),
|
||||
'explication' => _T('librealire:evenement_explications'),
|
||||
'obligatoire' => false
|
||||
)
|
||||
),
|
||||
'licence' => array(
|
||||
'saisie' => 'checkbox',
|
||||
'options' => array(
|
||||
'nom'=>'licence',
|
||||
'sql' => "text NOT NULL DEFAULT ''",
|
||||
'rechercher' => false,
|
||||
'label' => _T('librealire:licence'),
|
||||
'explication' => _T('librealire:licence_explications'),
|
||||
'obligatoire' => false,
|
||||
'datas' => array(
|
||||
'verbatim' => 'verbatim',
|
||||
'autrelicence' => 'autrelicence'
|
||||
),
|
||||
'defaut' => 'verbatim'
|
||||
)
|
||||
),
|
||||
'creditsvisuels' => array(
|
||||
'saisie' => 'input',
|
||||
'options' => array(
|
||||
'nom'=>'creditsvisuels',
|
||||
'sql' => "text NOT NULL DEFAULT ''",
|
||||
'rechercher' => false,
|
||||
'label' => _T('librealire:creditsvisuels'),
|
||||
'explication' => _T('librealire:creditsvisuels_explications'),
|
||||
'obligatoire' => false
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
return $champs;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
<div class="formulaire_spip formulaire_configurer formulaire_#FORM">
|
||||
|
||||
<h3 class="titrem"><:librealire:titre_page_configurer_librealire:/></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}}
|
||||
<ul class="editer-groupe">
|
||||
|
||||
[(#SAISIE{input,avertissement,
|
||||
label=<:librealire:avertissement_label:>,
|
||||
explication=<:librealire:avertissement_explications:>})]
|
||||
|
||||
</ul>
|
||||
<p class="boutons"><span class="image_loading"> </span><input type="submit" class="submit" value="<:bouton_enregistrer:/>" /></p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* Fichier gérant l'installation et désinstallation du plugin librealire
|
||||
*
|
||||
* @plugin librealire
|
||||
* @copyright 2020
|
||||
* @author Nicolas Dorigny
|
||||
* @licence GNU/GPL
|
||||
* @package SPIP\librealire\Installation
|
||||
*/
|
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
// include_spip('inc/meta');
|
||||
include_spip('inc/cextras');
|
||||
include_spip('base/librealire');
|
||||
|
||||
/**
|
||||
* Fonction d'installation et de mise à jour du plugin librealire.
|
||||
*
|
||||
* @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 librealire_upgrade($nom_meta_base_version, $version_cible) {
|
||||
|
||||
// Création du tableau des mises à jour.
|
||||
$maj = array();
|
||||
|
||||
// maj champs extras et autres
|
||||
cextras_api_upgrade(librealire_declarer_champs_extras(), $maj['0.1.0']);
|
||||
cextras_api_upgrade(librealire_declarer_champs_extras(), $maj['0.2.0']);
|
||||
cextras_api_upgrade(librealire_declarer_champs_extras(), $maj['0.3.0']);
|
||||
// $maj['1.1.4'] = array(
|
||||
// array('maj_tables', array('spip_roles_documents')),
|
||||
// );
|
||||
|
||||
// Maj du plugin.
|
||||
include_spip('base/upgrade');
|
||||
maj_plugin($nom_meta_base_version, $version_cible, $maj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fonction de désinstallation du plugin librealire.
|
||||
*
|
||||
* @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 librealire_vider_tables($nom_meta_base_version) {
|
||||
cextras_api_vider_tables(librealire_declarer_champs_extras());
|
||||
effacer_meta($nom_meta_base_version);
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fonction d'appel pour le pipeline
|
||||
*
|
||||
* @pipeline autoriser
|
||||
*/
|
||||
function librealire_autoriser() {
|
||||
}
|
||||
|
||||
|
||||
include_spip('inc/cextras_autoriser');
|
||||
// restreindre le champ 'loisirs' sur les articles qui portent la composition 'cv'
|
||||
restreindre_extras('article', array('transcriptions'), 'transcriptions', 'composition');
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
|
11
paquet.xml
11
paquet.xml
|
@ -1,7 +1,8 @@
|
|||
<paquet
|
||||
prefix="librealire"
|
||||
categorie="squelette"
|
||||
version="0.1.3"
|
||||
version="0.2.0"
|
||||
schema="0.3.0"
|
||||
etat="dev"
|
||||
compatibilite="[3.2.7;3.3.*]"
|
||||
>
|
||||
|
@ -12,8 +13,16 @@
|
|||
|
||||
<necessite nom="baz_april" />
|
||||
|
||||
<necessite nom="cextras" />
|
||||
|
||||
<chemin path="squelettes" />
|
||||
<chemin path="squelettes/scss" />
|
||||
<chemin path="" />
|
||||
|
||||
<pipeline nom="autoriser" inclure="librealire_autorisations.php"/>
|
||||
<pipeline nom="declarer_champs_extras" inclure="base/librealire.php"/>
|
||||
<!-- <pipeline nom="declarer_tables_objets_sql" inclure="base/librealire.php" /> -->
|
||||
|
||||
<menu nom="configurer_librealire" titre="Options Libre à lire" parent="menu_squelette" icone="images/baz_april-16.png" />
|
||||
|
||||
</paquet>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
[(#AUTORISER{configurer,_librealire}|sinon_interdire_acces)]
|
||||
|
||||
<h1 class="grostitre"><:librealire:titre_page_configurer_librealire:/></h1>
|
||||
|
||||
<div class="ajax">
|
||||
#FORMULAIRE_CONFIGURER_LIBREALIRE
|
||||
</div>
|
|
@ -1,58 +0,0 @@
|
|||
<BOUCLE_principale(ARTICLES){id_article}>
|
||||
|
||||
<article>
|
||||
|
||||
<header class="cartouche">
|
||||
|
||||
[<p class="#EDIT{surtitre} surtitre">(#SURTITRE)</p>]
|
||||
<h1><span class="#EDIT{titre} article__titre">#TITRE</span>[
|
||||
<small class="#EDIT{soustitre} soustitre">(#SOUSTITRE)</small>
|
||||
]</h1>
|
||||
|
||||
<p class="article__infos">
|
||||
[<span class="article__date">Publié le (#DATE|nom_jour) [(#DATE|affdate)] #SET{heure,#DATE|heures_minutes} [à (#GET{heure}|=={00h00min}|non)#GET{heure}]</span>]
|
||||
[(#CONFIG{baz_april/afficherauteurs}|=={on}|oui)[<span class="article__auteurs"><:par_auteur:> (#LESAUTEURS)</span>]]
|
||||
</p>
|
||||
|
||||
<div class="postmeta">
|
||||
#MODELE{article_traductions}
|
||||
<BOUCLE_groupes(GROUPES_MOTS){par titre}>
|
||||
<B_tags>
|
||||
<p class="mots">
|
||||
<strong>#TITRE : </strong><BOUCLE_tags(MOTS){id_article}{id_groupe}{', '}>
|
||||
<a href="#URL_MOT">#TITRE</a>
|
||||
</BOUCLE_tags>
|
||||
</p>
|
||||
</B_tags>
|
||||
</BOUCLE_groupes>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="main">
|
||||
|
||||
[<div class="#EDIT{chapo} article__chapo">(#CHAPO)</div>]
|
||||
|
||||
[<div class="#EDIT{texte} article__texte">(#TEXTE|image_reduire{#CONST{_CONTENT_WIDTH},0})</div>]
|
||||
|
||||
</div>
|
||||
|
||||
[<aside>
|
||||
(#INCLURE{fond=inclure/documents,id_article})
|
||||
</aside>]
|
||||
|
||||
<footer>
|
||||
|
||||
[<p class="#EDIT{hyperlien} article__hyperlien"><:voir_en_ligne:/> : <a href="(#URL_SITE)" class="spip_out">[(#NOM_SITE|sinon{[(#URL_SITE|couper{80})]})]</a></p>]
|
||||
|
||||
[<div class="ps">
|
||||
<div class="#EDIT{ps} article__ps">(#PS|image_reduire{#CONST{_CONTENT_WIDTH},0})</div>
|
||||
</div>]
|
||||
|
||||
[<div class="article__notes">(#NOTES)</div>]
|
||||
|
||||
</footer>
|
||||
|
||||
</article>
|
||||
|
||||
</BOUCLE_principale>
|
Loading…
Reference in New Issue