Changeset 5876 in spip-zone
- Timestamp:
- Oct 4, 2006, 3:10:08 PM (15 years ago)
- Location:
- _plugins_/_dev_/widgets
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_dev_/widgets/action/widgets_html.php
r5827 r5876 16 16 foreach($modifs as $m) { 17 17 if (preg_match( 18 ',(article|rubrique)-(titre|surtitre|soustitre )-(\d+),',18 ',(article|rubrique)-(titre|surtitre|soustitre|chapo)-(\d+),', 19 19 $m[0], $regs)) { 20 20 if ($m[2]) { … … 24 24 addslashes($m[1])."' WHERE id_".$regs[1]."=".$regs[3]); 25 25 } 26 echo typo($m[1]); 26 27 // type du widget 28 if ($regs[2] == 'chapo') 29 echo propre($m[1]); 30 else 31 echo typo($m[1]); 27 32 } 28 33 } … … 34 39 // sinon on affiche le formulaire demande 35 40 else if (preg_match( 36 ',(article|rubrique)-(titre|surtitre|soustitre )-(\d+),',41 ',(article|rubrique)-(titre|surtitre|soustitre|chapo)-(\d+),', 37 42 $_GET['class'], $regs)) { 43 44 // type du widget 45 if ($regs[2] == 'chapo') 46 $type = 'texte'; 47 else 48 $type = 'ligne'; 38 49 39 50 $s = spip_query("SELECT ".$regs[2]." AS val FROM spip_".$regs[1]."s … … 43 54 $n = new SecureWidget($regs[0], $t['val']); 44 55 echo $n->code(); 45 echo $n->input( );56 echo $n->input($type); 46 57 echo '<input type="submit" value="ok" />'."\n".'</form>'."\n"; 47 58 } -
_plugins_/_dev_/widgets/inc/widgets.php
r5873 r5876 74 74 function input($type = 'ligne') { 75 75 switch ($type) { 76 case 'ligne': 77 default: 78 return '<textarea width="80"' 76 case 'texte': 77 return '<textarea' 79 78 . ' name="content_'.$this->key.'">' 80 79 . $this->text # entites_html 81 80 . '</textarea>'."\n"; 81 case 'ligne': 82 default: 83 return '<input type="text"' 84 . ' name="content_'.$this->key.'"' 85 . ' value="' 86 . entites_html($this->text) # entites_html 87 . '" />'."\n"; 82 88 } 83 89 } -
_plugins_/_dev_/widgets/widgets.html
r5864 r5876 20 20 <div class="widget article-surtitre-#ID_ARTICLE surtitre">#SURTITRE</div> 21 21 <h2 class="widget article-titre-#ID_ARTICLE title">#TITRE</h2> 22 <div class="intro ">#INTRODUCTION</div>22 <div class="intro widget article-chapo-#ID_ARTICLE">#CHAPO</div> 23 23 24 24 </BOUCLE_s> -
_plugins_/_dev_/widgets/widgets.js
r5875 r5876 23 23 .click($.setupwidget); // recursif 24 24 }) 25 .find("textarea ")25 .find("textarea,input[@type='text']") 26 26 .css('backgroundColor', 'yellow') 27 27 .css('font', 'inherit') // pour safari
Note: See TracChangeset
for help on using the changeset viewer.