Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

Commit

Permalink
Preparing release 1.2.0
Browse files Browse the repository at this point in the history
- Added user group option to disable the plugin for certain user groups
  • Loading branch information
SoftCreatR committed Mar 3, 2019
1 parent b51fb63 commit b125697
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class ScUploadFilterAbstractPageListener implements IParameterizedEventListener
/**
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
public function execute($eventObj, $className, $eventName, array &$parameters) {
if (WCF::getSession()->getPermission('user.uploadFilter.canIgnoreUploadFilter')) return;

$tz = WCF::getUser()->getTimeZone();
$now = new DateTime('now', $tz);
$start = DateTime::createFromFormat('!Y-m-d', SC_UPLOAD_FREE_SUNDAY_START_DATE, $tz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ScUploadFilterAttachmentListListener implements IParameterizedEventListene
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
if (WCF::getSession()->getPermission('user.uploadFilter.canIgnoreUploadFilter')) return;
if (!SC_UPLOAD_FREE_SUNDAY_HIDE_ATTACHMENTS) return;

$tz = WCF::getUser()->getTimeZone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class ScUploadFilterHtmlOutputListener implements IParameterizedEventListener {
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
if (WCF::getSession()->getPermission('user.uploadFilter.canIgnoreUploadFilter')) return;

$tz = WCF::getUser()->getTimeZone();
$now = new DateTime('now', $tz);
$start = DateTime::createFromFormat('!Y-m-d', SC_UPLOAD_FREE_SUNDAY_START_DATE, $tz);
Expand Down
5 changes: 5 additions & 0 deletions language/de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<item name="wcf.message.error.scUploadFilter"><![CDATA[Diese{if $type === 'image'}s Bild{elseif $type === 'quote'}s Zitat{elseif $type === 'media'}s Medium{else}r Dateianhang{/if} wird aktuell auf mögliche Urheberrechtsverstöße geprüft. Voraussichtlicher Abschluss der Prüfung: <strong>Wird berechnet...</strong>.<br /><br /><i class="icon icon16 fa-info-circle"></i> <a href="https://pledge2019.eu/de">Weitere Informationen</a>]]></item>
</category>

<category name="wcf.acp.group">
<item name="wcf.acp.group.option.category.user.uploadFilter"><![CDATA[Uploadfreier Sonntag]]></item>
<item name="wcf.acp.group.option.user.uploadFilter.canIgnoreUploadFilter"><![CDATA[Kann die Einschränkungen des "Uploadfreien Sonntag" umgehen]]></item>
</category>

<category name="wcf.acp.option">
<item name="wcf.acp.option.category.sc_upload_free_sunday"><![CDATA[Uploadfreier Sonntag]]></item>
<item name="wcf.acp.option.category.sc_upload_free_sunday.general"><![CDATA[Allgemein]]></item>
Expand Down
5 changes: 5 additions & 0 deletions language/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<item name="wcf.message.error.scUploadFilter"><![CDATA[This {if $type === 'image'}image{elseif $type === 'quote'}quote{elseif $type === 'media'}media{else}attachment{/if} is being checked for possible copyright issues. Current predicted waiting time: <strong>Calculating...</strong>.<br /><br /><i class="icon icon16 fa-info-circle"></i> <a href="https://pledge2019.eu/en">More informations</a>]]></item>
</category>

<category name="wcf.acp.group">
<item name="wcf.acp.group.option.category.user.uploadFilter"><![CDATA[Upload Free Sunday]]></item>
<item name="wcf.acp.group.option.user.uploadFilter.canIgnoreUploadFilter"><![CDATA[Can avoid the "Upload Free Sunday" restrictions]]></item>
</category>

<category name="wcf.acp.option">
<item name="wcf.acp.option.category.sc_upload_free_sunday"><![CDATA[Upload Free Sunday]]></item>
<item name="wcf.acp.option.category.sc_upload_free_sunday.general"><![CDATA[General]]></item>
Expand Down
13 changes: 12 additions & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<packagedescription><![CDATA[Provides functionalities for the "upload free sunday" on 03rd March 2019.]]></packagedescription>
<packagedescription language="de"><![CDATA[Stellt Funktionalitäten für den "Uploadfreien Sonntag" am 03. März 2019 zur Verfügung.]]></packagedescription>
<packageurl><![CDATA[https://support.softcreatr.com/thread/2985-artikel-13-uploadfreier-sonntag-wsc-plugin/]]></packageurl>
<version>1.1.0 pl 2</version>
<version>1.2.0</version>
<date>2019-03-03</date>
<license><![CDATA[GNU General Public License <https://www.gnu.org/licenses/gpl-3.0.txt>]]></license>
</packageinformation>
Expand Down Expand Up @@ -34,6 +34,7 @@
<instruction type="option" />
<instruction type="eventListener" />
<instruction type="templateListener" />
<instruction type="userGroupOption" />
<instruction type="language" />
</instructions>

Expand Down Expand Up @@ -84,4 +85,14 @@
<!-- config -->
<instruction type="templateListener" />
</instructions>

<instructions type="update" fromversion="1.1.0 pl 2">
<!-- files -->
<instruction type="file" />

<!-- config -->
<instruction type="templateListener" />
<instruction type="userGroupOption" />
<instruction type="language" />
</instructions>
</package>
18 changes: 18 additions & 0 deletions userGroupOption.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="https://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.woltlab.com https://www.woltlab.com/XSD/vortex/userGroupOption.xsd">
<import>
<categories>
<category name="user.uploadFilter">
<parent>user</parent>
</category>
</categories>

<options>
<option name="user.uploadFilter.canIgnoreUploadFilter">
<categoryname>user.uploadFilter</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
</option>
</options>
</import>
</data>

0 comments on commit b125697

Please sign in to comment.