Skip to content

Commit

Permalink
Merge pull request #224 from HanashiDev/anmerkungen
Browse files Browse the repository at this point in the history
Anmerkungen
  • Loading branch information
Hanashi authored Oct 19, 2023
2 parents d75a214 + ec7c17a commit 8d8afc0
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 20 deletions.
5 changes: 5 additions & 0 deletions files/acp/database/install_dev.tkirch.wsc.faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use wcf\system\database\table\column\TinyintDatabaseTableColumn;
use wcf\system\database\table\DatabaseTable;
use wcf\system\database\table\index\DatabaseTableForeignKey;
use wcf\system\database\table\index\DatabaseTablePrimaryIndex;

return [
DatabaseTable::create('wcf1_faq_questions')
Expand All @@ -25,6 +26,10 @@
->notNull()
->defaultValue(0),
])
->indices([
DatabaseTablePrimaryIndex::create()
->columns(['questionID']),
])
->foreignKeys([
DatabaseTableForeignKey::create()
->columns(['categoryID'])
Expand Down
13 changes: 0 additions & 13 deletions files/acp/database/update_dev.tkirch.wsc.faq_2.0.0_step1.php

This file was deleted.

9 changes: 5 additions & 4 deletions files/lib/action/FaqSearchAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ class FaqSearchAction implements RequestHandlerInterface
{
public function handle(ServerRequestInterface $request): ResponseInterface
{
if ($request->getMethod() === 'GET') {
return new HtmlResponse(WCF::getTPL()->fetch('faqQuestionSearchDialog'));
} elseif ($request->getMethod() === 'POST') {
if ($request->getMethod() === 'GET' || $request->getMethod() === 'POST') {
$postParameters = Helper::mapQueryParameters(
$request->getParsedBody(),
<<<'EOT'
array {
searchString: string
searchString?: string
}
EOT
);
if (!isset($postParameters['searchString'])) {
return new HtmlResponse(WCF::getTPL()->fetch('faqQuestionSearchDialog'));
}

$sql = "
SELECT faq_questions.questionID
Expand Down
1 change: 1 addition & 0 deletions language/de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<category name="wcf.faq.bbcode">
<item name="wcf.faq.bbcode.noPermissions"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du verfügst{else}Sie verfügen{/if} nicht über die notwendigen Zugriffsrechte, um diese FAQ-Frage zu sehen.]]></item>
<item name="wcf.faq.bbcode.faqEntry"><![CDATA[FAQ-Eintrag]]></item>
<item name="wcf.faq.bbcode.title"><![CDATA[FAQ:]]></item>
</category>
<category name="wcf.search.type">
<item name="wcf.search.type.dev.tkirch.wsc.faq.question"><![CDATA[FAQ]]></item>
Expand Down
1 change: 1 addition & 0 deletions language/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<category name="wcf.faq.bbcode">
<item name="wcf.faq.bbcode.noPermissions"><![CDATA[You are not authorized to view this FAQ question.]]></item>
<item name="wcf.faq.bbcode.faqEntry"><![CDATA[FAQ entry]]></item>
<item name="wcf.faq.bbcode.title"><![CDATA[FAQ:]]></item>
</category>
<category name="wcf.search.type">
<item name="wcf.search.type.dev.tkirch.wsc.faq.question"><![CDATA[FAQ]]></item>
Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<instruction type="acpMenu"/>
<instruction type="language"/>
<instruction type="templateListener"/>
<instruction type="database" run="standalone">acp/database/update_dev.tkirch.wsc.faq_2.0.0_step1.php</instruction>
<instruction type="script" run="standalone">acp/database/update_dev.tkirch.wsc.faq_2.0.0_step2.php</instruction>
<instruction type="database" run="standalone">acp/database/install_dev.tkirch.wsc.faq.php</instruction>
<instruction type="script" run="standalone">acp/database/update_dev.tkirch.wsc.faq_2.0.0.php</instruction>
</instructions>
</package>
2 changes: 1 addition & 1 deletion templates/faqBBCode.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<div class="faqBBcodeBoxTitle">
<span class="faqBBcodeBoxTitle">
FAQ: <a href="{$question->getLink()}">{$question->getTitle()}</a>
{lang}wcf.faq.bbcode.title{/lang} <a href="{$question->getLink()}">{$question->getTitle()}</a>
</span>
</div>

Expand Down

0 comments on commit 8d8afc0

Please sign in to comment.