availabilityController = new AvailabilityController( $availability ); $this->lessonController = new LessonController( $bookings ); $this->offeringController = new OfferingController( $offerings ); $this->questionController = new QuestionController( $questions, $offerings ); } public function register(): void { add_action( 'admin_menu', [ $this, 'addPages' ] ); } public function addPages(): void { // Studio-wide dashboard: all upcoming lessons across instructors. add_menu_page( __( 'Scheduler', 'unsupervised-schedular' ), __( 'Scheduler', 'unsupervised-schedular' ), RoleManager::CAP_VIEW_ALL_LESSONS, 'us-scheduler', [ $this->lessonController, 'renderAdminDashboard' ], 'dashicons-calendar-alt', 30 ); // Instructor: manage their own availability. add_menu_page( __( 'My Availability', 'unsupervised-schedular' ), __( 'My Availability', 'unsupervised-schedular' ), RoleManager::CAP_MANAGE_AVAILABILITY, 'us-availability', [ $this->availabilityController, 'renderPage' ], 'dashicons-clock', 31 ); // Studio admin / instructor: manage offerings. add_menu_page( __( 'Offerings', 'unsupervised-schedular' ), __( 'Offerings', 'unsupervised-schedular' ), RoleManager::CAP_MANAGE_OFFERINGS, 'us-offerings', [ $this->offeringController, 'renderPage' ], 'dashicons-tag', 33 ); // Studio admin / instructor: manage per-offering intake questions. add_submenu_page( 'us-offerings', __( 'Questions', 'unsupervised-schedular' ), __( 'Questions', 'unsupervised-schedular' ), RoleManager::CAP_MANAGE_QUESTIONS, 'us-questions', [ $this->questionController, 'renderPage' ] ); // Instructor: view their upcoming lessons. add_menu_page( __( 'My Lessons', 'unsupervised-schedular' ), __( 'My Lessons', 'unsupervised-schedular' ), RoleManager::CAP_VIEW_LESSONS, 'us-my-lessons', [ $this->lessonController, 'renderInstructorLessons' ], 'dashicons-welcome-learn-more', 32 ); } }