/** * Returns a list with the users that the specified role for the provided course * or a message indicating there are none. * * @since 0.1 * * @param EPCourse $course * @param string $roleName * * @return string */ protected function getRoleList(EPCourse $course, $roleName) { $users = $course->getUserWithRole($roleName); if (count($users) > 0) { $instList = array(); foreach ($users as $user) { $instList[] = $user->getUserLink() . $user->getToolLinks($this->getContext(), $course); } if (false) { // count( $instructors ) == 1 $html = $instList[0]; } else { $html = '<ul><li>' . implode('</li><li>', $instList) . '</li></ul>'; } } else { $html = wfMsgHtml('ep-course-no-' . $roleName); } return Html::rawElement('div', array('id' => 'ep-course-' . $roleName), $html); }