Skip to content

Commit

Permalink
Separate header
Browse files Browse the repository at this point in the history
  • Loading branch information
takayukister committed Aug 15, 2024
1 parent 32649af commit ec3bb39
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
8 changes: 8 additions & 0 deletions admin/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ form.tag-generator-panel[data-version="2"] {
text-align: end;
}

.description-box {
box-sizing: border-box;
flex: none;
margin-inline: -12px;
padding-inline: 12px;
border-bottom: 1px solid #dfdfdf;
}

.control-box {
box-sizing: border-box;
flex: auto;
Expand Down
12 changes: 5 additions & 7 deletions admin/includes/tag-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,12 @@ private function class_attr( $options = '' ) {
<?php
}

private function insert_box( $options = '' ) {
private function insert_box_content( $options = '' ) {
?>
<footer class="insert-box">
<div class="flex-container">
<input type="text" class="code" readonly="readonly" onfocus="this.select();" data-tag-part="tag" />
<button type="button" class="button button-primary" data-taggen="insert-tag"><?php echo esc_html( __( 'Insert Tag', 'contact-form-7' ) ); ?></button>
</div>
</footer>
<div class="flex-container">
<input type="text" class="code" readonly="readonly" onfocus="this.select();" data-tag-part="tag" />
<button type="button" class="button button-primary" data-taggen="insert-tag"><?php echo esc_html( __( 'Insert Tag', 'contact-form-7' ) ); ?></button>
</div>
<?php
}
}
10 changes: 7 additions & 3 deletions modules/text.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,15 @@ function wpcf7_tag_generator_text( $contact_form, $options ) {
);

?>
<section class="control-box">
<header class="description-box">
<h3><?php
echo esc_html( 'Text field form-tag generator' );
?></h3>

<p><?php echo sprintf( esc_html( $description ), $desc_link ); ?></p>
</header>

<div class="control-box">
<?php $tgg->print( 'field_type' ); ?>

<?php $tgg->print( 'field_name' ); ?>
Expand All @@ -274,8 +276,10 @@ function wpcf7_tag_generator_text( $contact_form, $options ) {
<?php $tgg->print( 'id_attr' ); ?>

<?php $tgg->print( 'class_attr' ); ?>
</section>
</div>

<?php $tgg->print( 'insert_box' ); ?>
<footer class="insert-box">
<?php $tgg->print( 'insert_box_content' ); ?>
</footer>
<?php
}

0 comments on commit ec3bb39

Please sign in to comment.