Changeset 10179 in spip-zone
- Timestamp:
- Mar 5, 2007, 11:56:30 PM (14 years ago)
- Location:
- _plugins_/_stable_/crayons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_stable_/crayons/action/crayons_html.php
r9675 r10179 123 123 // $name : son nom 124 124 // $texts : tableau associatif des valeurs ou valeur unique si crayon monochamp 125 // $options : options directes du crayon (d éveloppement)125 // $options : options directes du crayon (developpement) 126 126 function Crayon($name, $texts = array(), $options = array()) { 127 127 $this->name = $name; -
_plugins_/_stable_/crayons/controleurs/forms_donnee.php
r10173 r10179 2 2 // un controleur qui n'utilise que php et les inputs dfauts 3 3 function controleurs_forms_donnee_dist($regs) { 4 list(,$crayon,$type,$champ,$id) = $regs; 5 $q = "SELECT valeur FROM spip_forms_donnees_champs WHERE champ="._q($champ)." AND id_donnee="._q($id); 6 $s = spip_query($q); 7 if (!$t = spip_fetch_array($s)) 8 return array("$type $id $champ: " . _U('crayons:pas_de_valeur'), 6); 4 list(,$crayon,$type,$champ,$id) = $regs; 5 $res = spip_query("SELECT id_form FROM spip_forms_donnees WHERE id_donnee="._q($id)); 6 if( !$row = spip_fetch_array($res)) 7 return array("$type $id $champ: " . _U('crayons:form_introuvable'), 6); 8 $id_form = $row['id_form']; 9 10 include_spip('inc/forms'); 11 $valeurs = Forms_valeurs($id,$id_form,$champ); 12 if (!count($valeurs)) 13 return array("$type $id $champ: " . _U('crayons:pas_de_valeur'), 6); 9 14 10 $valeur = $t['valeur']; 15 $n = new Crayon("$type-$champ-" . $id, $valeurs, 16 array('hauteurMini' => 234, 17 'controleur' => 'formulaires/forms_structure')); 18 19 $contexte = array( 20 'champ'=>$champ, 21 'erreur'=>serialize(array()), 22 'id_form' => $id_form, 23 'id_donnee' => $id, 24 'valeurs' => serialize($valeurs)); 25 $html = $n->formulaire($contexte); 26 $status = NULL; 11 27 12 $n = new Crayon("$type-$champ-$id", $valeur); 13 14 $return = array( 15 // html 16 $n->formulaire(), 17 // status 18 null); 19 20 return $return; 28 return array($html, $status); 21 29 } 22 30
Note: See TracChangeset
for help on using the changeset viewer.