Plugin Directory

Changeset 610101


Ignore:
Timestamp:
10/09/2012 06:11:25 PM (13 years ago)
Author:
sushkov
Message:

Fix use of deprecated function "add_contextual_help"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • buddypress-courseware/trunk/wordpress/wordpress.class.php

    r442924 r610101  
    1515            array( __CLASS__, 'menus')
    1616        );
    17        
     17
    1818        // Ensure compatibility
    1919        add_action('admin_notices', 'bpsp_check' );
     
    2424        // Settings link
    2525        add_action( 'plugin_action_links_' . BPSP_PLUGIN_FILE, array( __CLASS__, 'action_link' ), 10, 4 );
    26        
     26
    2727        // Initialize our options
    2828        add_option( 'bpsp_allow_only_admins' );
     
    3434        add_option( 'bpsp_load_css' );
    3535    }
    36    
     36
    3737    /**
    3838     * menus()
     
    5151            );
    5252    }
    53    
     53
    5454    /**
    5555     * screen_help()
    56      * 
     56     *
    5757     * Handles the screen() help
    5858     */
    5959    function screen_help() {
    6060        global $current_screen;
    61        
     61
    6262        // If it's not Courseware Screen
    6363        if( !stristr( $current_screen->id, 'courseware' ) )
    6464            return;
    65        
     65
    6666        $vars['name'] = 'contextual_help';
    67         add_contextual_help( $current_screen, self::load_template( $vars ) );
    68     }
    69    
     67        get_current_screen()->add_help_tab( array( 'id'=> 'Help', 'title'=> 'Help', 'content' => self::load_template( $vars )) );
     68    }
     69
    7070    /**
    7171     * screen()
    72      * 
     72     *
    7373     * Handles the wp-admin screen
    7474     */
     
    7878        $vars['nonce'] = wp_nonce_field( $nonce_name, '_wpnonce', true, false );
    7979        $is_nonce = false;
    80        
     80
    8181        if( isset( $_POST['_wpnonce'] ) )
    8282            check_admin_referer( $nonce_name );
    83        
     83
    8484        // Courseware Global Status
    8585        if( isset( $_POST['bpsp_global_status'] ) )
     
    8989            if( update_option( 'bpsp_global_status', '' ) )
    9090                $vars['flash'][] = __( 'Courseware option was updated.', 'bpsp' );
    91        
     91
    9292        // Courseware Collaborative Settings
    9393        if( isset( $_POST['bpsp_allow_only_admins'] ) )
     
    9797            if( update_option( 'bpsp_allow_only_admins', '' ) )
    9898                $vars['flash'][] = __( 'Courseware option was updated.', 'bpsp' );
    99        
     99
    100100        // Courseware Private Responses
    101101        if( isset( $_POST['bpsp_private_responses_check'] ) )
     
    105105            if( update_option( 'bpsp_private_responses', '' ) )
    106106                $vars['flash'][] = __( 'Courseware option was updated.', 'bpsp' );
    107        
     107
    108108        // Courseware Default Gradebook Format
    109109        if( isset( $_POST['bpsp_gradebook_format_check'] ) && isset( $_POST['bpsp_gradebook_format'] ) )
    110110            if( update_option( 'bpsp_gradebook_format', strtolower( $_POST['bpsp_gradebook_format'] ) ) )
    111111                $vars['flash'][] = __( 'Courseware gradebook format option was updated.', 'bpsp' );
    112        
     112
    113113        // Courseware Bibliography Webservices Integration
    114114        if( isset( $_POST['worldcat_key'] ) && !empty( $_POST['worldcat_key'] ) )
     
    118118            if( update_option( 'bpsp_isbndb_key', $_POST['isbndb_key'] ) )
    119119                $vars['flash'][] = __( 'ISBNdb option was updated.', 'bpsp' );
    120        
     120
    121121        // Courseware Custom CSS
    122122        if( isset( $_POST['bpsp_load_css_check'] ) && isset( $_POST['bpsp_load_css'] ) )
     
    126126            if( update_option( 'bpsp_load_css', '' ) )
    127127                $vars['flash'][] = __( 'Courseware customization options updated.', 'bpsp' );
    128        
     128
    129129        $vars['name'] = 'admin';
    130130        $vars['echo'] = 'true';
     
    136136        $vars['isbndb_key'] = get_option( 'bpsp_isbndb_key' );
    137137        $vars['bpsp_load_css'] = get_option( 'bpsp_load_css' );
    138        
     138
    139139        //Load the template
    140140        self::load_template( $vars );
    141141    }
    142    
     142
    143143    /**
    144144     * action_link( $links )
     
    155155        return $links;
    156156    }
    157    
     157
    158158    /**
    159159     * action_link( $links )
     
    168168        return $links;
    169169    }
    170    
     170
    171171    /**
    172172     * load_template( $vars )
     
    182182        if( file_exists( BPSP_PLUGIN_DIR . '/wordpress/templates/' . $name . '.php' ) )
    183183            include( BPSP_PLUGIN_DIR . '/wordpress/templates/' . $name . '.php' );
    184        
     184
    185185        if( isset( $echo ) && $echo )
    186186            echo ob_get_clean();
     
    188188            return ob_get_clean();
    189189    }
    190    
     190
    191191    /**
    192192     * get_posts( $terms, $post_types, $s )
     
    206206        $post_ids = array();
    207207        $posts = array();
    208        
     208
    209209        // Get term ids
    210210        // TODO: Here's something wrong, totally!!!
Note: See TracChangeset for help on using the changeset viewer.