+ /**
+ * Return the CSS classes of a known link
+ *
+ * @param LinkTarget $target
+ * @return string CSS class
+ */
+ public function getLinkClasses( LinkTarget $target ) {
+ // Make sure the target is in the cache
+ $id = $this->linkCache->addLinkObj( $target );
+ if ( $id == 0 ) {
+ // Doesn't exist
+ return '';
+ }
+
+ if ( $this->linkCache->getGoodLinkFieldObj( $target, 'redirect' ) ) {
+ # Page is a redirect
+ return 'mw-redirect';
+ } elseif ( $this->stubThreshold > 0 && MWNamespace::isContent( $target->getNamespace() )
+ && $this->linkCache->getGoodLinkFieldObj( $target, 'length' ) < $this->stubThreshold
+ ) {
+ # Page is a stub
+ return 'stub';
+ }
+
+ return '';
+ }