Changeset 3810 for extensions
- Timestamp:
- Sep 1, 2009, 7:13:00 PM (15 years ago)
- Location:
- extensions/ContactForm
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/CHANGELOG
r3809 r3810 1 1 2009-08-21 1.0.6 2 2 Replace redirect page by a message on the index one 3 Add e-mail address management 3 4 4 5 2009-08-21 1.0.5 -
extensions/ContactForm/admin/template/cf_history.tab.tpl
r3771 r3810 10 10 </tr> 11 11 {foreach from=$CF_HISTORY item=history_item name=history} 12 <tr class="{ if $smarty.foreach.history.index is odd}row1{else}row2{/if}">12 <tr class="{cycle values="row2,row1"}"> 13 13 <td> 14 14 {if isset($history_item.DATE.FORMATTED)} -
extensions/ContactForm/admin/template/contactform_admin.css
r3753 r3810 21 21 text-align: right; 22 22 } 23 .cf-refresh { 24 padding-top: 5px; 25 padding-bottom: 5px; 26 } -
extensions/ContactForm/classes/cf_log.class.php
r3753 r3810 22 22 $debug_text = $template->parse('contact_form_debug', true); 23 23 $template->assign('CF_DEBUG', $debug_text); 24 25 24 return $debug_text; 26 25 } -
extensions/ContactForm/classes/cf_plugin.class.php
r3809 r3810 311 311 } 312 312 313 protected function get_active_admin_emails() { 314 //$cf_emails = $cf_config->get_value(CF_CFG_ADMIN_MAILS); 315 $all_mails = $this->config->get_value(CF_CFG_ADMIN_MAILS); 316 $active = array('WEBMASTER' => null, 'ADMINS' => array()); 317 foreach($all_mails as $email => $values) { 318 if (1 == $values['ACTIVE']) { 319 if (1 == $values['WEBMASTER']) { 320 $active['WEBMASTER'] = $values['EMAILSTR']; 321 } else { 322 array_push($active['ADMINS'], $values['EMAILSTR']); 323 } 324 } 325 } 326 return $active; 327 } 328 313 329 protected function send_message(&$infos) { 314 330 //redirect(make_index_url()); 315 331 // include(PHPWG_ROOT_PATH . 'include/functions_mail.inc.php'); 316 $webmaster_mail = get_webmaster_mail_address(); 317 if (null == $webmaster_mail) {318 $webmaster_mail = '';319 }320 $admin_mails = cf_get_admins_emails($webmaster_mail);321 if (('' == $webmaster_mail) and (0 == count($admin_mails))) {332 333 $admin_mails = $this->get_active_admin_emails(); 334 if ( empty($admin_mails) or 335 (empty($admin_mails['WEBMASTER']) and 336 empty($admin_mails['ADMINS'])) 337 ) { 322 338 // No admin mail... 339 array_push( $infos['infos'], l10n('cf_no_mail')); 323 340 return true; 324 341 } … … 338 355 $mail_args = array( 339 356 'from' => $from, 340 'Bcc' => $admin_mails ,357 'Bcc' => $admin_mails['ADMINS'], 341 358 'subject' => $subject, 342 359 'content' => $content, … … 347 364 348 365 $return = true; 349 //$return = @pwg_mail(350 // $webmaster_mail,351 //$mail_args352 //);366 $return = @pwg_mail( 367 $admin_mails['WEBMASTER'], 368 $mail_args 369 ); 353 370 354 371 cf_switch_back_to_user_lang(); -
extensions/ContactForm/config.php
r3771 r3810 1 1 <?php 2 /* $Id: config.php,v 1. 4 2009/08/21 09:24:18Criss Exp $ */2 /* $Id: config.php,v 1.5 2009/09/01 17:10:49 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 check_status(ACCESS_ADMINISTRATOR); … … 8 8 9 9 $config_tabs[]='config'; 10 $config_tabs[]='emails'; 10 11 $config_tabs[]='language'; 11 12 $config_tabs[]='history'; -
extensions/ContactForm/include/cf_common.inc.php
r3809 r3810 58 58 define('CF_CFG_DEFINE_LINK', 'cf_define_link'); 59 59 define('CF_CFG_CONTACT_LINK', 'cf_link'); 60 define('CF_CFG_ADMIN_MAILS', 'cf_admin_mails'); 60 61 61 62 /* ************************** */ … … 87 88 $cf_config_default[CF_CFG_DEFINE_LINK] = true; 88 89 $cf_config_default[CF_CFG_CONTACT_LINK] = CF_DEFAULT_LINKNAME; 90 $cf_config_default[CF_CFG_ADMIN_MAILS] = cf_get_admins_contacts(); 91 $cf_config_default[CF_CFG_ADMIN_MAILS] = array(); 89 92 CF_Config::$default_config = $cf_config_default; 90 93 -
extensions/ContactForm/include/cf_functions.inc.php
r3809 r3810 74 74 } 75 75 76 function cf_get_admins_contacts() { 77 global $conf, $user; 78 $admins = array(); 79 80 $query = ' 81 select 82 U.'.$conf['user_fields']['username'].' as username, 83 U.'.$conf['user_fields']['email'].' as mail_address 84 from 85 '.USERS_TABLE.' as U, 86 '.USER_INFOS_TABLE.' as I 87 where 88 I.user_id = U.'.$conf['user_fields']['id'].' and 89 I.status in (\'webmaster\', \'admin\') and 90 I.adviser = \'false\' and 91 '.$conf['user_fields']['email'].' is not null 92 order by 93 username 94 '; 95 96 $webmaster_mail = get_webmaster_mail_address(); 97 $datas = pwg_query($query); 98 if (!empty($datas)) { 99 while ($admin = mysql_fetch_array($datas)) { 100 if (!empty($admin['mail_address'])) { 101 $name = $admin['username']; 102 $webmaster = 0; 103 if (0 == strcasecmp($webmaster_mail, $admin['mail_address'])) { 104 $name = l10n('Webmaster'); 105 $webmaster = 1; 106 } 107 $admins[$admin['mail_address']] = array( 108 'NAME' => $name, 109 'EMAILSTR' => format_email($name, 110 $admin['mail_address']), 111 'ACTIVE' => 1, 112 'WEBMASTER'=> $webmaster, 113 ); 114 } 115 } 116 } 117 return $admins; 118 119 } 120 76 121 /* Return template for user template/theme*/ 77 122 function cf_get_template($file, $dir=CF_TEMPLATE, $prefix='') { -
extensions/ContactForm/language/en_UK/plugin.lang.php
r3809 r3810 1 1 <?php 2 /* $Id: plugin.lang.php,v 1.1 0 2009/09/01 13:25:03Criss Exp $ */2 /* $Id: plugin.lang.php,v 1.11 2009/09/01 17:10:50 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 global $lang; … … 64 64 $lang['cf_define_link'] = 'Define link'; 65 65 $lang['cf_link'] = 'Name of the template variable containing the HTML link to the contact form'; 66 // Emails tab 67 $lang['cf_tab_emails'] = 'E-mails'; 68 $lang['cf_emails_desc'] = 'Destination e-mails management'; 69 $lang['cf_active'] = 'Active e-mail'; 70 $lang['cf_no_mail'] = 'No e-mail address available'; 71 $lang['cf_refresh'] = 'Regenerate e-mail list address'; 66 72 // Language tab 67 73 $lang['cf_tab_language'] = 'Localization'; -
extensions/ContactForm/language/fr_FR/plugin.lang.php
r3809 r3810 1 1 <?php 2 /* $Id: plugin.lang.php,v 1.1 0 2009/09/01 13:25:03Criss Exp $ */2 /* $Id: plugin.lang.php,v 1.11 2009/09/01 17:10:49 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 global $lang; … … 64 64 $lang['cf_define_link'] = 'Définir le lien'; 65 65 $lang['cf_link'] = 'Nom de la variable de template contenant le lien HTML vers le formulaire de contact'; 66 // Emails tab 67 $lang['cf_tab_emails'] = 'E-mails'; 68 $lang['cf_emails_desc'] = 'Gestion des e-mails de destination'; 69 $lang['cf_active'] = 'E-mail actif'; 70 $lang['cf_no_mail'] = 'Aucune adresse e-mail disponible'; 71 $lang['cf_refresh'] = 'Regénérer la liste des adresses'; 66 72 // Language tab 67 73 $lang['cf_tab_language'] = 'Localisation'; -
extensions/ContactForm/language/it_IT/plugin.lang.php
r3809 r3810 1 1 <?php 2 /* $Id: plugin.lang.php,v 1.1 0 2009/09/01 13:25:03Criss Exp $ */2 /* $Id: plugin.lang.php,v 1.11 2009/09/01 17:10:50 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 global $lang; … … 64 64 $lang['cf_define_link'] = 'Definire il link'; 65 65 $lang['cf_link'] = 'Nome della variabile del template contenente il link HTML verso il formulario di contatto'; 66 // Emails tab 67 // TODO $lang['cf_tab_emails'] = ''; 68 // TODO $lang['cf_emails_desc'] = ''; 69 // TODO $lang['cf_active'] = ''; 70 // TODO $lang['cf_no_mail'] = ''; 71 // TODO $lang['cf_refresh'] = ''; 66 72 // Language tab 67 73 $lang['cf_tab_language'] = 'Localizzazione';
Note: See TracChangeset
for help on using the changeset viewer.