[PLUGINS] +crayons
[lhc/web/clavette_www.git] / www / plugins / crayons / controleurs / article_introduction.php
1 <?php
2
3 if (!defined("_ECRIRE_INC_VERSION")) return;
4
5 // un controleur php + html
6 // html == avec un modele, controleurs/article_introduction.html)
7 function controleurs_article_introduction_dist($regs) {
8 list(,$crayon,$type,$champ,$id) = $regs;
9 $valeur = valeur_colonne_table($type, array('descriptif', 'chapo', 'texte'), $id);
10 if ($valeur === false) {
11 return array("$type $id $champ: " . _U('crayons:pas_de_valeur'), 6);
12 }
13
14 $n = new Crayon('article-introduction-' . $id, $valeur,
15 array('hauteurMini' => 234,
16 'controleur' => 'controleurs/article_introduction'));
17
18 $contexte = array(
19 'h_descriptif' => (int)ceil($n->hauteur*2/13),
20 'h_chapo' => (int)ceil($n->hauteur*4/13),
21 'h_texte' => (int)ceil($n->hauteur*4/13));
22 $html = $n->formulaire($contexte);
23 $status = NULL;
24
25 return array($html, $status);
26 }
27
28 ?>