Skip to content

Commit

Permalink
move wrapper div inside view
Browse files Browse the repository at this point in the history
  • Loading branch information
ilicfilip committed Nov 5, 2024
1 parent e0265a2 commit 1b6cf27
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
7 changes: 1 addition & 6 deletions views/admin-page-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@
<div class="prpl-pages-list">
<?php foreach ( \progress_planner()->get_admin__page_settings()->get_tabs_settings() as $prpl_tab_key => $prpl_tab ) : ?>
<?php foreach ( $prpl_tab['settings'] as $prpl_setting ) : ?>
<div
class="prpl-pages-item prpl-pages-item-<?php echo esc_attr( $prpl_setting['page'] ); ?>"
data-page-item="<?php echo esc_attr( $prpl_setting['page'] ); ?>"
>
<?php \progress_planner()->the_view( "setting/{$prpl_setting['type']}.php", [ 'prpl_setting' => $prpl_setting ] ); ?>
</div>
<?php \progress_planner()->the_view( "setting/{$prpl_setting['type']}.php", [ 'prpl_setting' => $prpl_setting ] ); ?>
<?php endforeach; ?>
<?php endforeach; ?>

Expand Down
101 changes: 53 additions & 48 deletions views/setting/page-select.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,61 +25,66 @@
}

?>
<prpl-page-select>
<div class="item-description">
<h3><?php echo esc_html( $prpl_setting['title'] ); ?></h3>
<p><?php echo esc_html( $prpl_setting['description'] ); ?></p>
</div>
<div>
<fieldset id="prpl-setting-fieldset-<?php echo esc_attr( $prpl_setting['id'] ); ?>">
<div class="radios">
<?php foreach ( $prpl_radios as $prpl_r_value => $prpl_r_label ) : ?>
<label>
<input type="radio" id="<?php echo esc_attr( 'pages[' . esc_attr( $prpl_setting['id'] ) . '][have_page]' ); ?>" name="<?php echo esc_attr( 'pages[' . esc_attr( $prpl_setting['id'] ) . '][have_page]' ); ?>" value="<?php echo esc_attr( $prpl_r_value ); ?>" data-page="<?php echo esc_attr( $prpl_setting['page'] ); ?>" <?php checked( $prpl_radio_value, $prpl_r_value ); ?>>
<?php echo esc_html( $prpl_r_label ); ?>
</label>
<?php endforeach; ?>
<div
class="prpl-pages-item prpl-pages-item-<?php echo esc_attr( $prpl_setting['page'] ); ?>"
data-page-item="<?php echo esc_attr( $prpl_setting['page'] ); ?>"
>
<prpl-page-select>
<div class="item-description">
<h3><?php echo esc_html( $prpl_setting['title'] ); ?></h3>
<p><?php echo esc_html( $prpl_setting['description'] ); ?></p>
</div>
<div>
<fieldset id="prpl-setting-fieldset-<?php echo esc_attr( $prpl_setting['id'] ); ?>">
<div class="radios">
<?php foreach ( $prpl_radios as $prpl_r_value => $prpl_r_label ) : ?>
<label>
<input type="radio" id="<?php echo esc_attr( 'pages[' . esc_attr( $prpl_setting['id'] ) . '][have_page]' ); ?>" name="<?php echo esc_attr( 'pages[' . esc_attr( $prpl_setting['id'] ) . '][have_page]' ); ?>" value="<?php echo esc_attr( $prpl_r_value ); ?>" data-page="<?php echo esc_attr( $prpl_setting['page'] ); ?>" <?php checked( $prpl_radio_value, $prpl_r_value ); ?>>
<?php echo esc_html( $prpl_r_label ); ?>
</label>
<?php endforeach; ?>
</div>
</fieldset>
</div>
<div class="item-actions">
<div class="prpl-select-page">
<div data-action="select">
<?php
wp_dropdown_pages(
[
'name' => 'pages[' . esc_attr( $prpl_setting['id'] ) . '][id]',
'show_option_none' => '&mdash; ' . esc_html__( 'Select page', 'progress-planner' ) . ' &mdash;',
'selected' => $prpl_setting['value'], // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
]
);
?>
</div>
<div data-action="edit">
<a
target="_blank"
class="button"
href=""
data-page="<?php echo esc_attr( $prpl_setting['page'] ); ?>"
>
<?php esc_html_e( 'Edit', 'progress-planner' ); ?>
</a>
</div>
</div>
</fieldset>
</div>
<div class="item-actions">
<div class="prpl-select-page">
<div data-action="select">

<div data-action="create">
<?php
wp_dropdown_pages(
[
'name' => 'pages[' . esc_attr( $prpl_setting['id'] ) . '][id]',
'show_option_none' => '&mdash; ' . esc_html__( 'Select page', 'progress-planner' ) . ' &mdash;',
'selected' => $prpl_setting['value'], // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
]
);
/**
* TODO: Find a way to assign the post-meta for the new page.
*/
?>
</div>
<div data-action="edit">
<a
target="_blank"
class="button"
href=""
data-page="<?php echo esc_attr( $prpl_setting['page'] ); ?>"
href="<?php echo esc_url( admin_url( 'post-new.php?post_type=page' ) ); ?>"
>
<?php esc_html_e( 'Edit', 'progress-planner' ); ?>
<?php esc_html_e( 'Create', 'progress-planner' ); ?>
</a>
</div>
</div>

<div data-action="create">
<?php
/**
* TODO: Find a way to assign the post-meta for the new page.
*/
?>
<a
target="_blank"
class="button"
href="<?php echo esc_url( admin_url( 'post-new.php?post_type=page' ) ); ?>"
>
<?php esc_html_e( 'Create', 'progress-planner' ); ?>
</a>
</div>
</div>
</prpl-page-select>
</prpl-page-select>
</div>

0 comments on commit 1b6cf27

Please sign in to comment.