Skip to content

Commit

Permalink
Add support for XenForo 2.1 (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
daohoangson committed Oct 14, 2020
2 parents be63058 + 93d0a9e commit dc80d02
Show file tree
Hide file tree
Showing 22 changed files with 48 additions and 26 deletions.
5 changes: 3 additions & 2 deletions Mvc/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ public function __construct($app)
* @param mixed $link
* @param mixed|null $data
* @param array $parameters
* @param mixed|null $hash
* @return string
*/
public function buildLink($link, $data = null, array $parameters = [])
public function buildLink($link, $data = null, array $parameters = [], $hash = null)
{
if (!isset($parameters[Listener::$accessTokenParamKey])) {
/** @var mixed $session */
Expand All @@ -44,7 +45,7 @@ public function buildLink($link, $data = null, array $parameters = [])
}
}

return parent::buildLink($link, $data, $parameters);
return parent::buildLink($link, $data, $parameters, $hash);
}

/**
Expand Down
10 changes: 7 additions & 3 deletions XF/ApiOnly/Template/Templater.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ public function getDefaultAvatarStylingForApi($username)
return $this->getDefaultAvatarStyling($username);
}

public function renderTemplate($template, array $params = [], $addDefaultParams = true)
{
$output = parent::renderTemplate($template, $params, $addDefaultParams);
public function renderTemplate(
$template,
array $params = [],
$addDefaultParams = true,
\XF\Template\ExtensionSet $extensionOverrides = null
) {
$output = parent::renderTemplate($template, $params, $addDefaultParams, $extensionOverrides);

if ($template === 'public:bb_code_tag_attach' && isset($params['attachment'])) {
/** @var \XF\Entity\Attachment $attachment */
Expand Down
2 changes: 1 addition & 1 deletion _output/option_groups/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"bdApi.json": {
"hash": "6bd069e84ba8930264b993ce3e298aeb"
"hash": "34681743b9276a0f9d60823a46cce3ee"
}
}
1 change: 1 addition & 0 deletions _output/option_groups/bdApi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"icon": "",
"display_order": 9999,
"advanced": false,
"debug_only": false
}
32 changes: 16 additions & 16 deletions _output/options/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
{
"bdApi_authCodeTTL.json": {
"hash": "b4e446ab89f79780d5feebc30db4b1cd"
"hash": "da794e2c00d7bc5126964300a5e72b4d"
},
"bdApi_cors.json": {
"hash": "49bf33143e73258b7e96ede1f0dfd214"
"hash": "b0a70bd49ca1c0e02a613f21033bf82b"
},
"bdApi_logRetentionDays.json": {
"hash": "25b4b3d13494a5a699d23f2276c7058d"
"hash": "46b137a4cf7648cba5553266b2e1427e"
},
"bdApi_paramLimitDefault.json": {
"hash": "3c27531eabd7183a898bd70cfc3f1779"
"hash": "494f628de855c691a347083fa7d80cfc"
},
"bdApi_paramLimitMax.json": {
"hash": "a1f7f555f66b5b2bd764580571050448"
"hash": "f477fab869fd0656bb9db5949050e2a2"
},
"bdApi_paramPageMax.json": {
"hash": "f105958153411491e0ac4fa2e7c81c2b"
"hash": "77fbedd2fc0ae24e03d787c739c2faff"
},
"bdApi_refreshTokenTTLDays.json": {
"hash": "0e0669e64483b08378cb183ce1c7fe09"
"hash": "98b7abcf3277c79a5ec0a89522c28fcf"
},
"bdApi_restrictAccess.json": {
"hash": "49bf33143e73258b7e96ede1f0dfd214"
"hash": "b0a70bd49ca1c0e02a613f21033bf82b"
},
"bdApi_subscriptionColumnThreadPost.json": {
"hash": "1d8ea47bd0923f2c4739e5c5f95cb6aa"
"hash": "0e61e84ef9ef69f97815a33228cd3c62"
},
"bdApi_subscriptionColumnUser.json": {
"hash": "f2cbca5cf10d34674a814f0e2f201d59"
"hash": "dc3715519f68c17ec36ba7a452c028ab"
},
"bdApi_subscriptionColumnUserNotification.json": {
"hash": "cd507424d986a96c97e3074a67735b2e"
"hash": "831852d30faf76b1ec6ab829f8d380c9"
},
"bdApi_subscriptionThreadPost.json": {
"hash": "b9d8eaf2d22b9858c0120a889b005197"
"hash": "68ff233d244acc2665ab14058a57be5e"
},
"bdApi_subscriptionUser.json": {
"hash": "3f4259d8dbc3e0a0a1c424af751faa4b"
"hash": "aa7af21bf3928b0132be4f2e244a876f"
},
"bdApi_subscriptionUserNotification.json": {
"hash": "f7ef9569354e95a851937d8a81c0d325"
"hash": "b57e64ccdd8cfa7692bcdd77b1dc3e0c"
},
"bdApi_tokenTTL.json": {
"hash": "5717f8abd434e3672265f1d6672f7668"
"hash": "8334129d2f01ebe9ee671c63687b194e"
},
"bdApi_userNotificationConversation.json": {
"hash": "b3ca1de80285f0b6b8fc467b95402865"
"hash": "66f2f642d10198a3c2b25101226c0be5"
}
}
1 change: 1 addition & 0 deletions _output/options/bdApi_authCodeTTL.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "30",
"relations": {
"bdApi": 100
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_cors.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "0",
"relations": {
"bdApi": 10
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_logRetentionDays.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "90",
"relations": {
"bdApi": 600
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_paramLimitDefault.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "20",
"relations": {
"bdApi": 500
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_paramLimitMax.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "100",
"relations": {
"bdApi": 510
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_paramPageMax.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "0",
"relations": {
"bdApi": 550
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_refreshTokenTTLDays.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "14",
"relations": {
"bdApi": 120
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_restrictAccess.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "0",
"relations": {
"bdApi": 10
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_subscriptionColumnThreadPost.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "Xfrocks\\Api\\Option\\ColumnOption",
"validation_method": "verifyTextboxOption",
"advanced": false,
"default_value": "",
"relations": {
"bdApi": 70
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_subscriptionColumnUser.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "Xfrocks\\Api\\Option\\ColumnOption",
"validation_method": "verifyTextboxOption",
"advanced": false,
"default_value": "",
"relations": {
"bdApi": 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "Xfrocks\\Api\\Option\\ColumnOption",
"validation_method": "verifyTextboxOption",
"advanced": false,
"default_value": "",
"relations": {
"bdApi": 65
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_subscriptionThreadPost.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "Xfrocks\\Api\\Option\\ColumnOption",
"validation_method": "verifyOnOffOption",
"advanced": false,
"default_value": "0",
"relations": {
"bdApi": 35
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_subscriptionUser.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "Xfrocks\\Api\\Option\\ColumnOption",
"validation_method": "verifyOnOffOption",
"advanced": false,
"default_value": "0",
"relations": {
"bdApi": 20
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_subscriptionUserNotification.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "Xfrocks\\Api\\Option\\ColumnOption",
"validation_method": "verifyOnOffOption",
"advanced": false,
"default_value": "0",
"relations": {
"bdApi": 25
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_tokenTTL.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "3600",
"relations": {
"bdApi": 110
Expand Down
1 change: 1 addition & 0 deletions _output/options/bdApi_userNotificationConversation.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sub_options": [],
"validation_class": "",
"validation_method": "",
"advanced": false,
"default_value": "1",
"relations": {
"bdApi": 30
Expand Down
8 changes: 4 additions & 4 deletions addon.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"legacy_addon_id": "bdApi",
"title": "[bd] API",
"description": "",
"version_id": 2000134,
"version_string": "2.0.1 Beta 4",
"version_id": 2020031,
"version_string": "2.2.0 Beta 1",
"dev": "",
"dev_url": "",
"faq_url": "",
"support_url": "",
"extra_urls": [],
"require": {
"XF": [
2010400,
"XenForo 2.1.4"
2020000,
"XenForo 2.2.0"
]
},
"icon": ""
Expand Down

0 comments on commit dc80d02

Please sign in to comment.