Skip to content

Commit 8bad328

Browse files
committed
Init package
1 parent ab7d522 commit 8bad328

File tree

6 files changed

+179
-0
lines changed

6 files changed

+179
-0
lines changed

.gitignore

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Linux
2+
# backup files
3+
*~
4+
5+
# Windows
6+
# thumbnails
7+
Thumbs.db
8+
9+
# Mac OS X
10+
# metadata
11+
.DS_Store
12+
# thumbnails
13+
._*
14+
15+
# Visual Studio PHP
16+
*.sln
17+
*.phpproj
18+
*.puo
19+
*.suo
20+
*.cache
21+
22+
# Netbeans
23+
nbproject/
24+
catalog.xml
25+
nbactions.xml
26+
27+
# Eclipse
28+
.settings/
29+
.buildpath
30+
.classpath
31+
.project
32+
33+
# SVN
34+
# svn folders
35+
.svn/
36+
37+
# PHPStorm
38+
.idea/
39+
.nameencodings
40+
.xmlmisc
41+
.xmlmodules
42+
.xmlprojectCodeStyle
43+
.xmlvcs.xml
44+
*.imlworkspace
45+
.xml
46+
47+
# Sublime Text 2
48+
*.sublime-*
49+
50+
# Textmate
51+
*.tmproj
52+
53+
# Visual Studio Code
54+
.vscode/
55+
56+
# WoltLab Suite
57+
# Ignore packages build directly in the workspace. They can however be added manually via git add, if wanted.
58+
*.tar
59+
*.tar.gz
60+
61+
# Node.js
62+
extra/node_modules
63+
64+
# build script
65+
build.sh
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
namespace wbb\system\condition\thread;
3+
use wbb\data\thread\Thread;
4+
use wcf\data\DatabaseObject;
5+
use wcf\data\DatabaseObjectList;
6+
use wcf\system\condition\AbstractObjectTextPropertyCondition;
7+
use wcf\system\exception\NotImplementedException;
8+
9+
/**
10+
* Condition implementation for the topic name of a thread.
11+
*
12+
* @author Joshua Ruesweg
13+
* @copyright 2016-2019 WCFLabs.de
14+
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15+
*/
16+
class ThreadTopicCondition extends AbstractObjectTextPropertyCondition {
17+
/**
18+
* @inheritDoc
19+
*/
20+
protected $className = Thread::class;
21+
22+
/**
23+
* @inheritDoc
24+
*/
25+
protected $description = 'wbb.thread.condition.topic.description';
26+
27+
/**
28+
* @inheritDoc
29+
*/
30+
protected $fieldName = 'wbbThreadTopic';
31+
32+
/**
33+
* @inheritDoc
34+
*/
35+
protected $label = 'wbb.thread.condition.topic';
36+
37+
/**
38+
* @inheritDoc
39+
*/
40+
protected $propertyName = 'topic';
41+
42+
/**
43+
* @inheritDoc
44+
*/
45+
public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
46+
$className = $this->getListClassName();
47+
if (!($objectList instanceof $className)) {
48+
throw new \InvalidArgumentException("Object list is no instance of '{$className}', instance of '".get_class($objectList)."' given.");
49+
}
50+
51+
$objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' LIKE ?', [$conditionData[$this->fieldName]]);
52+
}
53+
54+
/**
55+
* @inheritDoc
56+
*/
57+
public function checkObject(DatabaseObject $object, array $conditionData) {
58+
throw new NotImplementedException();
59+
}
60+
}

language/de.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<language 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/2019/language.xsd" languagecode="de">
3+
<category name="wbb.thread">
4+
<item name="wbb.thread.condition.topic"><![CDATA[Themen-Titel]]></item>
5+
<item name="wbb.thread.condition.topic.description"><![CDATA[Nur Themen, die <strong>exakt</strong> den angegebenen Themen-Titel haben werden ausgewählt. <kbd>%</kbd> kann hierbei als Platzhalter genutzt werden. <kbd>%Test%</kbd> findet also beispielsweise alle Themen, dessen Titel das Wort Test enthält.]]></item>
6+
</category>
7+
</language>

language/en.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<language 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/2019/language.xsd" languagecode="de">
3+
<category name="wbb.thread">
4+
<item name="wbb.thread.condition.topic"><![CDATA[Thread Topic]]></item>
5+
<item name="wbb.thread.condition.topic.description"><![CDATA[Only topics that have <strong>exakt</strong> the specified topic title are selected. <kbd>%</kbd> can be used as placeholder. <kbd>%test%</kbd> for example finds all topics whose title contains the word test.]]></item>
6+
</category>
7+
</language>

objectType.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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/2019/objectType.xsd">
3+
<import>
4+
<type>
5+
<name>com.wcflabs.wbb.threadTopic</name>
6+
<definitionname>com.woltlab.wbb.bulkProcessing.thread.condition</definitionname>
7+
<classname>wbb\system\condition\thread\ThreadTopicCondition</classname>
8+
</type>
9+
</import>
10+
</data>

package.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<package name="com.wcflabs.wbb.threadTopicCondition" 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/2019/package.xsd">
3+
<packageinformation>
4+
<packagename>Thread Bulk Processing: Thread Topic</packagename>
5+
<packagedescription>Adds the condition "Topic" in the Thread Bulk Processing</packagedescription>
6+
<packagedescription language="de">Fügt die Bedingung „Themen-Titel“ in das Formular für die Massenverarbeitung von Themen hinzu.</packagedescription>
7+
<version>1.0.0</version>
8+
<date>2019-11-04</date>
9+
</packageinformation>
10+
11+
<authorinformation>
12+
<author>Joshua Rüsweg</author>
13+
<authorurl>https://www.wcflabs.com</authorurl>
14+
</authorinformation>
15+
16+
<requiredpackages>
17+
<requiredpackage minversion="3.1.11">com.woltlab.wcf</requiredpackage>
18+
<requiredpackage minversion="5.1.11">com.woltlab.wbb</requiredpackage>
19+
</requiredpackages>
20+
21+
<compatibility>
22+
<api version="2018" />
23+
</compatibility>
24+
25+
<instructions type="install">
26+
<instruction type="file" application="wbb" />
27+
<instruction type="objectType" />
28+
<instruction type="language" />
29+
</instructions>
30+
</package>

0 commit comments

Comments
 (0)