SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/email_share_form.php

  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2015 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 3 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16.  
  17. use Sprout\Helpers\Captcha;
  18. use Sprout\Helpers\Csrf;
  19. use Sprout\Helpers\Enc;
  20. use Sprout\Helpers\Form;
  21. use Sprout\Helpers\Spam;
  22. ?>
  23. <p><b>You are sharing the following page:</b>
  24. <br><a href="<?php echo Enc::html($data['url']); ?>"><?php echo Enc::html($data['title'] ? $data['title'] : $data['url']); ?></a></p>
  25.  
  26. <?php Form::setData($data); ?>
  27. <?php Form::setErrors($errors); ?>
  28. <form action="SITE/email_share/submit" method="post">
  29. <?= Csrf::token(); ?>
  30. <?= Spam::glue(); ?>
  31.  
  32. <input type="hidden" name="title" value="<?php echo Enc::html($data['title']); ?>">
  33. <input type="hidden" name="url" value="<?php echo Enc::html($data['url']); ?>">
  34.  
  35. <?php Form::nextFieldDetails('Their name', false); ?>
  36. <?= Form::text('their_name'); ?>
  37.  
  38. <?php Form::nextFieldDetails('Their email', false); ?>
  39. <?= Form::text('their_email'); ?>
  40.  
  41. <?php Form::nextFieldDetails('A short message', false); ?>
  42. <?= Form::multiline('message'); ?>
  43.  
  44. <?php if (!empty($use_captcha)): ?>
  45. <?php Captcha::field(); ?>
  46. <?php endif; ?>
  47.  
  48. <p>
  49. <input type="submit" value="Share" class="button">
  50. &nbsp;
  51. <a href="<?php echo Enc::html($data['url']); ?>">Cancel</a>
  52. </p>
  53. </form>
  54.