textdomain ), '3pagination', 'activate_plugins', '3pagination', array( $this, 'draw_settings_page' ) );
}
public function contextual_help( $content, $screen_id, $screen ) {
global $threepagination_screen;
if ( $screen_id == $threepagination_screen ) {
$content = '
' . __( 'Preview', parent::$_object->textdomain ) . ' ';
$content.= __( ' - See a preview of the pagination according to your current settings', parent::$_object->textdomain ) . '
';
$content.= '' . __( 'Labels', parent::$_object->textdomain ) . ' ';
$content.= __( ' - Enable navigation labels. Set navigation labels: first and last, previous and next page. Leave empty to revert to defaults', parent::$_object->textdomain ) . '
';
$content.= '' . __( 'Placement', parent::$_object->textdomain ) . ' ';
$content.= __( ' - Determine where the pagination should appear on your site. Inject: You can "inject" the navigation bar below the header or above the footer div. Your theme needs to have an according HTML structure (which most WordPress themes do).Append/prepend: You can specifiy a container into which the pagination will be prepended/appended. Write it CSS-style, i.e. #mycontainer', parent::$_object->textdomain ) . '
';
$content.= '' . __( 'DOM & CSS', parent::$_object->textdomain ) . ' ';
$content.= __( ' - Define the CSS class that will be attributed to the main pagination container div.', parent::$_object->textdomain ) . '
';
$content.= '' . __( 'Other options', parent::$_object->textdomain ) . ' ';
$content.= __( ' - Limit the pagination to a maximum number of pages, enable pagination links for pretty URLs (checked by default).', parent::$_object->textdomain ) . '
';
$content = apply_filters( 'threepagination_help', $content );
$screen->add_help_tab( array( 'id' => 'threepagination-help', 'title' => __( '3pagination' ), 'content' => $content ) );
}
//return $content;
}
/**
* Settings page output
*
* @since 0.1
*/
public function draw_settings_page() {
?>
textdomain ); ?>
textdomain ); ?>
register_setting( '3pagination_settings', '3pagination_settings', array( $this, 'threepagination_validate' ) );
// Add the section to reading settings so we can add our
// fields to it
add_settings_section( '3pagination_preview', __( 'Preview', parent::$_object->textdomain ), array( $this, 'section_preview' ), '3pagination' );
add_settings_section( '3pagination_labels', __( 'Labels', parent::$_object->textdomain ), array( $this, 'section_labels' ), '3pagination' );
add_settings_section( '3pagination_placement', __( 'Placement', parent::$_object->textdomain ), array( $this, 'section_placement' ), '3pagination' );
add_settings_section( '3pagination_css', __( 'DOM & CSS', parent::$_object->textdomain ), array( $this, 'section_css' ), '3pagination' );
add_settings_section( '3pagination_other', __( 'Other options', parent::$_object->textdomain ), array( $this, 'section_other' ), '3pagination' );
// Add the field with the names and function to use for our new
// settings, put it in our new section
add_settings_field( 'threepagination_preview', __( 'Preview of pagination', parent::$_object->textdomain ), array( $this, 'preview' ), '3pagination', '3pagination_preview' );
add_settings_field( 'threepagination_labels_show', __( 'Show labels', parent::$_object->textdomain ), array( $this, 'labels_show' ), '3pagination', '3pagination_labels' );
add_settings_field( 'threepagination_labels_previous', __( 'Previous page', parent::$_object->textdomain ), array( $this, 'labels_previous' ), '3pagination', '3pagination_labels' );
add_settings_field( 'threepagination_labels_next', __( 'Next page', parent::$_object->textdomain ), array( $this, 'labels_next' ), '3pagination', '3pagination_labels' );
add_settings_field( 'threepagination_labels_first', __( 'First page', parent::$_object->textdomain ), array( $this, 'labels_first' ), '3pagination', '3pagination_labels' );
add_settings_field( 'threepagination_labels_last', __( 'Last page', parent::$_object->textdomain ), array( $this, 'labels_last' ), '3pagination', '3pagination_labels' );
add_settings_field( 'threepagination_css_class', __( 'Set CSS class', parent::$_object->textdomain ), array( $this, 'css_class' ), '3pagination', '3pagination_css' );
add_settings_field( 'threepagination_placement_header', __( 'Inject below header', parent::$_object->textdomain ), array( $this, 'placement_header' ), '3pagination', '3pagination_placement' );
add_settings_field( 'threepagination_placement_footer', __( 'Inject above footer', parent::$_object->textdomain ), array( $this, 'placement_footer' ), '3pagination', '3pagination_placement' );
add_settings_field( 'threepagination_placement_prepend', __( 'Prepend to', parent::$_object->textdomain ), array( $this, 'placement_prepend' ), '3pagination', '3pagination_placement' );
add_settings_field( 'threepagination_placement_append', __( 'Append to', parent::$_object->textdomain ), array( $this, 'placement_append' ), '3pagination', '3pagination_placement' );
add_settings_field( 'threepagination_other_maxnumpages', __( 'Max no. of pages', parent::$_object->textdomain ), array( $this, 'other_maxnumpages' ), '3pagination', '3pagination_other' );
add_settings_field( 'threepagination_other_pretty', __( 'Pretty URLs enabled?', parent::$_object->textdomain ), array( $this, 'other_pretty' ), '3pagination', '3pagination_other' );
}
/**
* Head of "preview" section
*
* @since 0.1
*/
public function section_preview() {
?>
textdomain ); ?>
textdomain ); ?>
textdomain ); ?>
Note: If you want your site to degrade gracefully, you should additionaly hardcode the pagination function into your theme files: textdomain ); ?>
init_var( $settings, 'labels_show', 'on' ), 'on' ); ?> />
init_var( $settings, 'placement_header_index', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_header_archive', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_header_category', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_header_search', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_footer_index', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_footer_archive', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_footer_category', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_footer_search', FALSE ), 'on' ); ?> />
textdomain ); ?>
textdomain ); ?>
init_var( $settings, 'placement_prepend_index', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_prepend_archive', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_prepend_category', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_prepend_search', FALSE ), 'on' ); ?> />
textdomain ); ?>
textdomain ); ?>
init_var( $settings, 'placement_append_index', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_append_archive', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_append_category', FALSE ), 'on' ); ?> />
textdomain ); ?>
init_var( $settings, 'placement_append_search', FALSE ), 'on' ); ?> />
textdomain ); ?>
textdomain ); ?>
textdomain ); ?>
init_var( $settings, 'other_pretty', 'on' ), 'on' ); ?> />
option_string . '_group', $this->option_string );
delete_option( $this->option_string );
}
}
new threepagination_settings();
}
?>