Un champ objets sur les types de blocs, pour restreindre un type de bloc à un ou plusieurs objets éditoriaux

master
nicod_ 5 months ago
parent a33ce5e0e3
commit bc97a02f19

@ -92,6 +92,7 @@ function blocks_declarer_tables_objets_sql($tables) {
'description' => 'text NOT NULL DEFAULT ""',
'identifiant' => 'text NOT NULL DEFAULT ""',
'saisies' => 'text NOT NULL DEFAULT ""',
'objets' => 'text NOT NULL DEFAULT ""',
'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
],
'key' => [
@ -99,8 +100,8 @@ function blocks_declarer_tables_objets_sql($tables) {
'UNIQUE KEY identifiant' => 'identifiant',
],
'titre' => 'titre AS titre, "" AS lang',
'champs_editables' => ['titre', 'description', 'saisies', 'identifiant'],
'champs_versionnes' => ['titre', 'description', 'saisies', 'identifiant'],
'champs_editables' => ['titre', 'description', 'saisies', 'objets', 'identifiant'],
'champs_versionnes' => ['titre', 'description', 'saisies', 'objets', 'identifiant'],
'rechercher_champs' => ["titre" => 10, 'description' => 5, 'identifiant' => 5],
'tables_jointures' => [],
'page' => false,

@ -47,6 +47,10 @@ function blocks_upgrade($nom_meta_base_version, $version_cible) {
['maj_tables', ['spip_blocks']],
];
$maj['1.1.2'] = [
['maj_tables', ['spip_blocktypes']],
];
include_spip('base/upgrade');
maj_plugin($nom_meta_base_version, $version_cible, $maj);
}

@ -10,12 +10,15 @@ $GLOBALS[$GLOBALS['idx_lang']] = [
// A
'ajouter_lien_blocktype' => 'Ajouter ce type de bloc',
'aucune_saisie' => 'Ce type de bloc n\'a pas de paramètres.',
// C
'champ_identifiant_label' => 'Identifiant',
'champ_identifiant_explication' => 'Unique, composé de lettres en minuscules, chiffres ou souligné <code>_</code><br>Cet identifiant servira aussi à trouver le squelette qui affichera ce type de bloc : <code>squelettes/blocks/identifiant.html</code></code>',
'champ_saisies_label' => 'Paramètres de ce type de bloc',
'champ_titre_label' => 'Titre',
'champ_description_label' => 'Description',
'champ_objets_label' => 'Objets',
'champ_objets_explication' => 'Restreindre ce type de bloc à certains objets',
'confirmer_supprimer_blocktype' => 'Confirmez-vous la suppression de cet type de bloc ?',
// I

@ -5,7 +5,7 @@
compatibilite="[4.2.0;4.2.*]"
logo="prive/themes/spip/images/blocks-xx.svg"
documentation=""
schema="1.1.1"
schema="1.1.2"
>
<nom>Blocks</nom>

@ -6,6 +6,10 @@
<p>
<strong class="label"><:blocktype:champ_identifiant_label:/> : </strong>#IDENTIFIANT
</p>
<p>
<strong class="label"><:blocktype:champ_objets_label:/> : </strong>
<INCLURE{fond=saisies-vues/blocks_objets, valeur=#OBJETS}>
</p>
<p>
<strong class="label"><:blocktype:texte_squelette_public:/> : </strong>
#SET{skel, #IDENTIFIANT|blocks_trouver_squelette{1,1,0}}

Loading…
Cancel
Save