Formatage

master
nicod_ 4 weeks ago
parent 10d6a33d7f
commit c7c2e36d39

@ -45,17 +45,17 @@ function blocks_declarer_tables_objets_sql($tables) {
'type' => 'block',
'principale' => 'oui',
'field' => [
'id_block' => 'bigint(21) NOT NULL',
'id_block' => 'bigint(21) NOT NULL',
'id_blocktype' => 'bigint(21) NOT NULL DEFAULT 0',
'valeurs' => 'text NOT NULL DEFAULT ""',
'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"',
'statut' => 'varchar(20) DEFAULT "0" NOT NULL',
'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
'valeurs' => 'text NOT NULL DEFAULT ""',
'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"',
'statut' => 'varchar(20) DEFAULT "0" NOT NULL',
'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
],
'key' => [
'PRIMARY KEY' => 'id_block',
'PRIMARY KEY' => 'id_block',
'KEY id_blocktype' => 'id_blocktype',
'KEY statut' => 'statut',
'KEY statut' => 'statut',
],
'titre' => 'id_blocktype AS titre',
'date' => 'date',
@ -88,11 +88,11 @@ function blocks_declarer_tables_objets_sql($tables) {
'table_objet_surnoms' => ['blockstype'], // table_objet('blocktype') => 'blocktypes'
'field' => [
'id_blocktype' => 'bigint(21) NOT NULL',
'titre' => 'text NOT NULL DEFAULT ""',
'description' => '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',
'titre' => 'text NOT NULL DEFAULT ""',
'description' => '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_blocktype',
@ -125,14 +125,14 @@ function blocks_declarer_tables_auxiliaires($tables) {
$tables['spip_blocks_liens'] = [
'field' => [
'id_block' => 'bigint(21) DEFAULT "0" NOT NULL',
'id_block' => 'bigint(21) DEFAULT "0" NOT NULL',
'id_objet' => 'bigint(21) DEFAULT "0" NOT NULL',
'objet' => 'varchar(25) DEFAULT "" NOT NULL',
'rang_lien' => 'int(4) DEFAULT "0" NOT NULL',
'vu' => 'varchar(6) DEFAULT "non" NOT NULL',
],
'key' => [
'PRIMARY KEY' => 'id_block,id_objet,objet',
'PRIMARY KEY' => 'id_block,id_objet,objet',
'UNIQUE KEY id_block' => 'id_block',
],
];

@ -128,9 +128,9 @@ function blocks_installe_config() {
[
'options' =>
[
'nom' => 'id_mot',
'label' => 'Mot clé',
'obligatoire' => 'oui',
'nom' => 'id_mot',
'label' => 'Mot clé',
'obligatoire' => 'oui',
],
'identifiant' => uniqid('@'),
'saisie' => 'mot',

@ -223,7 +223,7 @@ function autoriser_blockstype_modifier_dist($faire, $type, $id, $qui, $opt) {
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blockstype_supprimer_dist($faire, $type, $id, $qui, $opt) {
if (!sql_countsel('spip_blocks', 'id_blocktype = '.(int)$id)) {
if (!sql_countsel('spip_blocks', 'id_blocktype = ' . (int)$id)) {
return autoriser('webmestre', '', '', $qui);
}
return false;

@ -14,7 +14,7 @@ if (!defined('_ECRIRE_INC_VERSION')) {
}
function blocks_header_prive($flux) {
$flux .= '<link rel="stylesheet" href="'.timestamp(find_in_path('css/blocks_prive.css')).'" type="text/css" />';
$flux .= '<link rel="stylesheet" href="' . timestamp(find_in_path('css/blocks_prive.css')) . '" type="text/css" />';
return $flux;
}
@ -36,8 +36,8 @@ function blocks_afficher_contenu_objet($flux) {
$texte = recuperer_fond(
'prive/squelettes/inclure/blocks_objet',
[
'objet' => $objet,
'id_objet' => $id_objet
'objet' => $objet,
'id_objet' => $id_objet,
],
['ajax' => 'blocks_objet']
);
@ -68,7 +68,7 @@ function blocks_affiche_enfants($flux) {
$flux['data'] .= recuperer_fond(
'prive/objets/liste/blocks',
[
'titre' => _T('block:titre_blocks'),
'titre' => _T('block:titre_blocks'),
'id_blocktype' => $id_objet,
]
);

@ -20,7 +20,7 @@ include_spip('inc/editer');
/**
* Identifier le formulaire en faisant abstraction des paramètres qui ne représentent pas l'objet edité
*
* @param int|string $id_block Identifiant du block. 'new' pour un nouveau block.
* @param int|string $id_block Identifiant du block. 'new' pour un nouveau block.
* @param string|null $objet Type d'objet à associer (article, rubrique,...)
* @param int|null $id_objet Id de l'objet à associer
* @param string|null $retour URL de redirection après le traitement
@ -36,7 +36,7 @@ function formulaires_editer_block_identifier_dist($id_block = 'new', $objet = nu
*
* Déclarer les champs postés et y intégrer les valeurs par défaut
*
* @param int|string $id_block Identifiant du block. 'new' pour un nouveau block.
* @param int|string $id_block Identifiant du block. 'new' pour un nouveau block.
* @param string|null $objet Type d'objet à associer (article, rubrique,...)
* @param int|null $id_objet Id de l'objet à associer
* @param string|null $retour URL de redirection après le traitement
@ -125,7 +125,7 @@ function formulaires_editer_block_charger_dist($id_block = 'new', $objet = null,
*
* Vérifier les champs postés et signaler d'éventuelles erreurs
*
* @param int|string $id_block Identifiant du block. 'new' pour un nouveau block.
* @param int|string $id_block Identifiant du block. 'new' pour un nouveau block.
* @param string|null $objet Type d'objet à associer (article, rubrique,...)
* @param int|null $id_objet Id de l'objet à associer
* @param string|null $retour URL de redirection après le traitement
@ -166,7 +166,7 @@ function formulaires_editer_block_verifier_dist($id_block = 'new', $objet = null
*
* Traiter les champs postés
*
* @param int|string $id_block Identifiant du block. 'new' pour un nouveau block.
* @param int|string $id_block Identifiant du block. 'new' pour un nouveau block.
* @param string|null $objet Type d'objet à associer (article, rubrique,...)
* @param int|null $id_objet Id de l'objet à associer
* @param string|null $retour URL de redirection après le traitement
@ -210,13 +210,13 @@ function formulaires_editer_block_traiter_dist($id_block = 'new', $objet = null,
if (autoriser('modifier', $objet, $id_objet)) {
include_spip('action/editer_liens');
$qualif = [];
if($creation) {
if ($creation) {
$rang = sql_getfetsel(
'max(rang_lien)',
'spip_blocks_liens',
[
'objet = '.sql_quote($objet),
'id_objet = '.$id_objet
'objet = ' . sql_quote($objet),
'id_objet = ' . $id_objet,
]
);
$qualif = ['rang_lien' => $rang + 1];
@ -225,8 +225,8 @@ function formulaires_editer_block_traiter_dist($id_block = 'new', $objet = null,
}
// un block est automatiquement publié lors de sa création
if($creation){
objet_instituer('block',$id_block,['statut' => 'publie']);
if ($creation) {
objet_instituer('block', $id_block, ['statut' => 'publie']);
}
if ($include && isset($retours['redirect'])) {

@ -11,15 +11,15 @@ $GLOBALS[$GLOBALS['idx_lang']] = [
'ajouter_lien_block' => 'Ajouter ce bloc',
// B
'bouton_ajouter' => 'Ajouter ce bloc',
'bouton_choisir' => 'Choisir ce type de bloc',
'bouton_enregistrer' => 'Enregistrer ce bloc',
'bouton_ajouter' => 'Ajouter ce bloc',
'bouton_choisir' => 'Choisir ce type de bloc',
'bouton_enregistrer' => 'Enregistrer ce bloc',
// C
'champ_block_config_label' => 'Configuration du bloc',
'champ_block_contenu_label' => 'Contenu du bloc',
'champ_id_blocktype_label' => 'Type de bloc',
'champ_valeurs_label' => 'Valeurs',
'champ_id_blocktype_label' => 'Type de bloc',
'champ_valeurs_label' => 'Valeurs',
'confirmer_supprimer_block' => 'Confirmez-vous la suppression de ce bloc ?',
// I

@ -9,13 +9,13 @@ $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.',
'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_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',
'confirmer_supprimer_blocktype' => 'Confirmez-vous la suppression de cet type de bloc ?',
// I
@ -36,9 +36,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = [
'supprimer_blocktype' => 'Supprimer cet type de bloc',
// T
'texte_squelette' => 'Squelette',
'texte_squelette_public' => 'Squelette public',
'texte_squelette_prive' => 'Squelette privé',
'texte_squelette' => 'Squelette',
'texte_squelette_public' => 'Squelette public',
'texte_squelette_prive' => 'Squelette privé',
'texte_ajouter_blocktype' => 'Ajouter un type de bloc',
'texte_changer_statut_blocktype' => 'Ce type de bloc est :',
'texte_creer_associer_blocktype' => 'Créer et associer un type de bloc',

Loading…
Cancel
Save