source: trunk/spip/esqueleto-redcta/plugins/crayons/controleurs/article_intro3.php @ 69

Last change on this file since 69 was 69, checked in by guille, 16 years ago

Se agrego Plugin Crayon y se actualizaron los esqueletos para que funcione

File size: 1.2 KB
Line 
1<?php
2// un controleur qui n'utilise que php et les inputs défauts
3function controleurs_article_intro3_dist($regs) {
4    list(,$crayon,$type,$champ,$id) = $regs;
5    $valeur = valeur_colonne_table($type, array('descriptif', 'chapo', 'texte'), $id);
6    if ($valeur === false) {
7            return array("$type $id $champ: " . _U('crayons:pas_de_valeur'), 6);
8    }
9
10        $n = new Crayon('article-intro3-' . $id, $valeur,
11                        array('hauteurMini' => 234));
12   
13    $return = array(
14        // html
15            $n->formulaire(
16                // champs et attributs propres
17                array(
18                'descriptif' => array('type' => 'texte', 'attrs' => array(
19                        'style' => 'height:' . ceil($n->hauteur*2/13) . 'px;' .
20                                                'width:' . $n->largeur . 'px;')),
21                        'chapo' =>  array('type' => 'texte', 'attrs' => array(
22                        'style' => 'height:' . ceil($n->hauteur*4/13) . 'px;' .
23                                                'width:' . $n->largeur . 'px;')),
24                        'texte' =>  array('type' => 'texte', 'attrs' => array(
25                        'style' => 'height:' . ceil($n->hauteur*4/13) . 'px;' .
26                                                'width:' . $n->largeur . 'px;'))) //,
27                    // attributs communs :( marche pas pour style , pas 2 fois ?
28//              array('style' => 'width:' . $n->largeur . 'px;')
29        ),
30        // status
31        null);
32
33        return $return;
34}
35
36?>
Note: See TracBrowser for help on using the repository browser.