Like in OOjs UI. Less confusing. No one is using this yet.
Bug: T93669
Change-Id: Ib1c9af96b46ba660b3697d272129e071da1fdf18
} );
$extensions = array_unique( $extensions );
if ( count( $extensions ) !== 1 ) {
- throw new MWException( 'Image type for various images differs.' );
+ throw new MWException( "File type for different image files of '$name' not the same." );
}
$ext = $extensions[0];
if ( !isset( self::$fileTypes[$ext] ) ) {
- throw new MWException( 'Invalid image type; svg, png, gif or jpg required.' );
+ throw new MWException( "Invalid file type for image files of '$name' (valid: svg, png, gif, jpg)." );
}
$this->extension = $ext;
}
$this->imageObjects = array();
foreach ( $this->images as $name => $options ) {
- $imageDesc = is_string( $options ) ? $options : $options['image'];
+ $fileDescriptor = is_string( $options ) ? $options : $options['file'];
$allowedVariants = array_merge(
is_array( $options ) && isset( $options['variants'] ) ? $options['variants'] : array(),
$image = new ResourceLoaderImage(
$name,
$this->getName(),
- $imageDesc,
+ $fileDescriptor,
$this->localBasePath,
$variantConfig
);
$commonImageData = array(
'advanced' => 'advanced.svg',
'remove' => array(
- 'image' => 'remove.svg',
+ 'file' => 'remove.svg',
'variants' => array( 'destructive' ),
),
'next' => array(
- 'image' => array(
+ 'file' => array(
'ltr' => 'next.svg',
'rtl' => 'prev.svg'
),
),
'help' => array(
- 'image' => array(
+ 'file' => array(
'ltr' => 'help-ltr.svg',
'rtl' => 'help-rtl.svg',
'lang' => array(
),
),
'bold' => array(
- 'image' => array(
+ 'file' => array(
'default' => 'bold-a.svg',
'lang' => array(
'en' => 'bold-b.svg',