Changeset 3771
- Timestamp:
- Aug 21, 2009, 11:32:30 AM (15 years ago)
- Location:
- extensions/ContactForm
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/config.php
r3753 r3771 1 1 <?php 2 /* $Id: config.php,v 1. 3 2009/08/19 13:30:25Criss Exp $ */2 /* $Id: config.php,v 1.4 2009/08/21 09:24:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 check_status(ACCESS_ADMINISTRATOR); … … 9 9 $config_tabs[]='config'; 10 10 $config_tabs[]='language'; 11 $config_tabs[]='history'; 11 12 12 13 global $template, $page; -
extensions/ContactForm/include/cf_common.inc.php
r3753 r3771 7 7 8 8 // Version 9 define('CF_VERSION', '1.0. 4');9 define('CF_VERSION', '1.0.5'); 10 10 define('CF_TITLE', 'cf_plugin_name'); 11 11 … … 26 26 // Files 27 27 define('CF_OBSOLETE', 'obsolete.list'); 28 define('CF_CHANGELOG', 'CHANGELOG'); 28 29 // Constants 29 30 define('CF_DEBUG_ACTIVE', false); -
extensions/ContactForm/include/cf_functions.inc.php
r3753 r3771 132 132 } 133 133 134 function cf_format_date($year, $month, $day, $format='%M %D, %Y') { 135 $format = str_ireplace('%Y', $year, $format); 136 $format = str_ireplace('%M', $month, $format); 137 $format = str_ireplace('%D', $day, $format); 138 return $format; 139 } 140 141 function cf_get_history_list($file_name, &$errors = array()) { 142 // Include language advices 143 load_language('plugin.lang', CF_PATH); 144 global $lang; 145 $month_list = $lang['month']; 146 $history = array(); 147 if (!file_exists($file_name)) { 148 array_push($errors, sprintf(l10n('cf_file_not_found'), $file_name)); 149 return $history; 150 } 151 $raw_history = file($file_name, 152 FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); 153 154 $index = -1; 155 array_push($errors, sprintf(l10n('cf_file_empty'), $file_name)); 156 foreach($raw_history as $new_line) { 157 $pos = strpos($new_line, ' '); 158 switch ($pos) { 159 case 0: 160 // History item 161 if (isset($history[$index]) and is_array($history[$index])) { 162 array_push($history[$index]['CHANGES'], trim($new_line)); 163 } 164 break; 165 default: 166 // New history date 167 $index++; 168 list($date, $version) = explode(' ', $new_line); 169 list($year, $month, $day) = explode('-', $date); 170 $date_array = array('RAW' => $date); 171 if (isset($month)) { 172 $month = $month_list[intval($month)]; 173 } 174 if (isset($year) and isset($month) and isset($day)) { 175 $date_array['FORMATTED'] = cf_format_date($year, 176 $month, 177 $day, 178 l10n('cf_format_date')); 179 } 180 $history[$index] = array( 181 'DATE' => $date_array, 182 'VERSION' => $version, 183 'CHANGES' => array(), 184 ); 185 } 186 } 187 return $history; 188 } 189 134 190 ?> -
extensions/ContactForm/include/contactform.css
r3753 r3771 3 3 padding-bottom: 10px; 4 4 } 5 div.contact-form-content { 6 border-width: 0px; 7 border-style: solid; 8 margin-top: 5px; 9 margin-bottom: 5px; 10 margin-left: 20px; 11 margin-right: 20px; 12 padding: 10px; 13 } 14 .cf-input-disabled { 15 position: relative; 16 } 17 .cf-input, .cf-input-disabled { 18 left: 5px; 19 } 5 20 td.contact-form-left { 6 21 padding-right: 5px; 7 22 text-align: right; 8 vertical-align: top; 23 vertical-align: middle; 24 } 25 td.contact-form-left#cf_message_label { 26 vertical-align: top; 27 padding-top: 5px; 9 28 } 10 29 td.contact-form-right { -
extensions/ContactForm/language/en_UK/plugin.lang.php
r3749 r3771 1 1 <?php 2 /* $Id: plugin.lang.php,v 1. 8 2009/08/18 14:40:36Criss Exp $ */2 /* $Id: plugin.lang.php,v 1.9 2009/08/21 09:24:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 global $lang; … … 71 71 $lang['contact_form_label'] = 'Name used in menubar'; 72 72 $lang['contact_form_link_label'] = 'Text used for contact link in the page footer'; 73 // History tab 74 $lang['cf_tab_history'] = 'History'; 75 $lang['cf_history'] = 'History'; 76 $lang['cf_history_desc'] = 'Changes history'; 77 $lang['cf_history_date'] = 'Date'; 78 $lang['cf_history_version'] = 'Version'; 79 $lang['cf_history_log'] = 'Changelog'; 80 $lang['cf_file_not_found'] = 'File not found'; 81 $lang['cf_file_empty'] = 'File is empty'; 82 $lang['cf_format_date'] = '%M %D, %Y'; 73 83 ?> -
extensions/ContactForm/language/fr_FR/plugin.lang.php
r3749 r3771 1 1 <?php 2 /* $Id: plugin.lang.php,v 1. 8 2009/08/18 14:40:36Criss Exp $ */2 /* $Id: plugin.lang.php,v 1.9 2009/08/21 09:24:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 global $lang; … … 71 71 $lang['contact_form_label'] = 'Nom affiché dans la barre de menus'; 72 72 $lang['contact_form_link_label'] = 'Texte utilisé pour le lien de contact en bas de page'; 73 73 // History tab 74 $lang['cf_tab_history'] = 'Historique'; 75 $lang['cf_history'] = 'Historique'; 76 $lang['cf_history_desc'] = 'Historique des modifications'; 77 $lang['cf_history_date'] = 'Date'; 78 $lang['cf_history_version'] = 'Version'; 79 $lang['cf_history_log'] = 'Changelog'; 80 $lang['cf_file_not_found'] = 'Fichier non trouvé'; 81 $lang['cf_file_empty'] = 'Fichier vide'; 82 $lang['cf_format_date'] = '%D %M %Y'; 74 83 ?> -
extensions/ContactForm/language/it_IT/plugin.lang.php
r3749 r3771 1 1 <?php 2 /* $Id: plugin.lang.php,v 1. 8 2009/08/18 14:40:36Criss Exp $ */2 /* $Id: plugin.lang.php,v 1.9 2009/08/21 09:24:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 global $lang; … … 71 71 // TODO $lang['contact_form_label'] = ' '; 72 72 // TODO $lang['contact_form_link_label'] = ' '; 73 // History tab 74 // TODO $lang['cf_tab_history'] = ''; 75 // TODO $lang['cf_history'] = ''; 76 // TODO $lang['cf_history_desc'] = ''; 77 // TODO $lang['cf_history_date'] = ''; 78 // TODO $lang['cf_history_version'] = ''; 79 // TODO $lang['cf_history_log'] = ''; 80 // TODO $lang['cf_file_not_found'] = ''; 81 // TODO $lang['cf_file_empty'] = ''; 82 // TODO $lang['cf_format_date'] = '%D %M %Y'; 73 83 74 84 ?> -
extensions/ContactForm/main.inc.php
r3753 r3771 2 2 /* 3 3 Plugin Name: Contact Form 4 Version: 1.0. 44 Version: 1.0.5 5 5 Description: Add a "Contact" item in the Menu block to offer a contact form to users 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=304 … … 9 9 */ 10 10 11 /** History **12 13 2009-08-18 1.0.414 Update configuration pages15 16 2009-08-18 1.0.317 Add configuration option to define menu link or not18 19 2009-08-18 1.0.220 Add configuration option to define template variable or not21 22 2009-08-17 1.0.123 Add default value to language translation24 25 2009-08-17 1.0.026 Put under SVN control27 28 2009-08-17 0.1.f29 Add obsolete list30 31 2009-08-17 0.1.e32 Add language configuration for items texts33 Add template variable34 35 2009-08-14 0.1.d36 Add a redirection page when successfully sent message37 38 2009-08-13 0.1.c39 Fix regexp bug in mail format check in javascript40 41 2009-08-13 0.1.b42 Add admin management43 44 2009-08-13 0.1.a45 Plugin creation46 47 */48 11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 49 12 -
extensions/ContactForm/template/cf_form.tpl
r3743 r3771 1 {known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"} 2 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"} 3 {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.resizable.packed.js"} 1 4 {literal} 2 5 <script type="text/javascript"> 6 jQuery().ready(function(){ 7 // Resize possible for textarea 8 jQuery("#cf_message").resizable({ 9 handles: "all", 10 animate: true, 11 animateDuration: "slow", 12 animateEasing: "swing", 13 preventDefault: true, 14 preserveCursor: true, 15 autoHide: true, 16 ghost: true 17 }); 18 }); 19 jQuery().ready(function(){ 20 // Resize possible for textarea 21 jQuery(".cf-input").resizable({ 22 handles: "e", 23 animate: true, 24 animateDuration: "slow", 25 animateEasing: "swing", 26 preventDefault: true, 27 preserveCursor: true, 28 autoHide: true, 29 ghost: true 30 }); 31 }); 32 3 33 function cf_validate() { 4 34 var items = new Array('cf_from_name','cf_from_mail','cf_subject','cf_message'); … … 29 59 <div id="autre_content" class="contact-form"> 30 60 <form method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();"> 31 < fieldset>61 <div class="contact-form-content"> 32 62 <table> 33 63 <tr> … … 35 65 <td class="contact-form-right"> 36 66 {if $CF.LOGGED} 37 <input type="text" name="cf_from_name_label" id="cf_from_name" size="40" value="{$CF.NAME}" disabled="disabled" >67 <input type="text" name="cf_from_name_label" id="cf_from_name" size="40" value="{$CF.NAME}" disabled="disabled" class="cf-input-disabled"> 38 68 <input type="hidden" name="cf_from_name" value="{$CF.NAME}" /> 39 69 {else} 40 <input type="text" name="cf_from_name" id="cf_from_name" size="40" value="{$CF.NAME}" >70 <input type="text" name="cf_from_name" id="cf_from_name" size="40" value="{$CF.NAME}" class="cf-input"> 41 71 {/if} 42 72 </td> … … 46 76 <td class="contact-form-right"> 47 77 {if $CF.LOGGED and ''!=$CF.EMAIL} 48 <input type="text" name="cf_from_mail_label" id="cf_from_mail" size="40" value="{$CF.EMAIL}" disabled="disabled" >78 <input type="text" name="cf_from_mail_label" id="cf_from_mail" size="40" value="{$CF.EMAIL}" disabled="disabled" class="cf-input-disabled"> 49 79 <input type="hidden" name="cf_from_mail" value="{$CF.EMAIL}" /> 50 80 {else} 51 <input type="text" name="cf_from_mail" id="cf_from_mail" size="40" value="{$CF.EMAIL}" ></td>81 <input type="text" name="cf_from_mail" id="cf_from_mail" size="40" value="{$CF.EMAIL}" class="cf-input"></td> 52 82 {/if} 53 83 </td> … … 55 85 <tr> 56 86 <td class="contact-form-left">{'cf_subject'|@translate}</td> 57 <td class="contact-form-right"><input type="text" name="cf_subject" id="cf_subject" size="40" value="{$CF.SUBJECT}" ></td>87 <td class="contact-form-right"><input type="text" name="cf_subject" id="cf_subject" size="40" value="{$CF.SUBJECT}" class="cf-input"></td> 58 88 </tr> 59 89 <tr> 60 <td class="contact-form-left" >{'cf_message'|@translate}</td>90 <td class="contact-form-left" id="cf_message_label">{'cf_message'|@translate}</td> 61 91 <td class="contact-form-right"><textarea name="cf_message" id="cf_message" rows="10" cols="40">{$CF.MESSAGE}</textarea></td> 62 92 </tr> … … 68 98 <input type="hidden" name="cf_key" value="{$CF.KEY}" /> 69 99 <input type="hidden" name="cf_id" value="{$CF.ID}" /> 70 </ fieldset>100 </div> 71 101 </form> 72 102 </div>
Note: See TracChangeset
for help on using the changeset viewer.