<?php

/**
 * BuddyPress Delete Account
 *
 * @package BuddyPress
 * @subpackage bp-default
 */
get_header();

global $bp;

?>

    <?php locate_template( array( 'leftsidebar.php' ), true ) ?>

    <div id="content">
    
        <div id="iron-encabezado-container">
            <?php
            if ($bp->current_action == "edit" || $bp->current_action == "change-avatar") { ?>
                <h2 class="iron-encabezado-seccion"><?php echo __('Mi perfil','buddypress'); ?></h2>
                <ul class="iron-encabezado-ul">
                <li class="iron-encabezado-li"><a <?php if ($bp->current_action=="edit") echo 'class="selected"'; ?> href="<?php echo bp_loggedin_user_domain(); ?>profile/edit"><?php _e ('Editar perfil','buddypress'); ?></a></li>
                <li class="iron-encabezado-li">&middot;&nbsp;<a <?php if ($bp->current_action=="change-avatar") echo 'class="selected"'; ?> href="<?php echo bp_loggedin_user_domain(); ?>profile/change-avatar"><?php _e ('Cambiar avatar','buddypress'); ?></a></li>
                <li class="iron-encabezado-li">&middot;&nbsp;<a <?php if ($bp->current_action=="delete-account") echo 'class="selected"'; ?> href="<?php echo bp_loggedin_user_domain(); ?>settings"><?php _e ('Tu cuenta','buddypress'); ?></a></li>
                </ul>
            <?php } else { ?>
                <?php if (bp_loggedin_user_id() == bp_displayed_user_id()){ ?>
                    <h2 class="iron-encabezado-seccion"><?php echo __('Mi perfil','buddypress'); ?></h2>
                    <ul class="iron-encabezado-ul">
                        <li class="iron-encabezado-li"><a <?php if ($bp->current_action=="edit") echo 'class="selected"'; ?> href="<?php echo bp_loggedin_user_domain(); ?>profile/edit"><?php _e ('Editar perfil','buddypress'); ?></a></li>
                        <li class="iron-encabezado-li">&middot;&nbsp;<a <?php if ($bp->current_action=="change-avatar") echo 'class="selected"'; ?> href="<?php echo bp_loggedin_user_domain(); ?>profile/change-avatar"><?php _e ('Cambiar avatar','buddypress'); ?></a></li>
                        <li class="iron-encabezado-li">&middot;&nbsp;<a <?php if ($bp->current_action=="delete-account") echo 'class="selected"'; ?> href="<?php echo bp_loggedin_user_domain(); ?>settings"><?php _e ('Tu cuenta','buddypress'); ?></a></li>
                    </ul>
            <?php     }
                  } 
            ?>
        </div>
    
        <div class="padder">

            <div id="content-top"></div>
            
            <div id="content-middle">
                
                <div id="item-nav">
                    <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
                        <ul>
                            <?php do_action( 'bp_member_options_nav' ); ?>
                        </ul>
                    </div>
                </div><!-- #item-nav -->
                
                <div id="item-body" role="main">
    
                    <?php do_action( 'bp_before_member_body' ); ?>
    
                    <div class="item-list-tabs no-ajax" id="subnav">
                        <ul>
    
                            <?php bp_get_options_nav(); ?>
    
                            <?php do_action( 'bp_member_plugin_options_nav' ); ?>
    
                        </ul>
                    </div><!-- .item-list-tabs -->
    
                    <h3><?php _e( 'Delete Account', 'buddypress' ); ?></h3>
    
                    <div id="message" class="info">
                        
                        <?php if ( bp_is_my_profile() ) : ?>
    
                            <p><?php _e( 'Deleting your account will delete all of the content you have created. It will be completely irrecoverable.', 'buddypress' ); ?></p>
                            
                        <?php else : ?>
    
                            <p><?php _e( 'Deleting this account will delete all of the content it has created. It will be completely irrecoverable.', 'buddypress' ); ?></p>
    
                        <?php endif; ?>
    
                    </div>
    
                    <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">
    
                        <?php do_action( 'bp_members_delete_account_before_submit' ); ?>
    
                        <label>
                            <input type="checkbox" name="delete-account-understand" id="delete-account-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-account-button').disabled = ''; } else { document.getElementById('delete-account-button').disabled = 'disabled'; }" />
                             <?php _e( 'I understand the consequences.', 'buddypress' ); ?>
                        </label>
    
                        <div class="submit">
                            <input type="submit" disabled="disabled" value="<?php _e( 'Delete Account', 'buddypress' ); ?>" id="delete-account-button" name="delete-account-button" />
                        </div>
    
                        <?php do_action( 'bp_members_delete_account_after_submit' ); ?>
    
                        <?php wp_nonce_field( 'delete-account' ); ?>
    
                    </form>
    
                    <?php do_action( 'bp_after_member_body' ); ?>
    
                </div><!-- #item-body -->

            <?php do_action( 'bp_after_member_settings_template' ); ?>
            
            </div><!-- #content-middle -->
            
        <div id="content-bottom"></div>

        </div><!-- .padder -->

    </div><!-- #content -->

<?php get_sidebar( 'buddypress' ); ?>

<?php get_footer( 'buddypress' ); ?>