You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
171 lines
5.1 KiB
171 lines
5.1 KiB
<?php |
|
if (!defined('_ECRIRE_INC_VERSION')) { |
|
return; |
|
} |
|
|
|
/** |
|
* Insertion dans le pipeline declarer_tables_objets_sql (SPIP). |
|
* |
|
* Declarer les champs categorie et préfixe pour les rubriques. |
|
* |
|
* @param array $champs La définition des objets SPIP |
|
* |
|
* @return array La définition des objets SPIP modifiés |
|
*/ |
|
function contrib_declarer_champs_extras($champs = array()) { |
|
|
|
// Table : spip_rubriques, on initialise les champs extras de la table. |
|
// Ajout de la catégorie de plugin. La saisie est une sélection particulière. |
|
$champs['spip_rubriques']['categorie'] = array( |
|
'saisie' => 'rubrique_categorie', |
|
'options' => array( |
|
'nom' => 'categorie', |
|
'label' => '<:svptype:categorie_identifiant_label:>', |
|
'option_intro' => '<:contrib:categorie_vide_label:>', |
|
'env' => true, |
|
'restrictions' => array( |
|
'modifier' => array( |
|
'auteur' => 'webmestre', |
|
), |
|
'voir' => false, |
|
), |
|
'sql' => "varchar(100) DEFAULT '' NOT NULL", |
|
'rechercher' => true, |
|
'rechercher_ponderation' => 2, |
|
'versionner' => false, |
|
), |
|
'verifier' => array( |
|
), |
|
); |
|
|
|
// Ajout du préfixe de plugin. La saisie est un input simple. |
|
$champs['spip_rubriques']['prefixe'] = array( |
|
'saisie' => 'input', |
|
'options' => array( |
|
'nom' => 'prefixe', |
|
'label' => '<:svp:label_prefixe:>', |
|
'restrictions' => array( |
|
'modifier' => array( |
|
'auteur' => 'webmestre', |
|
), |
|
'voir' => false, |
|
), |
|
'sql' => "varchar(30) DEFAULT '' NOT NULL", |
|
'rechercher' => true, |
|
'rechercher_ponderation' => 10, |
|
'versionner' => false, |
|
), |
|
'verifier' => array( |
|
), |
|
); |
|
|
|
// Table : spip_rubriques, on initialise les champs extras de la table. |
|
// Ajout de la catégorie de plugin. La saisie est une sélection particulière. |
|
$champs['spip_articles']['type_article'] = array( |
|
'saisie' => 'article_type', |
|
'options' => array( |
|
'nom' => 'type_article', |
|
'label' => '<:contrib:type_article_label:>', |
|
'data' => array( |
|
'' => '<:contrib:type_article_utilisation_label:>', |
|
'conception' => '<:contrib:type_article_conception_label:>', |
|
'actualite' => '<:contrib:type_article_actualite_label:>' |
|
), |
|
'exclusions' => array( |
|
'' => array(), |
|
'conception' => array('apropos'), |
|
'actualite' => array('apropos', 'carnet') |
|
), |
|
'env' => true, |
|
'restrictions' => array( |
|
'modifier' => array( |
|
'auteur' => 'webmestre', |
|
), |
|
), |
|
'sql' => "varchar(16) DEFAULT '' NOT NULL", |
|
'versionner' => false, |
|
), |
|
'verifier' => array( |
|
), |
|
); |
|
|
|
return $champs; |
|
} |
|
|
|
/** |
|
* 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 contrib_declarer_tables_interfaces($interfaces) { |
|
// Les tables : permet d'appeler une boucle avec le *type* de la table uniquement |
|
$interfaces['table_des_tables']['inscriptions'] = 'inscriptions'; |
|
|
|
// Les traitements |
|
// - on desérialise les tableaux |
|
$interface['table_des_traitements']['PARAMETRES']['inscriptions'] = 'unserialize(%s)'; |
|
|
|
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 contrib_declarer_tables_objets_sql($tables) { |
|
|
|
$tables['spip_inscriptions'] = array( |
|
'type' => 'inscription', |
|
'principale' => 'oui', |
|
'field'=> array( |
|
'id_inscription' => 'bigint(21) NOT NULL', |
|
'username' => 'varchar(100) DEFAULT "" NOT NULL', |
|
'email' => 'tinytext DEFAULT "" NOT NULL', |
|
'charte_approuvee' => 'varchar(3) DEFAULT "non" NOT NULL', |
|
'parametres' => 'text DEFAULT "" NOT NULL', |
|
'date' => 'datetime DEFAULT "0000-00-00 00:00:00" NOT NULL', |
|
'statut' => 'varchar(20) DEFAULT "0" NOT NULL', |
|
'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP' |
|
), |
|
'key' => array( |
|
'PRIMARY KEY' => 'id_inscription', |
|
'KEY statut' => 'statut', |
|
), |
|
'titre' => '', |
|
'champs_editables' => array('username', 'email', 'charte_approuvee', 'parametres'), |
|
'champs_versionnes' => array(), |
|
'rechercher_champs' => array("username" => 10, "email" => 10), |
|
'tables_jointures' => array(), |
|
'statut_textes_instituer' => array( |
|
'prop' => 'texte_statut_proposee', |
|
'publie' => 'texte_statut_traitee', |
|
'refuse' => 'texte_statut_refusee', |
|
'poubelle' => 'texte_statut_poubelle', |
|
), |
|
'statut'=> array( |
|
array( |
|
'champ' => 'statut', |
|
'publie' => 'publie', |
|
'previsu' => 'publie,prop', |
|
'post_date' => 'date', |
|
'exception' => array('statut','tout') |
|
) |
|
), |
|
'texte_changer_statut' => 'inscription:texte_changer_statut_inscription', |
|
); |
|
|
|
return $tables; |
|
}
|
|
|