From: Alexander Ebert Date: Sat, 11 Jan 2020 22:27:39 +0000 (+0100) Subject: Suppress the option for i18n articles when there is only a single language X-Git-Tag: 5.2.2~57 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e418f0f01b5eb113dd67c062d589e340064253d6;p=GitHub%2FWoltLab%2FWCF.git Suppress the option for i18n articles when there is only a single language --- 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(), ]); } }