b2evolution PHP Cross Reference Blogging Systems

Source: /skins/_contact_msg.form.php - 96 lines - 3161 bytes - Summary - Text - Print

Description: This is the template that displays the email message form

   1  <?php
   2  /**
   3   * This is the template that displays the email message form
   4   *
   5   * This file is not meant to be called directly.
   6   *
   7   * b2evolution - {@link http://b2evolution.net/}
   8   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
   9   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  10   *
  11   * @package evoskins
  12   */
  13  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  14  
  15  global $dummy_fields;
  16  
  17  // Default params:
  18  $default_params = array(
  19          'skin_form_params' => array(),
  20      );
  21  
  22  if( isset( $params ) )
  23  {    // Merge with default params
  24      $params = array_merge( $default_params, $params );
  25  }
  26  else
  27  {    // Use a default params
  28      $params = $default_params;
  29  }
  30  
  31  
  32  $submit_url = $samedomain_htsrv_url.'message_send.php';
  33  
  34  if( ( $unsaved_message_params = get_message_params_from_session() ) == NULL )
  35  { // set message default to empty string
  36      $message = '';
  37  }
  38  else
  39  { // set saved message params
  40      $subject = $unsaved_message_params[ 'subject' ];
  41      $message = $unsaved_message_params[ 'message' ];
  42      $email_author = $unsaved_message_params[ 'sender_name' ];
  43      $email_author_address = $unsaved_message_params[ 'sender_address' ];
  44  }
  45  
  46  $Form = new Form( $submit_url );
  47  
  48  $Form->switch_template_parts( $params['skin_form_params'] );
  49  
  50      $Form->begin_form( 'bComment' );
  51  
  52      $Form->add_crumb( 'newmessage' );
  53      if( isset($Blog) )
  54      {
  55          $Form->hidden( 'blog', $Blog->ID );
  56      }
  57      $Form->hidden( 'recipient_id', $recipient_id );
  58      $Form->hidden( 'post_id', $post_id );
  59      $Form->hidden( 'comment_id', $comment_id );
  60      $Form->hidden( 'redirect_to', url_rel_to_same_host($redirect_to, $samedomain_htsrv_url) );
  61  
  62      $Form->info( T_('To'), $recipient_link );
  63  
  64      // Note: we use funky field names in order to defeat the most basic guestbook spam bots:
  65      // email form
  66      $Form->text_input( $dummy_fields[ 'name' ], $email_author, 40, T_('From'), T_('Your name.'), array( 'maxlength'=>50, 'class'=>'wide_input', 'required'=>true ) );
  67      $Form->text_input( $dummy_fields[ 'email' ], $email_author_address, 40, T_('Email'), T_('Your email address. (Will <strong>not</strong> be displayed on this site.)'),
  68           array( 'maxlength'=>150, 'class'=>'wide_input', 'required'=>true ) );
  69  
  70      $Form->text_input( $dummy_fields[ 'subject' ], $subject, 40, T_('Subject'), T_('Subject of your message.'), array( 'maxlength'=>255, 'class'=>'wide_input', 'required'=>true ) );
  71  
  72      $Form->textarea( $dummy_fields[ 'content' ], $message, 15, T_('Message'), T_('Plain text only.'), 35, 'wide_textarea', true );
  73  
  74      $Plugins->trigger_event( 'DisplayMessageFormFieldset', array( 'Form' => & $Form,
  75          'recipient_ID' => & $recipient_id, 'item_ID' => $post_id, 'comment_ID' => $comment_id ) );
  76  
  77      $Form->begin_fieldset();
  78      ?>
  79          <div class="input">
  80              <?php
  81              $Form->button_input( array( 'name' => 'submit_message_'.$recipient_id, 'class' => 'submit', 'value' => T_('Send message') ) );
  82  
  83              $Plugins->trigger_event( 'DisplayMessageFormButton', array( 'Form' => & $Form,
  84                  'recipient_ID' => & $recipient_id, 'item_ID' => $post_id, 'comment_ID' => $comment_id ) );
  85              ?>
  86          </div>
  87          <?php
  88      $Form->end_fieldset();
  89      ?>
  90  
  91      <div class="clear"></div>
  92  
  93  <?php
  94  $Form->end_form();
  95  
  96  ?>

title

Description

title

Description

title

Description

title

title

Body