Formatage

master
nicod_ 1 week ago
parent 22209ed41c
commit 1057d3f8c3

@ -84,9 +84,9 @@ function blocks_declarer_tables_objets_sql($tables) {
];
$tables['spip_blocktypes'] = [
'type' => 'blocktype',
'principale' => 'oui',
'field' => [
'type' => 'blocktype',
'principale' => 'oui',
'field' => [
'id_blocktype' => 'bigint(21) NOT NULL',
'titre' => 'text NOT NULL DEFAULT ""',
'description' => 'text NOT NULL DEFAULT ""',
@ -95,7 +95,7 @@ function blocks_declarer_tables_objets_sql($tables) {
'objets' => 'text NOT NULL DEFAULT ""',
'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
],
'key' => [
'key' => [
'PRIMARY KEY' => 'id_blocktype',
'UNIQUE KEY identifiant' => 'identifiant',
],
@ -144,6 +144,7 @@ function blocks_declarer_tables_auxiliaires($tables) {
],
'key' => [
'PRIMARY KEY' => 'id_block,id_objet,objet',
// clé unique : un block ne peut être associé qu'à un seul objet
'UNIQUE KEY id_block' => 'id_block',
],
];

@ -74,7 +74,7 @@ function blocks_installe_config() {
// associer par défaut aux articles
ecrire_config('blocks/objets',
[
0 => 'spip_articles'
0 => 'spip_articles',
],
);
@ -135,7 +135,7 @@ function blocks_installe_config() {
);
}
function blocks_update_1_0_1(){
function blocks_update_1_0_1() {
// renommage des tables
sql_alter('TABLE spip_blocs RENAME TO spip_blocks');
sql_alter('TABLE spip_blocs_liens RENAME TO spip_blocks_liens');

@ -244,9 +244,9 @@ function formulaires_editer_block_traiter_dist($id_block = 'new', $objet = null,
}
if (isset($retours['redirect'])) {
$retours['redirect'] = parametre_url($retours['redirect'],'id_blocktype','');
$retours['redirect'] = parametre_url($retours['redirect'],'id_block','');
$retours['redirect'] = parametre_url($retours['redirect'],'edit_bloc','');
$retours['redirect'] = parametre_url($retours['redirect'], 'id_blocktype', '');
$retours['redirect'] = parametre_url($retours['redirect'], 'id_block', '');
$retours['redirect'] = parametre_url($retours['redirect'], 'edit_bloc', '');
$retours['redirect'] = ancre_url($retours['redirect'], 'block_' . $id_block);
}
@ -254,7 +254,7 @@ function formulaires_editer_block_traiter_dist($id_block = 'new', $objet = null,
}
if (_request('annuler')) {
$retours['redirect'] = parametre_url($retour,'id_blocktype','');
$retours['redirect'] = parametre_url($retour, 'id_blocktype', '');
}
return $retours;

Loading…
Cancel
Save