From e418f0f01b5eb113dd67c062d589e340064253d6 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 11 Jan 2020 23:27:39 +0100 Subject: [PATCH] Suppress the option for i18n articles when there is only a single language --- com.woltlab.wcf/templates/articleList.tpl | 6 +++++- wcfsetup/install/files/lib/page/ArticleListPage.class.php | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/com.woltlab.wcf/templates/articleList.tpl b/com.woltlab.wcf/templates/articleList.tpl index 1021864538..1f66022fa4 100644 --- a/com.woltlab.wcf/templates/articleList.tpl +++ b/com.woltlab.wcf/templates/articleList.tpl @@ -32,7 +32,11 @@ {if $__wcf->getSession()->getPermission('admin.content.article.canManageArticle') || $__wcf->getSession()->getPermission('admin.content.article.canContributeArticle')} -
  • {lang}wcf.acp.article.add{/lang}
  • + {if $availableLanguages|count > 1} +
  • {lang}wcf.acp.article.add{/lang}
  • + {else} +
  • {lang}wcf.acp.article.add{/lang}
  • + {/if} {/if} {/capture} diff --git a/wcfsetup/install/files/lib/page/ArticleListPage.class.php b/wcfsetup/install/files/lib/page/ArticleListPage.class.php index d290bc1dd0..08f46b9dcc 100644 --- a/wcfsetup/install/files/lib/page/ArticleListPage.class.php +++ b/wcfsetup/install/files/lib/page/ArticleListPage.class.php @@ -7,6 +7,7 @@ use wcf\data\object\type\ObjectTypeCache; use wcf\data\user\User; use wcf\system\exception\IllegalLinkException; use wcf\system\label\LabelHandler; +use wcf\system\language\LanguageFactory; use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\HeaderUtil; @@ -207,6 +208,7 @@ class ArticleListPage extends SortablePage { 'user' => $this->user, 'categoryID' => 0, 'showArticleAddDialog' => $this->showArticleAddDialog, + 'availableLanguages' => LanguageFactory::getInstance()->getLanguages(), ]); } } -- 2.20.1