/** @var Title|string|bool */
protected $title;
- /** @var string Text of last error */
+ /** @var string Text of last error */
protected $lastError;
- /** @var string Main part of the title, with underscores (Title::getDBkey) */
+ /** @var string Main part of the title, with underscores (Title::getDBkey) */
protected $redirected;
/** @var Title */
}
}
+ /**
+ * Gives a (possibly empty) list of languages to render
+ * the file in.
+ *
+ * If the file doesn't have translations, or if the file
+ * format does not support that sort of thing, returns
+ * an empty array.
+ *
+ * @return Array
+ * @since 1.23
+ */
+ public function getAvailableLanguages() {
+ $handler = $this->getHandler();
+ if ( $handler ) {
+ return $handler->getAvailableLanguages( $this );
+ } else {
+ return array();
+ }
+ }
+
+ /**
+ * In files that support multiple language, what is the default language
+ * to use if none specified.
+ *
+ * @return String lang code, or null if filetype doesn't support multiple languages.
+ * @since 1.23
+ */
+ public function getDefaultRenderLanguage() {
+ $handler = $this->getHandler();
+ if ( $handler ) {
+ return $handler->getDefaultRenderLanguage( $this );
+ } else {
+ return null;
+ }
+ }
+
/**
* Will the thumbnail be animated if one would expect it to be.
*
public function getCommonMetaArray() {
$handler = $this->getHandler();
+ if ( !$handler ) {
+ return false;
+ }
+
return $handler->getCommonMetaArray( $this );
}
$params['height'] = $height;
}
$thumb = $this->transform( $params );
- if ( is_null( $thumb ) || $thumb->isError() ) {
+ if ( !$thumb || $thumb->isError() ) {
return '';
}
$this->assertRepoDefined();
return $this->repo->getZonePath( 'thumb' ) . '/' .
- $this->getArchiveThumbRel( $archiveName, $suffix );
+ $this->getArchiveThumbRel( $archiveName, $suffix );
}
/**