Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/contact-.../admin/includes
File: editor.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class WPCF7_Editor {
[2] Fix | Delete
[3] Fix | Delete
private $contact_form;
[4] Fix | Delete
private $panels = array();
[5] Fix | Delete
[6] Fix | Delete
public function __construct( WPCF7_ContactForm $contact_form ) {
[7] Fix | Delete
$this->contact_form = $contact_form;
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
public function add_panel( $panel_id, $title, $callback ) {
[11] Fix | Delete
if ( wpcf7_is_name( $panel_id ) ) {
[12] Fix | Delete
$this->panels[$panel_id] = array(
[13] Fix | Delete
'title' => $title,
[14] Fix | Delete
'callback' => $callback,
[15] Fix | Delete
);
[16] Fix | Delete
}
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
public function display() {
[20] Fix | Delete
if ( empty( $this->panels ) ) {
[21] Fix | Delete
return;
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
echo '<ul id="contact-form-editor-tabs">';
[25] Fix | Delete
[26] Fix | Delete
foreach ( $this->panels as $panel_id => $panel ) {
[27] Fix | Delete
echo sprintf(
[28] Fix | Delete
'<li id="%1$s-tab"><a href="#%1$s">%2$s</a></li>',
[29] Fix | Delete
esc_attr( $panel_id ),
[30] Fix | Delete
esc_html( $panel['title'] )
[31] Fix | Delete
);
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
echo '</ul>';
[35] Fix | Delete
[36] Fix | Delete
foreach ( $this->panels as $panel_id => $panel ) {
[37] Fix | Delete
echo sprintf(
[38] Fix | Delete
'<div class="contact-form-editor-panel" id="%1$s">',
[39] Fix | Delete
esc_attr( $panel_id )
[40] Fix | Delete
);
[41] Fix | Delete
[42] Fix | Delete
if ( is_callable( $panel['callback'] ) ) {
[43] Fix | Delete
$this->notice( $panel_id, $panel );
[44] Fix | Delete
call_user_func( $panel['callback'], $this->contact_form );
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
echo '</div>';
[48] Fix | Delete
}
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
public function notice( $panel_id, $panel ) {
[52] Fix | Delete
echo '<div class="config-error"></div>';
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
function wpcf7_editor_panel_form( $post ) {
[57] Fix | Delete
$desc_link = wpcf7_link(
[58] Fix | Delete
__( 'https://contactform7.com/editing-form-template/', 'contact-form-7' ),
[59] Fix | Delete
__( 'Editing form template', 'contact-form-7' ) );
[60] Fix | Delete
$description = __( "You can edit the form template here. For details, see %s.", 'contact-form-7' );
[61] Fix | Delete
$description = sprintf( esc_html( $description ), $desc_link );
[62] Fix | Delete
?>
[63] Fix | Delete
[64] Fix | Delete
<h2><?php echo esc_html( __( 'Form', 'contact-form-7' ) ); ?></h2>
[65] Fix | Delete
[66] Fix | Delete
<fieldset>
[67] Fix | Delete
<legend><?php echo $description; ?></legend>
[68] Fix | Delete
[69] Fix | Delete
<?php
[70] Fix | Delete
$tag_generator = WPCF7_TagGenerator::get_instance();
[71] Fix | Delete
$tag_generator->print_buttons();
[72] Fix | Delete
?>
[73] Fix | Delete
[74] Fix | Delete
<textarea id="wpcf7-form" name="wpcf7-form" cols="100" rows="24" class="large-text code" data-config-field="form.body"><?php echo esc_textarea( $post->prop( 'form' ) ); ?></textarea>
[75] Fix | Delete
</fieldset>
[76] Fix | Delete
<?php
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
function wpcf7_editor_panel_mail( $post ) {
[80] Fix | Delete
wpcf7_editor_box_mail( $post );
[81] Fix | Delete
[82] Fix | Delete
echo '<br class="clear" />';
[83] Fix | Delete
[84] Fix | Delete
wpcf7_editor_box_mail( $post, array(
[85] Fix | Delete
'id' => 'wpcf7-mail-2',
[86] Fix | Delete
'name' => 'mail_2',
[87] Fix | Delete
'title' => __( 'Mail (2)', 'contact-form-7' ),
[88] Fix | Delete
'use' => __( 'Use Mail (2)', 'contact-form-7' ),
[89] Fix | Delete
) );
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
function wpcf7_editor_box_mail( $post, $options = '' ) {
[93] Fix | Delete
$options = wp_parse_args( $options, array(
[94] Fix | Delete
'id' => 'wpcf7-mail',
[95] Fix | Delete
'name' => 'mail',
[96] Fix | Delete
'title' => __( 'Mail', 'contact-form-7' ),
[97] Fix | Delete
'use' => null,
[98] Fix | Delete
) );
[99] Fix | Delete
[100] Fix | Delete
$id = esc_attr( $options['id'] );
[101] Fix | Delete
[102] Fix | Delete
$mail = wp_parse_args( $post->prop( $options['name'] ), array(
[103] Fix | Delete
'active' => false,
[104] Fix | Delete
'recipient' => '',
[105] Fix | Delete
'sender' => '',
[106] Fix | Delete
'subject' => '',
[107] Fix | Delete
'body' => '',
[108] Fix | Delete
'additional_headers' => '',
[109] Fix | Delete
'attachments' => '',
[110] Fix | Delete
'use_html' => false,
[111] Fix | Delete
'exclude_blank' => false,
[112] Fix | Delete
) );
[113] Fix | Delete
[114] Fix | Delete
?>
[115] Fix | Delete
<div class="contact-form-editor-box-mail" id="<?php echo $id; ?>">
[116] Fix | Delete
<h2><?php echo esc_html( $options['title'] ); ?></h2>
[117] Fix | Delete
[118] Fix | Delete
<?php
[119] Fix | Delete
if ( ! empty( $options['use'] ) ) :
[120] Fix | Delete
?>
[121] Fix | Delete
<label for="<?php echo $id; ?>-active"><input type="checkbox" id="<?php echo $id; ?>-active" name="<?php echo $id; ?>[active]" data-config-field="" class="toggle-form-table" value="1"<?php echo ( $mail['active'] ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html( $options['use'] ); ?></label>
[122] Fix | Delete
<p class="description"><?php echo esc_html( __( "Mail (2) is an additional mail template often used as an autoresponder.", 'contact-form-7' ) ); ?></p>
[123] Fix | Delete
<?php
[124] Fix | Delete
endif;
[125] Fix | Delete
?>
[126] Fix | Delete
[127] Fix | Delete
<fieldset>
[128] Fix | Delete
<legend>
[129] Fix | Delete
<?php
[130] Fix | Delete
$desc_link = wpcf7_link(
[131] Fix | Delete
__( 'https://contactform7.com/setting-up-mail/', 'contact-form-7' ),
[132] Fix | Delete
__( 'Setting up mail', 'contact-form-7' ) );
[133] Fix | Delete
$description = __( "You can edit the mail template here. For details, see %s.", 'contact-form-7' );
[134] Fix | Delete
$description = sprintf( esc_html( $description ), $desc_link );
[135] Fix | Delete
echo $description;
[136] Fix | Delete
echo '<br />';
[137] Fix | Delete
[138] Fix | Delete
echo esc_html( __( "In the following fields, you can use these mail-tags:",
[139] Fix | Delete
'contact-form-7' ) );
[140] Fix | Delete
echo '<br />';
[141] Fix | Delete
$post->suggest_mail_tags( $options['name'] );
[142] Fix | Delete
?>
[143] Fix | Delete
</legend>
[144] Fix | Delete
<table class="form-table">
[145] Fix | Delete
<tbody>
[146] Fix | Delete
<tr>
[147] Fix | Delete
<th scope="row">
[148] Fix | Delete
<label for="<?php echo $id; ?>-recipient"><?php echo esc_html( __( 'To', 'contact-form-7' ) ); ?></label>
[149] Fix | Delete
</th>
[150] Fix | Delete
<td>
[151] Fix | Delete
<input type="text" id="<?php echo $id; ?>-recipient" name="<?php echo $id; ?>[recipient]" class="large-text code" size="70" value="<?php echo esc_attr( $mail['recipient'] ); ?>" data-config-field="<?php echo sprintf( '%s.recipient', esc_attr( $options['name'] ) ); ?>" />
[152] Fix | Delete
</td>
[153] Fix | Delete
</tr>
[154] Fix | Delete
[155] Fix | Delete
<tr>
[156] Fix | Delete
<th scope="row">
[157] Fix | Delete
<label for="<?php echo $id; ?>-sender"><?php echo esc_html( __( 'From', 'contact-form-7' ) ); ?></label>
[158] Fix | Delete
</th>
[159] Fix | Delete
<td>
[160] Fix | Delete
<input type="text" id="<?php echo $id; ?>-sender" name="<?php echo $id; ?>[sender]" class="large-text code" size="70" value="<?php echo esc_attr( $mail['sender'] ); ?>" data-config-field="<?php echo sprintf( '%s.sender', esc_attr( $options['name'] ) ); ?>" />
[161] Fix | Delete
</td>
[162] Fix | Delete
</tr>
[163] Fix | Delete
[164] Fix | Delete
<tr>
[165] Fix | Delete
<th scope="row">
[166] Fix | Delete
<label for="<?php echo $id; ?>-subject"><?php echo esc_html( __( 'Subject', 'contact-form-7' ) ); ?></label>
[167] Fix | Delete
</th>
[168] Fix | Delete
<td>
[169] Fix | Delete
<input type="text" id="<?php echo $id; ?>-subject" name="<?php echo $id; ?>[subject]" class="large-text code" size="70" value="<?php echo esc_attr( $mail['subject'] ); ?>" data-config-field="<?php echo sprintf( '%s.subject', esc_attr( $options['name'] ) ); ?>" />
[170] Fix | Delete
</td>
[171] Fix | Delete
</tr>
[172] Fix | Delete
[173] Fix | Delete
<tr>
[174] Fix | Delete
<th scope="row">
[175] Fix | Delete
<label for="<?php echo $id; ?>-additional-headers"><?php echo esc_html( __( 'Additional headers', 'contact-form-7' ) ); ?></label>
[176] Fix | Delete
</th>
[177] Fix | Delete
<td>
[178] Fix | Delete
<textarea id="<?php echo $id; ?>-additional-headers" name="<?php echo $id; ?>[additional_headers]" cols="100" rows="4" class="large-text code" data-config-field="<?php echo sprintf( '%s.additional_headers', esc_attr( $options['name'] ) ); ?>"><?php echo esc_textarea( $mail['additional_headers'] ); ?></textarea>
[179] Fix | Delete
</td>
[180] Fix | Delete
</tr>
[181] Fix | Delete
[182] Fix | Delete
<tr>
[183] Fix | Delete
<th scope="row">
[184] Fix | Delete
<label for="<?php echo $id; ?>-body"><?php echo esc_html( __( 'Message body', 'contact-form-7' ) ); ?></label>
[185] Fix | Delete
</th>
[186] Fix | Delete
<td>
[187] Fix | Delete
<textarea id="<?php echo $id; ?>-body" name="<?php echo $id; ?>[body]" cols="100" rows="18" class="large-text code" data-config-field="<?php echo sprintf( '%s.body', esc_attr( $options['name'] ) ); ?>"><?php echo esc_textarea( $mail['body'] ); ?></textarea>
[188] Fix | Delete
[189] Fix | Delete
<p><label for="<?php echo $id; ?>-exclude-blank"><input type="checkbox" id="<?php echo $id; ?>-exclude-blank" name="<?php echo $id; ?>[exclude_blank]" value="1"<?php echo ( ! empty( $mail['exclude_blank'] ) ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html( __( 'Exclude lines with blank mail-tags from output', 'contact-form-7' ) ); ?></label></p>
[190] Fix | Delete
[191] Fix | Delete
<p><label for="<?php echo $id; ?>-use-html"><input type="checkbox" id="<?php echo $id; ?>-use-html" name="<?php echo $id; ?>[use_html]" value="1"<?php echo ( $mail['use_html'] ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html( __( 'Use HTML content type', 'contact-form-7' ) ); ?></label></p>
[192] Fix | Delete
</td>
[193] Fix | Delete
</tr>
[194] Fix | Delete
[195] Fix | Delete
<tr>
[196] Fix | Delete
<th scope="row">
[197] Fix | Delete
<label for="<?php echo $id; ?>-attachments"><?php echo esc_html( __( 'File attachments', 'contact-form-7' ) ); ?></label>
[198] Fix | Delete
</th>
[199] Fix | Delete
<td>
[200] Fix | Delete
<textarea id="<?php echo $id; ?>-attachments" name="<?php echo $id; ?>[attachments]" cols="100" rows="4" class="large-text code" data-config-field="<?php echo sprintf( '%s.attachments', esc_attr( $options['name'] ) ); ?>"><?php echo esc_textarea( $mail['attachments'] ); ?></textarea>
[201] Fix | Delete
</td>
[202] Fix | Delete
</tr>
[203] Fix | Delete
</tbody>
[204] Fix | Delete
</table>
[205] Fix | Delete
</fieldset>
[206] Fix | Delete
</div>
[207] Fix | Delete
<?php
[208] Fix | Delete
}
[209] Fix | Delete
[210] Fix | Delete
function wpcf7_editor_panel_messages( $post ) {
[211] Fix | Delete
$desc_link = wpcf7_link(
[212] Fix | Delete
__( 'https://contactform7.com/editing-messages/', 'contact-form-7' ),
[213] Fix | Delete
__( 'Editing messages', 'contact-form-7' ) );
[214] Fix | Delete
$description = __( "You can edit messages used in various situations here. For details, see %s.", 'contact-form-7' );
[215] Fix | Delete
$description = sprintf( esc_html( $description ), $desc_link );
[216] Fix | Delete
[217] Fix | Delete
$messages = wpcf7_messages();
[218] Fix | Delete
[219] Fix | Delete
if ( isset( $messages['captcha_not_match'] )
[220] Fix | Delete
and ! wpcf7_use_really_simple_captcha() ) {
[221] Fix | Delete
unset( $messages['captcha_not_match'] );
[222] Fix | Delete
}
[223] Fix | Delete
[224] Fix | Delete
?>
[225] Fix | Delete
<h2><?php echo esc_html( __( 'Messages', 'contact-form-7' ) ); ?></h2>
[226] Fix | Delete
<fieldset>
[227] Fix | Delete
<legend><?php echo $description; ?></legend>
[228] Fix | Delete
<?php
[229] Fix | Delete
[230] Fix | Delete
foreach ( $messages as $key => $arr ) {
[231] Fix | Delete
$field_id = sprintf( 'wpcf7-message-%s', strtr( $key, '_', '-' ) );
[232] Fix | Delete
$field_name = sprintf( 'wpcf7-messages[%s]', $key );
[233] Fix | Delete
[234] Fix | Delete
?>
[235] Fix | Delete
<p class="description">
[236] Fix | Delete
<label for="<?php echo $field_id; ?>"><?php echo esc_html( $arr['description'] ); ?><br />
[237] Fix | Delete
<input type="text" id="<?php echo $field_id; ?>" name="<?php echo $field_name; ?>" class="large-text" size="70" value="<?php echo esc_attr( $post->message( $key, false ) ); ?>" data-config-field="<?php echo sprintf( 'messages.%s', esc_attr( $key ) ); ?>" />
[238] Fix | Delete
</label>
[239] Fix | Delete
</p>
[240] Fix | Delete
<?php
[241] Fix | Delete
}
[242] Fix | Delete
?>
[243] Fix | Delete
</fieldset>
[244] Fix | Delete
<?php
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
function wpcf7_editor_panel_additional_settings( $post ) {
[248] Fix | Delete
$desc_link = wpcf7_link(
[249] Fix | Delete
__( 'https://contactform7.com/additional-settings/', 'contact-form-7' ),
[250] Fix | Delete
__( 'Additional settings', 'contact-form-7' ) );
[251] Fix | Delete
$description = __( "You can add customization code snippets here. For details, see %s.", 'contact-form-7' );
[252] Fix | Delete
$description = sprintf( esc_html( $description ), $desc_link );
[253] Fix | Delete
[254] Fix | Delete
?>
[255] Fix | Delete
<h2><?php echo esc_html( __( 'Additional Settings', 'contact-form-7' ) ); ?></h2>
[256] Fix | Delete
<fieldset>
[257] Fix | Delete
<legend><?php echo $description; ?></legend>
[258] Fix | Delete
<textarea id="wpcf7-additional-settings" name="wpcf7-additional-settings" cols="100" rows="8" class="large-text" data-config-field="additional_settings.body"><?php echo esc_textarea( $post->prop( 'additional_settings' ) ); ?></textarea>
[259] Fix | Delete
</fieldset>
[260] Fix | Delete
<?php
[261] Fix | Delete
}
[262] Fix | Delete
[263] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function