From 6c87bcb4413d39364e8ffc2163d9e461e3973188 Mon Sep 17 00:00:00 2001
From: nicod_ <nicod@lerebooteux.fr>
Date: Sat, 15 Apr 2023 20:56:36 +0200
Subject: [PATCH] =?UTF-8?q?Cr=C3=A9er=20un=20bloc=20de=20type=20"Texte=20s?=
 =?UTF-8?q?imple"=20l'installation?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 blocks_administrations.php | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/blocks_administrations.php b/blocks_administrations.php
index 63bc24d..a7e19bf 100644
--- a/blocks_administrations.php
+++ b/blocks_administrations.php
@@ -60,10 +60,37 @@ function blocks_vider_tables($nom_meta_base_version) {
 }
 
 function blocks_installe_config() {
+	include_spip('blocks_fonctions');
+
+	// associer par défaut aux articles et rubriques
 	ecrire_config('blocks/objets',
 		[
 			0 => 'spip_articles',
 			2 => 'spip_rubriques',
 		],
 	);
+
+	// un type de bloc de base : texte
+	sql_insertq(
+		'spip_blocs_types',
+		[
+			'titre'       => 'Texte simple',
+			'identifiant' => 'texte_simple',
+			'saisies'     => blocks_serialize([
+				[
+					'options'     =>
+						[
+							'label'            => 'Texte',
+							'conteneur_class'  => 'pleine_largeur',
+							'rows'             => '10',
+							'inserer_barre'    => 'edition',
+							'previsualisation' => 'on',
+							'nom'              => 'textarea_1',
+						],
+					'identifiant' => uniqid('@'),
+					'saisie'      => 'textarea',
+				],
+			]),
+		]
+	);
 }
-- 
GitLab