Skip to content

Commit

Permalink
Merge pull request #124 from lloc/master
Browse files Browse the repository at this point in the history
PHP Notice & PHP Strict Standards reloaded
  • Loading branch information
stas committed Oct 14, 2014
2 parents c7c26c7 + d3a526a commit e69483d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions lectures/lectures.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function __construct() {
add_action( 'courseware_new_teacher_removed', array( $this, 'remove_caps' ) );
add_action( 'courseware_group_screen_handler', array( $this, 'screen_handler' ) );
add_filter( 'courseware_course', array( $this, 'lectures_screen' ) );
add_filter( 'post_type_link', array( __CLASS__, 'get_permalink' ), 10, 2 );
add_filter( 'post_type_link', array( $this, 'get_permalink' ), 10, 2 );
add_filter( 'page_css_class', array( __CLASS__, 'css_class' ), 10, 2 );
}

Expand Down Expand Up @@ -610,12 +610,12 @@ function prev_lecture( $lecture ) {
function get_permalink( $permalink, $lecture ) {
global $bp;

if( is_object( $lecture ) && $lecture->post_type == 'lecture' && is_plugin_active( 'buddypress/bp-loader.php' ) ) {
if ( is_object( $lecture ) && $lecture->post_type == 'lecture' && is_plugin_active( 'buddypress/bp-loader.php' ) && ! empty( $bp->groups->current_group ) ) {
$courseware_uri = bp_get_group_permalink( $bp->groups->current_group ) . 'courseware/lecture/' ;
return $courseware_uri . $lecture->post_name;
} else {
return $permalink;
}
}

return $permalink;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions wordpress/wordpress.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ class BPSP_WordPress {
*/
function __construct() {
// Add our screen to BuddyPress menu
add_action( 'network_admin_menu', array( __CLASS__, 'network_menu') );
add_action( 'admin_menu', array( __CLASS__, 'single_menu') );
add_action( 'network_admin_menu', array( $this, 'network_menu') );
add_action( 'admin_menu', array( $this, 'single_menu') );

// Ensure compatibility
add_action('admin_notices', 'bpsp_check' );
// Help Screen
add_action('admin_head', array( __CLASS__, 'screen_help') );
add_action('admin_head', array( $this, 'screen_help') );
// Support link
add_filter( 'plugin_row_meta', array( __CLASS__, 'support_link' ), 10, 2 );
add_filter( 'plugin_row_meta', array( $this, 'support_link' ), 10, 2 );
// Settings link
add_action( 'plugin_action_links_' . BPSP_PLUGIN_FILE, array( __CLASS__, 'action_link' ), 10, 4 );
add_action( 'plugin_action_links_' . BPSP_PLUGIN_FILE, array( $this, 'action_link' ), 10, 4 );

// Initialize our options
add_option( 'bpsp_allow_only_admins' );
Expand Down

0 comments on commit e69483d

Please sign in to comment.