Changeset 14756 for extensions/ContactForm/admin
- Timestamp:
- May 5, 2012, 12:56:27 AM (13 years ago)
- Location:
- extensions/ContactForm/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/admin/cf_persoform.tab.php
r14428 r14756 1 1 <?php 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 3 4 check_status(ACCESS_ADMINISTRATOR); 4 5 5 6 global $template, $conf, $user; 6 7 8 if (isset($_POST['submitpersoform'])) 9 { 10 conf_update_param('persoformtop', $_POST['persoform_top']); 11 conf_update_param('persoformbottom', $_POST['persoform_bottom']); 12 13 // reload configuration 14 load_conf_from_db(); 15 } 16 7 17 //charge Persoform 8 $query = ' 9 select param,value 10 FROM ' . CONFIG_TABLE . ' 11 WHERE param = "persoformtop" 12 ;'; 13 $result = pwg_query($query); 14 15 $row = mysql_fetch_array($result); 16 17 $template->assign( 18 array( 19 'PERSOFORMTOP' => $row['value'], 20 )); 21 22 $query = ' 23 select param,value 24 FROM ' . CONFIG_TABLE . ' 25 WHERE param = "persoformbottom" 26 ;'; 27 $result = pwg_query($query); 28 29 $row = mysql_fetch_array($result); 30 31 $template->assign( 32 array( 33 'PERSOFORMBOTTOM' => $row['value'], 34 )); 35 36 if (isset($_POST['submitpersoform'])) 37 { 38 $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="persoformtop" LIMIT 1;'; 39 pwg_query($q); 40 $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("persoformtop","'.$_POST['persoform_top'].'","Add text above form to contactform plugin");'; 41 pwg_query($query); 42 43 $template->assign( 44 array( 45 'PERSOFORMTOP' => stripslashes($_POST['persoform_top']), 46 )); 47 48 $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="persoformbottom" LIMIT 1;'; 49 pwg_query($q); 50 $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("persoformbottom","'.$_POST['persoform_bottom'].'","Add text below form to contactform plugin");'; 51 pwg_query($query); 52 53 $template->assign( 54 array( 55 'PERSOFORMBOTTOM' => stripslashes($_POST['persoform_bottom']), 56 )); 57 } 58 18 $template->assign( 19 array( 20 'PERSOFORMTOP' => $conf['persoformtop'], 21 'PERSOFORMBOTTOM' => $conf['persoformbottom'], 22 ) 23 ); 59 24 ?> -
extensions/ContactForm/admin/themes/cf_persoform.tab.tpl
r14428 r14756 2 2 <h2>{$CF.TITLE}<br>{'cf_tab_persoform'|@translate}</h2> 3 3 </div> 4 <h3>{'Add text to the contact form'|@translate}</h3> 5 <br> 6 <form method="post" > 7 <fieldset id="mainConf"> 8 <span class="property"> 9 <label for="persoformtop">{'Add text above'|@translate} *1</label> 10 </span> 11 <br> 12 <textarea rows="4" cols="80" class="description" name="persoform_top" id="persoform_top">{$PERSOFORMTOP}</textarea> 13 <br> 14 <br> 15 <h3>{'contact_form_title'|@translate}</h3> 16 <br> 17 <br> 18 <span class="property"> 19 <label for="persoformbottom">{'Add text below'|@translate} *2</label> 20 </span> 21 <br> 22 <textarea rows="4" cols="80" class="description" name="persoform_bottom" id="persoform_bottom">{$PERSOFORMBOTTOM}</textarea> 23 <p> 24 <input class="submit" type="submit" name="submitpersoform" value="{'Submit'|@translate}"> 25 </p> 26 </form> 27 <br> 28 <br> 29 <br> 30 <br> 31 *1 {'use tag < div id="persoformtop" > to customize your personal text'|@translate}<br> 32 *2 {'use tag < div id="persoformbottom" > to customize your personal text'|@translate}<br> 33 {'if plugin ExtendedDescription is actif, you can use tags [lang]'|@translate}<br> 4 5 <form method="post" > 6 <fieldset> 7 <legend>{'Text before the contact form'|@translate}</legend> 8 <textarea rows="4" cols="80" class="description" name="persoform_top" id="persoform_top">{$PERSOFORMTOP}</textarea> 34 9 </fieldset> 10 11 <fieldset> 12 <legend>{'Text after the contact form'|@translate}</legend> 13 <textarea rows="4" cols="80" class="description" name="persoform_bottom" id="persoform_bottom">{$PERSOFORMBOTTOM}</textarea> 14 </fieldset> 15 16 <p> 17 <input class="submit" type="submit" name="submitpersoform" value="{'Submit'|@translate}"> 18 </p> 19 </form>
Note: See TracChangeset
for help on using the changeset viewer.