corpus_web/base/corpus_web.php
2021-01-25 14:05:32 +01:00

108 lines
3.1 KiB
PHP

<?php
/**
* Déclarations relatives à la base de données
*
* @plugin corpus web
* @copyright 2021
* @author Gamuza[informatique]
* @licence GNU/GPL
* @package SPIP\corpus_web\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 corpus_web_declarer_tables_interfaces($interfaces) {
$interfaces['table_des_tables']['corpus_videos'] = 'corpus_videos';
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 corpus_web_declarer_tables_objets_sql($tables) {
$tables['spip_corpus_videos'] = array(
'type' => 'corpus_video',
'principale' => 'oui',
'field'=> array(
'id_corpus_video' => 'bigint(21) NOT NULL',
'title' => 'text NOT NULL DEFAULT ""',
'description' => 'text NOT NULL DEFAULT ""',
'keywords' => 'text NOT NULL DEFAULT ""',
'provider' => 'varchar(25) NOT NULL DEFAULT ""',
'urn' => 'varchar(100) NOT NULL DEFAULT ""',
'id' => 'varchar(25) NOT NULL DEFAULT ""',
'user' => 'varchar(100) NOT NULL DEFAULT ""',
'user_id' => 'varchar(100) NOT NULL DEFAULT ""',
'first_download_date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"',
'publication_date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"',
'duration' => 'bigint(21) NOT NULL',
'page_url' => 'varchar(250) NOT NULL DEFAULT ""',
'webmedia_search_url' => 'varchar(250) NOT NULL DEFAULT ""',
'webmedia_play_url' => 'varchar(250) NOT NULL DEFAULT ""',
'transcription_readable_file' => 'varchar(250) NOT NULL DEFAULT ""',
'transcription_detailed_file' => 'varchar(250) NOT NULL DEFAULT ""',
'transcription_readable_content' => 'text NOT NULL DEFAULT ""',
'transcription_detailed_content' => 'text NOT NULL DEFAULT ""',
),
'key' => array(
'PRIMARY KEY' => 'id_corpus_video',
),
);
return $tables;
}
function corpus_web_declarer_tables_principales($tables_principales){
//$tables_principales['spip_auteurs']['field']['initiales'] = "varchar(5) NOT NULL DEFAULT ''";
return $tables_principales;
}
/**
* Déclaration des tables secondaires (liaisons)
*/
function corpus_web_declarer_tables_auxiliaires($tables) {
/* $tables['spip_gbev_seances_liens'] = array(
'field' => array(
"id_gbev_seance" => "bigint(21) DEFAULT '0' NOT NULL",
"id_objet" => "bigint(21) DEFAULT '0' NOT NULL",
"objet" => "VARCHAR(25) DEFAULT '' NOT NULL",
"type" => "VARCHAR(25) DEFAULT '' NOT NULL",
"vu" => "VARCHAR(6) DEFAULT 'non' NOT NULL",
'maj' => 'TIMESTAMP',
),
'key' => array(
"PRIMARY KEY" => "id_gbev_seance,id_objet,objet",
"KEY id_gbev_seance" => "id_gbev_seance"
)
);*/
return $tables;
}