', 'scoper' ); $remove_all = __( '>>', 'scoper' ); $restore = __( '< Restore', 'scoper' ); $restore_all = __( '<<', 'scoper' ); $approve = __( 'Approve ^', 'scoper' ); $activate = __( 'Activate ^', 'scoper' ); $recommend = __( 'Recommend ^', 'scoper' ); if ( 'groups' == $agent_type ) { $can_admin = is_user_administrator_rs(); if ( $can_admin ) { $this->status []= 'active'; $this->list_ids [] = 'current_agents_rs'; $this->removal_ids [] = 'uncurrent_agents_rs'; $this->list_captions[] = __( 'Active Groups', 'scoper' ); $this->removal_captions[] = __( 'Remove', 'scoper' ); $this->remove_button []= $remove_btn; $this->remove_all_button []= $remove_all; $this->restore_button []= $restore; $this->restore_all_button []= $restore_all; $this->approval_button_id []= ''; $this->approval_caption []= ''; } if ( scoper_get_option( 'group_recommendations' ) && ( $can_admin || ( $can_moderate = current_user_can( 'recommend_group_membership' ) ) ) ) { $this->status []= 'recommended'; $this->list_ids [] = 'recommended_agents_rs'; $this->removal_ids [] = 'unrecommended_agents_rs'; $this->list_captions[] = __( 'Recommended Groups', 'scoper' ); $this->removal_captions[] = $remove; $this->remove_button []= $remove_btn; $this->remove_all_button []= $remove_all; $this->restore_button []= $restore; $this->restore_all_button []= $restore_all; if ( $can_admin ) { $this->approval_button_id []= 'recommended_to_active_rs'; $this->approval_caption []= $activate; } else { $this->approval_button_id []= ''; $this->approval_caption []= ''; } } if ( scoper_get_option( 'group_requests' ) && ( $can_admin || current_user_can( 'request_group_membership' ) ) ) { $this->status []= 'requested'; $this->list_ids [] = 'requested_agents_rs'; $this->removal_ids [] = 'unrequested_agents_rs'; $this->list_captions[] = __( 'Requested Groups', 'scoper' ); $this->removal_captions[] = $remove; $this->remove_button []= $remove_btn; $this->remove_all_button []= $remove_all; $this->restore_button []= $restore; $this->restore_all_button []= $restore_all; if ( $can_admin ) { $this->approval_button_id []= 'requested_to_active_rs'; $this->approval_caption []= $activate; } elseif ( $can_moderate ) { $this->approval_button_id []= 'requested_to_recommended_rs'; $this->approval_caption []= $recommend; } else { $this->approval_button_id []= ''; $this->approval_caption []= ''; } } } else { if ( ! empty( $_GET['page'] ) && ( 'rs-groups' == $_GET['page'] ) && ! empty( $_GET['id'] ) ) $group_id = $_GET['id']; else $group_id = 0; $can_admin = is_user_administrator_rs() || current_user_can( 'manage_groups', $group_id ); if ( $can_admin ) { $this->status []= 'active'; $this->list_ids [] = 'current_agents_rs'; $this->removal_ids [] = 'uncurrent_agents_rs'; $this->list_captions[] = __( 'Active Users', 'scoper' ); $this->removal_captions[] = $remove; $this->remove_button []= $remove_btn; $this->remove_all_button []= $remove_all; $this->restore_button []= $restore; $this->restore_all_button []= $restore_all; $this->approval_button_id []= ''; $this->approval_caption []= ''; } if ( scoper_get_option( 'group_recommendations' ) && ( $can_admin || ( $can_moderate = current_user_can( 'recommend_group_membership' ) ) ) ) { $this->status []= 'recommended'; $this->list_ids [] = 'recommended_agents_rs'; $this->removal_ids [] = 'unrecommended_agents_rs'; $this->list_captions[] = __( 'Recommended Users', 'scoper' ); $this->removal_captions[] = $remove; $this->remove_button []= $remove_btn; $this->remove_all_button []= $remove_all; $this->restore_button []= $restore; $this->restore_all_button []= $restore_all; if ( $can_admin ) { $this->approval_button_id []= 'recommended_to_active_rs'; $this->approval_caption []= $activate; } else { $this->approval_button_id []= ''; $this->approval_caption []= ''; } } if ( scoper_get_option( 'group_requests' ) && ( $can_admin || current_user_can( 'request_group_membership' ) ) ) { $this->status []= 'requested'; $this->list_ids [] = 'requested_agents_rs'; $this->removal_ids [] = 'unrequested_agents_rs'; $this->list_captions[] = __( 'Requested Users', 'scoper' ); $this->removal_captions[] = $remove; $this->remove_button []= $remove_btn; $this->remove_all_button []= $remove_all; $this->restore_button []= $restore; $this->restore_all_button []= $restore_all; if ( $can_admin ) { $this->approval_button_id []= 'requested_to_active_rs'; $this->approval_caption []= $activate; } elseif ( $can_moderate ) { $this->approval_button_id []= 'requesed_to_recommended_rs'; $this->approval_caption []= $recommend; } else { $this->approval_button_id []= ''; $this->approval_caption []= ''; } } } } function output_js( $agent_type = 'users', $agent_id ) { echo "\n" . ""; echo "\n" . ""; $site_url = admin_url(''); if ( ! $this->list_ids ) return; $list_id = $this->list_ids[0]; // only the logged user's highest authority listbox will receive new selections from search results ?> status[0] ) ) { if ( 'requested' == $this->status[0] ) $reqd_caps = 'request_group_membership'; elseif ( 'recommended' == $this->status[0] ) $reqd_caps = 'recommend_group_membership'; } $editable_group_ids = ScoperAdminLib::get_all_groups( FILTERED_RS, COL_ID_RS, array( 'reqd_caps' => $reqd_caps ) ); } if ( ! empty($this->list_ids) ) : ?>

