2021-05-11 22:18:36 +02:00
|
|
|
<?php
|
|
|
|
if (!defined("_ECRIRE_INC_VERSION")) return;
|
|
|
|
|
|
|
|
// des champs extras sur les articles
|
|
|
|
function libreavous_declarer_champs_extras($champs = array()) {
|
|
|
|
|
|
|
|
// Table : spip_articles
|
|
|
|
if (isset($champs['spip_articles']) and !is_array($champs['spip_articles'])) {
|
|
|
|
$champs['spip_articles'] = array();
|
|
|
|
}
|
|
|
|
|
2021-09-07 10:28:39 +02:00
|
|
|
$champs['spip_articles']['podcast_sommaire'] = array(
|
|
|
|
'saisie' => 'textarea',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_sommaire',
|
|
|
|
'label' => 'Sommaire',
|
|
|
|
'rows' => '10',
|
|
|
|
'cols' => '40',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
'inserer_barre' => 'edition',
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2021-05-11 22:18:36 +02:00
|
|
|
$champs['spip_articles']['podcast_code'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'input',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_code',
|
|
|
|
'label' => 'Code',
|
|
|
|
'type' => 'text',
|
|
|
|
'size' => '40',
|
|
|
|
'autocomplete' => 'defaut',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
|
|
|
$champs['spip_articles']['podcast_duree'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'input',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_duree',
|
|
|
|
'label' => 'Durée',
|
|
|
|
'type' => 'text',
|
|
|
|
'size' => '40',
|
|
|
|
'autocomplete' => 'defaut',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
|
|
|
$champs['spip_articles']['podcast_mp3'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'input',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_mp3',
|
|
|
|
'label' => 'Taille mp3',
|
|
|
|
'type' => 'text',
|
|
|
|
'size' => '40',
|
|
|
|
'autocomplete' => 'defaut',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
|
|
|
$champs['spip_articles']['podcast_ogg'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'input',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_ogg',
|
|
|
|
'label' => 'Taille Ogg',
|
|
|
|
'type' => 'text',
|
|
|
|
'size' => '40',
|
|
|
|
'autocomplete' => 'defaut',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
|
|
|
$champs['spip_articles']['podcast_transcription'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'input',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_transcription',
|
|
|
|
'label' => 'Lien transcription',
|
|
|
|
'type' => 'text',
|
|
|
|
'size' => '40',
|
|
|
|
'autocomplete' => 'defaut',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
|
|
|
$champs['spip_articles']['podcast_personnes'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'textarea',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_personnes',
|
|
|
|
'label' => 'Personnes participantes',
|
|
|
|
'rows' => '10',
|
|
|
|
'cols' => '40',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
'inserer_barre' => 'edition',
|
2021-09-28 18:13:11 +02:00
|
|
|
'rechercher' => 5,
|
2021-09-06 22:06:58 +02:00
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2021-07-10 14:58:55 +02:00
|
|
|
$champs['spip_articles']['podcast_references'] = array(
|
|
|
|
'saisie' => 'textarea',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_references',
|
|
|
|
'label' => 'Références',
|
|
|
|
'rows' => '20',
|
|
|
|
'cols' => '40',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
2021-09-06 22:06:58 +02:00
|
|
|
'inserer_barre' => 'edition',
|
2021-09-28 18:13:11 +02:00
|
|
|
'rechercher' => 5,
|
2021-07-10 14:58:55 +02:00
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
|
|
|
$champs['spip_articles']['podcast_galeriephotos'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'input',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_galeriephotos',
|
|
|
|
'label' => 'Galerie Photos',
|
|
|
|
'type' => 'text',
|
|
|
|
'size' => '40',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
|
|
|
$champs['spip_articles']['podcast_musique'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'textarea',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'podcast_musique',
|
|
|
|
'label' => 'Pauses musicales',
|
|
|
|
'rows' => '5',
|
|
|
|
'cols' => '40',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
'inserer_barre' => 'edition',
|
2021-09-28 18:13:11 +02:00
|
|
|
'rechercher' => 5,
|
2021-09-06 22:06:58 +02:00
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
|
|
|
$champs['spip_articles']['drupal_guid'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'input',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'drupal_guid',
|
|
|
|
'label' => 'GUID Drupal',
|
|
|
|
'type' => 'text',
|
|
|
|
'size' => '40',
|
|
|
|
'autocomplete' => 'defaut',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
|
|
|
$champs['spip_articles']['drupal_pubdate'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'input',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'drupal_pubdate',
|
|
|
|
'label' => 'PubDate Drupal',
|
|
|
|
'type' => 'text',
|
|
|
|
'size' => '40',
|
|
|
|
'autocomplete' => 'defaut',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-05-11 22:18:36 +02:00
|
|
|
|
2021-09-03 11:29:18 +02:00
|
|
|
$champs['spip_articles']['chronique'] = array(
|
2021-09-06 22:06:58 +02:00
|
|
|
'saisie' => 'input',
|
|
|
|
'options' => array(
|
|
|
|
'nom' => 'chronique',
|
|
|
|
'label' => _T('libreavous:chronique_label'),
|
|
|
|
'type' => 'text',
|
|
|
|
'size' => '40',
|
|
|
|
'autocomplete' => 'defaut',
|
|
|
|
'sql' => 'text DEFAULT \'\' NOT NULL',
|
|
|
|
'explication' => _T('libreavous:chronique_explications'),
|
|
|
|
),
|
|
|
|
'verifier' => array(
|
|
|
|
),
|
|
|
|
);
|
2021-09-03 11:29:18 +02:00
|
|
|
|
2021-05-11 22:18:36 +02:00
|
|
|
return $champs;
|
|
|
|
}
|
|
|
|
|
|
|
|
// un nouvel objet chapitre
|
|
|
|
/**
|
|
|
|
* 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 libreavous_declarer_tables_interfaces($interfaces) {
|
|
|
|
|
|
|
|
$interfaces['table_des_tables']['chapitres'] = 'chapitres';
|
|
|
|
|
|
|
|
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 libreavous_declarer_tables_objets_sql($tables) {
|
|
|
|
|
|
|
|
$tables['spip_chapitres'] = array(
|
|
|
|
'type' => 'chapitre',
|
|
|
|
'principale' => 'oui',
|
|
|
|
'field'=> array(
|
|
|
|
'id_chapitre' => 'bigint(21) NOT NULL',
|
|
|
|
'id_article' => 'bigint(21) NOT NULL DEFAULT 0',
|
|
|
|
'titre' => 'tinytext NOT NULL DEFAULT ""',
|
|
|
|
'code' => 'tinytext NOT NULL DEFAULT ""',
|
|
|
|
'code_fichier' => 'tinytext NOT NULL DEFAULT ""',
|
|
|
|
'code_podcast' => 'varchar(255) NOT NULL DEFAULT ""',
|
|
|
|
'debut' => 'varchar(25) NOT NULL DEFAULT ""',
|
|
|
|
'fin' => 'varchar(25) NOT NULL DEFAULT ""',
|
|
|
|
'type_sujet' => 'varchar(25) NOT NULL DEFAULT ""',
|
|
|
|
'chronique' => 'varchar(255) NOT NULL DEFAULT ""',
|
|
|
|
'mp3' => 'varchar(255) NOT NULL DEFAULT ""',
|
|
|
|
'ogg' => 'varchar(255) NOT NULL DEFAULT ""',
|
2021-06-21 10:00:24 +02:00
|
|
|
'references_sujet' => 'text NOT NULL DEFAULT ""',
|
2021-05-11 22:18:36 +02:00
|
|
|
'drupal_guid' => 'varchar(255) NOT NULL DEFAULT ""',
|
|
|
|
'drupal_pubdate' => 'varchar(255) NOT NULL DEFAULT ""',
|
|
|
|
'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'
|
|
|
|
),
|
|
|
|
'key' => array(
|
|
|
|
'PRIMARY KEY' => 'id_chapitre',
|
|
|
|
'KEY id_article' => 'id_article',
|
|
|
|
),
|
|
|
|
'titre' => 'titre AS titre, "" AS lang',
|
|
|
|
#'date' => '',
|
2021-06-21 10:00:24 +02:00
|
|
|
'champs_editables' => array('titre', 'code', 'code_fichier', 'code_podcast', 'debut', 'fin', 'type_sujet', 'chronique', 'mp3', 'ogg', 'references_sujet', 'drupal_guid', 'drupal_pubdate', 'id_article'),
|
|
|
|
'champs_versionnes' => array('titre', 'code', 'code_fichier', 'code_podcast', 'debut', 'fin', 'type_sujet', 'chronique', 'mp3', 'ogg', 'references_sujet', 'drupal_guid', 'drupal_pubdate', 'id_article'),
|
2021-09-28 18:13:11 +02:00
|
|
|
'rechercher_champs' => array("titre" => 8, "references_sujet" => 5),
|
2021-05-11 22:18:36 +02:00
|
|
|
'tables_jointures' => array(),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
return $tables;
|
|
|
|
}
|
2021-06-21 10:00:24 +02:00
|
|
|
|
|
|
|
|