Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSC 6.0 compatibility #1

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion acpMenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<controller>wcf\acp\form\ApiSecretAddForm</controller>
<parent>wcf.acp.menu.link.wscApi.secrets.list</parent>
<permissions>admin.wscApi.canManageSecret</permissions>
<icon>fa-plus</icon>
<icon>plus</icon>
</acpmenuitem>
</import>
</data>
4 changes: 2 additions & 2 deletions acptemplates/apiSecretAdd.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<nav class="contentHeaderNavigation">
<ul>
<li><a href="{link application='wcf' controller='ApiSecretList'}{/link}" class="button"><span class="icon icon16 fa-list"></span> <span>{lang}wcf.acp.menu.link.wscApi.secrets.list{/lang}</span></a></li>
<li><a href="{link application='wcf' controller='ApiSecretList'}{/link}" class="button">{icon name='list' size=16} <span>{lang}wcf.acp.menu.link.wscApi.secrets.list{/lang}</span></a></li>

{event name='contentHeaderNavigation'}
</ul>
Expand Down Expand Up @@ -107,7 +107,7 @@

<div class="formSubmit">
<input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s">
{@SECURITY_TOKEN_INPUT_TAG}
{csrfToken}
</div>
</form>

Expand Down
2 changes: 1 addition & 1 deletion acptemplates/apiSecretDocumentation.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<nav class="contentHeaderNavigation">
<ul>
<li><a href="{link application='wcf' controller='ApiSecretList'}{/link}" class="button"><span class="icon icon16 fa-list"></span> <span>{lang}wcf.acp.menu.link.wscApi.secrets.list{/lang}</span></a></li>
<li><a href="{link application='wcf' controller='ApiSecretList'}{/link}" class="button">{icon name='list' size=16} <span>{lang}wcf.acp.menu.link.wscApi.secrets.list{/lang}</span></a></li>

{event name='contentHeaderNavigation'}
</ul>
Expand Down
16 changes: 5 additions & 11 deletions acptemplates/apiSecretList.tpl
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
{include file='header' pageTitle='wcf.acp.menu.link.wscApi.secrets.list'}

<script data-relocate="true">
$(function() {
new WCF.Action.Delete('wcf\\data\\ApiSecretAction', '.jsSecretRow');
});
</script>

<header class="contentHeader">
<div class="contentHeaderTitle">
<h1 class="contentTitle">{lang}wcf.acp.menu.link.wscApi.secrets.list{/lang}</h1>
</div>

<nav class="contentHeaderNavigation">
<ul>
<li><a href="{link application='wcf' controller='ApiSecretAdd'}{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.menu.link.wscApi.secrets.add{/lang}</span></a></li>
<li><a href="{link application='wcf' controller='ApiSecretAdd'}{/link}" class="button">{icon name='plus' size=16} <span>{lang}wcf.acp.menu.link.wscApi.secrets.add{/lang}</span></a></li>

{event name='contentHeaderNavigation'}
</ul>
Expand All @@ -23,7 +17,7 @@
{hascontent}
<div id="boardNodeList" class="section sortableListContainer">
<ol id="boardContainer0" class="sortableList" data-object-id="0">
<table class="table">
<table class="table jsObjectActionContainer" data-object-action-class-name="wcf\data\ApiSecretAction">
<thead>
<tr>
<th></th>
Expand All @@ -34,10 +28,10 @@
<tbody>
{content}
{foreach from=$secrets item=secret}
<tr class="jsSecretRow">
<tr class="jsObjectActionObject" data-object-id="{$secret.secretID}">
<td class="columnIcon">
<a href="{link controller='ApiSecretEdit' id=$secret.secretID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
<span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$secret.secretID}" data-confirm-message-html="{lang}TODO{/lang}"></span>
<a href="{link controller='ApiSecretEdit' id=$secret.secretID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip">{icon name='pencil' size=16}</a>
{objectAction action="delete" objectTitle=$secret.secretDescription}
</td>
<td>{$secret.secretID}</td>
<td><a title="{lang}wcf.acp.user.edit{/lang}" href="{link controller='ApiSecretEdit' id=$secret.secretID}{/link}">{$secret.secretDescription}</a></td>
Expand Down
2 changes: 1 addition & 1 deletion files/lib/acp/form/ApiSecretAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function readFormParameters() {
if (!empty($_POST['secretKey'])) {
$this->secretKey = StringUtil::trim($_POST['secretKey']);
} else {
$this->secretKey = bin2hex(CryptoUtil::randomBytes(16));
$this->secretKey = bin2hex(random_bytes(16));
}

if (!empty($_POST['secretDescription'])) {
Expand Down
18 changes: 18 additions & 0 deletions files/lib/api/ThreadApi.class.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
<?php
namespace wcf\api;

use wbb\data\thread\Thread;
use wbb\data\thread\ThreadAction;
use wcf\util\StringUtil;
use wcf\system\exception\ApiException;
use wbb\data\thread\ThreadList;
use wbb\system\label\object\ThreadLabelObjectHandler;
use wcf\system\api\ApiResponse;

/**
* @author Robert Bitschnau
* @package at.megathorx.wsc-api
*/
class ThreadApi extends BaseApi {
protected $attachmentHandler;

protected $htmlInputProcessor;

protected $enableTimeObj;

protected $subscribeThread;

protected $optionHandler;

protected $type;

protected $boardIDs;

protected $labelIDs;

/**
* @api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function prepare() {
/**
* @inheritDoc
*/
public function getTitle() {
public function getTitle(): string {
return $this->getUserNotificationObject()->title;
}

Expand Down Expand Up @@ -69,7 +69,7 @@ public function getEventHash() {
/**
* @inheritDoc
*/
public function getLink() {
public function getLink(): string {
return $this->getUserNotificationObject()->url;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ApiNotificationUserNotificationObject extends DatabaseObjectDecorator impl
/**
* @inheritDoc
*/
public function getTitle() {
public function getTitle(): string {
return $this->getDecoratedObject()->title;
}

Expand Down
6 changes: 1 addition & 5 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
<authorurl>https://github.com/eXo-OpenSource/wsc-api</authorurl>
</authorinformation>
<requiredpackages>
<requiredpackage minversion="3.0.0">com.woltlab.wcf</requiredpackage>
<requiredpackage minversion="6.0.2">com.woltlab.wcf</requiredpackage>
</requiredpackages>
<compatibility>
<api version="2018"/>
<api version="2019"/>
</compatibility>
<instructions type="install">
<instruction type="file"/>
<instruction type="language"/>
Expand Down