<?php get_header() ?>

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

	<div id="content">

		<div id="iron-encabezado-container">
			<h2 class="iron-encabezado-seccion"><?php echo __('Grupos','buddypress'); ?></h2>

			<ul class="iron-encabezado-ul">
				<?php if (xprofile_get_field_data('Privacidad', bp_loggedin_user_id()) != 'Privado') { ?>
					<li class="iron-encabezado-li"><a class="fancybox-groups" href="<?php echo bp_get_root_domain() . '/grupos/create/' ?>"><?php _e( 'Crear grupo', 'buddypress' ) ?></a></li>
				<?php } ?>
				<li class="iron-encabezado-li">
				<?php
					if (xprofile_get_field_data('Privacidad', bp_loggedin_user_id()) != 'Privado') { ?>
					&middot;&nbsp;
				<?php } ?>
				<a <?php if (!$bp->current_action) echo 'class="selected"'; ?> href="<?php bp_root_domain() ?>/grupos"><?php printf( __( 'Todos', 'buddypress' ) ) ?></a></li>
				<li class="iron-encabezado-li">&middot;&nbsp;<a href="<?php echo bp_loggedin_user_domain() . 'groups/' ?>"><?php printf( __( 'Mis grupos', 'buddypress' )  ) ?></a></li>
				<li class="iron-encabezado-li">&middot;&nbsp;<a href="<?php echo bp_loggedin_user_domain() . 'groups/invites/' ?>"><?php _e( 'Invitaciones', 'buddypress' ) ?></a></li>
			</ul>
		</div>

		<div class="padder">

		<div id="content-top"></div>

		<div id="content-middle">

			<div id="item-body">

			<form action="" method="post" id="groups-directory-form" class="dir-form">

				<?php do_action( 'bp_before_directory_groups_content' ) ?>

				<div class="item-list-tabs" id="subnav">

				<div id="group-dir-search" class="dir-search">
					<?php bp_directory_groups_search_form() ?>
				</div><!-- #group-dir-search -->

				<div class="item-list-tabs">
					<ul>

						<li class="selected" id="groups-all" style="display: none;"><a href="<?php echo bp_get_root_domain() . '/grupos' ?>"><?php printf( __( 'All Groups (%s)', 'buddypress' ), bp_get_total_group_count() ) ?></a></li>

						<?php if ( is_user_logged_in() && bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
							<li id="groups-personal" style="display: none;"><a href="<?php echo bp_loggedin_user_domain() . 'grupos/' ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
						<?php endif; ?>

						<?php do_action( 'bp_groups_directory_group_types' ) ?>

						<li id="groups-order-select" class="last filter">

							<?php _e( 'Order By:', 'buddypress' ) ?>
							<select>
								<option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
								<option value="popular"><?php _e( 'Most Members', 'buddypress' ) ?></option>
								<option value="newest"><?php _e( 'Newly Created', 'buddypress' ) ?></option>
								<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>

								<?php do_action( 'bp_groups_directory_order_options' ) ?>
							</select>
						</li>
					</ul>
				</div><!-- .item-list-tabs -->

				</div>

				<div id="groups-dir-list" class="groups dir-list">
					<?php locate_template( array( 'groups/groups-loop.php' ), true ) ?>
				</div><!-- #groups-dir-list -->

				<?php do_action( 'bp_directory_groups_content' ) ?>

				<?php wp_nonce_field( 'directory_groups', '_wpnonce-groups-filter' ) ?>

			</form><!-- #groups-directory-form -->

			<?php do_action( 'bp_after_directory_groups_content' ) ?>

			</div> <!-- #item-body -->

		</div><!-- content-middle -->

		<div id="content-bottom"></div>

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

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

<?php get_footer() ?>
