<nav class="contentHeaderNavigation">
<ul>
{content}
+ {if $__wcf->getSession()->getPermission('admin.content.article.canManageArticle')}<li><a href="{link controller='ArticleEdit' id=$article->articleID isACP=true}{/link}" class="button"><span class="icon icon16 fa-pencil"></span> <span>{lang}wcf.acp.article.edit{/lang}</span></a></li>{/if}
{event name='contentHeaderNavigation'}
{/content}
</ul>
<li><a rel="alternate" href="{if $__wcf->getUser()->userID}{link controller='ArticleFeed' appendSession=false}at={@$__wcf->getUser()->userID}-{@$__wcf->getUser()->accessToken}{/link}{else}{link controller='ArticleFeed' appendSession=false}{/link}{/if}" title="{lang}wcf.global.button.rss{/lang}" class="jsTooltip"><span class="icon icon16 fa-rss"></span> <span class="invisible">{lang}wcf.global.button.rss{/lang}</span></a></li>
{/capture}
+{if $__wcf->getSession()->getPermission('admin.content.article.canManageArticle')}
+ {capture assign='contentHeaderNavigation'}
+ <li><a href="{link controller='ArticleAdd' isACP=true}{/link}" class="button"><span class="icon icon16 fa-pencil"></span> <span>{lang}wcf.acp.article.add{/lang}</span></a></li>
+ {/capture}
+{/if}
+
{include file='header'}
{hascontent}
<li><a rel="alternate" href="{if $__wcf->getUser()->userID}{link controller='ArticleFeed' id=$categoryID appendSession=false}at={@$__wcf->getUser()->userID}-{@$__wcf->getUser()->accessToken}{/link}{else}{link controller='ArticleFeed' id=$categoryID appendSession=false}{/link}{/if}" title="{lang}wcf.global.button.rss{/lang}" class="jsTooltip"><span class="icon icon16 fa-rss"></span> <span class="invisible">{lang}wcf.global.button.rss{/lang}</span></a></li>
{/capture}
+{if $__wcf->getSession()->getPermission('admin.content.article.canManageArticle')}
+ {capture assign='contentHeaderNavigation'}
+ <li><a href="{link controller='ArticleAdd' isACP=true}categoryID={@$category->categoryID}{/link}" class="button"><span class="icon icon16 fa-pencil"></span> <span>{lang}wcf.acp.article.add{/lang}</span></a></li>
+ {/capture}
+{/if}
+
{include file='header'}
{hascontent}
</div>
<script data-relocate="true">
require(['WoltLab/WCF/Acp/Ui/Article/Add'], function(AcpUiArticleAdd) {
- AcpUiArticleAdd.init('{link controller='ArticleAdd' encode=false}{literal}isMultilingual={$isMultilingual}{/literal}{/link}');
+ AcpUiArticleAdd.init('{link controller='ArticleAdd' encode=false}{literal}isMultilingual={$isMultilingual}{/literal}{if $categoryID}&categoryID={@$categoryID}{/if}{/link}');
{if $showArticleAddDialog}
window.setTimeout(function() {
public function readParameters() {
parent::readParameters();
+ if (isset($_REQUEST['categoryID'])) $this->categoryID = intval($_REQUEST['categoryID']);
+
$this->readMultilingualSetting();
// get available languages
// work-around to force adding article via dialog overlay
if (empty($_POST) && !isset($_REQUEST['isMultilingual'])) {
- HeaderUtil::redirect(LinkHandler::getInstance()->getLink('ArticleList', ['showArticleAddDialog' => 1]));
+ $parameters = ['showArticleAddDialog' => 1];
+ if ($this->categoryID) $parameters['categoryID'] = $this->categoryID;
+ HeaderUtil::redirect(LinkHandler::getInstance()->getLink('ArticleList', $parameters));
exit;
}
}
parent::readFormParameters();
$this->enableComments = 0;
- if (isset($_POST['categoryID'])) $this->categoryID = intval($_POST['categoryID']);
if (isset($_POST['username'])) $this->username = StringUtil::trim($_POST['username']);
if (isset($_POST['time'])) {
$this->time = $_POST['time'];
public function readParameters() {
parent::readParameters();
- if (isset($_POST['categoryID'])) $this->categoryID = intval($_POST['categoryID']);
+ if (isset($_REQUEST['categoryID'])) $this->categoryID = intval($_REQUEST['categoryID']);
if (!empty($_REQUEST['username'])) $this->username = StringUtil::trim($_REQUEST['username']);
if (!empty($_REQUEST['title'])) $this->title = StringUtil::trim($_REQUEST['title']);
if (!empty($_REQUEST['content'])) $this->content = StringUtil::trim($_REQUEST['content']);