Add blocks layout to calendar close #22

This commit is contained in:
Brian Miyaji
2014-04-28 01:38:03 +10:00
parent bb8169f139
commit 24f95d75b6
20 changed files with 292 additions and 46 deletions

View File

@@ -24,6 +24,7 @@ class SP_Meta_Box_Calendar_Details {
$season_id = sp_get_the_term_id( $post->ID, 'sp_season', 0 );
$venue_id = sp_get_the_term_id( $post->ID, 'sp_venue', 0 );
$team_id = get_post_meta( $post->ID, 'sp_team', true );
$order = get_post_meta( $post->ID, 'sp_order', true );
?>
<div>
<p><strong><?php _e( 'Status', 'sportspress' ); ?></strong></p>
@@ -97,6 +98,13 @@ class SP_Meta_Box_Calendar_Details {
endif;
?>
</p>
<p><strong><?php _e( 'Sort Order', 'sportspress' ); ?></strong></p>
<p>
<select name="sp_order">
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'sportspress' ); ?></option>
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php _e( 'Descending', 'sportspress' ); ?></option>
</select>
</p>
</div>
<?php
}
@@ -110,5 +118,6 @@ class SP_Meta_Box_Calendar_Details {
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_venue', 0 ), 'sp_venue' );
update_post_meta( $post_id, 'sp_status', sp_array_value( $_POST, 'sp_status', 0 ) );
update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', 0 ) );
update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) );
}
}

View File

@@ -19,7 +19,8 @@ class SP_Meta_Box_List_Data {
* Output the metabox
*/
public static function output( $post ) {
list( $columns, $usecolumns, $data, $placeholders, $merged ) = sp_get_player_list_data( $post->ID, true );
$list = new SP_Player_List( $post );
list( $columns, $usecolumns, $data, $placeholders, $merged ) = $list->data( true );
$adjustments = get_post_meta( $post->ID, 'sp_adjustments', true );
self::table( $columns, $usecolumns, $data, $placeholders, $adjustments );
}

View File

@@ -69,7 +69,7 @@ class SP_Meta_Box_List_Details {
endif;
?>
</p>
<p><strong><?php _e( 'Sort by:', 'sportspress' ); ?></strong></p>
<p><strong><?php _e( 'Sort by', 'sportspress' ); ?></strong></p>
<p>
<?php
$args = array(
@@ -87,7 +87,7 @@ class SP_Meta_Box_List_Details {
endif;
?>
</p>
<p><strong><?php _e( 'Sort Order:', 'sportspress' ); ?></strong></p>
<p><strong><?php _e( 'Sort Order', 'sportspress' ); ?></strong></p>
<p>
<select name="sp_order">
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'sportspress' ); ?></option>