Index: trunk/extensions/EducationProgram/specials/SpecialInstitution.php |
— | — | @@ -41,11 +41,11 @@ |
42 | 42 | |
43 | 43 | if ( $org === false ) { |
44 | 44 | if ( $this->getUser()->isAllowed( 'epadmin' ) ) { |
45 | | - $out->addWikiMsg( 'ep-institution-create', 'parsemag', $this->subPage ); |
| 45 | + $out->addWikiMsg( 'ep-institution-create', $this->subPage ); |
46 | 46 | EPOrg::displayAddNewControl( $this->getContext(), array( 'name' => $this->subPage ) ); |
47 | 47 | } |
48 | 48 | else { |
49 | | - $out->addWikiMsg( 'ep-institution-none', 'parsemag', $this->subPage ); |
| 49 | + $out->addWikiMsg( 'ep-institution-none', $this->subPage ); |
50 | 50 | } |
51 | 51 | } |
52 | 52 | else { |
Index: trunk/extensions/EducationProgram/specials/SpecialCourse.php |
— | — | @@ -41,11 +41,11 @@ |
42 | 42 | |
43 | 43 | if ( $course === false ) { |
44 | 44 | if ( $this->getUser()->isAllowed( 'epadmin' ) || $this->getUser()->isAllowed( 'epmentor' ) ) { |
45 | | - $out->addWikiMsg( 'ep-course-create', 'parsemag', $this->subPage ); |
| 45 | + $out->addWikiMsg( 'ep-course-create', $this->subPage ); |
46 | 46 | EPCourse::displayAddNewRegion( $this->getContext(), array( 'name' => $this->subPage ) ); |
47 | 47 | } |
48 | 48 | else { |
49 | | - $out->addWikiMsg( 'ep-course-none', 'parsemag', $this->subPage ); |
| 49 | + $out->addWikiMsg( 'ep-course-none', $this->subPage ); |
50 | 50 | } |
51 | 51 | } |
52 | 52 | else { |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | | - * Display the orgs info. |
| 62 | + * Display the course info. |
63 | 63 | * |
64 | 64 | * @since 0.1 |
65 | 65 | * |
Index: trunk/extensions/EducationProgram/specials/SpecialTerm.php |
— | — | @@ -34,8 +34,40 @@ |
35 | 35 | parent::execute( $subPage ); |
36 | 36 | |
37 | 37 | $out = $this->getOutput(); |
38 | | - |
39 | | - // TODO: AUTH |
| 38 | + |
| 39 | + $out->setPageTitle( wfMsgExt( 'ep-term-title', 'parsemag', $this->subPage ) ); |
| 40 | + |
| 41 | + $term = EPTerm::selectRow( null, array( 'id' => $this->subPage ) ); |
| 42 | + |
| 43 | + if ( $term === false ) { |
| 44 | + if ( $this->getUser()->isAllowed( 'epadmin' ) || $this->getUser()->isAllowed( 'epmentor' ) ) { |
| 45 | + $out->addWikiMsg( 'ep-term-create', $this->subPage ); |
| 46 | + EPTerm::displayAddNewRegion( $this->getContext(), array( 'id' => $this->subPage ) ); |
| 47 | + } |
| 48 | + else { |
| 49 | + $out->addWikiMsg( 'ep-term-none', $this->subPage ); |
| 50 | + } |
| 51 | + } |
| 52 | + else { |
| 53 | + $this->displayInfo( $term ); |
| 54 | + |
| 55 | + $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-term-students' ) ) ); |
| 56 | + |
| 57 | + // TODO |
| 58 | + } |
40 | 59 | } |
| 60 | + |
| 61 | + /** |
| 62 | + * Display the terms info. |
| 63 | + * |
| 64 | + * @since 0.1 |
| 65 | + * |
| 66 | + * @param EPTerm $term |
| 67 | + */ |
| 68 | + protected function displayInfo( EPTerm $term ) { |
| 69 | + $out = $this->getOutput(); |
| 70 | + |
| 71 | + |
| 72 | + } |
41 | 73 | |
42 | 74 | } |
Index: trunk/extensions/EducationProgram/includes/EPTerm.php |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | * @param IContextSource $context |
96 | 96 | * @param array $args |
97 | 97 | */ |
98 | | - public static function displayAddNewControl( IContextSource $context, array $courses ) { |
| 98 | + public static function displayAddNewControl( IContextSource $context, array $args ) { |
99 | 99 | $out = $context->getOutput(); |
100 | 100 | |
101 | 101 | $out->addHTML( Html::openElement( |
— | — | @@ -113,8 +113,13 @@ |
114 | 114 | |
115 | 115 | $out->addHTML( Html::element( 'label', array( 'for' => 'newcourse' ), wfMsg( 'ep-terms-newcourse' ) ) ); |
116 | 116 | |
117 | | - $select = new XmlSelect( 'newcourse', 'newcourse' ); |
118 | | - $select->addOptions( EPCourse::getCourseOptions( $courses ) ); |
| 117 | + $select = new XmlSelect( |
| 118 | + 'newcourse', |
| 119 | + 'newcourse', |
| 120 | + array_key_exists( 'course', $args ) ? $args['course'] : false |
| 121 | + ); |
| 122 | + |
| 123 | + $select->addOptions( EPCourse::getCourseOptions( EPCourse::getEditableCourses( $context->getUser() ) ) ); |
119 | 124 | $out->addHTML( $select->getHTML() ); |
120 | 125 | |
121 | 126 | $out->addHTML( ' ' . Xml::inputLabel( wfMsg( 'ep-terms-newyear' ), 'newyear', 'newyear', 10 ) ); |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -162,6 +162,12 @@ |
163 | 163 | 'ep-course-terms' => 'Terms', |
164 | 164 | 'ep-course-none' => 'There is no course with name "$1". See [[Special:Course|here]] for a list of courses.', |
165 | 165 | 'ep-course-create' => 'There is no course with name "$1" yet, but you can create it.', |
| 166 | + |
| 167 | + // Special:Term |
| 168 | + 'ep-term-title' => 'Term: $1', |
| 169 | + 'ep-term-students' => 'Students', |
| 170 | + 'ep-term-none' => 'There is no term with name "$1". See [[Special:Terms|here]] for a list of terms.', |
| 171 | + 'ep-term-create' => 'There is no term with name "$1" yet, but you can create it.', |
166 | 172 | ); |
167 | 173 | |
168 | 174 | /** Message documentation (Message documentation) |