Index: trunk/extensions/EducationProgram/includes/EPOrgPager.php |
— | — | @@ -142,15 +142,12 @@ |
143 | 143 | protected function getControlLinks( EPDBObject $item ) { |
144 | 144 | $links = parent::getControlLinks( $item ); |
145 | 145 | |
146 | | - $links[] = $value = Linker::linkKnown( |
147 | | - SpecialPage::getTitleFor( 'Institution', $item->getField( 'name' ) ), |
148 | | - wfMsgHtml( 'view' ) |
149 | | - ); |
| 146 | + $links[] = $item->getLink(); |
150 | 147 | |
151 | 148 | if ( $this->getUser()->isAllowed( 'ep-org' ) ) { |
152 | | - $links[] = $value = Linker::linkKnown( |
153 | | - SpecialPage::getTitleFor( 'EditInstitution', $item->getField( 'name' ) ), |
154 | | - wfMsgHtml( 'edit' ), |
| 149 | + $links[] = $item->getLink( |
| 150 | + 'edit', |
| 151 | + null, |
155 | 152 | array(), |
156 | 153 | array( 'wpreturnto' => $this->getTitle()->getText() ) |
157 | 154 | ); |
Index: trunk/extensions/EducationProgram/includes/EPCoursePager.php |
— | — | @@ -171,15 +171,12 @@ |
172 | 172 | protected function getControlLinks( EPDBObject $item ) { |
173 | 173 | $links = parent::getControlLinks( $item ); |
174 | 174 | |
175 | | - $links[] = $value = Linker::linkKnown( |
176 | | - SpecialPage::getTitleFor( 'Course', $item->getId() ), |
177 | | - wfMsgHtml( 'view' ) |
178 | | - ); |
| 175 | + $links[] = $item->getLink(); |
179 | 176 | |
180 | 177 | if ( $this->getUser()->isAllowed( 'ep-course' ) ) { |
181 | | - $links[] = $value = Linker::linkKnown( |
182 | | - SpecialPage::getTitleFor( 'EditCourse', $item->getId() ), |
183 | | - wfMsgHtml( 'edit' ), |
| 178 | + $links[] = $item->getLink( |
| 179 | + 'edit', |
| 180 | + null, |
184 | 181 | array(), |
185 | 182 | array( 'wpreturnto' => $this->getTitle()->getText() ) |
186 | 183 | ); |
Index: trunk/extensions/EducationProgram/includes/EPPageObject.php |
— | — | @@ -54,10 +54,12 @@ |
55 | 55 | return SpecialPage::getTitleFor( self::getTitleText( $action ), $this->getIdentifier() ); |
56 | 56 | } |
57 | 57 | |
58 | | - public function getLink( $action = 'view' ) { |
| 58 | + public function getLink( $action = 'view', $html = null, $customAttribs = array(), $query = array() ) { |
59 | 59 | return Linker::link( |
60 | 60 | self::getTitle( $action ), |
61 | | - htmlspecialchars( $this->getIdentifier() ) |
| 61 | + is_null( $html ) ? htmlspecialchars( $this->getIdentifier() ) : $html, |
| 62 | + $customAttribs, |
| 63 | + $query |
62 | 64 | ); |
63 | 65 | } |
64 | 66 | |
— | — | @@ -65,10 +67,12 @@ |
66 | 68 | return SpecialPage::getTitleFor( self::getTitleText( $action ), $identifierValue ); |
67 | 69 | } |
68 | 70 | |
69 | | - public static function getLinkFor( $identifierValue, $action = 'view' ) { |
| 71 | + public static function getLinkFor( $identifierValue, $action = 'view', $html = null, $customAttribs = array(), $query = array() ) { |
70 | 72 | return Linker::link( |
71 | 73 | self::getTitleFor( $identifierValue, $action ), |
72 | | - htmlspecialchars( $identifierValue ) |
| 74 | + is_null( $html ) ? htmlspecialchars( $identifierValue ) : $html, |
| 75 | + $customAttribs, |
| 76 | + $query |
73 | 77 | ); |
74 | 78 | } |
75 | 79 | |