[PLUGINS] +crayons
[lhc/web/clavette_www.git] / www / plugins / crayons / controleurs / article_intro3.php
1 <?php
2
3 if (!defined("_ECRIRE_INC_VERSION")) return;
4
5 // un controleur qui n'utilise que php et les inputs défauts
6 function controleurs_article_intro3_dist($regs) {
7 list(,$crayon,$type,$champ,$id) = $regs;
8 $valeur = valeur_colonne_table($type, array('descriptif', 'chapo', 'texte'), $id);
9 if ($valeur === false) {
10 return array("$type $id $champ: " . _U('crayons:pas_de_valeur'), 6);
11 }
12
13 $n = new Crayon('article-intro3-' . $id, $valeur,
14 array('hauteurMini' => 234));
15
16 $return = array(
17 // html
18 $n->formulaire(
19 // champs et attributs propres
20 array(
21 'descriptif' => array('type' => 'texte', 'attrs' => array(
22 'style' => 'height:' . ceil($n->hauteur*2/13) . 'px;' .
23 'width:' . $n->largeur . 'px;')),
24 'chapo' => array('type' => 'texte', 'attrs' => array(
25 'style' => 'height:' . ceil($n->hauteur*4/13) . 'px;' .
26 'width:' . $n->largeur . 'px;')),
27 'texte' => array('type' => 'texte', 'attrs' => array(
28 'style' => 'height:' . ceil($n->hauteur*4/13) . 'px;' .
29 'width:' . $n->largeur . 'px;'))) //,
30 // attributs communs :( marche pas pour style , pas 2 fois ?
31 // array('style' => 'width:' . $n->largeur . 'px;')
32 ),
33 // status
34 null);
35
36 return $return;
37 }
38
39 ?>