<?php

/**
 * BuddyPress Member Settings
 *
 * @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=="general") 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=="general") 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( 'General Settings', 'buddypress' ); ?></h3>

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

                    <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/general'; ?>" method="post" class="standard-form" id="settings-form">

                        <?php if ( !is_super_admin() ) : ?>

                            <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label>
                            <input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" />
                            
                            <hr />
                            <a href="<?php echo site_url( add_query_arg( array( 'action' => 'lostpassword' ), 'wp-login.php' ), 'login' ); ?>" title="<?php _e( 'Password Lost and Found', 'buddypress' ); ?>">
                                <?php _e( 'Lost your password?', 'buddypress' ); ?>
                            </a>
                            <hr />

                        <?php endif; ?>

                        <label for="email"><?php _e( 'Email', 'buddypress' ); ?></label>
                        <input type="text" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input" />

                        <p><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ); ?></p>
                        <label for="pass1"><?php _e( 'New Password', 'buddypress' ); ?></label>
                        <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" />
                        <label for="pass2"><?php _e( 'Repeat New Password', 'buddypress' ); ?></label>
                        <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" />

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

                        <div class="submit">
                            <input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="submit" class="auto" />
                        </div>

                        <?php do_action( 'bp_core_general_settings_after_submit' ); ?>
                        <?php wp_nonce_field( 'bp_settings_general' ); ?>

                    </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' ); ?>