From 037be93292a23bef17ddfd87d639c7dfc68196fe Mon Sep 17 00:00:00 2001 From: TickTackk Date: Mon, 9 Jan 2023 23:09:06 +0530 Subject: [PATCH 01/10] Update year in LICENSE.md --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index d183806..d49159e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2022 TickTackk +Copyright (c) 2018-2023 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 From f1fb23a4adbc16c4f481e76daaba9a36df6e4bc2 Mon Sep 17 00:00:00 2001 From: TickTackk Date: Tue, 10 Jan 2023 20:38:16 +0530 Subject: [PATCH 02/10] Increase version --- addon.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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": "", From ff2fd0fdbbcd3846cd1fb3b54925629b446c9445 Mon Sep 17 00:00:00 2001 From: TickTackk Date: Tue, 10 Jan 2023 20:41:23 +0530 Subject: [PATCH 03/10] closes #94 --- CHANGELOG.md | 4 ++++ _output/phrases/permission.forum_changePostDate.txt | 2 +- _output/phrases/permission.forum_changePostOwner.txt | 2 +- _output/phrases/permission.forum_changeThreadDate.txt | 2 +- _output/phrases/permission.forum_changeThreadOwner.txt | 2 +- _output/phrases/permission.profilePost_changeCommentDate.txt | 2 +- _output/phrases/permission.profilePost_changeCommentOwner.txt | 2 +- .../phrases/permission.profilePost_changeProfilePostDate.txt | 2 +- .../phrases/permission.profilePost_changeProfilePostOwner.txt | 2 +- _output/phrases/permission.xfmg_changeAlbumDate.txt | 2 +- _output/phrases/permission.xfmg_changeAlbumOwner.txt | 2 +- _output/phrases/permission.xfmg_changeCommentDate.txt | 2 +- _output/phrases/permission.xfmg_changeCommentOwner.txt | 2 +- _output/phrases/permission.xfmg_changeMediaDate.txt | 2 +- _output/phrases/permission.xfmg_changeMediaOwner.txt | 2 +- 15 files changed, 18 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 352dd81..4622747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ CHANGELOG ========================== +## 2.0.16 (`2001670`) + +- **Change:** Change permission names to be consistent with that of XenForo itself (#94) + ## 2.0.15 (`2001570`) - **Fix:** Slow upgrade query causes timeouts on large boards (#92) diff --git a/_output/phrases/permission.forum_changePostDate.txt b/_output/phrases/permission.forum_changePostDate.txt index 35d515a..79e4d79 100644 --- a/_output/phrases/permission.forum_changePostDate.txt +++ b/_output/phrases/permission.forum_changePostDate.txt @@ -1 +1 @@ -Can change post date \ No newline at end of file +Change post date \ No newline at end of file diff --git a/_output/phrases/permission.forum_changePostOwner.txt b/_output/phrases/permission.forum_changePostOwner.txt index 375cbf7..4713745 100644 --- a/_output/phrases/permission.forum_changePostOwner.txt +++ b/_output/phrases/permission.forum_changePostOwner.txt @@ -1 +1 @@ -Can change post owner \ No newline at end of file +Change post owner \ No newline at end of file diff --git a/_output/phrases/permission.forum_changeThreadDate.txt b/_output/phrases/permission.forum_changeThreadDate.txt index 4d0ccd4..e8c662e 100644 --- a/_output/phrases/permission.forum_changeThreadDate.txt +++ b/_output/phrases/permission.forum_changeThreadDate.txt @@ -1 +1 @@ -Can change thread date \ No newline at end of file +Change thread date \ No newline at end of file diff --git a/_output/phrases/permission.forum_changeThreadOwner.txt b/_output/phrases/permission.forum_changeThreadOwner.txt index 03a2ea0..f899f02 100644 --- a/_output/phrases/permission.forum_changeThreadOwner.txt +++ b/_output/phrases/permission.forum_changeThreadOwner.txt @@ -1 +1 @@ -Can change thread owner \ No newline at end of file +Change thread owner \ No newline at end of file diff --git a/_output/phrases/permission.profilePost_changeCommentDate.txt b/_output/phrases/permission.profilePost_changeCommentDate.txt index a65d6fb..cd0192d 100644 --- a/_output/phrases/permission.profilePost_changeCommentDate.txt +++ b/_output/phrases/permission.profilePost_changeCommentDate.txt @@ -1 +1 @@ -Can change profile post comment date \ No newline at end of file +Change profile post comment date \ No newline at end of file diff --git a/_output/phrases/permission.profilePost_changeCommentOwner.txt b/_output/phrases/permission.profilePost_changeCommentOwner.txt index e9cd4ed..93e01bb 100644 --- a/_output/phrases/permission.profilePost_changeCommentOwner.txt +++ b/_output/phrases/permission.profilePost_changeCommentOwner.txt @@ -1 +1 @@ -Can change profile post comment owner \ No newline at end of file +Change profile post comment owner \ No newline at end of file diff --git a/_output/phrases/permission.profilePost_changeProfilePostDate.txt b/_output/phrases/permission.profilePost_changeProfilePostDate.txt index 9b46c0c..96ea991 100644 --- a/_output/phrases/permission.profilePost_changeProfilePostDate.txt +++ b/_output/phrases/permission.profilePost_changeProfilePostDate.txt @@ -1 +1 @@ -Can change profile post date \ No newline at end of file +Change profile post date \ No newline at end of file diff --git a/_output/phrases/permission.profilePost_changeProfilePostOwner.txt b/_output/phrases/permission.profilePost_changeProfilePostOwner.txt index f815cef..1fa3b65 100644 --- a/_output/phrases/permission.profilePost_changeProfilePostOwner.txt +++ b/_output/phrases/permission.profilePost_changeProfilePostOwner.txt @@ -1 +1 @@ -Can change profile post owner \ No newline at end of file +Change profile post owner \ No newline at end of file diff --git a/_output/phrases/permission.xfmg_changeAlbumDate.txt b/_output/phrases/permission.xfmg_changeAlbumDate.txt index 6757a06..4ce1c65 100644 --- a/_output/phrases/permission.xfmg_changeAlbumDate.txt +++ b/_output/phrases/permission.xfmg_changeAlbumDate.txt @@ -1 +1 @@ -Can change album date \ No newline at end of file +Change album date \ No newline at end of file diff --git a/_output/phrases/permission.xfmg_changeAlbumOwner.txt b/_output/phrases/permission.xfmg_changeAlbumOwner.txt index f2ddebd..ac3f71d 100644 --- a/_output/phrases/permission.xfmg_changeAlbumOwner.txt +++ b/_output/phrases/permission.xfmg_changeAlbumOwner.txt @@ -1 +1 @@ -Can change album owner \ No newline at end of file +Change album owner \ No newline at end of file diff --git a/_output/phrases/permission.xfmg_changeCommentDate.txt b/_output/phrases/permission.xfmg_changeCommentDate.txt index aefb967..6ccb44c 100644 --- a/_output/phrases/permission.xfmg_changeCommentDate.txt +++ b/_output/phrases/permission.xfmg_changeCommentDate.txt @@ -1 +1 @@ -Can change comment date \ No newline at end of file +Change comment date \ No newline at end of file diff --git a/_output/phrases/permission.xfmg_changeCommentOwner.txt b/_output/phrases/permission.xfmg_changeCommentOwner.txt index 9d3d292..e21df0c 100644 --- a/_output/phrases/permission.xfmg_changeCommentOwner.txt +++ b/_output/phrases/permission.xfmg_changeCommentOwner.txt @@ -1 +1 @@ -Can change comment owner \ No newline at end of file +Change comment owner \ No newline at end of file diff --git a/_output/phrases/permission.xfmg_changeMediaDate.txt b/_output/phrases/permission.xfmg_changeMediaDate.txt index 12c74fc..942713f 100644 --- a/_output/phrases/permission.xfmg_changeMediaDate.txt +++ b/_output/phrases/permission.xfmg_changeMediaDate.txt @@ -1 +1 @@ -Can change media date \ No newline at end of file +Change media date \ No newline at end of file diff --git a/_output/phrases/permission.xfmg_changeMediaOwner.txt b/_output/phrases/permission.xfmg_changeMediaOwner.txt index f7b79d9..d7eb593 100644 --- a/_output/phrases/permission.xfmg_changeMediaOwner.txt +++ b/_output/phrases/permission.xfmg_changeMediaOwner.txt @@ -1 +1 @@ -Can change media owner \ No newline at end of file +Change media owner \ No newline at end of file From 5dc8c23e0528bde01f8c1559af0fe173cd6a8753 Mon Sep 17 00:00:00 2001 From: TickTackk Date: Wed, 11 Jan 2023 19:34:29 +0530 Subject: [PATCH 04/10] Rebuild readme files --- README.md | 28 ++++++++++++++-------------- _dev/resource_description.html | 2 +- _dev/resource_description.txt | 28 ++++++++++++++-------------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index ef3d5c0..2879549 100644 --- a/README.md +++ b/README.md @@ -25,32 +25,32 @@ Permissions #### XFMG: Album moderator permissions -- Can change album owner -- Can change album date +- Change album owner +- Change album 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 -- Can change comment owner -- Can change comment date +- Change comment owner +- Change comment date #### Forum moderator permissions -- Can change thread owner -- Can change thread date -- Can change post owner -- Can change post date +- Change thread owner +- Change thread date +- Change post owner +- Change post date License ------- diff --git a/_dev/resource_description.html b/_dev/resource_description.html index f283842..da14a2b 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

  • PHP 7.1.0+

