Changeset 9886 in spip-zone
- Timestamp:
- Feb 25, 2007, 4:00:46 PM (14 years ago)
- Location:
- _plugins_/_stable_/forms/forms_et_tables_1_9_1
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_stable_/forms/forms_et_tables_1_9_1/balise/forms.php
r9751 r9886 51 51 $valeurs = array('0'=>'0'); 52 52 $affiche_sondage = ''; 53 $formactif = (_DIR_RESTREINT==_DIR_RESTREINT_ABS || preg_match(',donnees_edit$,',_request('exec')))?' ':'';53 $formactif = (_DIR_RESTREINT==_DIR_RESTREINT_ABS || in_array(_request('exec'),$GLOBALS['forms_actif_exec']))?' ':''; 54 54 55 55 $id_donnee = $id_donnee?$id_donnee:intval(_request('id_donnee')); -
_plugins_/_stable_/forms/forms_et_tables_1_9_1/forms_options.php
r9641 r9886 16 16 } 17 17 include_spip('base/forms'); 18 $GLOBALS['forms_actif_exec'][] = 'donnees_edit'; 18 19 19 20 function autoriser_form_dist($faire, $type='', $id=0, $qui = NULL, $opt = NULL) { … … 55 56 $dejareponse=Forms_verif_cookie_sondage_utilise($id_form); 56 57 if ($dejareponse) return false; 58 return true; 59 } 60 function autoriser_table_donnee_instituer($faire,$type,$id_donnee,$qui,$opt) { 61 if (($qui['statut'] != '0minirezo') 62 OR !isset($opt['nouveau_statut']) 63 OR ($opt['nouveau_statut']=='prepa')) return false; 57 64 return true; 58 65 } -
_plugins_/_stable_/forms/forms_et_tables_1_9_1/inc/forms.php
r9857 r9886 559 559 if ($moderation = 'posteriori') 560 560 $statut='publie'; 561 else 562 $statut = 'propose'; 561 else { 562 $statut = 'prop'; 563 foreach(array('prepa','prop','publie','refuse') as $s) 564 if (autoriser( 565 'instituer', 566 (in_array($row['type_form'],array('','sondage'))?'form':$row['type_form']).'_donnee', 567 0,NULL,array('id_form'=>$id_form,'statut'=>'prepa','nouveau_statut'=>$s))){ 568 $statut = $s; 569 break; 570 } 571 } 563 572 // D'abord creer la reponse dans la base de donnees 564 573 if ($ok) { -
_plugins_/_stable_/forms/forms_et_tables_1_9_1/inc/instituer_forms_donnee.php
r9881 r9886 15 15 function inc_instituer_forms_donnee_dist($id_form, $id_donnee, $statut, $rang=NULL) 16 16 { 17 $type_form = "form"; 17 18 $pi18n = "form"; 18 19 $res = spip_query("SELECT type_form FROM spip_forms WHERE id_form="._q($id_form)); … … 20 21 AND $row['type_form']!='' 21 22 AND $rox['type_form']!='sondage') 22 $pi18n = forms_prefixi18n($row['type_form']); 23 $type_form = $row['type_form']; 24 $pi18n = forms_prefixi18n($type_form); 23 25 24 26 $res = … … 34 36 " setvisibility('valider_statut', 'visible');\">\n"; 35 37 36 $atts = array("prepa"=>"", 38 $atts = array( 39 "prepa"=>"style='background-color: white'", 37 40 "prop"=>"style='background-color: #FFF1C6'", 38 41 "publie"=>"style='background-color: #B4E8C5'", … … 42 45 foreach(array("prepa","prop","publie","poubelle","refuse") as $s) { 43 46 $lib = _T("$pi18n:texte_statut_$s"); 44 if (strlen(trim($lib))) 47 if ( 48 $s==$statut 49 OR autoriser('instituer',$type_form.'_donnee',$id_donnee,NULL,array('id_form'=>$id_form,'statut'=>$statut,'nouveau_statut'=>$s)) 50 ) 45 51 $res .= "<option" . 46 52 mySel($s, $statut) . " " . 47 53 $atts[$s] . " >" . 48 $lib.54 trim($lib) . 49 55 "</option>\n"; 50 56 } … … 71 77 static $script=NULL; 72 78 static $pi18n = array(); 79 static $type_form = array(); 73 80 74 81 if (!$id) { … … 77 84 } else $ajax_node = " id='imgstatutforms_donnee$id'"; 78 85 79 if (!isset($ pi18n[$id_form])){80 $ pi18n[$id_form] = "form";86 if (!isset($type_form[$id_form])){ 87 $type_form[$id_form] = "form"; 81 88 $res = spip_query("SELECT type_form FROM spip_forms WHERE id_form="._q($id_form)); 82 89 if ($row = spip_fetch_array($res) 83 90 AND $row['type_form']!='' 84 91 AND $rox['type_form']!='sondage') 85 $ pi18n[$id_form] = forms_prefixi18n($row['type_form']);92 $type_form[$id_form] = $row['type_form']; 86 93 } 94 if (!isset($pi18n[$id_form])) 95 $pi18n[$id_form] = forms_prefixi18n($type_form[$id_form]); 87 96 88 97 $p = $pi18n[$id_form]; … … 99 108 foreach($statuts as $s){ 100 109 $lib[$s] = _T("$p:texte_statut_$s"); 101 if ( strlen(trim($lib[$s]))){110 if ($lib[$s]{0}!=' ') 102 111 $clip[$s] = $c++; 103 }104 else$clip[$s] = 0;112 else 113 $clip[$s] = 0; 105 114 } 106 115 $width = 11*$c+1; 107 $inser_puce = http_img_pack($puce[$statut], $lib[$statut], " style='margin: 1px;'$ajax_node");116 $inser_puce = http_img_pack($puce[$statut], trim($lib[$statut]), " style='margin: 1px;'$ajax_node"); 108 117 109 118 if (!autoriser('publierdans', 'form', $id_form)) … … 117 126 . "<span class='puce_article_popup' id='statutdecalforms_donnee$id'\nonmouseout=\"cacher('statutdecalforms_donnee$id');\" style='margin-left: -".((11*$clip[$statut])+1)."px;width:{$width}px'>"; 118 127 foreach($statuts as $s) 119 if ( strlen(trim($lib[$s])))128 if (autoriser('instituer',$type_form[$id_form].'_donnee',$id_donnee,NULL,array('id_form'=>$id_form,'statut'=>$statut,'nouveau_statut'=>$s))) 120 129 $res .= afficher_script_statut($id, 'forms_donnee', -((11*$clip[$s])+1), $puce[$s], $s, $lib[$s], $action); 121 130 $res .= "</span>"; -
_plugins_/_stable_/forms/forms_et_tables_1_9_1/lang/table_fr.php
r9875 r9886 24 24 'nombre_reponses' => "@nombre@ données", 25 25 'texte_donnee_statut' => "Statut de cette donnée", 26 'texte_statut_prepa' => " 26 'texte_statut_prepa' => "Donnée en cours de rédaction", 27 27 'texte_statut_prop' => "Donnée proposée", 28 28 'texte_statut_publie' => "Donnée publiée",
Note: See TracChangeset
for help on using the changeset viewer.