Ajout d'une ancre nommée sur les blocks

master
nicod_ 5 months ago
parent fe87b6a1fe
commit 17aa24fda1

@ -47,6 +47,7 @@ function blocks_declarer_tables_objets_sql($tables) {
'field' => [
'id_block' => 'bigint(21) NOT NULL',
'id_blocktype' => 'bigint(21) NOT NULL DEFAULT 0',
'ancre' => 'varchar(20) NOT NULL DEFAULT ""',
'valeurs' => 'text NOT NULL DEFAULT ""',
'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"',
'statut' => 'varchar(20) DEFAULT "0" NOT NULL',
@ -59,8 +60,8 @@ function blocks_declarer_tables_objets_sql($tables) {
],
'titre' => 'id_blocktype AS titre',
'date' => 'date',
'champs_editables' => ['id_blocktype'],
'champs_versionnes' => ['valeurs', 'id_blocktype'],
'champs_editables' => ['id_blocktype', 'ancre'],
'champs_versionnes' => ['id_blocktype', 'ancre', 'valeurs'],
'tables_jointures' => ['spip_blocks_liens'],
'statut_textes_instituer' => [
'prepa' => 'texte_statut_en_cours_redaction',

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

@ -120,3 +120,7 @@
.formulaire_spip .editer_id_blocktype.obligatoire label {
font-weight: normal;
}
#wysiwyg .formulaire_spip .editer .explication {
margin-bottom: 0;
}

@ -16,6 +16,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = [
'bouton_enregistrer' => 'Enregistrer ce bloc',
// C
'champ_ancre_label' => 'Ancre nommée (optionnel)',
'champ_ancre_explication' => 'Pour pouvoir faire un lien vers ce bloc',
'champ_block_config_label' => 'Configuration du bloc',
'champ_block_contenu_label' => 'Contenu du bloc',
'champ_id_blocktype_label' => 'Type de bloc',

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

@ -4,4 +4,11 @@
#SET{valeurs, #VALEURS|blocks_deserialize}
[(#VOIR_SAISIES{#GET{saisies}, #GET{valeurs}})]
[<div class="champ afficher afficher_ancre">
<strong class="label"><:block:champ_ancre_label:/></strong>
<div class="valeur ">
(#ANCRE)
</div>
</div>]
</BOUCLE_block>

Loading…
Cancel
Save