Options

Change content owner

NameDescription
Default time interval

Permissions

XFMG: Album moderator permissions

  • Can change album owner
  • Can change album 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

XFMG: Media moderator permissions

  • Can change media owner
  • Can change media date

XFMG: Comment moderator permissions

  • Can change comment owner
  • Can change comment date

Forum moderator permissions

  • Can change thread owner
  • Can change thread date
  • Can change post owner
  • Can change post date

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

  • PHP 7.1.0+

Options

Change content owner

NameDescription
Default time interval

Permissions

XFMG: Album moderator permissions

  • Change album owner
  • Change album date

Profile post moderator permissions

  • Change profile post owner
  • Change profile post date
  • Change profile post comment owner
  • Change profile post comment date

XFMG: Media moderator permissions

  • Change media owner
  • Change media date

XFMG: Comment moderator permissions

  • Change comment owner
  • Change comment date

Forum moderator permissions

  • Change thread owner
  • Change thread date
  • Change post owner
  • Change post date

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..23cc52f 100644 --- a/_dev/resource_description.txt +++ b/_dev/resource_description.txt @@ -19,32 +19,32 @@ This add-on allows you to change the owner of content or the timestamp content. [HEADING=1]Permissions[/HEADING] [HEADING=3]XFMG: Album moderator permissions[/HEADING] [LIST] -[*]Can change album owner -[*]Can change album date +[*]Change album owner +[*]Change album date [/LIST] [HEADING=3]Profile post moderator permissions[/HEADING] [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] [LIST] -[*]Can change media owner -[*]Can change media date +[*]Change media owner +[*]Change media date [/LIST] [HEADING=3]XFMG: Comment moderator permissions[/HEADING] [LIST] -[*]Can change comment owner -[*]Can change comment date +[*]Change comment owner +[*]Change comment date [/LIST] [HEADING=3]Forum moderator permissions[/HEADING] [LIST] -[*]Can change thread owner -[*]Can change thread date -[*]Can change post owner -[*]Can change post date +[*]Change thread owner +[*]Change thread date +[*]Change post owner +[*]Change post date [/LIST] [HEADING=1]License[/HEADING] 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 From 1304ac181c2ef04af09e5e90c1e1d974536ee33e Mon Sep 17 00:00:00 2001 From: TickTackk Date: Thu, 12 Jan 2023 23:32:22 +0530 Subject: [PATCH 05/10] Sync extension_hint.php --- _output/extension_hint.php | 1 + 1 file changed, 1 insertion(+) 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 @@ Date: Wed, 7 Aug 2024 12:18:28 +0530 Subject: [PATCH 06/10] closes #95 --- CHANGELOG.md | 1 + Setup.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4622747..48d1da9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG ## 2.0.16 (`2001670`) - **Change:** Change permission names to be consistent with that of XenForo itself (#94) +- **Fix:** `\[E_DEPRECATED\]` Use of "parent" in callables is deprecated (#95) ## 2.0.15 (`2001570`) 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(); From f8dbc2cba958504e070d857da7b24e46e3f7a572 Mon Sep 17 00:00:00 2001 From: TickTackk Date: Wed, 7 Aug 2024 12:36:17 +0530 Subject: [PATCH 07/10] closes #96 --- CHANGELOG.md | 1 + ControllerPlugin/Content.php | 1 + .../public/tckChangeContentOwner_post_edit.json | 2 +- ...eContentOwner_profile_post_comment_edit.json | 2 +- ...tckChangeContentOwner_profile_post_edit.json | 2 +- .../tckChangeContentOwner_thread_edit.json | 2 +- .../tckChangeContentOwner_xfmg_album_edit.json | 2 +- ...tckChangeContentOwner_xfmg_comment_edit.json | 2 +- .../tckChangeContentOwner_xfmg_media_edit.json | 2 +- .../public/tckChangeContentOwner_macros.html | 17 +++++++++-------- 10 files changed, 18 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48d1da9..5ee89eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 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) - **Fix:** `\[E_DEPRECATED\]` Use of "parent" in callables is deprecated (#95) ## 2.0.15 (`2001570`) diff --git a/ControllerPlugin/Content.php b/ControllerPlugin/Content.php index 9c7e66a..6d7342d 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')); } } } diff --git a/_output/template_modifications/public/tckChangeContentOwner_post_edit.json b/_output/template_modifications/public/tckChangeContentOwner_post_edit.json index a4d420b..c62dba7 100644 --- a/_output/template_modifications/public/tckChangeContentOwner_post_edit.json +++ b/_output/template_modifications/public/tckChangeContentOwner_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_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..e2a9f53 100644 --- a/_output/templates/public/tckChangeContentOwner_macros.html +++ b/_output/templates/public/tckChangeContentOwner_macros.html @@ -37,16 +37,17 @@ - - + - - + + @@ -251,11 +252,10 @@ - + - + @@ -266,7 +266,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 From 2aada9836b1e2085db534ce75658a91130034dc0 Mon Sep 17 00:00:00 2001 From: TickTackk Date: Wed, 7 Aug 2024 16:42:56 +0530 Subject: [PATCH 08/10] closes #97 --- CHANGELOG.md | 1 + ControllerPlugin/Content.php | 16 +- InlineMod/AbstractOwnerChangerAction.php | 16 +- .../public/tckChangeContentOwner_macros.html | 174 +----------------- ...geContentOwner_macros_change_date_row.less | 16 ++ 5 files changed, 49 insertions(+), 174 deletions(-) create mode 100644 _output/templates/public/tckChangeContentOwner_macros_change_date_row.less diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ee89eb..0f8f27f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG - **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`) diff --git a/ControllerPlugin/Content.php b/ControllerPlugin/Content.php index 6d7342d..1fbe404 100644 --- a/ControllerPlugin/Content.php +++ b/ControllerPlugin/Content.php @@ -164,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/_output/templates/public/tckChangeContentOwner_macros.html b/_output/templates/public/tckChangeContentOwner_macros.html index e2a9f53..3803f6f 100644 --- a/_output/templates/public/tckChangeContentOwner_macros.html +++ b/_output/templates/public/tckChangeContentOwner_macros.html @@ -46,178 +46,24 @@ + + + + - + -
-
- {{ 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 - -
-
+
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 From 827a7b3642fd85a86592886c9d99892d0f256f20 Mon Sep 17 00:00:00 2001 From: TickTackk Date: Wed, 7 Aug 2024 16:44:17 +0530 Subject: [PATCH 09/10] Update year in LICESNE.md --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index d49159e..77cb920 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2023 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 From 9007ad40e26af446484fe731428b7a4da871f525 Mon Sep 17 00:00:00 2001 From: TickTackk Date: Wed, 7 Aug 2024 16:45:04 +0530 Subject: [PATCH 10/10] Rebuild readme files --- README.md | 20 +++++++-------- _dev/resource_description.html | 2 +- _dev/resource_description.txt | 47 +++++++++++++++++----------------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 2879549..ae81562 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,12 @@ Options Permissions ----------- -#### XFMG: Album moderator permissions +#### Forum moderator permissions -- Change album owner -- Change album date +- Change thread owner +- Change thread date +- Change post owner +- Change post date #### Profile post moderator permissions @@ -40,18 +42,16 @@ Permissions - Change media owner - Change media date +#### XFMG: Album moderator permissions + +- Change album owner +- Change album date + #### XFMG: Comment moderator permissions - Change comment owner - Change comment date -#### Forum moderator permissions - -- Change thread owner -- Change thread date -- Change post owner -- Change post date - License ------- diff --git a/_dev/resource_description.html b/_dev/resource_description.html index da14a2b..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

  • PHP 7.1.0+

Options

Change content owner

NameDescription
Default time interval

Permissions

XFMG: Album moderator permissions

  • Change album owner
  • Change album date

Profile post moderator permissions

  • Change profile post owner
  • Change profile post date
  • Change profile post comment owner
  • Change profile post comment date

XFMG: Media moderator permissions

  • Change media owner
  • Change media date

XFMG: Comment moderator permissions

  • Change comment owner
  • Change comment date

Forum moderator permissions

  • Change thread owner
  • Change thread date
  • Change post owner
  • Change post date

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

  • PHP 7.1.0+

Options

Change content owner

NameDescription
Default time interval

Permissions

Forum moderator permissions

  • Change thread owner
  • Change thread date
  • Change post owner
  • Change post date

Profile post moderator permissions

  • Change profile post owner
  • Change profile post date
  • Change profile post comment owner
  • Change profile post comment date

XFMG: Media moderator permissions

  • Change media owner
  • Change media date

XFMG: Album moderator permissions

  • Change album owner
  • Change album date

XFMG: Comment moderator permissions

  • Change comment owner
  • Change comment date

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 23cc52f..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] -[*]Change album owner -[*]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] [*]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] [*]Change media owner [*]Change media date [/LIST] -[HEADING=3]XFMG: Comment moderator permissions[/HEADING] +[H4]XFMG: Album moderator permissions[/H4] [LIST] -[*]Change comment owner -[*]Change comment date +[*]Change album owner +[*]Change album date [/LIST] -[HEADING=3]Forum moderator permissions[/HEADING] +[H4]XFMG: Comment moderator permissions[/H4] [LIST] -[*]Change thread owner -[*]Change thread date -[*]Change post owner -[*]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