diff --git a/base/blocks.php b/base/blocks.php index d54b06c4b0b3780042a2f842782b2f4aacbfa559..981c683497bf0a69c0db0d147f87b22cd3e14f3d 100644 --- a/base/blocks.php +++ b/base/blocks.php @@ -91,17 +91,19 @@ function blocks_declarer_tables_objets_sql($tables) { 'field' => [ 'id_blocs_type' => 'bigint(21) NOT NULL', 'titre' => 'text NOT NULL DEFAULT ""', + 'identifiant' => 'text NOT NULL DEFAULT ""', 'saisies' => 'text NOT NULL DEFAULT ""', 'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', ], 'key' => [ - 'PRIMARY KEY' => 'id_blocs_type', + 'PRIMARY KEY' => 'id_blocs_type', + 'KEY identifiant' => 'identifiant', ], 'titre' => 'titre AS titre, "" AS lang', #'date' => '', - 'champs_editables' => ['titre', 'saisies'], - 'champs_versionnes' => ['titre', 'saisies'], - 'rechercher_champs' => ["titre" => 10], + 'champs_editables' => ['titre', 'saisies', 'identifiant'], + 'champs_versionnes' => ['titre', 'saisies', 'identifiant'], + 'rechercher_champs' => ["titre" => 10, 'identifiant' => 5], 'tables_jointures' => [], ]; diff --git a/formulaires/editer_blocs_type.php b/formulaires/editer_blocs_type.php index b99e4850190fa6f99e848c0c393307b2cde8f428..acee67f607c844a1e90398f10a79c53a795ebaa6 100644 --- a/formulaires/editer_blocs_type.php +++ b/formulaires/editer_blocs_type.php @@ -45,6 +45,16 @@ function formulaires_editer_blocs_type_saisies_dist($id_blocs_type = 'new', $ret ], ], + [ + 'saisie' => 'input', + 'options' => [ + 'nom' => 'identifiant', + 'obligatoire' => 'oui', + 'label' => _T('blocs_type:champ_identifiant_label'), + 'explication' => _T('blocs_type:champ_identifiant_explication'), + + ], + ], ]; return $saisies; } @@ -124,7 +134,7 @@ function formulaires_editer_blocs_type_charger_dist($id_blocs_type = 'new', $ret */ function formulaires_editer_blocs_type_verifier_dist($id_blocs_type = 'new', $retour = '', $lier_trad = 0, $config_fonc = '', $row = [], $hidden = '') { - $erreurs = formulaires_editer_objet_verifier('blocs_type', $id_blocs_type, ['titre']); + $erreurs = formulaires_editer_objet_verifier('blocs_type', $id_blocs_type, ['titre', 'identifiant']); return $erreurs; } diff --git a/lang/blocs_type_fr.php b/lang/blocs_type_fr.php index eafebb33d66789caf5d7a46dc101d88a4c9d2f5f..174f7970c54862f5aa3c3a9d859e95e420290d06 100644 --- a/lang/blocs_type_fr.php +++ b/lang/blocs_type_fr.php @@ -11,6 +11,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = [ 'ajouter_lien_blocs_type' => 'Ajouter ce type de bloc', // 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', 'confirmer_supprimer_blocs_type' => 'Confirmez-vous la suppression de cet type de bloc ?',