Index: trunk/extensions/EducationProgram/actions/ViewCourseAction.php |
— | — | @@ -59,13 +59,9 @@ |
60 | 60 | protected function getSummaryData( EPDBObject $course ) { |
61 | 61 | $stats = array(); |
62 | 62 | |
63 | | - $org = EPOrg::selectFieldsRow( 'name', array( 'id' => $course->getField( 'org_id' ) ) ); |
| 63 | + $orgName = EPOrg::selectFieldsRow( 'name', array( 'id' => $course->getField( 'org_id' ) ) ); |
| 64 | + $stats['org'] = EPOrg::getLinkFor( $orgName ); |
64 | 65 | |
65 | | - $stats['org'] = Linker::linkKnown( |
66 | | - SpecialPage::getTitleFor( 'Institution', $org ), |
67 | | - htmlspecialchars( $org ) |
68 | | - ); |
69 | | - |
70 | 66 | $lang = $this->getLanguage(); |
71 | 67 | |
72 | 68 | $stats['term'] = htmlspecialchars( $course->getField( 'term' ) ); |
Index: trunk/extensions/EducationProgram/actions/EPViewAction.php |
— | — | @@ -53,31 +53,7 @@ |
54 | 54 | } |
55 | 55 | else { |
56 | 56 | $object = $rev->getObject(); |
57 | | - |
58 | | - $lang = $this->getLanguage(); |
59 | | - |
60 | | - $current = false; // TODO |
61 | | - $td = $lang->timeanddate( $rev->getField( 'time' ), true ); |
62 | | - $tddate = $lang->date( $rev->getField( 'time' ), true ); |
63 | | - $tdtime = $lang->time( $rev->getField( 'time' ), true ); |
64 | | - |
65 | | - $userToolLinks = Linker::userLink( $rev->getUser()->getId(), $rev->getUser()->getName() ) |
66 | | - . Linker::userToolLinks( $rev->getUser()->getId(), $rev->getUser()->getName() ); |
67 | | - |
68 | | - $infomsg = $current && !wfMessage( 'revision-info-current' )->isDisabled() |
69 | | - ? 'revision-info-current' |
70 | | - : 'revision-info'; |
71 | | - |
72 | | - $out->setSubtitle( |
73 | | - "<div id=\"mw-{$infomsg}\">" . |
74 | | - wfMessage( $infomsg, $td )->rawParams( $userToolLinks )->params( |
75 | | - $rev->getId(), |
76 | | - $tddate, |
77 | | - $tdtime, |
78 | | - $rev->getUser() |
79 | | - )->parse() . |
80 | | - "</div>" |
81 | | - ); |
| 57 | + $this->displayRevisionNotice( $rev ); |
82 | 58 | } |
83 | 59 | } |
84 | 60 | } |
— | — | @@ -103,6 +79,33 @@ |
104 | 80 | return ''; |
105 | 81 | } |
106 | 82 | |
| 83 | + protected function displayRevisionNotice( EPRevision $rev ) { |
| 84 | + $lang = $this->getLanguage(); |
| 85 | + |
| 86 | + $current = false; // TODO |
| 87 | + $td = $lang->timeanddate( $rev->getField( 'time' ), true ); |
| 88 | + $tddate = $lang->date( $rev->getField( 'time' ), true ); |
| 89 | + $tdtime = $lang->time( $rev->getField( 'time' ), true ); |
| 90 | + |
| 91 | + $userToolLinks = Linker::userLink( $rev->getUser()->getId(), $rev->getUser()->getName() ) |
| 92 | + . Linker::userToolLinks( $rev->getUser()->getId(), $rev->getUser()->getName() ); |
| 93 | + |
| 94 | + $infomsg = $current && !wfMessage( 'revision-info-current' )->isDisabled() |
| 95 | + ? 'revision-info-current' |
| 96 | + : 'revision-info'; |
| 97 | + |
| 98 | + $this->getOutput()->setSubtitle( |
| 99 | + "<div id=\"mw-{$infomsg}\">" . |
| 100 | + wfMessage( $infomsg, $td )->rawParams( $userToolLinks )->params( |
| 101 | + $rev->getId(), |
| 102 | + $tddate, |
| 103 | + $tdtime, |
| 104 | + $rev->getUser() |
| 105 | + )->parse() . |
| 106 | + "</div>" |
| 107 | + ); |
| 108 | + } |
| 109 | + |
107 | 110 | protected function displayPage( EPDBObject $object ) { |
108 | 111 | $this->displayNavigation(); |
109 | 112 | |
Index: trunk/extensions/EducationProgram/actions/EditCourseAction.php |
— | — | @@ -50,6 +50,9 @@ |
51 | 51 | 'term' => $this->getRequest()->getText( 'newterm', '' ), |
52 | 52 | ) |
53 | 53 | ); |
| 54 | + |
| 55 | + $this->isNew = true; |
| 56 | + $this->getOutput()->setSubtitle( $this->getDescription() ); |
54 | 57 | |
55 | 58 | return ''; |
56 | 59 | } |
Index: trunk/extensions/EducationProgram/actions/EPEditAction.php |
— | — | @@ -118,7 +118,7 @@ |
119 | 119 | */ |
120 | 120 | protected function isNew() { |
121 | 121 | if ( is_null( $this->isNew ) ) { |
122 | | - $isNew = $this->isNewPost(); |
| 122 | + $this->isNew = $this->isNewPost(); |
123 | 123 | } |
124 | 124 | |
125 | 125 | return $this->isNew; |