| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly. |
| 4 |
} |
| 5 |
echo '<div id="fep-reply-form">'; |
| 6 |
if ( ! fep_current_user_can( 'send_reply', $parent_id ) ) { |
| 7 |
echo '<div class="fep-error">' . esc_html__( 'You do not have permission to send reply to this message!', 'front-end-pm' ) . '</div>'; |
| 8 |
} elseif( isset( $_POST['fep_action'] ) && 'reply' == $_POST['fep_action'] ) { |
| 9 |
if( fep_errors()->get_error_messages() ) { |
| 10 |
echo Fep_Form::init()->form_field_output( 'reply', fep_errors(), array( 'fep_parent_id' => $parent_id ) ); |
| 11 |
} else { |
| 12 |
echo fep_info_output(); |
| 13 |
if( 'threaded' == fep_get_message_view() ) { |
| 14 |
unset( $_REQUEST['message_content'] ); //hack to empty message content |
| 15 |
echo Fep_Form::init()->form_field_output( 'reply', '', array( 'fep_parent_id' => $parent_id ) ); |
| 16 |
} |
| 17 |
} |
| 18 |
} else { |
| 19 |
echo Fep_Form::init()->form_field_output( 'reply', '', array( 'fep_parent_id' => $parent_id ) ); |
| 20 |
} |
| 21 |
echo '</div>'; |
| 22 |
|