hesabixWpTheme/bbpress/form-reply.php

213 lines
7.6 KiB
PHP

<?php
/**
* ایجاد / ویرایش پاسخ
*
* @package Hesabix2
* @subpackage bbPress
*/
defined( 'ABSPATH' ) || exit;
if ( bbp_is_reply_edit() ) :
?>
<div id="bbpress-forums" class="bbpress-wrapper">
<?php
endif;
if ( bbp_current_user_can_access_create_reply_form() ) :
?>
<div id="new-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-form">
<form id="new-post" name="new-post" method="post" enctype="multipart/form-data">
<?php do_action( 'bbp_theme_before_reply_form' ); ?>
<fieldset class="bbp-form">
<legend><?php
if ( bbp_get_form_reply_to() ) {
printf(
/* translators: 1: reply number, 2: topic title */
esc_html__( 'پاسخ به #%1$s در «%2$s»', 'hesabix2' ),
esc_html( (string) bbp_get_form_reply_to() ),
esc_html( bbp_get_topic_title() )
);
} else {
printf(
/* translators: %s: topic title */
esc_html__( 'پاسخ به: %s', 'hesabix2' ),
esc_html( bbp_get_topic_title() )
);
}
?></legend>
<?php do_action( 'bbp_theme_before_reply_form_notices' ); ?>
<?php if ( ! bbp_is_topic_open() && ! bbp_is_reply_edit() ) : ?>
<div class="bbp-template-notice">
<ul>
<li><?php esc_html_e( 'این موضوع بسته است، اما همچنان می‌توانید پاسخ دهید.', 'hesabix2' ); ?></li>
</ul>
</div>
<?php endif; ?>
<?php if ( ! bbp_is_reply_edit() && bbp_is_forum_closed() ) : ?>
<div class="bbp-template-notice">
<ul>
<li><?php esc_html_e( 'انجمن بسته است، اما همچنان می‌توانید پاسخ ارسال کنید.', 'hesabix2' ); ?></li>
</ul>
</div>
<?php endif; ?>
<?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
<div class="bbp-template-notice info">
<ul>
<li><?php esc_html_e( 'حساب شما اجازهٔ ارسال محتوای HTML بدون فیلتر را دارد.', 'hesabix2' ); ?></li>
</ul>
</div>
<?php endif; ?>
<?php do_action( 'bbp_template_notices' ); ?>
<div class="hesabix2-bbp-form-fields">
<?php bbp_get_template_part( 'form', 'anonymous' ); ?>
<?php do_action( 'bbp_theme_before_reply_form_content' ); ?>
<?php bbp_the_content( array( 'context' => 'reply' ) ); ?>
<?php do_action( 'bbp_theme_after_reply_form_content' ); ?>
<?php bbp_get_template_part( 'form', 'allowed-tags' ); ?>
<?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() ) ) : ?>
<?php do_action( 'bbp_theme_before_reply_form_tags' ); ?>
<p>
<label for="bbp_topic_tags"><?php esc_html_e( 'برچسب‌ها:', 'hesabix2' ); ?></label>
<input type="text" value="<?php bbp_form_topic_tags(); ?>" name="bbp_topic_tags" id="bbp_topic_tags" <?php disabled( bbp_is_topic_spam() ); ?> />
</p>
<?php do_action( 'bbp_theme_after_reply_form_tags' ); ?>
<?php endif; ?>
<?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous() && ( ! bbp_is_reply_edit() || ( bbp_is_reply_edit() && ! bbp_is_reply_anonymous() ) ) ) : ?>
<?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?>
<p class="hesabix2-bbp-form-checkbox">
<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> />
<label for="bbp_topic_subscription"><?php
if ( bbp_is_reply_edit() && ( bbp_get_reply_author_id() !== bbp_get_current_user_id() ) ) {
esc_html_e( 'اطلاع‌رسانی نویسنده از پاسخ‌های بعدی با ایمیل', 'hesabix2' );
} else {
esc_html_e( 'اطلاع‌رسانی من از پاسخ‌های بعدی با ایمیل', 'hesabix2' );
}
?></label>
</p>
<?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?>
<?php endif; ?>
<?php if ( bbp_is_reply_edit() ) : ?>
<?php if ( current_user_can( 'moderate', bbp_get_reply_id() ) ) : ?>
<?php do_action( 'bbp_theme_before_reply_form_reply_to' ); ?>
<p class="form-reply-to">
<label for="bbp_reply_to"><?php esc_html_e( 'پاسخ به:', 'hesabix2' ); ?></label>
<?php bbp_reply_to_dropdown(); ?>
</p>
<?php do_action( 'bbp_theme_after_reply_form_reply_to' ); ?>
<?php do_action( 'bbp_theme_before_reply_form_status' ); ?>
<p>
<label for="bbp_reply_status"><?php esc_html_e( 'وضعیت پاسخ:', 'hesabix2' ); ?></label>
<?php bbp_form_reply_status_dropdown(); ?>
</p>
<?php do_action( 'bbp_theme_after_reply_form_status' ); ?>
<?php endif; ?>
<?php if ( bbp_allow_revisions() ) : ?>
<?php do_action( 'bbp_theme_before_reply_form_revisions' ); ?>
<fieldset class="bbp-form bbp-form--nested">
<legend>
<input name="bbp_log_reply_edit" id="bbp_log_reply_edit" type="checkbox" value="1" <?php bbp_form_reply_log_edit(); ?> />
<label for="bbp_log_reply_edit"><?php esc_html_e( 'ثبت این ویرایش در تاریخچه', 'hesabix2' ); ?></label>
</legend>
<div>
<label for="bbp_reply_edit_reason"><?php esc_html_e( 'دلیل ویرایش (اختیاری):', 'hesabix2' ); ?></label>
<input type="text" value="<?php bbp_form_reply_edit_reason(); ?>" name="bbp_reply_edit_reason" id="bbp_reply_edit_reason" />
</div>
</fieldset>
<?php do_action( 'bbp_theme_after_reply_form_revisions' ); ?>
<?php endif; ?>
<?php endif; ?>
<?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?>
<div class="bbp-submit-wrapper">
<?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?>
<?php bbp_cancel_reply_to_link(); ?>
<button type="submit" id="bbp_reply_submit" name="bbp_reply_submit" class="button submit"><?php esc_html_e( 'ارسال', 'hesabix2' ); ?></button>
<?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?>
</div>
<?php do_action( 'bbp_theme_after_reply_form_submit_wrapper' ); ?>
</div>
<?php bbp_reply_form_fields(); ?>
</fieldset>
<?php do_action( 'bbp_theme_after_reply_form' ); ?>
</form>
</div>
<?php
elseif ( bbp_is_topic_closed() ) :
?>
<div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
<div class="bbp-template-notice">
<ul>
<li><?php
printf(
/* translators: %s: topic title */
esc_html__( 'موضوع «%s» برای پاسخ جدید بسته است.', 'hesabix2' ),
esc_html( bbp_get_topic_title() )
);
?></li>
</ul>
</div>
</div>
<?php
elseif ( bbp_is_forum_closed( bbp_get_topic_forum_id() ) ) :
?>
<div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
<div class="bbp-template-notice">
<ul>
<li><?php
printf(
/* translators: %s: forum title */
esc_html__( 'انجمن «%s» برای موضوع و پاسخ جدید بسته است.', 'hesabix2' ),
esc_html( bbp_get_forum_title( bbp_get_topic_forum_id() ) )
);
?></li>
</ul>
</div>
</div>
<?php
else :
?>
<div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
<div class="bbp-template-notice">
<ul>
<li><?php
is_user_logged_in()
? esc_html_e( 'شما اجازهٔ پاسخ به این موضوع را ندارید.', 'hesabix2' )
: esc_html_e( 'برای پاسخ باید وارد شوید.', 'hesabix2' );
?></li>
</ul>
</div>
<?php if ( ! is_user_logged_in() ) : ?>
<?php bbp_get_template_part( 'form', 'user-login' ); ?>
<?php endif; ?>
</div>
<?php
endif;
if ( bbp_is_reply_edit() ) :
?>
</div>
<?php
endif;