Skip to content

Commit

Permalink
Use get_admin_page_title() for page titles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Sisk committed Feb 3, 2013
1 parent 63ec6ab commit 28b2ca9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion -/php/commerce.php
Expand Up @@ -58,7 +58,7 @@ public function page() {
?>
<div class="wrap">
<div id="icon-tools" class="icon32"></div>
<h2><?php _e( 'Webcomic Commerce', 'webcomic' ); ?></h2>
<h2><?php echo get_admin_page_title(); ?></h2>
<br>
<table class="wp-list-table widefat fixed">
<thead>
Expand Down
66 changes: 33 additions & 33 deletions -/php/config.php
Expand Up @@ -145,7 +145,7 @@ public function admin_init() {
* @hook admin_menu
*/
public function admin_menu() {
add_submenu_page( 'options-general.php', __( 'Webcomic', 'webcomic' ), __( 'Webcomic', 'webcomic' ), 'manage_options', 'webcomic-options', array( $this, 'page' ) );
add_submenu_page( 'options-general.php', __( 'Webcomic Settings', 'webcomic' ), __( 'Webcomic', 'webcomic' ), 'manage_options', 'webcomic-options', array( $this, 'page' ) );

foreach ( self::$config[ 'collections' ] as $k => $v ) {
add_submenu_page( "edit.php?post_type={$k}", sprintf( __( '%s Settings', 'webcomic' ), esc_html( $v[ 'name' ] ) ), __( 'Settings', 'webcomic' ), 'manage_options', "{$k}-options", array( $this, 'page' ) );
Expand All @@ -169,38 +169,6 @@ public function admin_enqueue_scripts() {
}
}

/** Render a settings page.
*
* @uses Webcomic::$config
* @uses Webcomic::$version
*/
public function page() {
$page = empty( $_GET[ 'post_type' ] ) ? 'webcomic-options' : "{$_GET[ 'post_type' ]}-options";
?>
<div class="wrap" >
<div id="icon-options-general" class="icon32" data-webcomic-admin-url="<?php echo admin_url(); ?>"></div>
<h2><?php echo 'webcomic-options' === $page ? __( 'Webcomic Settings', 'webcomic' ) : sprintf( __( '%s Settings', 'webcomic' ), esc_html( self::$config[ 'collections' ][ $_GET[ 'post_type' ] ][ 'name' ] ) ); ?></h2>
<form action="options.php" method="post"<?php echo 'webcomic' !== $page ? ' enctype="multipart/form-data"' : ''; ?>>
<?php
settings_fields( 'webcomic-options' );
do_settings_sections( $page );

echo 'webcomic-options' === $page ? '<input type="hidden" name="webcomic_general" value="1">' : sprintf( '<input type="hidden" name="webcomic_collection" value="%s">', $_GET[ 'post_type' ] );
?>
<p class="submit">
<?php
submit_button( '', 'primary', '', false );

if ( 'webcomic-options' === $page ) {
printf( '<span class="alignright">%s</span>', sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">Webcomic %2$s</a>', 'webcomic' ), 'http://webcomic.nu', self::$version ) );
}
?>
</p>
</form>
</div>
<?php
}

/** Render the Integrate setting.
*
* @uses Webcomic::$config
Expand Down Expand Up @@ -1140,6 +1108,38 @@ private function save_sizes() {
}
}

/** Render a settings page.
*
* @uses Webcomic::$config
* @uses Webcomic::$version
*/
public function page() {
$page = empty( $_GET[ 'post_type' ] ) ? 'webcomic-options' : "{$_GET[ 'post_type' ]}-options";
?>
<div class="wrap" >
<div id="icon-options-general" class="icon32" data-webcomic-admin-url="<?php echo admin_url(); ?>"></div>
<h2><?php echo get_admin_page_title(); ?></h2>
<form action="options.php" method="post"<?php echo 'webcomic' !== $page ? ' enctype="multipart/form-data"' : ''; ?>>
<?php
settings_fields( 'webcomic-options' );
do_settings_sections( $page );

echo 'webcomic-options' === $page ? '<input type="hidden" name="webcomic_general" value="1">' : sprintf( '<input type="hidden" name="webcomic_collection" value="%s">', $_GET[ 'post_type' ] );
?>
<p class="submit">
<?php
submit_button( '', 'primary', '', false );

if ( 'webcomic-options' === $page ) {
printf( '<span class="alignright">%s</span>', sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">Webcomic %2$s</a>', 'webcomic' ), 'http://webcomic.nu', self::$version ) );
}
?>
</p>
</form>
</div>
<?php
}

/** Generic settings section callback.
*
* Most sections don't include a description, but if permalinks are
Expand Down
2 changes: 1 addition & 1 deletion -/php/legacy.php
Expand Up @@ -190,7 +190,7 @@ public function page() {
?>
<div class="wrap">
<div id="icon-tools" class="icon32"></div>
<h2><?php _e( 'Upgrade Webcomic', 'webcomic' ); ?></h2>
<h2><?php echo get_admin_page_title(); ?></h2>
<div id="col-left">
<div class="col-wrap">
<?php if ( isset( $_POST[ 'webcomic_upgrade_status' ] ) and 0 === $_POST[ 'webcomic_upgrade_status' ] ) { ?>
Expand Down

0 comments on commit 28b2ca9

Please sign in to comment.