Skip to content

Commit

Permalink
V1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
boiteasite committed Oct 14, 2016
1 parent 4fc0b0d commit 6dca7f8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Added with a Shortcode in the content of the page or directly in the template.

### Versions ###

* 1.2 - 14/10/2016 : Use PHP-Gettext in place of gettext
* 1.1.1 - 12/03/2016 : Update Simple-php-captcha.
* 1.1 - 21/11/2015 : Remove Table structure.
* 1.0.1 - 05/11/2015 : Fix bugs and auto set default admin email
Expand Down
38 changes: 19 additions & 19 deletions contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,49 @@
<style type="text/css">#contactResult td{padding:10px;vertical-align:middle;} #contactResult td:first-child{max-width:120px;}</style>
<div class="blocForm">
<h2>Contact</h2>
<p><?php echo _("This plugin allows you to create a contact form that can be installed at any location of the site.");?></p>
<p><?php echo _("Just insert the code")." <code>[[contact]]</code> "._("in the text of your page or directly into the template. This code will be replaced by the form.");?></p>
<p><?php echo T_("This plugin allows you to create a contact form that can be installed at any location of the site.");?></p>
<p><?php echo T_("Just insert the code")." <code>[[contact]]</code> ".T_("in the text of your page or directly into the template. This code will be replaced by the form.");?></p>
<table class="hForm">
<tr>
<td><label><?php echo _("Admin email");?></label></td>
<td><label><?php echo T_("Admin email");?></label></td>
<td><input type="text" class="input" name="contactAdmin" id="contactAdmin" /></td>
<td><em><?php echo _("E-mail address of destination : Your email address or the contact site.");?></em></td>
<td><em><?php echo T_("E-mail address of destination : Your email address or the contact site.");?></em></td>
</tr>
<tr>
<td><label><?php echo _("Send button");?></label></td>
<td><label><?php echo T_("Send button");?></label></td>
<td><input type="text" class="input" name="contactSend" id="contactSend" /></td>
<td><em><?php echo _("The word that should appear on the 'Send' button.");?></em></td>
<td><em><?php echo T_("The word that should appear on the 'Send' button.");?></em></td>
</tr>
<tr>
<td><label><?php echo _("Thank you");?></label></td>
<td><label><?php echo T_("Thank you");?></label></td>
<td><input type="text" class="input" name="contactHappy" id="contactHappy" /></td>
<td><em><?php echo _("The sentence of thanks that will be displayed on the screen after sending the message.");?></em></td>
<td><em><?php echo T_("The sentence of thanks that will be displayed on the screen after sending the message.");?></em></td>
</tr>
<tr>
<td><label><?php echo _("Enable Captcha");?></label></td>
<td><label><?php echo T_("Enable Captcha");?></label></td>
<td><input type="checkbox" class="input" name="contactCaptcha" id="contactCaptcha" /></td>
<td><em><?php echo _("Code image to enter to block the automatic sending of email by robots.");?></em></td>
<td><em><?php echo T_("Code image to enter to block the automatic sending of email by robots.");?></em></td>
</tr>
</table>
<h3><?php echo _("Add a field :");?></h3>
<h3><?php echo T_("Add a field :");?></h3>
<table class="hForm">
<tr>
<td><label><?php echo _("Label");?></label></td>
<td><label><?php echo T_("Label");?></label></td>
<td>
<input type="text" class="input" name="contactLabel" id="contactLabel" value="" />
<select name="contactType" id="contactType" />
<option value="te"><?php echo _("Text");?></option>
<option value="ta"><?php echo _("Textarea");?></option>
<option value="te"><?php echo T_("Text");?></option>
<option value="ta"><?php echo T_("Textarea");?></option>
</select>
</td>
<td><div class="bouton fr" onClick="f_contact_add(document.getElementById('contactLabel').value, document.getElementById('contactType').options[document.getElementById('contactType').selectedIndex].value);" title="<?php echo _("Save settings");?>"><?php echo _("Add");?></div></td>
<td><div class="bouton fr" onClick="f_contact_add(document.getElementById('contactLabel').value, document.getElementById('contactType').options[document.getElementById('contactType').selectedIndex].value);" title="<?php echo T_("Save settings");?>"><?php echo T_("Add");?></div></td>
</tr>
</table>
<h3><?php echo _("Result :");?></h3>
<h3><?php echo T_("Result :");?></h3>
<form id="frmContact">
<table id="contactResult"></table>
</form>
<div class="bouton fr" onClick="f_contact_save();" title="<?php echo _("Save settings");?>"><?php echo _("Save");?></div>
<div class="bouton fr" onClick="f_contact_save();" title="<?php echo T_("Save settings");?>"><?php echo T_("Save");?></div>
<div class="clear"></div>
</div>
<?php break;
Expand Down Expand Up @@ -90,8 +90,8 @@
++$c;
}
$out = json_encode($a);
if (file_put_contents('../../data/_sdata-'.$sdata.'/'.$Ubusy.'/contact.json', $out)) echo _('Backup performed');
else echo '!'._('Impossible backup');
if (file_put_contents('../../data/_sdata-'.$sdata.'/'.$Ubusy.'/contact.json', $out)) echo T_('Backup performed');
else echo '!'.T_('Impossible backup');
break;
// ********************************************************************************************
case 'load':
Expand Down
6 changes: 3 additions & 3 deletions contactCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
session_start();
if ($_POST['contactCaptcha']!=$_SESSION['captcha']['code'])
{
echo _('Captcha error');
echo T_('Captcha error');
Exit;
}
}
Expand Down Expand Up @@ -62,10 +62,10 @@
$msg.= $rn."--".$boundary."--".$rn;
if($l>10 && mail($mail, stripslashes($sujet), stripslashes($msg),$header))
{
if(!$happy) echo _('OK');
if(!$happy) echo T_('OK');
else echo " ".$happy;
}
else echo _('Failed to send');
else echo T_('Failed to send');
break;
// ********************************************************************************************
}
Expand Down
11 changes: 6 additions & 5 deletions lang/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
//
if(isset($langPlug[$lang]) && $langPlug[$lang])
{
putenv('LC_ALL='.$langPlug[$lang]);
setlocale(LC_ALL, $langPlug[$lang]);
bindtextdomain("contact", dirname (__FILE__));
textdomain("contact");
require_once(dirname(__FILE__).'/../../../includes/lang/php-gettext/gettext.inc');
T_setlocale(LC_MESSAGES, $langPlug[$lang]);
T_bindtextdomain("contact", dirname(__FILE__));
T_bind_textdomain_codeset("contact", "UTF-8");
T_textdomain("contact");
}
?>
?>
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.1.1","host":"https://github.com/cmsunoPlugins/contact/"}
{"version":"1.2","host":"https://github.com/cmsunoPlugins/contact/"}

0 comments on commit 6dca7f8

Please sign in to comment.