Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed shorcode to shortcode. cleaned up bootstrap html in frontend … #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contact.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
/**
* Shorcode: {contact recipient="[email protected]"}
*/
Shortcode::add('contact', 'Contact::_shorcode');
Shortcode::add('contact', 'Contact::_shortcode');

/**
* Usage: <?php Contact::display('[email protected]'); ?>
*/
class Contact
{
public static function _shorcode($attributes)
public static function _shortcode($attributes)
{
return Contact::form($attributes['recipient']);
}
Expand Down Expand Up @@ -93,4 +93,4 @@ public static function display($recipient)
echo Contact::form($recipient);
}

}
}
1 change: 1 addition & 0 deletions languages/en.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
'A letter has been sent!' => 'A letter has been sent!',
'A Letter was not sent!' => 'A Letter was not sent!',
'Wrong captcha!' => 'Wrong captcha!',
'Enter the code to prove you are human' => 'Enter the code to prove you are human',
),
);
1 change: 1 addition & 0 deletions languages/ru.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
'A letter has been sent!' => 'Письмо было отправлено!',
'A Letter was not sent!' => 'Письмо не было отправлено!',
'Wrong captcha!' => 'Неправильная капча!',
'Enter the code to prove you are human' => 'Введите код, чтобы доказать, что ты человек',
),
);
50 changes: 36 additions & 14 deletions views/frontend/form.view.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php if (Notification::get('error')) Alert::error(Notification::get('error')); ?>
<br />
<form method="post">


<form method="post" class="form-horizontal">
<?php echo (Form::hidden('csrf', Security::token())); ?>
<label><?php echo __('Name', 'contact'); ?></label>
<input type="text" name="contact_name" class="input-xlarge" value="<?php echo $name; ?>" /><br />
<label><?php echo __('Email', 'contact'); ?></label>
<input type="text" name="contact_email" class="input-xlarge" value="<?php echo $email; ?>" /><br />
<label><?php echo __('Message', 'contact'); ?></label>
<textarea class="input-xxlarge" rows="10" name="contact_body"><?php echo $body; ?></textarea><br /><br />
<div class="form-group">
<label for="contact_name" class="col-md-4 control-label"><?php echo __('Name', 'contact'); ?></label>
<div class="col-md-8">
<input type="text" name="contact_name" class="input form-control" value="<?php echo $name; ?>" />
</div>
</div>
<div class="form-group">
<label for="contact_email" class="col-md-4 control-label"><?php echo __('Email', 'contact'); ?></label>
<div class="col-md-8">
<input type="text" name="contact_email" class="input form-control" value="<?php echo $email; ?>" />
</div>
</div>
<div class="form-group">
<label for="contact_body" class="col-md-4 control-label"><?php echo __('Message', 'contact'); ?></label>
<div class="col-md-8">
<textarea class="input form-control" rows="10" name="contact_body"><?php echo $body; ?></textarea>
</div>
</div>

<?php if (Option::get('captcha_installed') == 'true') { ?>
<label><?php echo __('Captcha', 'users'); ?></label>
<input type="text" name="answer"><?php if (isset($errors['captcha_wrong'])) echo Html::nbsp(3).'<span class="error">'.$errors['captcha_wrong'].'</span>'; ?>
<?php CryptCaptcha::draw(); ?>
<div class="form-group">
<div class="col-md-4 col-md-offset-4">
<input type="text" class="input form-control" name="answer">
<span class="help-block"><?php echo __('Enter the code to prove you are human', 'contact'); ?></span>
<?php if (isset($errors['captcha_wrong'])) echo Html::nbsp(3).'<span class="alert alert-danger error">'.$errors['captcha_wrong'].'</span>'; ?>
</div>
<div class="col-md-2">
<span type="image" class="form-control" style="overflow: hidden; width: 170px; padding: 0px;"><?php CryptCaptcha::draw(); ?></span>
</div>
</div>
<?php } ?>

<br />
<?php if (count($errors) > 0) { ?>
<ul>
<div class="alert alert-danger"><ul>
<?php foreach ($errors as $error) { ?>
<li><?php echo $error; ?></li>
<?php } ?>
</ul>
</ul></div>
<?php } ?>
<input type="submit" class="btn" value="<?php echo __('Send', 'contact'); ?>" name="contact_submit"/>
<div class="col-md-4 col-md-offset-4">
<input type="submit" class="btn btn-block" value="<?php echo __('Send', 'contact'); ?>" name="contact_submit"/>
</div>
</form>