lqdn_citations.module 547 Bytes
Newer Older
Mindiell's avatar
Mindiell committed
1
<?php
Mindiell's avatar
Mindiell committed
2 3 4 5 6 7 8 9 10 11 12 13
/**
 * @file
 * lqdn_citations module.
 *
 * @ingroup lqdn
 */

/**
 * Implements hook_form_alter().
 *
 * Modifie le corps du formulaire.
 */
Mindiell's avatar
Mindiell committed
14
function lqdn_citations_form_alter(&$form, &$form_state, $form_id) {
Mindiell's avatar
Mindiell committed
15
    $texte_defaut_citations = <<<EOF
Mindiell's avatar
Mindiell committed
16 17 18 19
<blockquote>« citation »</blockquote>

<b>Auteur[, Fonction]</b> - <i><a href="#">source</a>, le (jj mois aaaa). </i>
EOF;
Mindiell's avatar
Mindiell committed
20 21 22 23

    if($form_id == 'citations_node_form' && $form['nid']['#value']==NULL){
        $form['body_field']['body']['#default_value'] = $texte_defaut_citations;
    }
Mindiell's avatar
Mindiell committed
24
}