| @@ -9,9 +9,8 @@ | ||
| 9 | 9 | /** |
| 10 | 10 | * Register the module with Edit Flow but don't do anything else |
| 11 | 11 | */ |
| 12 | 12 | function __construct() { |
| 13 | - global $edit_flow; | |
| 14 | 13 | |
| 15 | 14 | // Register the module with Edit Flow |
| 16 | 15 | $this->module_url = $this->get_module_url( __FILE__ ); |
| 17 | 16 | $args = array( |
| @@ -27,9 +26,9 @@ | ||
| 27 | 26 | ), |
| 28 | 27 | 'configure_page_cb' => 'print_default_settings', |
| 29 | 28 | 'autoload' => true, |
| 30 | 29 | ); |
| 31 | - $this->module = $edit_flow->register_module( 'settings', $args ); | |
| 30 | + $this->module = EditFlow()->register_module( 'settings', $args ); | |
| 32 | 31 | } |
| 33 | 32 | |
| 34 | 33 | /** |
| 35 | 34 | * Initialize the rest of the stuff in the class if the module is active |
| @@ -51,10 +50,12 @@ | ||
| 51 | 50 | * Add necessary things to the admin menu |
| 52 | 51 | */ |
| 53 | 52 | function action_admin_menu() { |
| 54 | 53 | global $edit_flow; |
| 54 | + | |
| 55 | + $ef_logo = 'lib/eflogo_s32w.png'; | |
| 55 | 56 | |
| 56 | - add_menu_page( $this->module->title, $this->module->title, 'manage_options', $this->module->settings_slug, array( $this, 'settings_page_controller' ), $this->module->module_url . 'lib/eflogo_s16.png' ) ; | |
| 57 | + add_menu_page( $this->module->title, $this->module->title, 'manage_options', $this->module->settings_slug, array( $this, 'settings_page_controller' ), $this->module->module_url . $ef_logo ) ; | |
| 57 | 58 | |
| 58 | 59 | foreach ( $edit_flow->modules as $mod_name => $mod_data ) { |
| 59 | 60 | if ( isset( $mod_data->options->enabled ) && $mod_data->options->enabled == 'on' |
| 60 | 61 | && $mod_data->configure_page_cb && $mod_name != $this->module->name ) |
| @@ -214,29 +215,29 @@ | ||
| 214 | 215 | function print_default_footer( $current_module ) { |
| 215 | 216 | ?> |
| 216 | 217 | <?php if ( $current_module->slug == 'settings' ): ?> |
| 217 | 218 | <div class="credits"> |
| 218 | - <p><a href="http://editflow.org/">Edit Flow</a> is produced by <a href="http://danielbachhuber.com/">Daniel Bachhuber</a>, <a href="http://digitalize.ca/">Mo Jangda</a>, and <a href="http://www.scottbressler.com/blog/">Scott Bressler</a>, with special help from <a href="http://andrewspittle.net">Andrew Spittle</a> and <a href="http://andrewwitherspoon.com/">Andrew Witherspoon</a>. | |
| 219 | - <br />You're using Edit Flow v<?php echo EDIT_FLOW_VERSION; ?>. | |
| 220 | - <br />Icons courtesy of the <a href="http://thenounproject.com/">Noun Project</a>. | |
| 221 | - <br /><a href="http://wordpress.org/tags/edit-flow?forum_id=10">Please give us your feedback, ideas, bug reports and comments</a> in the WordPress.org forums. | |
| 219 | + <p><?php echo __( '<a href="http://editflow.org/">Edit Flow</a> is produced by <a href="http://danielbachhuber.com/">Daniel Bachhuber</a>, <a href="http://digitalize.ca/">Mo Jangda</a>, and <a href="http://www.scottbressler.com/blog/">Scott Bressler</a>, with special help from <a href="http://andrewspittle.net">Andrew Spittle</a> and <a href="http://andrewwitherspoon.com/">Andrew Witherspoon</a>.', 'edit-flow' ); ?> | |
| 220 | + <br /><?php echo sprintf( __( 'You\'re using Edit Flow version %s.', 'edit-flow' ), EDIT_FLOW_VERSION ); ?> | |
| 221 | + <br /><?php echo __( 'Icons courtesy of the <a href="http://thenounproject.com/">Noun Project</a>.', 'edit-flow' ); ?> | |
| 222 | + <br /><?php echo __( '<a href="http://wordpress.org/tags/edit-flow?forum_id=10">Please give us your feedback, ideas, bug reports and comments</a> in the WordPress.org forums.', 'edit-flow' ); ?> | |
| 222 | 223 | </div> |
| 223 | 224 | </div> |
| 224 | 225 | <?php endif; ?> |
| 225 | 226 | <?php |
| 226 | 227 | } |
| 227 | - | |
| 228 | + | |
| 228 | 229 | function print_modules() { |
| 229 | 230 | global $edit_flow; |
| 230 | - | |
| 231 | - if ( !count( $edit_flow->modules ) ) { | |
| 231 | + | |
| 232 | + if ( ! $edit_flow->modules_count ) { | |
| 232 | 233 | echo '<div class="message error">' . __( 'There are no Edit Flow modules registered', 'edit-flow' ) . '</div>'; |
| 233 | 234 | } else { |
| 234 | - | |
| 235 | + | |
| 235 | 236 | foreach ( $edit_flow->modules as $mod_name => $mod_data ) { |
| 236 | 237 | if ( $mod_data->autoload ) |
| 237 | 238 | continue; |
| 238 | - | |
| 239 | + | |
| 239 | 240 | $classes = array( |
| 240 | 241 | 'edit-flow-module', |
| 241 | 242 | ); |
| 242 | 243 | if ( $mod_data->options->enabled == 'on' ) |
| @@ -249,9 +250,12 @@ | ||
| 249 | 250 | if ( $mod_data->img_url ) |
| 250 | 251 | echo '<img src="' . esc_url( $mod_data->img_url ) . '" height="24px" width="24px" class="float-right module-icon" />'; |
| 251 | 252 | echo '<form method="get" action="' . get_admin_url( null, 'options.php' ) . '">'; |
| 252 | 253 | echo '<h4>' . esc_html( $mod_data->title ) . '</h4>'; |
| 253 | - echo '<p>' . esc_html( $mod_data->short_description ) . '</p>'; | |
| 254 | + if ( 'on' == $mod_data->options->enabled ) | |
| 255 | + echo '<p>' . wp_kses($mod_data->short_description, 'a') . '</p>'; | |
| 256 | + else | |
| 257 | + echo '<p>' . strip_tags( $mod_data->short_description ) . '</p>'; | |
| 254 | 258 | echo '<p class="edit-flow-module-actions">'; |
| 255 | 259 | if ( $mod_data->configure_page_cb ) { |
| 256 | 260 | $configure_url = add_query_arg( 'page', $mod_data->settings_slug, get_admin_url( null, 'admin.php' ) ); |
| 257 | 261 | echo '<a href="' . $configure_url . '" class="configure-edit-flow-module button button-primary'; |
| @@ -311,9 +315,9 @@ | ||
| 311 | 315 | foreach( $custom_post_types as $custom_post_type => $args ) { |
| 312 | 316 | $all_post_types[$custom_post_type] = $args->label; |
| 313 | 317 | } |
| 314 | 318 | } |
| 315 | - | |
| 319 | + | |
| 316 | 320 | foreach( $all_post_types as $post_type => $title ) { |
| 317 | 321 | echo '<label for="' . esc_attr( $post_type ) . '">'; |
| 318 | 322 | echo '<input id="' . esc_attr( $post_type ) . '" name="' |
| 319 | 323 | . $module->options_group_name . '[post_types][' . esc_attr( $post_type ) . ']"'; |
| @@ -362,9 +366,9 @@ | ||
| 362 | 366 | $edit_flow->update_all_module_options( $edit_flow->$module_name->module->name, $new_options ); |
| 363 | 367 | |
| 364 | 368 | // Redirect back to the settings page that was submitted without any previous messages |
| 365 | 369 | $goback = add_query_arg( 'message', 'settings-updated', remove_query_arg( array( 'message'), wp_get_referer() ) ); |
| 366 | - wp_redirect( $goback ); | |
| 370 | + wp_safe_redirect( $goback ); | |
| 367 | 371 | exit; |
| 368 | 372 | |
| 369 | 373 | } |
| 370 | 374 | |