JM_Resume_Bp_Resume_Loader

The BuddyPress JM Resume JM Resume Bp Loader class.

Defined (1)

The class is defined in the following location(s).

/buddypress-components/jm-resume-componet/bp-jm-resume/class-jm-resume-bp-resume-loader.php  
  1. class JM_Resume_Bp_Resume_Loader extends BP_Component { 
  2.  
  3. /** 
  4. * Start the messages component creation process 
  5. * @since BuddyPress (1.5) 
  6. */ 
  7. private $sub_nav_items; 
  8. static $resumes_slug = 'resumes'; 
  9. private $menu_order = 85; 
  10. public function __construct() { 
  11.  
  12. parent::start( 
  13. 'resume',  
  14. __( 'My Resume', 'buddypress_jm_resume' ),  
  15. BUDDYPRESS_JM_RESUME_PATH,  
  16. array( 
  17. 'adminbar_myaccount_order' => 999999 
  18. ); 
  19. $this->includes(); 
  20.  
  21.  
  22. /** 
  23. * Include files 
  24. * @global BuddyPress $bp The one true BuddyPress instance 
  25. */ 
  26. public function includes( $includes = array() ) { 
  27.  
  28. $includes = array( 
  29. 'screens',  
  30. 'functions',  
  31. ); 
  32.  
  33.  
  34. parent::includes( $includes ); 
  35.  
  36. /** 
  37. * Setup globals 
  38. * The BP_MESSAGES_SLUG constant is deprecated, and only used here for 
  39. * backwards compatibility. 
  40. * @since BuddyPress (1.5) 
  41. */ 
  42. public function setup_globals( $args = array() ) { 
  43. $bp = buddypress(); 
  44.  
  45. // Define a slug, if necessary 
  46. if ( !defined( 'BP_RESUME_SLUG' ) ) 
  47. define( 'BP_RESUME_SLUG', $this->id ); 
  48.  
  49.  
  50.  
  51. // All globals for messaging component. 
  52. // Note that global_tables is included in this array. 
  53. $globals = array( 
  54. 'slug' => BP_RESUME_SLUG,  
  55. 'has_directory' => false,  
  56. 'notification_callback' => 'messages_format_notifications',  
  57. 'search_string' => __( 'Search Messages...', 'buddypress_jm_resume' ),  
  58.  
  59. ); 
  60.  
  61. $this->autocomplete_all = defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL' ); 
  62.  
  63. parent::setup_globals( $globals ); 
  64.  
  65. /** 
  66. * Set up your component's navigation. 
  67. * The navigation elements created here are responsible for the main site navigation (eg 
  68. * Profile > Activity > Mentions), as well as the navigation in the BuddyBar. WP Admin Bar 
  69. * navigation is broken out into a separate method; see 
  70. * BP_Example_Component::setup_admin_bar(). 
  71. * @global obj $bp 
  72. */ 
  73. function setup_nav( $nav = array(), $sub_nav = array() ) { 
  74. if ( ! class_exists( 'WP_Job_Manager' ) ) 
  75. return; 
  76. if ( ! class_exists( 'WP_Resume_Manager' ) ) 
  77. return; 
  78.  
  79.  
  80.  
  81. $nav_name = __( 'My Resume', 'buddypress_jm_resume' ); 
  82.  
  83. // Add 'hrm' to the main navigation 
  84. $main_nav = array( 
  85. 'name' => __( 'My Resume', 'buddypress_jm_resume' ),  
  86. 'slug' => $this->id,  
  87. 'position' => $this->menu_order,  
  88. 'screen_function' => 'bp_jm_resumes',  
  89. 'default_subnav_slug' => 'resume',  
  90. ); 
  91.  
  92. // Determine user to use 
  93. if ( bp_displayed_user_domain() ) { 
  94. $user_domain = bp_displayed_user_domain(); 
  95. } elseif ( bp_loggedin_user_domain() ) { 
  96. $user_domain = bp_loggedin_user_domain(); 
  97. } else { 
  98. return; 
  99.  
  100. $resume_manager_link = trailingslashit( $user_domain . $this->slug ); 
  101.  
  102. // Add Candidate Dashboard nav item 
  103. if ( class_exists( 'WP_Resume_Manager' ) ) { 
  104. $sub_nav[] = array( 
  105. 'name' => __( 'My Resumes', 'buddypress-job-manager' ),  
  106. 'slug' => 'resume',  
  107. 'parent_url' => $resume_manager_link,  
  108. 'parent_slug' => $this->slug,  
  109. 'screen_function' => 'bp_jm_resumes',  
  110. 'position' => 30,  
  111. // 'user_has_access' => bp_core_can_edit_settings() 
  112. ); 
  113.  
  114.  
  115. // Add Resumes nav item 
  116. if ( class_exists( 'WP_Resume_Manager' ) ) { 
  117. $sub_nav[] = array( 
  118. 'name' => __( 'Resumes Listings', 'buddypress' ),  
  119. 'slug' => 'resume-listings',  
  120. 'parent_url' => $resume_manager_link,  
  121. 'parent_slug' => $this->slug,  
  122. 'screen_function' => 'bp_jm_resume_listings',  
  123. 'position' => 40,  
  124. 'user_has_access' => bp_core_can_edit_settings() 
  125. ); 
  126.  
  127.  
  128.  
  129.  
  130. parent::setup_nav( $main_nav, $sub_nav ); 
  131.  
  132.  
  133.  
  134.