Changeset 17945 for extensions/ContactForm/admin/emails.php
- Timestamp:
- Sep 16, 2012, 5:20:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/admin/emails.php
r17483 r17945 5 5 if (isset($_POST['save_emails'])) 6 6 { 7 var_dump($_POST); 7 8 $emails = array(); 8 9 foreach ($_POST['emails'] as $entry) … … 16 17 else 17 18 { 19 if ($entry['group_name'] == -1) $entry['group_name'] = null; 20 18 21 array_push($emails, array( 19 22 'name' => $entry['name'], 20 23 'email' => $entry['email'], 21 'active' => isset($entry['active']), 24 'group_name' => $entry['group_name'], 25 'active' => boolean_to_string(isset($entry['active'])), 22 26 )); 23 27 } 24 28 } 25 29 26 $conf['ContactForm']['cf_admin_mails'] = $emails; 27 conf_update_param('ContactForm', serialize($conf['ContactForm'])); 30 pwg_query('TRUNCATE TABLE `'. CONTACT_FORM_TABLE. '`'); 31 32 mass_inserts( 33 CONTACT_FORM_TABLE, 34 array('name','email','group_name','active'), 35 $emails 36 ); 37 28 38 array_push($page['infos'], l10n('Information data registered in database')); 29 39 } … … 31 41 32 42 // display emails 33 $template->assign('EMAILS', $conf['ContactForm']['cf_admin_mails']); 43 $query = ' 44 SELECT * 45 FROM '. CONTACT_FORM_TABLE .' 46 ORDER BY 47 group_name ASC, 48 name ASC 49 '; 50 $result = pwg_query($query); 34 51 35 $template->set_filename('contact_form', dirname(__FILE__).'/template/emails.tpl'); 52 $emails = $groups = array(); 53 while ($data = pwg_db_fetch_assoc($result)) 54 { 55 $data['active'] = get_boolean($data['active']); 56 array_push($emails, $data); 57 if (!empty($data['group_name'])) 58 { 59 array_push($groups, $data['group_name']); 60 } 61 } 62 63 $template->assign(array( 64 'EMAILS' => $emails, 65 'GROUPS' => array_unique($groups), 66 )); 67 68 $template->set_filename('contact_form', realpath(CONTACT_FORM_PATH . 'admin/template/emails.tpl')); 36 69 37 70 ?>
Note: See TracChangeset
for help on using the changeset viewer.