/**
  * Register hooks to show the admin page when a student who has not yet
  * changed their username is logged in to the admin side.
  *
  * @access private
  * @since 0.3
  */
 public function _register_hooks()
 {
     $current_user = nxt_get_current_user();
     if ($current_user->ID > 0 && ClassBlogs_Utils::on_student_blog_admin() && !array_key_exists($current_user->user_login, $this->get_option('changed_users'))) {
         add_action('admin_menu', array($this, '_add_admin_page'));
     }
 }
 /**
  * Adds a link that will appear in the comments admin menu group on the
  * admin side of a student's blog that allows them to view all comments
  * that they have left on other students' blogs.
  *
  * @access private
  * @since 0.2
  */
 public function _add_student_comment_list()
 {
     if (ClassBlogs_Utils::on_student_blog_admin()) {
         add_comments_page(__('My Comments'), __('My Comments'), 'edit_posts', $this->get_uid() . '-my-comments', array($this, '_student_admin_page'));
     }
 }
示例#3
0
 /**
  * Adds an admin dashboard widget to any student-blog admin pages that shows
  * the student's word count for the current and previous weeks.
  *
  * @access private
  * @since 0.1
  */
 public function _add_student_dashboard_widget()
 {
     if (is_admin() && ClassBlogs_Utils::on_student_blog_admin()) {
         nxt_add_dashboard_widget('dashboard_' . $this->get_uid(), __('Word Count', 'classblogs'), array($this, '_handle_student_dashboard_widget'));
     }
 }