Changeset 610101
- Timestamp:
- 10/09/2012 06:11:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
buddypress-courseware/trunk/wordpress/wordpress.class.php
r442924 r610101 15 15 array( __CLASS__, 'menus') 16 16 ); 17 17 18 18 // Ensure compatibility 19 19 add_action('admin_notices', 'bpsp_check' ); … … 24 24 // Settings link 25 25 add_action( 'plugin_action_links_' . BPSP_PLUGIN_FILE, array( __CLASS__, 'action_link' ), 10, 4 ); 26 26 27 27 // Initialize our options 28 28 add_option( 'bpsp_allow_only_admins' ); … … 34 34 add_option( 'bpsp_load_css' ); 35 35 } 36 36 37 37 /** 38 38 * menus() … … 51 51 ); 52 52 } 53 53 54 54 /** 55 55 * screen_help() 56 * 56 * 57 57 * Handles the screen() help 58 58 */ 59 59 function screen_help() { 60 60 global $current_screen; 61 61 62 62 // If it's not Courseware Screen 63 63 if( !stristr( $current_screen->id, 'courseware' ) ) 64 64 return; 65 65 66 66 $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 70 70 /** 71 71 * screen() 72 * 72 * 73 73 * Handles the wp-admin screen 74 74 */ … … 78 78 $vars['nonce'] = wp_nonce_field( $nonce_name, '_wpnonce', true, false ); 79 79 $is_nonce = false; 80 80 81 81 if( isset( $_POST['_wpnonce'] ) ) 82 82 check_admin_referer( $nonce_name ); 83 83 84 84 // Courseware Global Status 85 85 if( isset( $_POST['bpsp_global_status'] ) ) … … 89 89 if( update_option( 'bpsp_global_status', '' ) ) 90 90 $vars['flash'][] = __( 'Courseware option was updated.', 'bpsp' ); 91 91 92 92 // Courseware Collaborative Settings 93 93 if( isset( $_POST['bpsp_allow_only_admins'] ) ) … … 97 97 if( update_option( 'bpsp_allow_only_admins', '' ) ) 98 98 $vars['flash'][] = __( 'Courseware option was updated.', 'bpsp' ); 99 99 100 100 // Courseware Private Responses 101 101 if( isset( $_POST['bpsp_private_responses_check'] ) ) … … 105 105 if( update_option( 'bpsp_private_responses', '' ) ) 106 106 $vars['flash'][] = __( 'Courseware option was updated.', 'bpsp' ); 107 107 108 108 // Courseware Default Gradebook Format 109 109 if( isset( $_POST['bpsp_gradebook_format_check'] ) && isset( $_POST['bpsp_gradebook_format'] ) ) 110 110 if( update_option( 'bpsp_gradebook_format', strtolower( $_POST['bpsp_gradebook_format'] ) ) ) 111 111 $vars['flash'][] = __( 'Courseware gradebook format option was updated.', 'bpsp' ); 112 112 113 113 // Courseware Bibliography Webservices Integration 114 114 if( isset( $_POST['worldcat_key'] ) && !empty( $_POST['worldcat_key'] ) ) … … 118 118 if( update_option( 'bpsp_isbndb_key', $_POST['isbndb_key'] ) ) 119 119 $vars['flash'][] = __( 'ISBNdb option was updated.', 'bpsp' ); 120 120 121 121 // Courseware Custom CSS 122 122 if( isset( $_POST['bpsp_load_css_check'] ) && isset( $_POST['bpsp_load_css'] ) ) … … 126 126 if( update_option( 'bpsp_load_css', '' ) ) 127 127 $vars['flash'][] = __( 'Courseware customization options updated.', 'bpsp' ); 128 128 129 129 $vars['name'] = 'admin'; 130 130 $vars['echo'] = 'true'; … … 136 136 $vars['isbndb_key'] = get_option( 'bpsp_isbndb_key' ); 137 137 $vars['bpsp_load_css'] = get_option( 'bpsp_load_css' ); 138 138 139 139 //Load the template 140 140 self::load_template( $vars ); 141 141 } 142 142 143 143 /** 144 144 * action_link( $links ) … … 155 155 return $links; 156 156 } 157 157 158 158 /** 159 159 * action_link( $links ) … … 168 168 return $links; 169 169 } 170 170 171 171 /** 172 172 * load_template( $vars ) … … 182 182 if( file_exists( BPSP_PLUGIN_DIR . '/wordpress/templates/' . $name . '.php' ) ) 183 183 include( BPSP_PLUGIN_DIR . '/wordpress/templates/' . $name . '.php' ); 184 184 185 185 if( isset( $echo ) && $echo ) 186 186 echo ob_get_clean(); … … 188 188 return ob_get_clean(); 189 189 } 190 190 191 191 /** 192 192 * get_posts( $terms, $post_types, $s ) … … 206 206 $post_ids = array(); 207 207 $posts = array(); 208 208 209 209 // Get term ids 210 210 // TODO: Here's something wrong, totally!!!
Note: See TracChangeset
for help on using the changeset viewer.