Skip to content

Commit

Permalink
Revert "WSC 6.1: Version 2.2.0"
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanashi authored Aug 31, 2024
1 parent 050e404 commit bca884c
Show file tree
Hide file tree
Showing 57 changed files with 3,569 additions and 6,654 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.0'
extensions: ctype, dom, exif, gd, gmp, hash, intl, json, libxml, mbstring, opcache, pcre, pdo, pdo_mysql, zlib
tools: cs2pr, phpcs, php-cs-fixer
- name: phpcs
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
php:
- '8.1'
- '8.2'
- '8.3'
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
Expand Down
36 changes: 29 additions & 7 deletions acpMenu.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/5.4/acpMenu.xsd">
<delete>
<acpmenuitem name="wcf.acp.menu.link.faq.questions.add"/>
<acpmenuitem name="wcf.acp.menu.link.faq.questions.list"/>
<acpmenuitem name="wcf.acp.menu.link.faq.categories.add"/>
<acpmenuitem name="wcf.acp.menu.link.faq.categories.list"/>
<acpmenuitem name="wcf.acp.menu.link.faq"/>
</delete>
<import>
<acpmenuitem name="wcf.acp.menu.link.faq">
<parent>wcf.acp.menu.link.content</parent>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.faq.categories.list">
<controller>wcf\acp\page\FaqCategoryListPage</controller>
<parent>wcf.acp.menu.link.faq</parent>
<permissions>admin.faq.canViewCategory</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.faq.categories.add">
<controller>wcf\acp\form\FaqCategoryAddForm</controller>
<parent>wcf.acp.menu.link.faq.categories.list</parent>
<permissions>admin.faq.canAddCategory</permissions>
<icon>plus</icon>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.faq.questions.list">
<controller>wcf\acp\page\FaqQuestionListPage</controller>
<parent>wcf.acp.menu.link.faq</parent>
<permissions>admin.faq.canViewQuestion</permissions>
<showorder>2</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.faq.questions.add">
<controller>wcf\acp\form\FaqQuestionAddForm</controller>
<parent>wcf.acp.menu.link.faq.questions.list</parent>
<permissions>admin.faq.canAddQuestion</permissions>
<icon>plus</icon>
</acpmenuitem>
</import>
</data>
2 changes: 1 addition & 1 deletion acptemplates/faqQuestionAdd.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
</nav>
</header>

{unsafe:$form->getHtml()}
{@$form->getHtml()}

{include file='footer'}
17 changes: 8 additions & 9 deletions acptemplates/faqQuestionList.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
new UiSortableList({
containerId: 'questionList',
className: 'wcf\\data\\faq\\QuestionAction',
offset: {$startIndex}
offset: {@$startIndex}
});
});
</script>
Expand Down Expand Up @@ -36,7 +36,7 @@
<option value="0">{lang}wcf.acp.faq.category{/lang}</option>

{foreach from=$categoryNodeList item=category}
<option value="{$category->categoryID}"{if $category->categoryID == $categoryID} selected{/if}>{if $category->getDepth() > 1}{unsafe:"&nbsp;&nbsp;&nbsp;&nbsp;"|str_repeat:($category->getDepth() - 1)}{/if}{$category->getTitle()}</option>
<option value="{@$category->categoryID}"{if $category->categoryID == $categoryID} selected{/if}>{if $category->getDepth() > 1}{@"&nbsp;&nbsp;&nbsp;&nbsp;"|str_repeat:($category->getDepth() - 1)}{/if}{$category->getTitle()}</option>
{/foreach}
</select>
</dd>
Expand Down Expand Up @@ -70,9 +70,9 @@
<div class="paginationTop">
{content}
{assign var='linkParameters' value=''}
{if $categoryID}{capture append=linkParameters}&categoryID={$categoryID}{/capture}{/if}
{if $question}{capture append=linkParameters}&question={unsafe:$question|rawurlencode}{/capture}{/if}
{if $answer}{capture append=linkParameters}&answer={unsafe:$answer|rawurlencode}{/capture}{/if}
{if $categoryID}{capture append=linkParameters}&categoryID={@$categoryID}{/capture}{/if}
{if $question}{capture append=linkParameters}&question={@$question|rawurlencode}{/capture}{/if}
{if $answer}{capture append=linkParameters}&answer={@$answer|rawurlencode}{/capture}{/if}

{pages print=true assign=pagesLinks controller="FaqQuestionList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder$linkParameters"}
{/content}
Expand All @@ -81,16 +81,15 @@

