2021-02-10 07:46:37 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Déclarations relatives à la base de données
|
|
|
|
*
|
|
|
|
* @plugin podcast
|
|
|
|
* @copyright 2021
|
|
|
|
* @author chankalan,vcalame
|
|
|
|
* @licence GNU/GPL
|
|
|
|
* @package SPIP\Podcast\Pipelines
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Déclaration des alias de tables et filtres automatiques de champs
|
|
|
|
*
|
|
|
|
* @pipeline declarer_tables_interfaces
|
|
|
|
* @param array $interfaces
|
|
|
|
* Déclarations d'interface pour le compilateur
|
|
|
|
* @return array
|
|
|
|
* Déclarations d'interface pour le compilateur
|
|
|
|
*/
|
|
|
|
function podcast_declarer_tables_interfaces($interfaces) {
|
|
|
|
|
|
|
|
$interfaces['table_des_tables']['podcasts'] = 'podcasts';
|
2021-02-11 09:42:41 +01:00
|
|
|
$interfaces['table_des_tables']['chapitres'] = 'chapitres';
|
2021-02-10 07:46:37 +01:00
|
|
|
|
|
|
|
return $interfaces;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Déclaration des objets éditoriaux
|
|
|
|
*
|
|
|
|
* @pipeline declarer_tables_objets_sql
|
|
|
|
* @param array $tables
|
|
|
|
* Description des tables
|
|
|
|
* @return array
|
|
|
|
* Description complétée des tables
|
|
|
|
*/
|
|
|
|
function podcast_declarer_tables_objets_sql($tables) {
|
|
|
|
|
|
|
|
$tables['spip_podcasts'] = array(
|
|
|
|
'type' => 'podcast',
|
|
|
|
'principale' => 'oui',
|
|
|
|
'field'=> array(
|
|
|
|
'id_podcast' => 'bigint(21) NOT NULL',
|
|
|
|
'id_article' => 'bigint(21) NOT NULL DEFAULT 0',
|
|
|
|
'code' => 'tinytext NOT NULL DEFAULT ""',
|
|
|
|
'duree' => 'tinytext NOT NULL DEFAULT ""',
|
|
|
|
'maj' => 'TIMESTAMP NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP'
|
|
|
|
),
|
|
|
|
'key' => array(
|
|
|
|
'PRIMARY KEY' => 'id_podcast',
|
|
|
|
'KEY id_article' => 'id_article',
|
|
|
|
),
|
|
|
|
'titre' => 'code AS titre, "" AS lang',
|
|
|
|
#'date' => '',
|
|
|
|
'champs_editables' => array('code', 'duree', 'id_article'),
|
|
|
|
'champs_versionnes' => array('code', 'duree', 'id_article'),
|
|
|
|
'rechercher_champs' => array(),
|
|
|
|
'tables_jointures' => array(),
|
|
|
|
|
|
|
|
|
2021-02-11 09:42:41 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
$tables['spip_chapitres'] = array(
|
|
|
|
'type' => 'chapitre',
|
|
|
|
'principale' => 'oui',
|
|
|
|
'field'=> array(
|
|
|
|
'id_chapitre' => 'bigint(21) NOT NULL',
|
|
|
|
'id_podcast' => 'bigint(21) NOT NULL DEFAULT 0',
|
|
|
|
'titre' => 'tinytext NOT NULL DEFAULT ""',
|
|
|
|
'nom_identifiant' => 'tinytext NOT NULL DEFAULT ""',
|
|
|
|
'sujet_principal' => 'int(6) NOT NULL DEFAULT 0',
|
|
|
|
'debut' => 'varchar(25) NOT NULL DEFAULT ""',
|
|
|
|
'fin' => 'varchar(25) NOT NULL DEFAULT ""',
|
|
|
|
'maj' => 'TIMESTAMP NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP'
|
|
|
|
),
|
|
|
|
'key' => array(
|
|
|
|
'PRIMARY KEY' => 'id_chapitre',
|
|
|
|
'KEY id_podcast' => 'id_podcast',
|
|
|
|
),
|
|
|
|
'titre' => 'titre AS titre, "" AS lang',
|
|
|
|
#'date' => '',
|
|
|
|
'champs_editables' => array('titre', 'nom_identifiant', 'sujet_principal', 'debut', 'fin', 'id_podcast'),
|
|
|
|
'champs_versionnes' => array('titre', 'nom_identifiant', 'sujet_principal', 'debut', 'fin', 'id_podcast'),
|
|
|
|
'rechercher_champs' => array("titre" => 5),
|
|
|
|
'tables_jointures' => array(),
|
|
|
|
|
|
|
|
|
2021-02-10 07:46:37 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
return $tables;
|
|
|
|
}
|