list_ids ) > 1 ) : for( $key=1; $key < count($this->list_ids); $key++ ) : ?>


list_captions[0]; ?>



removal_captions[0]; ?>

list_captions[$key]; ?>


approval_button_id[$key] ) ) echo "

"; ?>
removal_captions[$key]; ?>

list_ids as $key => $list_id ) { if ( $agents && ! empty( $agents[ $this->status[$key] ] ) ) $csv = implode( ',', array_keys($agents[ $this->status[$key] ] ) ); else $csv = ''; echo ""; } endif; // any list_ids set (logged user can submit groups for any status) $captions = array(); $captions['active'] = __( 'Active Membership', 'scoper' ); $captions['recommended'] = __( 'Recommended Membership', 'scoper' ); $captions['requested'] = __( 'Requested Membership', 'scoper' ); if ( 'groups' == $agent_type ) { // display uneditable groups $uneditable_groups = array(); foreach ( array_keys($agents) as $status ) { $uneditable_groups[$status] = array(); $status_editable = ( false !== array_search( $status, $this->status ) ); foreach ( $agents[ $status ] as $group_id => $group_name ) if ( ( ! $status_editable || ! in_array( $group_id, $editable_group_ids ) ) && ( false === strpos( $group_name, '[' ) ) ) $uneditable_groups[$status] []= $group_name; if ( $uneditable_groups[$status] ) { $groups_csv = implode( ", ", $uneditable_groups[$status] ); printf( __( '%1$s: %2$s', 'scoper' ), $captions[$status], $groups_csv ); echo '

'; } } } else { foreach ( array_keys($agents) as $status ) { if ( false === array_search( $status, $this->status ) ) { $users_csv = implode( ", ", $agents[$status] ); printf( __( '%1$s: %2$s', 'scoper' ), $captions[$status], $users_csv ); echo '

'; } } } } // end function } // end class ?>