16 SpecialPrefixIndexGetFormFiltersHook,
17 SpecialPrefixIndexQueryHook,
19 SpecialPageBeforeFormDisplayHook,
20 SpecialWhatLinksHereQueryHook
23 public function onSpecialPrefixIndexGetFormFilters( IContextSource $contextSource, array &$filters ) {
24 $filters[
'translate-hidetranslations' ] = [
25 'class' => HTMLCheckField::class,
26 'name' =>
'translate-hidetranslations',
27 'label-message' =>
'translate-hidetranslations',
31 public function onSpecialPrefixIndexQuery( array $fieldData, SelectQueryBuilder $queryBuilder ) {
32 if ( $fieldData[
'translate-hidetranslations' ] ===
true ) {
33 $queryBuilder->leftJoin(
37 'translate_pp.pp_page=page_id',
38 'translate_pp.pp_propname' =>
'translate-is-translation'
40 )->andWhere( [
'translate_pp.pp_value' =>
null ] );
44 public function onLonelyPagesQuery( &$tables, &$conds, &$joinConds ) {
45 $tables[
'translate_pp' ] =
'page_props';
46 $joinConds[
'translate_pp'] = [
48 'translate_pp.pp_page=page_id',
49 'translate_pp.pp_propname' =>
'translate-is-translation'
52 $conds[
'translate_pp.pp_value'] =
null;
55 public function onSpecialPageBeforeFormDisplay( $name, $form ):
void {
56 if ( $name ===
'Whatlinkshere' ) {
58 'translate-hidetranslations' => [
60 'name' =>
'translate-hidetranslations',
61 'label-message' =>
'translate-hidetranslations',
62 'section' =>
'whatlinkshere-filter',
68 public function onSpecialWhatLinksHereQuery( $table, $data, $queryBuilder ) {
69 $isSupportedTable = in_array( $table, [
'pagelinks',
'templatelinks',
'imagelinks' ] );
71 if ( $data[
'translate-hidetranslations' ] && $isSupportedTable ) {
72 $queryBuilder->leftJoin(
76 'translate_pp.pp_page=page_id',
77 'translate_pp.pp_propname' =>
'translate-is-translation',
80 ->andWhere( [
'translate_pp.pp_value' =>
null ] );