diff --git a/CHANGELOG.md b/CHANGELOG.md index 352dd81..0f8f27f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========================== +## 2.0.16 (`2001670`) + +- **Change:** Change permission names to be consistent with that of XenForo itself (#94) +- **Change:** When inline editing post, form row is not using full width (#96) +- **Change:** Switch to native HTML controls on both XF 2.2 and 2.3 (#97) +- **Fix:** `\[E_DEPRECATED\]` Use of "parent" in callables is deprecated (#95) + ## 2.0.15 (`2001570`) - **Fix:** Slow upgrade query causes timeouts on large boards (#92) diff --git a/ControllerPlugin/Content.php b/ControllerPlugin/Content.php index 9c7e66a..1fbe404 100644 --- a/ControllerPlugin/Content.php +++ b/ControllerPlugin/Content.php @@ -89,6 +89,7 @@ public function extendContentEditAction(AbstractReply $reply, string $contentPar { $handler = $content->getChangeOwnerHandler(true); $reply->setParam('changeOwnerHandler', $handler); + $reply->setParam('tckCCO_fullWidth', $this->filter('_xfWithData', 'bool')); } } } @@ -163,11 +164,17 @@ protected function setNewOwnerDateTimeAndInterval(AbstractService $service, Cont $changeTime = $this->filter('change_time', 'bool'); if ($changeTime) { - $service->setNewTime($filterArray('new_time', [ - 'hour' => 'int', - 'minute' => 'int', - 'second' => 'int' - ])); + $newTimeArr = ['hour' => null, 'minute' => null, 'second' => null]; // fallback + $newTimeStr = $this->filter('new_time', 'str'); + if (substr_count($newTimeStr, ':') === 2) + { + [$hour, $minute, $second] = explode(':', $newTimeStr); + $newTimeArr['hour'] = (int) $hour; + $newTimeArr['minute'] = (int) $minute; + $newTimeArr['second'] = (int) $second; + } + + $service->setNewTime($newTimeArr); } $applyTimeInterval = $this->filter('apply_time_interval', 'bool'); diff --git a/InlineMod/AbstractOwnerChangerAction.php b/InlineMod/AbstractOwnerChangerAction.php index 4b26b3d..9f009ad 100644 --- a/InlineMod/AbstractOwnerChangerAction.php +++ b/InlineMod/AbstractOwnerChangerAction.php @@ -223,11 +223,17 @@ public function getFormOptions(AbstractCollection $entities, Request $request) : 'day' => null ]; } - $options['new_time'] = $filterArray('new_time', [ - 'hour' => 'int', - 'minute' => 'int', - 'second' => 'int' - ]); + + $options['new_time'] = ['hour' => null, 'minute' => null, 'second' => null]; // fallback + $newTimeStr = $request->filter('new_time', 'str'); + if (substr_count($newTimeStr, ':') === 2) + { + [$hour, $minute, $second] = explode(':', $newTimeStr); + $options['new_time']['hour'] = (int) $hour; + $options['new_time']['minute'] = (int) $minute; + $options['new_time']['second'] = (int) $second; + } + $options['time_interval'] = $filterArray('time_interval', [ 'hour' => 'int', 'minute' => 'int', diff --git a/LICENSE.md b/LICENSE.md index d183806..77cb920 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2022 TickTackk +Copyright (c) 2018-2024 TickTackk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index ef3d5c0..ae81562 100644 --- a/README.md +++ b/README.md @@ -23,34 +23,34 @@ Options Permissions ----------- -#### XFMG: Album moderator permissions +#### Forum moderator permissions -- Can change album owner -- Can change album date +- Change thread owner +- Change thread date +- Change post owner +- Change post date #### Profile post moderator permissions -- Can change profile post owner -- Can change profile post date -- Can change profile post comment owner -- Can change profile post comment date +- Change profile post owner +- Change profile post date +- Change profile post comment owner +- Change profile post comment date #### XFMG: Media moderator permissions -- Can change media owner -- Can change media date +- Change media owner +- Change media date -#### XFMG: Comment moderator permissions +#### XFMG: Album moderator permissions -- Can change comment owner -- Can change comment date +- Change album owner +- Change album date -#### Forum moderator permissions +#### XFMG: Comment moderator permissions -- Can change thread owner -- Can change thread date -- Can change post owner -- Can change post date +- Change comment owner +- Change comment date License ------- diff --git a/Setup.php b/Setup.php index a8a5ed8..1bc37f3 100644 --- a/Setup.php +++ b/Setup.php @@ -748,9 +748,9 @@ protected function jobManager() : JobManager */ protected function app() : BaseApp { - if (!\is_callable('parent::app')) + if (method_exists(get_parent_class($this), 'app')) { - return $this->app; + return parent::app(); } return parent::app(); diff --git a/_dev/resource_description.html b/_dev/resource_description.html index f283842..4d47003 100644 --- a/_dev/resource_description.html +++ b/_dev/resource_description.html @@ -1,2 +1,2 @@ -

Change Content Owner or Date for XenForo 2.0.10+

Description

This add-on allows you to change the owner of content or the timestamp content.

Requirements

