module_url = $this->get_module_url( __FILE__ ); $args = array( 'title' => __( 'Edit Flow', 'edit-flow' ), 'short_description' => __( 'Edit Flow redefines your WordPress publishing workflow.', 'edit-flow' ), 'extended_description' => __( 'Enable any of the features below to take control of your workflow. Custom statuses, email notifications, editorial comments, and more help you and your team save time so everyone can focus on what matters most: the content.', 'edit-flow' ), 'module_url' => $this->module_url, 'img_url' => $this->module_url . 'lib/eflogo_s128.png', 'slug' => 'settings', 'settings_slug' => 'ef-settings', 'default_options' => array( 'enabled' => 'on', ), 'configure_page_cb' => 'print_default_settings', 'autoload' => true, ); $this->module = EditFlow()->register_module( 'settings', $args ); } /** * Initialize the rest of the stuff in the class if the module is active */ function init() { add_action( 'admin_init', array( $this, 'helper_settings_validate_and_save' ), 100 ); add_action( 'admin_print_styles', array( $this, 'action_admin_print_styles' ) ); add_action( 'admin_print_scripts', array( $this, 'action_admin_print_scripts' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'action_admin_enqueue_scripts' ) ); add_action( 'admin_menu', array( $this, 'action_admin_menu' ) ); add_action( 'wp_ajax_change_edit_flow_module_state', array( $this, 'ajax_change_edit_flow_module_state' ) ); } /** * Add necessary things to the admin menu */ function action_admin_menu() { global $edit_flow; // Select Edit Flow icon if ( defined( 'MP6' ) ) : $ef_logo = 'lib/eflogo_s32b.png'; else : $ef_logo = 'lib/eflogo_s32.png'; endif; 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 ) ; foreach ( $edit_flow->modules as $mod_name => $mod_data ) { if ( isset( $mod_data->options->enabled ) && $mod_data->options->enabled == 'on' && $mod_data->configure_page_cb && $mod_name != $this->module->name ) add_submenu_page( $this->module->settings_slug, $mod_data->title, $mod_data->title, 'manage_options', $mod_data->settings_slug, array( $this, 'settings_page_controller' ) ) ; } } function action_admin_enqueue_scripts() { if ( $this->is_whitelisted_settings_view() ) wp_enqueue_script( 'edit-flow-settings-js', $this->module_url . 'lib/settings.js', array( 'jquery' ), EDIT_FLOW_VERSION, true ); } /** * Add settings styles to the settings page */ function action_admin_print_styles() { if ( $this->is_whitelisted_settings_view() ) wp_enqueue_style( 'edit_flow-settings-css', $this->module_url . 'lib/settings.css', false, EDIT_FLOW_VERSION ); } /** * Extra data we need on the page for transitions, etc. * * @since 0.7 */ function action_admin_print_scripts() { ?> get_module_by( 'slug', $slug ); if ( !$module ) die('-1'); if ( $module_action == 'enable' ) $return = $edit_flow->update_module_option( $module->name, 'enabled', 'on' ); else if ( $module_action == 'disable' ) $return = $edit_flow->update_module_option( $module->name, 'enabled', 'off' ); if ( $return ) die('1'); else die('-1'); } /** * Handles all settings and configuration page requests. Required element for Edit Flow */ function settings_page_controller() { global $edit_flow; $requested_module = $edit_flow->get_module_by( 'settings_slug', $_GET['page'] ); if ( !$requested_module ) wp_die( __( 'Not a registered Edit Flow module', 'edit-flow' ) ); $configure_callback = $requested_module->configure_page_cb; $requested_module_name = $requested_module->name; // Don't show the settings page for the module if the module isn't activated if ( !$this->module_enabled( $requested_module_name ) ) { echo '
'; return; } $this->print_default_header( $requested_module ); $edit_flow->$requested_module_name->$configure_callback(); $this->print_default_footer( $requested_module ); } /** * */ function print_default_header( $current_module ) { // If there's been a message, let's display it if ( isset( $_GET['message'] ) ) $message = $_GET['message']; else if ( isset( $_REQUEST['message'] ) ) $message = $_REQUEST['message']; else if ( isset( $_POST['message'] ) ) $message = $_POST['message']; else $message = false; if ( $message && isset( $current_module->messages[$message] ) ) $display_text = ''; // If there's been an error, let's display it if ( isset( $_GET['error'] ) ) $error = $_GET['error']; else if ( isset( $_REQUEST['error'] ) ) $error = $_REQUEST['error']; else if ( isset( $_POST['error'] ) ) $error = $_POST['error']; else $error = false; if ( $error && isset( $current_module->messages[$error] ) ) $display_text = ''; if ( $current_module->img_url ) $page_icon = 'extended_description; ?>
Edit Flow is produced by Daniel Bachhuber, Mo Jangda, and Scott Bressler, with special help from Andrew Spittle and Andrew Witherspoon.
You're using Edit Flow v.
Icons courtesy of the Noun Project.
Please give us your feedback, ideas, bug reports and comments in the WordPress.org forums.