71 lines
1.7 KiB
PHP
71 lines
1.7 KiB
PHP
|
<?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';
|
||
|
|
||
|
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(),
|
||
|
|
||
|
|
||
|
);
|
||
|
|
||
|
return $tables;
|
||
|
}
|