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