Skip to content

Commit

Permalink
feat: add dokan_dashboard_wrap_start and end hook for theme compatibi…
Browse files Browse the repository at this point in the history
…lity (#441)

* feat: add dokan_dashboard_wrap_start and end hook for theme compatibility

* refactor: code indentation
  • Loading branch information
saimonh3 authored and sabbir1991 committed Nov 27, 2018
1 parent c366d26 commit 17cf7e7
Show file tree
Hide file tree
Showing 9 changed files with 861 additions and 820 deletions.
116 changes: 60 additions & 56 deletions templates/dashboard/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,102 +9,106 @@
* @package dokan
*/
?>
<div class="dokan-dashboard-wrap">
<?php

/**
* dokan_dashboard_content_before hook
*
* @hooked get_dashboard_side_navigation
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_before' );
?>

<div class="dokan-dashboard-content">
<?php do_action( 'dokan_dashboard_wrap_start' ); ?>

<div class="dokan-dashboard-wrap">
<?php

/**
* dokan_dashboard_content_before hook
*
* @hooked show_seller_dashboard_notice
* @hooked get_dashboard_side_navigation
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_inside_before' );
do_action( 'dokan_dashboard_content_before' );
?>

<article class="dashboard-content-area">
<div class="dokan-dashboard-content">

<?php

/**
* dokan_dashboard_before_widgets hook
* dokan_dashboard_content_before hook
*
* @hooked dokan_show_profile_progressbar
* @hooked show_seller_dashboard_notice
*
* @since 2.4
*/
do_action( 'dokan_dashboard_before_widgets' );
do_action( 'dokan_dashboard_content_inside_before' );
?>

<div class="dokan-w6 dokan-dash-left">
<article class="dashboard-content-area">

<?php

/**
* dokan_dashboard_left_widgets hook
* dokan_dashboard_before_widgets hook
*
* @hooked get_big_counter_widgets
* @hooked get_orders_widgets
* @hooked get_products_widgets
* @hooked dokan_show_profile_progressbar
*
* @since 2.4
*/
do_action( 'dokan_dashboard_left_widgets' );
do_action( 'dokan_dashboard_before_widgets' );
?>

</div> <!-- .col-md-6 -->
<div class="dokan-w6 dokan-dash-left">

<div class="dokan-w6 dokan-dash-right">
<?php
/**
* dokan_dashboard_right_widgets hook
*
* @hooked get_sales_report_chart_widget
*
* @since 2.4
*/
do_action( 'dokan_dashboard_right_widgets' );
?>
<?php

/**
* dokan_dashboard_left_widgets hook
*
* @hooked get_big_counter_widgets
* @hooked get_orders_widgets
* @hooked get_products_widgets
*
* @since 2.4
*/
do_action( 'dokan_dashboard_left_widgets' );
?>

</div>
</div> <!-- .col-md-6 -->

</article><!-- .dashboard-content-area -->
<div class="dokan-w6 dokan-dash-right">
<?php
/**
* dokan_dashboard_right_widgets hook
*
* @hooked get_sales_report_chart_widget
*
* @since 2.4
*/
do_action( 'dokan_dashboard_right_widgets' );
?>

<?php
</div>

</article><!-- .dashboard-content-area -->

<?php

/**
* dokan_dashboard_content_inside_after hook
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_inside_after' );
?>


</div><!-- .dokan-dashboard-content -->

<?php

/**
* dokan_dashboard_content_inside_after hook
* dokan_dashboard_content_after hook
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_inside_after' );
do_action( 'dokan_dashboard_content_after' );
?>

</div><!-- .dokan-dashboard-wrap -->

</div><!-- .dokan-dashboard-content -->

<?php

/**
* dokan_dashboard_content_after hook
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_after' );
?>

</div><!-- .dokan-dashboard-wrap -->
<?php do_action( 'dokan_dashboard_wrap_end' ); ?>
144 changes: 75 additions & 69 deletions templates/dashboard/edit-account.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,114 +11,120 @@

$user = get_user_by( 'id', get_current_user_id() );
?>
<div class="dokan-dashboard-wrap">

<?php
/**
* dokan_dashboard_content_before hook
*
* @hooked get_dashboard_side_navigation
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_before' );
?>
<?php do_action( 'dokan_dashboard_wrap_start' ); ?>

<div class="dokan-dashboard-content">
<div class="dokan-dashboard-wrap">

<?php
/**
* dokan_dashboard_content_before hook
*
* @hooked show_seller_dashboard_notice
* @hooked get_dashboard_side_navigation
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_inside_before' );
do_action( 'dokan_dashboard_content_before' );
?>

<article class="dashboard-content-area woocommerce edit-account-wrap">
<div class="dokan-dashboard-content">

<?php wc_print_notices();?>
<?php
/**
* dokan_dashboard_content_before hook
*
* @hooked show_seller_dashboard_notice
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_inside_before' );
?>

<h1 class="entry-title"><?php _e( 'Edit Account Details', 'dokan-lite' ); ?></h1>
<article class="dashboard-content-area woocommerce edit-account-wrap">

<form class="edit-account" action="" method="post">
<?php wc_print_notices();?>

<?php do_action( 'woocommerce_edit_account_form_start' ); ?>
<h1 class="entry-title"><?php _e( 'Edit Account Details', 'dokan-lite' ); ?></h1>

<p class="form-row form-row-first">
<label for="account_first_name"><?php _e( 'First name', 'dokan-lite' ); ?> <span class="required">*</span></label>
<input type="text" class="input-text" name="account_first_name" id="account_first_name" value="<?php echo esc_attr( $user->first_name ); ?>" />
</p>
<form class="edit-account" action="" method="post">

<p class="form-row form-row-last">
<label for="account_last_name"><?php _e( 'Last name', 'dokan-lite' ); ?> <span class="required">*</span></label>
<input type="text" class="input-text" name="account_last_name" id="account_last_name" value="<?php echo esc_attr( $user->last_name ); ?>" />
</p>
<div class="clear"></div>
<?php do_action( 'woocommerce_edit_account_form_start' ); ?>

<p class="form-row form-row-wide">
<label for="account_email"><?php _e( 'Email address', 'dokan-lite' ); ?> <span class="required">*</span></label>
<input type="email" class="input-text" name="account_email" id="account_email" value="<?php echo esc_attr( $user->user_email ); ?>" />
</p>

<fieldset>
<legend><?php _e( 'Password Change', 'dokan-lite' ); ?></legend>
<p class="form-row form-row-first">
<label for="account_first_name"><?php _e( 'First name', 'dokan-lite' ); ?> <span class="required">*</span></label>
<input type="text" class="input-text" name="account_first_name" id="account_first_name" value="<?php echo esc_attr( $user->first_name ); ?>" />
</p>

<p class="form-row form-row-wide">
<label for="password_current"><?php _e( 'Current Password (leave blank to leave unchanged)', 'dokan-lite' ); ?></label>
<input type="password" class="input-text" name="password_current" id="password_current" />
<p class="form-row form-row-last">
<label for="account_last_name"><?php _e( 'Last name', 'dokan-lite' ); ?> <span class="required">*</span></label>
<input type="text" class="input-text" name="account_last_name" id="account_last_name" value="<?php echo esc_attr( $user->last_name ); ?>" />
</p>
<div class="clear"></div>

<p class="form-row form-row-wide">
<label for="password_1"><?php _e( 'New Password (leave blank to leave unchanged)', 'dokan-lite' ); ?></label>
<input type="password" class="input-text" name="password_1" id="password_1" />
<label for="account_email"><?php _e( 'Email address', 'dokan-lite' ); ?> <span class="required">*</span></label>
<input type="email" class="input-text" name="account_email" id="account_email" value="<?php echo esc_attr( $user->user_email ); ?>" />
</p>

<p class="form-row form-row-wide">
<label for="password_2"><?php _e( 'Confirm New Password', 'dokan-lite' ); ?></label>
<input type="password" class="input-text" name="password_2" id="password_2" />
<fieldset>
<legend><?php _e( 'Password Change', 'dokan-lite' ); ?></legend>

<p class="form-row form-row-wide">
<label for="password_current"><?php _e( 'Current Password (leave blank to leave unchanged)', 'dokan-lite' ); ?></label>
<input type="password" class="input-text" name="password_current" id="password_current" />
</p>

<p class="form-row form-row-wide">
<label for="password_1"><?php _e( 'New Password (leave blank to leave unchanged)', 'dokan-lite' ); ?></label>
<input type="password" class="input-text" name="password_1" id="password_1" />
</p>

<p class="form-row form-row-wide">
<label for="password_2"><?php _e( 'Confirm New Password', 'dokan-lite' ); ?></label>
<input type="password" class="input-text" name="password_2" id="password_2" />
</p>
</fieldset>

<div class="clear"></div>

<?php do_action( 'woocommerce_edit_account_form' ); ?>

<p>
<?php wp_nonce_field( 'dokan_save_account_details' ); ?>
<input type="submit" class="dokan-btn dokan-btn-danger dokan-btn-theme" name="dokan_save_account_details" value="<?php esc_attr_e( 'Save changes', 'dokan-lite' ); ?>" />
<input type="hidden" name="action" value="dokan_save_account_details" />
</p>
</fieldset>

<div class="clear"></div>
<?php do_action( 'woocommerce_edit_account_form_end' ); ?>

<?php do_action( 'woocommerce_edit_account_form' ); ?>
</form>

<p>
<?php wp_nonce_field( 'dokan_save_account_details' ); ?>
<input type="submit" class="dokan-btn dokan-btn-danger dokan-btn-theme" name="dokan_save_account_details" value="<?php esc_attr_e( 'Save changes', 'dokan-lite' ); ?>" />
<input type="hidden" name="action" value="dokan_save_account_details" />
</p>
</article><!-- .dashboard-content-area -->

<?php do_action( 'woocommerce_edit_account_form_end' ); ?>
<?php

</form>
/**
* dokan_dashboard_content_inside_after hook
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_inside_after' );
?>

</article><!-- .dashboard-content-area -->

<?php
</div><!-- .dokan-dashboard-content -->

<?php

/**
* dokan_dashboard_content_inside_after hook
* dokan_dashboard_content_after hook
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_inside_after' );
do_action( 'dokan_dashboard_content_after' );
?>

</div><!-- .dokan-dashboard-wrap -->

</div><!-- .dokan-dashboard-content -->

<?php

/**
* dokan_dashboard_content_after hook
*
* @since 2.4
*/
do_action( 'dokan_dashboard_content_after' );
?>
<?php do_action( 'dokan_dashboard_wrap_end' ); ?>

</div><!-- .dokan-dashboard-wrap -->
Loading

0 comments on commit 17cf7e7

Please sign in to comment.