{if $objects|count}
<div class="section sortableListContainer" id="questionList">
<ol class="sortableList jsObjectActionContainer jsReloadPageWhenEmpty" data-object-id="0" start="{($pageNo - 1) * $itemsPerPage + 1}" data-object-action-class-name="wcf\data\faq\QuestionAction">
<ol class="sortableList jsObjectActionContainer jsReloadPageWhenEmpty" data-object-id="0" start="{@($pageNo - 1) * $itemsPerPage + 1}" data-object-action-class-name="wcf\data\faq\QuestionAction">
{foreach from=$objects item=question}
<li class="sortableNode sortableNoNesting jsQuestion jsObjectActionObject" data-object-id="{$question->questionID}">
<li class="sortableNode sortableNoNesting jsQuestion jsObjectActionObject" data-object-id="{@$question->questionID}">
<span class="sortableNodeLabel">
({$question->getCategory()->getTitle()})&nbsp;
<a href="{link controller='FaqQuestionEdit' object=$question}{/link}">{$question->getTitle()}</a>

<span class="statusDisplay sortableButtonContainer">
{objectAction action="toggle" isDisabled=$question->isDisabled}
<a href="{link controller='FaqQuestionAdd' duplicateID=$question->questionID isMultilingual=$question->isMultilingual}{/link}" title="{lang}wcf.acp.faqQuestion.copy{/lang}" class="jsTooltip">{icon name='copy' size=16}</a>
<a href="{link controller='FaqQuestionEdit' object=$question}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip">{icon name='pencil' size=16}</a>
{objectAction action="delete" objectTitle=$question->getTitle()}

Expand All @@ -109,7 +108,7 @@
<footer class="contentFooter">
{hascontent}
<div class="paginationBottom">
{content}{unsafe:$pagesLinks}{/content}
{content}{@$pagesLinks}{/content}
</div>
{/hascontent}

Expand Down
24 changes: 0 additions & 24 deletions box.xml

This file was deleted.

3 changes: 0 additions & 3 deletions constants.php

This file was deleted.

6 changes: 0 additions & 6 deletions fileDelete.xml

This file was deleted.

17 changes: 0 additions & 17 deletions files/js/Hanashi/Api/Questions/GetSearch.js

This file was deleted.

16 changes: 0 additions & 16 deletions files/js/Hanashi/Api/Questions/RenderSearch.js

This file was deleted.

24 changes: 16 additions & 8 deletions files/js/Hanashi/Faq/BBCode.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 0 additions & 55 deletions files/js/Hanashi/Faq/Question.js

This file was deleted.

57 changes: 14 additions & 43 deletions files/lib/acp/form/FaqCategoryAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

namespace wcf\acp\form;

use Override;
use wcf\data\IStorableObject;
use wcf\system\form\builder\container\FormContainer;
use wcf\system\form\builder\data\processor\CustomFormDataProcessor;
use wcf\system\form\builder\field\IconFormField;
use wcf\system\form\builder\IFormDocument;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;

class FaqCategoryAddForm extends CategoryAddFormBuilderForm
class FaqCategoryAddForm extends AbstractCategoryAddForm
{
/**
* @inheritDoc
Expand All @@ -19,45 +15,20 @@ class FaqCategoryAddForm extends CategoryAddFormBuilderForm
/**
* @inheritDoc
*/
public string $objectTypeName = 'dev.tkirch.wsc.faq.category';
public $objectTypeName = 'dev.tkirch.wsc.faq.category';

#[Override]
protected function createForm()
/**
* @inheritDoc
*/
public function save()
{
parent::createForm();
parent::save();

$this->form->appendChildren([
FormContainer::create('properties')
->label('wcf.acp.faq.properties')
->appendChildren([
IconFormField::create('faqIcon')
->label('wcf.acp.faq.faqIcon'),
]),
WCF::getTPL()->assign([
'objectEditLink' => LinkHandler::getInstance()->getControllerLink(
FaqCategoryEditForm::class,
['id' => $this->objectAction->getReturnValues()['returnValues']->categoryID]
),
]);
}

#[Override]
protected function finalizeForm()
{
$this->form->getDataHandler()->addProcessor(
new CustomFormDataProcessor(
'icon',
static function (IFormDocument $document, array $parameters) {
$parameters['additionalData']['faqIcon'] = $parameters['data']['faqIcon'];
unset($parameters['data']['faqIcon']);

return $parameters;
},
function (IFormDocument $document, array $data, IStorableObject $object) {
if (isset($this->formObject->additionalData['faqIcon'])) {
$data['faqIcon'] = $this->formObject->additionalData['faqIcon'];
}

return $data;
}
)
);

parent::finalizeForm();
}
}
Loading

0 comments on commit bca884c

Please sign in to comment.