protected function displayPage(EPDBObject $org) { parent::displayPage($org); $out = $this->getOutput(); $out->addElement('h2', array(), wfMsg('ep-institution-courses')); EPCourse::displayPager($this->getContext(), array('org_id' => $org->getId())); if ($this->getUser()->isAllowed('ep-course')) { $out->addElement('h2', array(), wfMsg('ep-institution-add-course')); EPCourse::displayAddNewControl($this->getContext(), array('org' => $org->getId())); } }
protected function displayPage(EPDBObject $course) { parent::displayPage($course); $out = $this->getOutput(); $out->addElement('h2', array(), wfMsg('ep-course-description')); $out->addHTML($this->getOutput()->parse($course->getField('description'))); $studentIds = array_map(function (EPStudent $student) { return $student->getId(); }, $course->getStudents('id')); if (count($studentIds) > 0) { $out->addElement('h2', array(), wfMsg('ep-course-articles')); EPArticle::displayPager($this->getContext(), array('course_id' => $course->getId())); $out->addElement('h2', array(), wfMsg('ep-course-students')); EPStudent::displayPager($this->getContext(), array('id' => $studentIds)); } else { // TODO } }