mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-28 02:00:17 +00:00
6dee0147f4
* Move across all files * Rename ext-card- prefix to ext-related-articles- prefix ** Since all code using these prefixes is JS we do not have to worry about cached HTML Bug: T137021 Change-Id: I784fd132c36329fa0dcc49fe2804460061940347
27 lines
757 B
PHP
27 lines
757 B
PHP
<?php
|
|
namespace RelatedArticles;
|
|
|
|
use ResourceLoaderFileModule;
|
|
use ResourceLoaderContext;
|
|
|
|
/**
|
|
* A ResourceLoader module that serves Hogan or Mustache depending on the
|
|
* current target.
|
|
*
|
|
* FIXME: this is a copy&paste from the QuickSurveys extension. Find a way to
|
|
* share the code or use mustache in MobileFrontend too.
|
|
*/
|
|
class ResourceLoaderMuHoganModule extends ResourceLoaderFileModule {
|
|
public function getDependencies( ResourceLoaderContext $context = null ) {
|
|
$dependencies = parent::getDependencies( $context );
|
|
|
|
if ( $context && $context->getRequest()->getVal( 'target' ) === 'mobile' ) {
|
|
$dependencies[] = 'mediawiki.template.hogan';
|
|
} else {
|
|
$dependencies[] = 'mediawiki.template.mustache';
|
|
}
|
|
|
|
return $dependencies;
|
|
}
|
|
}
|