Options

Change content owner

NameDescription
Default time interval

Permissions

XFMG: Album moderator permissions

Profile post moderator permissions

XFMG: Media moderator permissions

XFMG: Comment moderator permissions

Forum moderator permissions

License

+

Change Content Owner or Date for XenForo 2.0.10+

Description

This add-on allows you to change the owner of content or the timestamp content.

Requirements

Options

Change content owner

NameDescription
Default time interval

Permissions

Forum moderator permissions

Profile post moderator permissions

XFMG: Media moderator permissions

XFMG: Album moderator permissions

XFMG: Comment moderator permissions

License

This project is licensed under the MIT License - see the LICENSE.md file for details. \ No newline at end of file diff --git a/_dev/resource_description.txt b/_dev/resource_description.txt index c74f621..28a611e 100644 --- a/_dev/resource_description.txt +++ b/_dev/resource_description.txt @@ -1,50 +1,49 @@ -[HEADING=1]Change Content Owner or Date for XenForo 2.0.10+[/HEADING] -[HEADING=1]Description[/HEADING] +[H1]Change Content Owner or Date for XenForo 2.0.10+[/H1] +[H2]Description[/H2] This add-on allows you to change the owner of content or the timestamp content. -[HEADING=1]Requirements[/HEADING] +[H2]Requirements[/H2] [LIST] [*]PHP 7.1.0+ [/LIST] -[HEADING=1]Options[/HEADING] -[HEADING=3]Change content owner[/HEADING] -[TABLE] +[H2]Options[/H2] +[H4]Change content owner[/H4] +[TABLE width="100%"] [TR] -[TH]Name[/TH] -[TH]Description[/TH] +[th]Name[/th][th]Description[/th] [/TR] [TR] -[TD]Default time interval[/TD] +[td]Default time interval[/td] [/TR] [/TABLE] -[HEADING=1]Permissions[/HEADING] -[HEADING=3]XFMG: Album moderator permissions[/HEADING] +[H2]Permissions[/H2] +[H4]Forum moderator permissions[/H4] [LIST] -[*]Can change album owner -[*]Can change album date +[*]Change thread owner +[*]Change thread date +[*]Change post owner +[*]Change post date [/LIST] -[HEADING=3]Profile post moderator permissions[/HEADING] +[H4]Profile post moderator permissions[/H4] [LIST] -[*]Can change profile post owner -[*]Can change profile post date -[*]Can change profile post comment owner -[*]Can change profile post comment date +[*]Change profile post owner +[*]Change profile post date +[*]Change profile post comment owner +[*]Change profile post comment date [/LIST] -[HEADING=3]XFMG: Media moderator permissions[/HEADING] +[H4]XFMG: Media moderator permissions[/H4] [LIST] -[*]Can change media owner -[*]Can change media date +[*]Change media owner +[*]Change media date [/LIST] -[HEADING=3]XFMG: Comment moderator permissions[/HEADING] +[H4]XFMG: Album moderator permissions[/H4] [LIST] -[*]Can change comment owner -[*]Can change comment date +[*]Change album owner +[*]Change album date [/LIST] -[HEADING=3]Forum moderator permissions[/HEADING] +[H4]XFMG: Comment moderator permissions[/H4] [LIST] -[*]Can change thread owner -[*]Can change thread date -[*]Can change post owner -[*]Can change post date +[*]Change comment owner +[*]Change comment date [/LIST] -[HEADING=1]License[/HEADING] +[H2]License[/H2] This project is licensed under the MIT License - see the [URL='https://github.com/ticktackk/ChangeContentOwnerForXF2/blob/master/LICENSE.md']LICENSE.md[/URL] file for details. \ No newline at end of file diff --git a/_output/extension_hint.php b/_output/extension_hint.php index d25c967..6c7dbc6 100644 --- a/_output/extension_hint.php +++ b/_output/extension_hint.php @@ -1,5 +1,6 @@ .*?<\\/xf:if>#si", - "replace": "$0\n\n" + "replace": "$0\n\n" } \ No newline at end of file diff --git a/_output/template_modifications/public/tckChangeContentOwner_profile_post_comment_edit.json b/_output/template_modifications/public/tckChangeContentOwner_profile_post_comment_edit.json index 41cce62..07da345 100644 --- a/_output/template_modifications/public/tckChangeContentOwner_profile_post_comment_edit.json +++ b/_output/template_modifications/public/tckChangeContentOwner_profile_post_comment_edit.json @@ -5,5 +5,5 @@ "enabled": true, "action": "preg_replace", "find": "#.*?<\\/xf:if>#si", - "replace": "$0\n\n" + "replace": "$0\n\n" } \ No newline at end of file diff --git a/_output/template_modifications/public/tckChangeContentOwner_profile_post_edit.json b/_output/template_modifications/public/tckChangeContentOwner_profile_post_edit.json index 32026f1..4566a24 100644 --- a/_output/template_modifications/public/tckChangeContentOwner_profile_post_edit.json +++ b/_output/template_modifications/public/tckChangeContentOwner_profile_post_edit.json @@ -5,5 +5,5 @@ "enabled": true, "action": "preg_replace", "find": "#.*?<\\/xf:if>#si", - "replace": "$0\n\n" + "replace": "$0\n\n" } \ No newline at end of file diff --git a/_output/template_modifications/public/tckChangeContentOwner_thread_edit.json b/_output/template_modifications/public/tckChangeContentOwner_thread_edit.json index 8ca9269..354563f 100644 --- a/_output/template_modifications/public/tckChangeContentOwner_thread_edit.json +++ b/_output/template_modifications/public/tckChangeContentOwner_thread_edit.json @@ -5,5 +5,5 @@ "enabled": true, "action": "preg_replace", "find": "##si", - "replace": "$0\n\n" + "replace": "$0\n\n" } \ No newline at end of file diff --git a/_output/template_modifications/public/tckChangeContentOwner_xfmg_album_edit.json b/_output/template_modifications/public/tckChangeContentOwner_xfmg_album_edit.json index 2437bf3..e28ff11 100644 --- a/_output/template_modifications/public/tckChangeContentOwner_xfmg_album_edit.json +++ b/_output/template_modifications/public/tckChangeContentOwner_xfmg_album_edit.json @@ -5,5 +5,5 @@ "enabled": true, "action": "preg_replace", "find": "#.*?<\\/xf:if>#si", - "replace": "$0\n\n" + "replace": "$0\n\n" } \ No newline at end of file diff --git a/_output/template_modifications/public/tckChangeContentOwner_xfmg_comment_edit.json b/_output/template_modifications/public/tckChangeContentOwner_xfmg_comment_edit.json index 15bb12c..404d5fc 100644 --- a/_output/template_modifications/public/tckChangeContentOwner_xfmg_comment_edit.json +++ b/_output/template_modifications/public/tckChangeContentOwner_xfmg_comment_edit.json @@ -5,5 +5,5 @@ "enabled": true, "action": "preg_replace", "find": "#.*?<\\/xf:if>#si", - "replace": "$0\n\n" + "replace": "$0\n\n" } \ No newline at end of file diff --git a/_output/template_modifications/public/tckChangeContentOwner_xfmg_media_edit.json b/_output/template_modifications/public/tckChangeContentOwner_xfmg_media_edit.json index 8bb8f64..e332cd1 100644 --- a/_output/template_modifications/public/tckChangeContentOwner_xfmg_media_edit.json +++ b/_output/template_modifications/public/tckChangeContentOwner_xfmg_media_edit.json @@ -5,5 +5,5 @@ "enabled": true, "action": "preg_replace", "find": "#.*?<\\/xf:if>#si", - "replace": "$0\n\n" + "replace": "$0\n\n" } \ No newline at end of file diff --git a/_output/templates/public/tckChangeContentOwner_macros.html b/_output/templates/public/tckChangeContentOwner_macros.html index 118e9e6..3803f6f 100644 --- a/_output/templates/public/tckChangeContentOwner_macros.html +++ b/_output/templates/public/tckChangeContentOwner_macros.html @@ -37,186 +37,33 @@ - - + - - + + + + + + - + -
-
- {{ phrase('tckChangeContentOwner_units_hour:') }} - - 0 {{ phrase('(midnight)') }} - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 {{ phrase('(noon)') }} - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - -
- -
- {{ phrase('tckChangeContentOwner_units_minute:') }} - - 00 - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - -
- -
- {{ phrase('tckChangeContentOwner_units_second:') }} - - 00 - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - -
-
+
@@ -251,11 +98,10 @@
- + - + @@ -266,7 +112,8 @@ name="change_date_row" arg-contentDate="{{ $contentDate.year . '-' . $contentDate.month . '-' . $contentDate.day }}" arg-contentTime="{{ $contentTime }}" - arg-showApplyTimeInterval="{{ $showApplyTimeInterval }}"/> + arg-showApplyTimeInterval="{{ $showApplyTimeInterval }}" + arg-fullWidth="{$fullWidth}" /> \ No newline at end of file diff --git a/_output/templates/public/tckChangeContentOwner_macros_change_date_row.less b/_output/templates/public/tckChangeContentOwner_macros_change_date_row.less new file mode 100644 index 0000000..b996bf7 --- /dev/null +++ b/_output/templates/public/tckChangeContentOwner_macros_change_date_row.less @@ -0,0 +1,16 @@ +.input +{ + &.input--date, + &.input--time + { + height: 2.4em; + max-width: @_input-dateInputWidth; + position: relative; + + &::-webkit-calendar-picker-indicator + { + right: @xf-paddingMedium; + position: absolute; + } + } +} \ No newline at end of file diff --git a/addon.json b/addon.json index d8e5c28..eaa8c1e 100644 --- a/addon.json +++ b/addon.json @@ -2,8 +2,8 @@ "legacy_addon_id": "", "title": "Change Content Owner or Date", "description": "This add-on allows you to change the owner of content or the timestamp content.", - "version_id": 2001570, - "version_string": "2.0.15", + "version_id": 2001670, + "version_string": "2.0.16", "dev": "TickTackk", "dev_url": "https://xenforo.com/community/members/90375/", "faq_url": "",