Add drag-and-drop template layout options

This commit is contained in:
Brian Miyaji
2016-04-02 18:39:17 +11:00
parent bd565b16bb
commit e611b00a92
10 changed files with 568 additions and 129 deletions

View File

@@ -23,9 +23,13 @@ class SP_Settings_Teams extends SP_Settings_Page {
public function __construct() {
$this->id = 'teams';
$this->label = __( 'Teams', 'sportspress' );
$this->template = 'team';
$this->templates = SP()->templates->team;
add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
add_action( 'sportspress_admin_field_team_layout', array( $this, 'layout_setting' ) );
add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
}
@@ -43,6 +47,8 @@ class SP_Settings_Teams extends SP_Settings_Page {
),
apply_filters( 'sportspress_team_options', array(
array( 'type' => 'team_layout' ),
array(
'title' => __( 'Link', 'sportspress' ),
'desc' => __( 'Link teams', 'sportspress' ),
@@ -51,31 +57,6 @@ class SP_Settings_Teams extends SP_Settings_Page {
'type' => 'checkbox',
),
array(
'title' => __( 'Display', 'sportspress' ),
'desc' => __( 'Logo', 'sportspress' ),
'id' => 'sportspress_team_show_logo',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
),
array(
'desc' => __( 'Details', 'sportspress' ),
'id' => 'sportspress_team_show_details',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => '',
),
array(
'desc' => __( 'Visit Site', 'sportspress' ),
'id' => 'sportspress_team_show_link',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end',
),
array(
'title' => __( 'Venue', 'sportspress' ),
'desc' => __( 'Link venues', 'sportspress' ),