r110108 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110107‎ | r110108 | r110109 >
Date:09:09, 27 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fix link issue
Modified paths:
  • /trunk/extensions/EducationProgram/includes/EPCoursePager.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPOrgPager.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPPageObject.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/includes/EPOrgPager.php
@@ -142,15 +142,12 @@
143143 protected function getControlLinks( EPDBObject $item ) {
144144 $links = parent::getControlLinks( $item );
145145
146 - $links[] = $value = Linker::linkKnown(
147 - SpecialPage::getTitleFor( 'Institution', $item->getField( 'name' ) ),
148 - wfMsgHtml( 'view' )
149 - );
 146+ $links[] = $item->getLink();
150147
151148 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,
155152 array(),
156153 array( 'wpreturnto' => $this->getTitle()->getText() )
157154 );
Index: trunk/extensions/EducationProgram/includes/EPCoursePager.php
@@ -171,15 +171,12 @@
172172 protected function getControlLinks( EPDBObject $item ) {
173173 $links = parent::getControlLinks( $item );
174174
175 - $links[] = $value = Linker::linkKnown(
176 - SpecialPage::getTitleFor( 'Course', $item->getId() ),
177 - wfMsgHtml( 'view' )
178 - );
 175+ $links[] = $item->getLink();
179176
180177 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,
184181 array(),
185182 array( 'wpreturnto' => $this->getTitle()->getText() )
186183 );
Index: trunk/extensions/EducationProgram/includes/EPPageObject.php
@@ -54,10 +54,12 @@
5555 return SpecialPage::getTitleFor( self::getTitleText( $action ), $this->getIdentifier() );
5656 }
5757
58 - public function getLink( $action = 'view' ) {
 58+ public function getLink( $action = 'view', $html = null, $customAttribs = array(), $query = array() ) {
5959 return Linker::link(
6060 self::getTitle( $action ),
61 - htmlspecialchars( $this->getIdentifier() )
 61+ is_null( $html ) ? htmlspecialchars( $this->getIdentifier() ) : $html,
 62+ $customAttribs,
 63+ $query
6264 );
6365 }
6466
@@ -65,10 +67,12 @@
6668 return SpecialPage::getTitleFor( self::getTitleText( $action ), $identifierValue );
6769 }
6870
69 - public static function getLinkFor( $identifierValue, $action = 'view' ) {
 71+ public static function getLinkFor( $identifierValue, $action = 'view', $html = null, $customAttribs = array(), $query = array() ) {
7072 return Linker::link(
7173 self::getTitleFor( $identifierValue, $action ),
72 - htmlspecialchars( $identifierValue )
 74+ is_null( $html ) ? htmlspecialchars( $identifierValue ) : $html,
 75+ $customAttribs,
 76+ $query
7377 );
7478 }
7579

Follow-up revisions

RevisionCommit summaryAuthorDate
r110110follow up to r110108 - fix link textjeroendedauw09:25, 27 January 2012

Status & tagging log