From ea42130c407455a03dc24c19bdcc23ca4d7513c2 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 12 Apr 2016 15:40:46 +0200 Subject: [PATCH] Overhauled dashboard boxes --- com.woltlab.wcf/box.xml | 150 ++++++++++++++++++ com.woltlab.wcf/dashboardBox.xml | 79 --------- com.woltlab.wcf/objectType.xml | 14 -- com.woltlab.wcf/package.xml | 1 - ...ineSidebar.tpl => boxFollowingsOnline.tpl} | 0 ...veMembers.tpl => boxMostActiveMembers.tpl} | 2 +- ...kedMembers.tpl => boxMostLikedMembers.tpl} | 0 ...NewestMembers.tpl => boxNewestMembers.tpl} | 2 +- .../templates/boxPaidSubscriptions.tpl | 26 +++ ...ar.tpl => boxPaidSubscriptionsSidebar.tpl} | 2 +- .../templates/boxRegisterButton.tpl | 1 + com.woltlab.wcf/templates/boxSignedInAs.tpl | 21 +++ ...ffOnlineSidebar.tpl => boxStaffOnline.tpl} | 0 com.woltlab.wcf/templates/boxStatistics.tpl | 11 ++ ...ysBirthdays.tpl => boxTodaysBirthdays.tpl} | 0 ...ys.tpl => boxTodaysFollowingBirthdays.tpl} | 0 com.woltlab.wcf/templates/boxUsersOnline.tpl | 26 +++ ...eSidebar.tpl => boxUsersOnlineSidebar.tpl} | 0 .../dashboardBoxPaidSubscriptions.tpl | 30 ---- .../templates/dashboardBoxRecentActivity.tpl | 33 ---- .../dashboardBoxRecentActivitySidebar.tpl | 15 -- .../templates/dashboardBoxRegisterButton.tpl | 5 - .../templates/dashboardBoxSignedInAs.tpl | 25 --- .../templates/dashboardBoxStatsSidebar.tpl | 11 -- .../FollowingsOnlineBoxController.class.php | 48 ++++++ .../MostActiveMembersBoxController.class.php | 73 +++++++++ .../MostLikedMembersBoxController.class.php | 73 +++++++++ .../box/NewestMembersBoxController.class.php | 73 +++++++++ .../PaidSubscriptionsBoxController.class.php | 92 +++++++++++ .../box/RegisterButtonBoxController.class.php | 36 +++++ .../box/SignedInAsBoxController.class.php | 29 ++++ .../box/StaffOnlineBoxController.class.php | 47 ++++++ .../box/StatisticsBoxController.class.php | 39 +++++ .../TodaysBirthdaysBoxController.class.php} | 63 ++++---- ...sFollowingBirthdaysBoxController.class.php | 34 ++++ .../box/UsersOnlineBoxController.class.php | 71 +++++++++ ...lowingsOnlineSidebarDashboardBox.class.php | 54 ------- .../MostActiveMembersDashboardBox.class.php | 61 ------- .../MostLikedMembersDashboardBox.class.php | 62 -------- .../box/NewestMembersDashboardBox.class.php | 61 ------- .../PaidSubscriptionsDashboardBox.class.php | 75 --------- ...SubscriptionsSidebarDashboardBox.class.php | 75 --------- .../box/RecentActivityDashboardBox.class.php | 86 ---------- ...ecentActivitySidebarDashboardBox.class.php | 56 ------- .../box/RegisterButtonDashboardBox.class.php | 27 ---- .../box/SignedInAsDashboardBox.class.php | 27 ---- .../StaffOnlineSidebarDashboardBox.class.php | 53 ------- .../box/StatsSidebarDashboardBox.class.php | 46 ------ ...ysFollowingBirthdaysDashboardBox.class.php | 72 --------- .../UsersOnlineSidebarDashboardBox.class.php | 57 ------- wcfsetup/install/lang/de.xml | 27 +--- wcfsetup/install/lang/en.xml | 27 +--- 52 files changed, 893 insertions(+), 1105 deletions(-) delete mode 100644 com.woltlab.wcf/dashboardBox.xml rename com.woltlab.wcf/templates/{dashboardBoxFollowingsOnlineSidebar.tpl => boxFollowingsOnline.tpl} (100%) rename com.woltlab.wcf/templates/{dashboardBoxMostActiveMembers.tpl => boxMostActiveMembers.tpl} (98%) rename com.woltlab.wcf/templates/{dashboardBoxMostLikedMembers.tpl => boxMostLikedMembers.tpl} (100%) rename com.woltlab.wcf/templates/{dashboardBoxNewestMembers.tpl => boxNewestMembers.tpl} (98%) create mode 100644 com.woltlab.wcf/templates/boxPaidSubscriptions.tpl rename com.woltlab.wcf/templates/{dashboardBoxPaidSubscriptionsSidebar.tpl => boxPaidSubscriptionsSidebar.tpl} (98%) create mode 100644 com.woltlab.wcf/templates/boxRegisterButton.tpl create mode 100644 com.woltlab.wcf/templates/boxSignedInAs.tpl rename com.woltlab.wcf/templates/{dashboardBoxStaffOnlineSidebar.tpl => boxStaffOnline.tpl} (100%) create mode 100644 com.woltlab.wcf/templates/boxStatistics.tpl rename com.woltlab.wcf/templates/{dashboardBoxTodaysBirthdays.tpl => boxTodaysBirthdays.tpl} (100%) rename com.woltlab.wcf/templates/{dashboardBoxTodaysFollowingBirthdays.tpl => boxTodaysFollowingBirthdays.tpl} (100%) create mode 100644 com.woltlab.wcf/templates/boxUsersOnline.tpl rename com.woltlab.wcf/templates/{dashboardBoxUsersOnlineSidebar.tpl => boxUsersOnlineSidebar.tpl} (100%) delete mode 100644 com.woltlab.wcf/templates/dashboardBoxPaidSubscriptions.tpl delete mode 100644 com.woltlab.wcf/templates/dashboardBoxRecentActivity.tpl delete mode 100644 com.woltlab.wcf/templates/dashboardBoxRecentActivitySidebar.tpl delete mode 100644 com.woltlab.wcf/templates/dashboardBoxRegisterButton.tpl delete mode 100644 com.woltlab.wcf/templates/dashboardBoxSignedInAs.tpl delete mode 100644 com.woltlab.wcf/templates/dashboardBoxStatsSidebar.tpl create mode 100644 wcfsetup/install/files/lib/system/box/FollowingsOnlineBoxController.class.php create mode 100644 wcfsetup/install/files/lib/system/box/MostActiveMembersBoxController.class.php create mode 100644 wcfsetup/install/files/lib/system/box/MostLikedMembersBoxController.class.php create mode 100644 wcfsetup/install/files/lib/system/box/NewestMembersBoxController.class.php create mode 100644 wcfsetup/install/files/lib/system/box/PaidSubscriptionsBoxController.class.php create mode 100644 wcfsetup/install/files/lib/system/box/RegisterButtonBoxController.class.php create mode 100644 wcfsetup/install/files/lib/system/box/SignedInAsBoxController.class.php create mode 100644 wcfsetup/install/files/lib/system/box/StaffOnlineBoxController.class.php create mode 100644 wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php rename wcfsetup/install/files/lib/system/{dashboard/box/TodaysBirthdaysDashboardBox.class.php => box/TodaysBirthdaysBoxController.class.php} (58%) create mode 100644 wcfsetup/install/files/lib/system/box/TodaysFollowingBirthdaysBoxController.class.php create mode 100644 wcfsetup/install/files/lib/system/box/UsersOnlineBoxController.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/FollowingsOnlineSidebarDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/MostActiveMembersDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/MostLikedMembersDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/NewestMembersDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/PaidSubscriptionsDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/PaidSubscriptionsSidebarDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/RecentActivityDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/RecentActivitySidebarDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/RegisterButtonDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/SignedInAsDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/StaffOnlineSidebarDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/StatsSidebarDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/TodaysFollowingBirthdaysDashboardBox.class.php delete mode 100644 wcfsetup/install/files/lib/system/dashboard/box/UsersOnlineSidebarDashboardBox.class.php diff --git a/com.woltlab.wcf/box.xml b/com.woltlab.wcf/box.xml index 5d7c6c3a01..c7c840ef35 100644 --- a/com.woltlab.wcf/box.xml +++ b/com.woltlab.wcf/box.xml @@ -26,5 +26,155 @@ com.woltlab.wcf.Dashboard + + + Bezahlte Mitgliedschaften + Paid Subscriptions + system + wcf\system\box\PaidSubscriptionsBoxController + contentBottom + 1 + 0 + + + + Bezahlte Mitgliedschaften (Sidebar) + Paid Subscriptions (Sidebar) + system + wcf\system\box\PaidSubscriptionsBoxController + sidebarRight + 1 + 0 + + + + Registrierungs-Button + Register Button + system + wcf\system\box\RegisterButtonBoxController + sidebarRight + 0 + 0 + + + com.woltlab.wcf.Dashboard + + + + + Angemeldet als + Signed In As + system + wcf\system\box\SignedInAsBoxController + sidebarRight + 0 + 0 + + com.woltlab.wcf.Dashboard + + + + + Statistiken + Statistics + system + wcf\system\box\StatisticsBoxController + sidebarRight + 1 + 0 + + com.woltlab.wcf.Dashboard + + + + + Neueste Mitglieder + Newest Members + system + wcf\system\box\NewestMembersBoxController + sidebarRight + 1 + 0 + + + + Aktivste Mitglieder + Most Active Members + system + wcf\system\box\MostActiveMembersBoxController + sidebarRight + 1 + 0 + + + + Mitglieder mit den meisten Likes + Most Liked Members + system + wcf\system\box\MostLikedMembersBoxController + sidebarRight + 1 + 0 + + + + Heutige Geburtstage + Today’s Birthdays + system + wcf\system\box\TodaysBirthdaysBoxController + sidebarRight + 1 + 0 + + + + Heutige Geburtstage von Nutzern, denen der Nutzer folgt + Today’s Birthdays of Users the User Follows + system + wcf\system\box\TodaysFollowingBirthdaysBoxController + sidebarRight + 1 + 0 + + + + Benutzer online + Users Online + system + wcf\system\box\UsersOnlineBoxController + footerBoxes + 1 + 0 + + + + Benutzer online (Sidebar) + Users Online (Sidebar) + system + wcf\system\box\UsersOnlineBoxController + sidebarRight + 1 + 0 + + + + Team-Mitglieder online + Staff-Members Online + system + wcf\system\box\StaffOnlineBoxController + sidebarRight + 1 + 0 + + + + Benutzer online, denen der Nutzer folgt + Users Online the User Follows + system + wcf\system\box\FollowingsBoxController + sidebarRight + 1 + 0 + diff --git a/com.woltlab.wcf/dashboardBox.xml b/com.woltlab.wcf/dashboardBox.xml deleted file mode 100644 index f4ce0c6f46..0000000000 --- a/com.woltlab.wcf/dashboardBox.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - content - - - - - content - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - - - sidebar - - - diff --git a/com.woltlab.wcf/objectType.xml b/com.woltlab.wcf/objectType.xml index e47ba5c281..e25eef0851 100644 --- a/com.woltlab.wcf/objectType.xml +++ b/com.woltlab.wcf/objectType.xml @@ -43,20 +43,6 @@ - - com.woltlab.wcf.user.DashboardPage - com.woltlab.wcf.user.dashboardContainer - 1 - 1 - - - - com.woltlab.wcf.user.MembersListPage - com.woltlab.wcf.user.dashboardContainer - 0 - 1 - - com.woltlab.wcf.user com.woltlab.wcf.moderation.report diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 9b6d1e5f6e..d8b9290b33 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -33,7 +33,6 @@ - diff --git a/com.woltlab.wcf/templates/dashboardBoxFollowingsOnlineSidebar.tpl b/com.woltlab.wcf/templates/boxFollowingsOnline.tpl similarity index 100% rename from com.woltlab.wcf/templates/dashboardBoxFollowingsOnlineSidebar.tpl rename to com.woltlab.wcf/templates/boxFollowingsOnline.tpl diff --git a/com.woltlab.wcf/templates/dashboardBoxMostActiveMembers.tpl b/com.woltlab.wcf/templates/boxMostActiveMembers.tpl similarity index 98% rename from com.woltlab.wcf/templates/dashboardBoxMostActiveMembers.tpl rename to com.woltlab.wcf/templates/boxMostActiveMembers.tpl index 7f9fcb3561..6bed38c24b 100644 --- a/com.woltlab.wcf/templates/dashboardBoxMostActiveMembers.tpl +++ b/com.woltlab.wcf/templates/boxMostActiveMembers.tpl @@ -9,4 +9,4 @@ {/foreach} - \ No newline at end of file + diff --git a/com.woltlab.wcf/templates/dashboardBoxMostLikedMembers.tpl b/com.woltlab.wcf/templates/boxMostLikedMembers.tpl similarity index 100% rename from com.woltlab.wcf/templates/dashboardBoxMostLikedMembers.tpl rename to com.woltlab.wcf/templates/boxMostLikedMembers.tpl diff --git a/com.woltlab.wcf/templates/dashboardBoxNewestMembers.tpl b/com.woltlab.wcf/templates/boxNewestMembers.tpl similarity index 98% rename from com.woltlab.wcf/templates/dashboardBoxNewestMembers.tpl rename to com.woltlab.wcf/templates/boxNewestMembers.tpl index 15fdbd4a99..05670ef1c5 100644 --- a/com.woltlab.wcf/templates/dashboardBoxNewestMembers.tpl +++ b/com.woltlab.wcf/templates/boxNewestMembers.tpl @@ -9,4 +9,4 @@ {/foreach} - \ No newline at end of file + diff --git a/com.woltlab.wcf/templates/boxPaidSubscriptions.tpl b/com.woltlab.wcf/templates/boxPaidSubscriptions.tpl new file mode 100644 index 0000000000..e0c3591fa6 --- /dev/null +++ b/com.woltlab.wcf/templates/boxPaidSubscriptions.tpl @@ -0,0 +1,26 @@ +
    + {foreach from=$subscriptions item=subscription} +
  • +
    +

    {$subscription->title|language}

    + {lang}wcf.paidSubscription.formattedCost{/lang} +
    + + {if !PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION} +
    +
      + {foreach from=$subscription->getPurchaseButtons() item=button} +
    • {@$button}
    • + {/foreach} +
    +
    + {/if} +
  • + {/foreach} +
+ +{if PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION} + +{/if} \ No newline at end of file diff --git a/com.woltlab.wcf/templates/dashboardBoxPaidSubscriptionsSidebar.tpl b/com.woltlab.wcf/templates/boxPaidSubscriptionsSidebar.tpl similarity index 98% rename from com.woltlab.wcf/templates/dashboardBoxPaidSubscriptionsSidebar.tpl rename to com.woltlab.wcf/templates/boxPaidSubscriptionsSidebar.tpl index 4941e3c869..382abff26d 100644 --- a/com.woltlab.wcf/templates/dashboardBoxPaidSubscriptionsSidebar.tpl +++ b/com.woltlab.wcf/templates/boxPaidSubscriptionsSidebar.tpl @@ -3,7 +3,7 @@
  • {$subscription->title|language}

    - {lang}wcf.paidSubscription.formattedCost{/lang} + {lang}wcf.paidSubscription.formattedCost{/lang}
    {if !PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION} diff --git a/com.woltlab.wcf/templates/boxRegisterButton.tpl b/com.woltlab.wcf/templates/boxRegisterButton.tpl new file mode 100644 index 0000000000..7ff8547fea --- /dev/null +++ b/com.woltlab.wcf/templates/boxRegisterButton.tpl @@ -0,0 +1 @@ +{lang}wcf.user.button.registerNow{/lang} diff --git a/com.woltlab.wcf/templates/boxSignedInAs.tpl b/com.woltlab.wcf/templates/boxSignedInAs.tpl new file mode 100644 index 0000000000..fa0f7bed7a --- /dev/null +++ b/com.woltlab.wcf/templates/boxSignedInAs.tpl @@ -0,0 +1,21 @@ +
    + {@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(96)} + +
    +
    +

    {$__wcf->user->username}

    + {if MODULE_USER_RANK} + {if $__wcf->getUserProfileHandler()->getUserTitle()} +

    {$__wcf->getUserProfileHandler()->getUserTitle()}

    + {/if} + {if $__wcf->getUserProfileHandler()->getRank() && $__wcf->getUserProfileHandler()->getRank()->rankImage} +

    {@$__wcf->getUserProfileHandler()->getRank()->getImage()}

    + {/if} + {/if} +
    + +
    + {include file='userInformationStatistics' user=$__wcf->user} +
    +
    +
    \ No newline at end of file diff --git a/com.woltlab.wcf/templates/dashboardBoxStaffOnlineSidebar.tpl b/com.woltlab.wcf/templates/boxStaffOnline.tpl similarity index 100% rename from com.woltlab.wcf/templates/dashboardBoxStaffOnlineSidebar.tpl rename to com.woltlab.wcf/templates/boxStaffOnline.tpl diff --git a/com.woltlab.wcf/templates/boxStatistics.tpl b/com.woltlab.wcf/templates/boxStatistics.tpl new file mode 100644 index 0000000000..ff89e6c6c9 --- /dev/null +++ b/com.woltlab.wcf/templates/boxStatistics.tpl @@ -0,0 +1,11 @@ +
    +
    {lang}wcf.user.members{/lang}
    +
    {#$statistics[members]}
    + + {event name='stats'} + + {if $statistics[newestMember]} +
    {lang}wcf.user.newestMember{/lang}
    +
    {$statistics[newestMember]}
    + {/if} +
    diff --git a/com.woltlab.wcf/templates/dashboardBoxTodaysBirthdays.tpl b/com.woltlab.wcf/templates/boxTodaysBirthdays.tpl similarity index 100% rename from com.woltlab.wcf/templates/dashboardBoxTodaysBirthdays.tpl rename to com.woltlab.wcf/templates/boxTodaysBirthdays.tpl diff --git a/com.woltlab.wcf/templates/dashboardBoxTodaysFollowingBirthdays.tpl b/com.woltlab.wcf/templates/boxTodaysFollowingBirthdays.tpl similarity index 100% rename from com.woltlab.wcf/templates/dashboardBoxTodaysFollowingBirthdays.tpl rename to com.woltlab.wcf/templates/boxTodaysFollowingBirthdays.tpl diff --git a/com.woltlab.wcf/templates/boxUsersOnline.tpl b/com.woltlab.wcf/templates/boxUsersOnline.tpl new file mode 100644 index 0000000000..3299e48cb5 --- /dev/null +++ b/com.woltlab.wcf/templates/boxUsersOnline.tpl @@ -0,0 +1,26 @@ +
      +
    • {lang}wcf.user.usersOnline.detail{/lang}
    • + {if USERS_ONLINE_RECORD}
    • {lang}wcf.user.usersOnline.record{/lang}
    • {/if} +
    + +{if $usersOnlineList|count} + +{/if} + +{if USERS_ONLINE_ENABLE_LEGEND && $usersOnlineList->getUsersOnlineMarkings()|count} +
    +
    {lang}wcf.user.usersOnline.marking.legend{/lang}
    +
    +
      + {foreach from=$usersOnlineList->getUsersOnlineMarkings() item=usersOnlineMarking} +
    • {@$usersOnlineMarking}
    • + {/foreach} +
    +
    + +
    +{/if} diff --git a/com.woltlab.wcf/templates/dashboardBoxUsersOnlineSidebar.tpl b/com.woltlab.wcf/templates/boxUsersOnlineSidebar.tpl similarity index 100% rename from com.woltlab.wcf/templates/dashboardBoxUsersOnlineSidebar.tpl rename to com.woltlab.wcf/templates/boxUsersOnlineSidebar.tpl diff --git a/com.woltlab.wcf/templates/dashboardBoxPaidSubscriptions.tpl b/com.woltlab.wcf/templates/dashboardBoxPaidSubscriptions.tpl deleted file mode 100644 index e637f734ca..0000000000 --- a/com.woltlab.wcf/templates/dashboardBoxPaidSubscriptions.tpl +++ /dev/null @@ -1,30 +0,0 @@ -
    -

    {lang}wcf.dashboard.box.com.woltlab.wcf.paidSubscriptions{/lang}

    - -
      - {foreach from=$subscriptions item=subscription} -
    • -
      -

      {$subscription->title|language}

      - {lang}wcf.paidSubscription.formattedCost{/lang} -
      - - {if !PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION} -
      -
        - {foreach from=$subscription->getPurchaseButtons() item=button} -
      • {@$button}
      • - {/foreach} -
      -
      - {/if} -
    • - {/foreach} -
    - - {if PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION} - - {/if} -
    diff --git a/com.woltlab.wcf/templates/dashboardBoxRecentActivity.tpl b/com.woltlab.wcf/templates/dashboardBoxRecentActivity.tpl deleted file mode 100644 index 800835226e..0000000000 --- a/com.woltlab.wcf/templates/dashboardBoxRecentActivity.tpl +++ /dev/null @@ -1,33 +0,0 @@ -
    -
    -

    {lang}wcf.user.recentActivity{/lang}

    - - {if $canFilterByFollowedUsers}{*todo*} - - {/if} -
    - - {assign var='__events' value=$eventList->getObjects()} - {assign var='__lastEvent' value=$__events|end} -
      - {include file='recentActivityListItem'} -
    -
    - - diff --git a/com.woltlab.wcf/templates/dashboardBoxRecentActivitySidebar.tpl b/com.woltlab.wcf/templates/dashboardBoxRecentActivitySidebar.tpl deleted file mode 100644 index 704799d996..0000000000 --- a/com.woltlab.wcf/templates/dashboardBoxRecentActivitySidebar.tpl +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/com.woltlab.wcf/templates/dashboardBoxRegisterButton.tpl b/com.woltlab.wcf/templates/dashboardBoxRegisterButton.tpl deleted file mode 100644 index 177e993e6c..0000000000 --- a/com.woltlab.wcf/templates/dashboardBoxRegisterButton.tpl +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/com.woltlab.wcf/templates/dashboardBoxSignedInAs.tpl b/com.woltlab.wcf/templates/dashboardBoxSignedInAs.tpl deleted file mode 100644 index ec54617d2d..0000000000 --- a/com.woltlab.wcf/templates/dashboardBoxSignedInAs.tpl +++ /dev/null @@ -1,25 +0,0 @@ -
    -

    {lang}wcf.dashboard.box.{$box->boxName}{/lang}

    - -
    - {@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(96)} - -
    -
    -

    {$__wcf->user->username}

    - {if MODULE_USER_RANK} - {if $__wcf->getUserProfileHandler()->getUserTitle()} -

    {$__wcf->getUserProfileHandler()->getUserTitle()}

    - {/if} - {if $__wcf->getUserProfileHandler()->getRank() && $__wcf->getUserProfileHandler()->getRank()->rankImage} -

    {@$__wcf->getUserProfileHandler()->getRank()->getImage()}

    - {/if} - {/if} -
    - -
    - {include file='userInformationStatistics' user=$__wcf->user} -
    -
    -
    -
    \ No newline at end of file diff --git a/com.woltlab.wcf/templates/dashboardBoxStatsSidebar.tpl b/com.woltlab.wcf/templates/dashboardBoxStatsSidebar.tpl deleted file mode 100644 index 9c63dba45b..0000000000 --- a/com.woltlab.wcf/templates/dashboardBoxStatsSidebar.tpl +++ /dev/null @@ -1,11 +0,0 @@ -
    -
    {lang}wcf.user.members{/lang}
    -
    {#$dashboardStats[members]}
    - - {event name='stats'} - - {if $dashboardStats[newestMember]} -
    {lang}wcf.user.newestMember{/lang}
    -
    {$dashboardStats[newestMember]}
    - {/if} -
    \ No newline at end of file diff --git a/wcfsetup/install/files/lib/system/box/FollowingsOnlineBoxController.class.php b/wcfsetup/install/files/lib/system/box/FollowingsOnlineBoxController.class.php new file mode 100644 index 0000000000..e8717f8471 --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/FollowingsOnlineBoxController.class.php @@ -0,0 +1,48 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class FollowingsOnlineBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.user.followingsOnline'); // @todo + } + + /** + * @inheritDoc + */ + protected function loadContent() { + if (MODULE_USERS_ONLINE && WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList') && count(WCF::getUserProfileHandler()->getFollowingUsers())) { + $usersOnlineList = new UsersOnlineList(); + $usersOnlineList->getConditionBuilder()->add('session.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers())); + $usersOnlineList->sqlLimit = 10; + $usersOnlineList->readObjects(); + + if (count($usersOnlineList)) { + WCF::getTPL()->assign([ + 'usersOnlineList' => $usersOnlineList + ]); + + $this->content = WCF::getTPL()->fetch('boxFollowingsOnline'); + } + } + } +} diff --git a/wcfsetup/install/files/lib/system/box/MostActiveMembersBoxController.class.php b/wcfsetup/install/files/lib/system/box/MostActiveMembersBoxController.class.php new file mode 100644 index 0000000000..0d5dcb04b6 --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/MostActiveMembersBoxController.class.php @@ -0,0 +1,73 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class MostActiveMembersBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.page.mostActiveMembers'); // @todo + } + + /** + * @inheritDoc + */ + public function hasImage() { + if (MODULE_MEMBERS_LIST) { + return true; + } + + return false; + } + + /** + * @inheritDoc + */ + public function getLink() { + if (MODULE_MEMBERS_LIST) { + return LinkHandler::getInstance()->getLink('MembersList', [], 'sortField=activityPoints&sortOrder=DESC'); + } + + return ''; + } + + /** + * @inheritDoc + */ + protected function loadContent() { + // get ids + $mostActiveMemberIDs = MostActiveMembersCacheBuilder::getInstance()->getData(); + if (!empty($mostActiveMemberIDs)) { + UserProfileRuntimeCache::getInstance()->cacheObjectIDs($mostActiveMemberIDs); + + // get users + $mostActiveMembers = UserProfileRuntimeCache::getInstance()->getObjects($mostActiveMemberIDs); + DatabaseObject::sort($mostActiveMembers, 'activityPoints', 'DESC'); + + WCF::getTPL()->assign([ + 'mostActiveMembers' => $mostActiveMembers + ]); + $this->content = WCF::getTPL()->fetch('boxMostActiveMembers'); + } + } +} diff --git a/wcfsetup/install/files/lib/system/box/MostLikedMembersBoxController.class.php b/wcfsetup/install/files/lib/system/box/MostLikedMembersBoxController.class.php new file mode 100644 index 0000000000..b8b729ce90 --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/MostLikedMembersBoxController.class.php @@ -0,0 +1,73 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class MostLikedMembersBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.page.mostLikedMembers'); // @todo + } + + /** + * @inheritDoc + */ + public function hasImage() { + if (MODULE_MEMBERS_LIST) { + return true; + } + + return false; + } + + /** + * @inheritDoc + */ + public function getLink() { + if (MODULE_MEMBERS_LIST) { + return LinkHandler::getInstance()->getLink('MembersList', [], 'sortField=likesReceived&sortOrder=DESC');; + } + + return ''; + } + + /** + * @inheritDoc + */ + protected function loadContent() { + // get ids + $mostLikedMemberIDs = MostLikedMembersCacheBuilder::getInstance()->getData(); + if (!empty($mostLikedMemberIDs)) { + UserProfileRuntimeCache::getInstance()->cacheObjectIDs($mostLikedMemberIDs); + + // get users + $mostLikedMembers = UserProfileRuntimeCache::getInstance()->getObjects($mostLikedMemberIDs); + DatabaseObject::sort($mostLikedMembers, 'likesReceived', 'DESC'); + + WCF::getTPL()->assign([ + 'mostLikedMembers' => $mostLikedMembers + ]); + $this->content = WCF::getTPL()->fetch('boxMostLikedMembers'); + } + } +} diff --git a/wcfsetup/install/files/lib/system/box/NewestMembersBoxController.class.php b/wcfsetup/install/files/lib/system/box/NewestMembersBoxController.class.php new file mode 100644 index 0000000000..bf36324832 --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/NewestMembersBoxController.class.php @@ -0,0 +1,73 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class NewestMembersBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.page.newestMembers'); // @todo + } + + /** + * @inheritDoc + */ + public function hasImage() { + if (MODULE_MEMBERS_LIST) { + return true; + } + + return false; + } + + /** + * @inheritDoc + */ + public function getLink() { + if (MODULE_MEMBERS_LIST) { + return LinkHandler::getInstance()->getLink('MembersList', [], 'sortField=registrationDate&sortOrder=DESC'); + } + + return ''; + } + + /** + * @inheritDoc + */ + protected function loadContent() { + // get ids + $newestMemberIDs = NewestMembersCacheBuilder::getInstance()->getData(); + if (!empty($newestMemberIDs)) { + UserProfileRuntimeCache::getInstance()->cacheObjectIDs($newestMemberIDs); + + // get users + $newestMembers = UserProfileRuntimeCache::getInstance()->getObjects($newestMemberIDs); + DatabaseObject::sort($newestMembers, 'registrationDate', 'DESC'); + + WCF::getTPL()->assign([ + 'newestMembers' => $newestMembers + ]); + $this->content = WCF::getTPL()->fetch('boxNewestMembers'); + } + } +} diff --git a/wcfsetup/install/files/lib/system/box/PaidSubscriptionsBoxController.class.php b/wcfsetup/install/files/lib/system/box/PaidSubscriptionsBoxController.class.php new file mode 100644 index 0000000000..7afa636ab9 --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/PaidSubscriptionsBoxController.class.php @@ -0,0 +1,92 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class PaidSubscriptionsBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['contentTop', 'contentBottom', 'sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.user.menu.settings.paidSubscription'); + } + + /** + * @inheritDoc + */ + public function getLink() { + return LinkHandler::getInstance()->getLink('PaidSubscriptionList'); + } + + /** + * @inheritDoc + */ + public function hasLink() { + return true; + } + + /** + * @inheritDoc + */ + protected function loadContent() { + if (WCF::getUser()->userID && MODULE_PAID_SUBSCRIPTION) { + // get available subscriptions + $subscriptions = PaidSubscriptionCacheBuilder::getInstance()->getData(); + + // get purchased subscriptions + $userSubscriptionList = new PaidSubscriptionUserList(); + $userSubscriptionList->getConditionBuilder()->add('userID = ?', [WCF::getUser()->userID]); + $userSubscriptionList->getConditionBuilder()->add('isActive = ?', [1]); + $userSubscriptionList->readObjects(); + + // remove purchased subscriptions + foreach ($userSubscriptionList as $userSubscription) { + if (isset($subscriptions[$userSubscription->subscriptionID])) { + $userSubscription->setSubscription($subscriptions[$userSubscription->subscriptionID]); + unset($subscriptions[$userSubscription->subscriptionID]); + } + } + // remove excluded subscriptions + foreach ($userSubscriptionList as $userSubscription) { + if ($userSubscription->getSubscription()->excludedSubscriptionIDs) { + foreach (explode(',', $userSubscription->getSubscription()->excludedSubscriptionIDs) as $subscriptionID) { + if (isset($subscriptions[$subscriptionID])) unset($subscriptions[$subscriptionID]); + } + } + } + + if (!empty($this->subscriptions)) { + if ($this->getBox()->position == 'contentTop' || $this->getBox()->position == 'contentBottom') { + $templateName = 'boxPaidSubscriptions'; + } + else { + $templateName = 'boxPaidSubscriptionsSidebar'; + } + + WCF::getTPL()->assign([ + 'subscriptions' => $subscriptions + ]); + + $this->content = WCF::getTPL()->fetch($templateName); + } + + } + } +} diff --git a/wcfsetup/install/files/lib/system/box/RegisterButtonBoxController.class.php b/wcfsetup/install/files/lib/system/box/RegisterButtonBoxController.class.php new file mode 100644 index 0000000000..19ae0b0461 --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/RegisterButtonBoxController.class.php @@ -0,0 +1,36 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class RegisterButtonBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.user.register'); + } + + /** + * @inheritDoc + */ + protected function loadContent() { + if (!WCF::getUser()->userID && !REGISTER_DISABLED) { + $this->content = WCF::getTPL()->fetch('boxRegisterButton'); + } + } +} diff --git a/wcfsetup/install/files/lib/system/box/SignedInAsBoxController.class.php b/wcfsetup/install/files/lib/system/box/SignedInAsBoxController.class.php new file mode 100644 index 0000000000..264a029fec --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/SignedInAsBoxController.class.php @@ -0,0 +1,29 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class SignedInAsBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + protected function loadContent() { + if (WCF::getUser()->userID) { + $this->content = WCF::getTPL()->fetch('boxSignedInAs'); + } + } +} diff --git a/wcfsetup/install/files/lib/system/box/StaffOnlineBoxController.class.php b/wcfsetup/install/files/lib/system/box/StaffOnlineBoxController.class.php new file mode 100644 index 0000000000..6f66a6a9fe --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/StaffOnlineBoxController.class.php @@ -0,0 +1,47 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class StaffOnlineBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.user.staffOnline'); // @todo + } + + /** + * @inheritDoc + */ + protected function loadContent() { + if (MODULE_USERS_ONLINE && WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList')) { + $usersOnlineList = new UsersOnlineList(); + $usersOnlineList->getConditionBuilder()->add('session.userID IN (SELECT userID FROM wcf'.WCF_N.'_user_to_group WHERE groupID IN (SELECT groupID FROM wcf'.WCF_N.'_user_group WHERE showOnTeamPage = ?))', array(1)); + $usersOnlineList->readObjects(); + + if (count($usersOnlineList)) { + WCF::getTPL()->assign([ + 'usersOnlineList' => $usersOnlineList + ]); + + $this->content = WCF::getTPL()->fetch('boxStaffOnline'); + } + } + } +} diff --git a/wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php b/wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php new file mode 100644 index 0000000000..f7a57035e7 --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php @@ -0,0 +1,39 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class StatisticsBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.page.statistics'); // @todo + } + + /** + * @inheritDoc + */ + protected function loadContent() { + WCF::getTPL()->assign(array( + 'statistics' => UserStatsCacheBuilder::getInstance()->getData() + )); + + $this->content = WCF::getTPL()->fetch('boxStatistics'); + } +} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php b/wcfsetup/install/files/lib/system/box/TodaysBirthdaysBoxController.class.php similarity index 58% rename from wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php rename to wcfsetup/install/files/lib/system/box/TodaysBirthdaysBoxController.class.php index 36256735aa..e32e00966a 100644 --- a/wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php +++ b/wcfsetup/install/files/lib/system/box/TodaysBirthdaysBoxController.class.php @@ -1,8 +1,6 @@ * @package com.woltlab.wcf - * @subpackage system.dashboard.box + * @subpackage system.box * @category Community Framework */ -class TodaysBirthdaysDashboardBox extends AbstractSidebarDashboardBox { +class TodaysBirthdaysBoxController extends AbstractBoxController { /** - * user profiles - * @var UserProfile[] + * @inheritDoc */ - public $userProfiles = []; + protected $supportedPositions = ['sidebarLeft', 'sidebarRight']; /** - * @inheritDoc + * template name + * @var string */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); + protected $templateName = 'boxTodaysBirthdays'; + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.page.todaysBirthdays'); // @todo + } + + /** + * @inheritDoc + */ + protected function loadContent() { // get current date $currentDay = DateUtil::format(null, 'm-d'); $date = explode('-', DateUtil::format(null, 'Y-n-j')); // get user ids $userIDs = UserBirthdayCache::getInstance()->getBirthdays($date[1], $date[2]); + $this->filterUserIDs($userIDs); if (!empty($userIDs)) { $userOptions = UserOptionCacheBuilder::getInstance()->getData([], 'options'); if (isset($userOptions['birthday'])) { + /** @var UserOption $birthdayUserOption */ $birthdayUserOption = $userOptions['birthday']; $userProfiles = UserProfileRuntimeCache::getInstance()->getObjects($userIDs); + $visibleUserProfiles = []; $i = 0; foreach ($userProfiles as $userProfile) { @@ -53,27 +64,25 @@ class TodaysBirthdaysDashboardBox extends AbstractSidebarDashboardBox { $birthdayUserOption->setUser($userProfile->getDecoratedObject()); if (!$userProfile->isProtected() && $birthdayUserOption->isVisible() && substr($userProfile->birthday, 5) == $currentDay) { - $this->userProfiles[] = $userProfile; + $visibleUserProfiles[] = $userProfile; $i++; } } + + if (!empty($visibleUserProfiles)) { + WCF::getTPL()->assign([ + 'birthdayUserProfiles' => $visibleUserProfiles + ]); + $this->content = WCF::getTPL()->fetch($this->templateName); + } } } - - $this->fetched(); } /** - * @inheritDoc + * Filters given user ids. + * + * @param integer[] $userIDs */ - protected function render() { - if (empty($this->userProfiles)) { - return ''; - } - - WCF::getTPL()->assign([ - 'birthdayUserProfiles' => $this->userProfiles - ]); - return WCF::getTPL()->fetch('dashboardBoxTodaysBirthdays'); - } + protected function filterUserIDs(&$userIDs) {} } diff --git a/wcfsetup/install/files/lib/system/box/TodaysFollowingBirthdaysBoxController.class.php b/wcfsetup/install/files/lib/system/box/TodaysFollowingBirthdaysBoxController.class.php new file mode 100644 index 0000000000..f3e7999660 --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/TodaysFollowingBirthdaysBoxController.class.php @@ -0,0 +1,34 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class TodaysFollowingBirthdaysBoxController extends TodaysBirthdaysBoxController { + /** + * @inheritDoc + */ + protected $templateName = 'boxTodaysFollowingBirthdays'; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.page.todaysFollowingBirthdays'); // @todo + } + + /** + * @inheritDoc + */ + protected function filterUserIDs(&$userIDs) { + $userIDs = array_intersect($userIDs, WCF::getUserProfileHandler()->getFollowingUsers()); + } +} diff --git a/wcfsetup/install/files/lib/system/box/UsersOnlineBoxController.class.php b/wcfsetup/install/files/lib/system/box/UsersOnlineBoxController.class.php new file mode 100644 index 0000000000..bfb4281586 --- /dev/null +++ b/wcfsetup/install/files/lib/system/box/UsersOnlineBoxController.class.php @@ -0,0 +1,71 @@ + + * @package com.woltlab.wcf + * @subpackage system.box + * @category Community Framework + */ +class UsersOnlineBoxController extends AbstractBoxController { + /** + * @inheritDoc + */ + protected $supportedPositions = ['footerBoxes', 'sidebarLeft', 'sidebarRight']; + + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.user.usersOnline'); // @todo + } + + /** + * @inheritDoc + */ + public function getLink() { + return LinkHandler::getInstance()->getLink('UsersOnlineList'); + } + + /** + * @inheritDoc + */ + public function hasLink() { + return true; + } + + /** + * @inheritDoc + */ + protected function loadContent() { + if (MODULE_USERS_ONLINE && WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList')) { + $usersOnlineList = new UsersOnlineList(); + $usersOnlineList->readStats(); + $usersOnlineList->checkRecord(); + $usersOnlineList->getConditionBuilder()->add('session.userID IS NOT NULL'); + $usersOnlineList->readObjects(); + + if (count($usersOnlineList)) { + if ($this->getBox()->position == 'footerBoxes') { + $templateName = 'boxUsersOnline'; + } + else { + $templateName = 'boxUsersOnlineSidebar'; + } + + WCF::getTPL()->assign([ + 'usersOnlineList' => $usersOnlineList + ]); + + $this->content = WCF::getTPL()->fetch($templateName); + } + } + } +} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/FollowingsOnlineSidebarDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/FollowingsOnlineSidebarDashboardBox.class.php deleted file mode 100644 index f080a302a9..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/FollowingsOnlineSidebarDashboardBox.class.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class FollowingsOnlineSidebarDashboardBox extends AbstractSidebarDashboardBox { - /** - * users online list - * @var \wcf\data\user\online\UsersOnlineList - */ - public $usersOnlineList = null; - - /** - * @see \wcf\system\dashboard\box\IDashboardBox::init() - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - if (MODULE_USERS_ONLINE && WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList') && count(WCF::getUserProfileHandler()->getFollowingUsers())) { - $this->usersOnlineList = new UsersOnlineList(); - $this->usersOnlineList->getConditionBuilder()->add('session.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers())); - $this->usersOnlineList->sqlLimit = 10; - $this->usersOnlineList->readObjects(); - } - - $this->fetched(); - } - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - if (empty($this->usersOnlineList) || !count($this->usersOnlineList->getObjects())) { - return ''; - } - - WCF::getTPL()->assign(array( - 'usersOnlineList' => $this->usersOnlineList - )); - return WCF::getTPL()->fetch('dashboardBoxFollowingsOnlineSidebar'); - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/MostActiveMembersDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/MostActiveMembersDashboardBox.class.php deleted file mode 100644 index 692fb5612a..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/MostActiveMembersDashboardBox.class.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class MostActiveMembersDashboardBox extends AbstractSidebarDashboardBox { - /** - * ids of the most active members - * @var integer[] - */ - public $mostActiveMemberIDs = []; - - /** - * @inheritDoc - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - // get ids - $this->mostActiveMemberIDs = MostActiveMembersCacheBuilder::getInstance()->getData(); - if (!empty($this->mostActiveMemberIDs)) { - UserProfileRuntimeCache::getInstance()->cacheObjectIDs($this->mostActiveMemberIDs); - } - - $this->fetched(); - } - - /** - * @inheritDoc - */ - protected function render() { - if (empty($this->mostActiveMemberIDs)) return ''; - - if (MODULE_MEMBERS_LIST) { - $this->titleLink = LinkHandler::getInstance()->getLink('MembersList', [], 'sortField=activityPoints&sortOrder=DESC'); - } - - $mostActiveMembers = UserProfileRuntimeCache::getInstance()->getObjects($this->mostActiveMemberIDs); - DatabaseObject::sort($mostActiveMembers, 'activityPoints', 'DESC'); - - WCF::getTPL()->assign([ - 'mostActiveMembers' => $mostActiveMembers - ]); - return WCF::getTPL()->fetch('dashboardBoxMostActiveMembers'); - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/MostLikedMembersDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/MostLikedMembersDashboardBox.class.php deleted file mode 100644 index 997651863c..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/MostLikedMembersDashboardBox.class.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class MostLikedMembersDashboardBox extends AbstractSidebarDashboardBox { - /** - * ids of the most liked members - * @var integer[] - */ - public $mostLikedMemberIDs = []; - - /** - * @inheritDoc - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - // get ids - $this->mostLikedMemberIDs = MostLikedMembersCacheBuilder::getInstance()->getData(); - - $this->fetched(); - - if (!empty($this->mostLikedMemberIDs)) { - UserProfileRuntimeCache::getInstance()->cacheObjectIDs($this->mostLikedMemberIDs); - } - } - - /** - * @inheritDoc - */ - protected function render() { - if (empty($this->mostLikedMemberIDs)) return ''; - - if (MODULE_MEMBERS_LIST) { - $this->titleLink = LinkHandler::getInstance()->getLink('MembersList', [], 'sortField=likesReceived&sortOrder=DESC'); - } - - $mostLikedMembers = UserProfileRuntimeCache::getInstance()->getObjects($this->mostLikedMemberIDs); - DatabaseObject::sort($mostLikedMembers, 'likesReceived', 'DESC'); - - WCF::getTPL()->assign([ - 'mostLikedMembers' => $mostLikedMembers - ]); - return WCF::getTPL()->fetch('dashboardBoxMostLikedMembers'); - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/NewestMembersDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/NewestMembersDashboardBox.class.php deleted file mode 100644 index a304fe0fa2..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/NewestMembersDashboardBox.class.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class NewestMembersDashboardBox extends AbstractSidebarDashboardBox { - /** - * ids of the newest members - * @var integer[] - */ - public $newestMemberIDs = []; - - /** - * @inheritDoc - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - // get ids - $this->newestMemberIDs = NewestMembersCacheBuilder::getInstance()->getData(); - if (!empty($this->newestMemberIDs)) { - UserProfileRuntimeCache::getInstance()->cacheObjectIDs($this->newestMemberIDs); - } - - $this->fetched(); - } - - /** - * @inheritDoc - */ - protected function render() { - if (empty($this->newestMemberIDs)) return ''; - - if (MODULE_MEMBERS_LIST) { - $this->titleLink = LinkHandler::getInstance()->getLink('MembersList', [], 'sortField=registrationDate&sortOrder=DESC'); - } - - $newestMembers = UserProfileRuntimeCache::getInstance()->getObjects($this->newestMemberIDs); - DatabaseObject::sort($newestMembers, 'registrationDate', 'DESC'); - - WCF::getTPL()->assign([ - 'newestMembers' => $newestMembers - ]); - return WCF::getTPL()->fetch('dashboardBoxNewestMembers'); - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/PaidSubscriptionsDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/PaidSubscriptionsDashboardBox.class.php deleted file mode 100644 index bead309e6a..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/PaidSubscriptionsDashboardBox.class.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class PaidSubscriptionsDashboardBox extends AbstractContentDashboardBox { - /** - * list of available paid subscriptions - * @var array - */ - public $subscriptions = array(); - - /** - * @see \wcf\system\dashboard\box\IDashboardBox::init() - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - if (WCF::getUser()->userID && MODULE_PAID_SUBSCRIPTION) { - // get available subscriptions - $this->subscriptions = PaidSubscriptionCacheBuilder::getInstance()->getData(); - - // get purchased subscriptions - $userSubscriptionList = new PaidSubscriptionUserList(); - $userSubscriptionList->getConditionBuilder()->add('userID = ?', array(WCF::getUser()->userID)); - $userSubscriptionList->getConditionBuilder()->add('isActive = ?', array(1)); - $userSubscriptionList->readObjects(); - - // remove purchased subscriptions - foreach ($userSubscriptionList as $userSubscription) { - if (isset($this->subscriptions[$userSubscription->subscriptionID])) { - $userSubscription->setSubscription($this->subscriptions[$userSubscription->subscriptionID]); - unset($this->subscriptions[$userSubscription->subscriptionID]); - } - } - // remove excluded subscriptions - foreach ($userSubscriptionList as $userSubscription) { - if ($userSubscription->getSubscription()->excludedSubscriptionIDs) { - foreach (explode(',', $userSubscription->getSubscription()->excludedSubscriptionIDs) as $subscriptionID) { - if (isset($this->subscriptions[$subscriptionID])) unset($this->subscriptions[$subscriptionID]); - } - } - } - } - $this->fetched(); - } - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - if (!empty($this->subscriptions)) { - WCF::getTPL()->assign(array( - 'subscriptions' => $this->subscriptions - )); - - return WCF::getTPL()->fetch('dashboardBoxPaidSubscriptions'); - } - - return ''; - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/PaidSubscriptionsSidebarDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/PaidSubscriptionsSidebarDashboardBox.class.php deleted file mode 100644 index b8f8f34dcc..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/PaidSubscriptionsSidebarDashboardBox.class.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class PaidSubscriptionsSidebarDashboardBox extends AbstractSidebarDashboardBox { - /** - * list of available paid subscriptions - * @var array - */ - public $subscriptions = array(); - - /** - * @see \wcf\system\dashboard\box\IDashboardBox::init() - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - if (WCF::getUser()->userID && MODULE_PAID_SUBSCRIPTION) { - // get available subscriptions - $this->subscriptions = PaidSubscriptionCacheBuilder::getInstance()->getData(); - - // get purchased subscriptions - $userSubscriptionList = new PaidSubscriptionUserList(); - $userSubscriptionList->getConditionBuilder()->add('userID = ?', array(WCF::getUser()->userID)); - $userSubscriptionList->getConditionBuilder()->add('isActive = ?', array(1)); - $userSubscriptionList->readObjects(); - - // remove purchased subscriptions - foreach ($userSubscriptionList as $userSubscription) { - if (isset($this->subscriptions[$userSubscription->subscriptionID])) { - $userSubscription->setSubscription($this->subscriptions[$userSubscription->subscriptionID]); - unset($this->subscriptions[$userSubscription->subscriptionID]); - } - } - // remove excluded subscriptions - foreach ($userSubscriptionList as $userSubscription) { - if ($userSubscription->getSubscription()->excludedSubscriptionIDs) { - foreach (explode(',', $userSubscription->getSubscription()->excludedSubscriptionIDs) as $subscriptionID) { - if (isset($this->subscriptions[$subscriptionID])) unset($this->subscriptions[$subscriptionID]); - } - } - } - } - $this->fetched(); - } - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - if (!empty($this->subscriptions)) { - WCF::getTPL()->assign(array( - 'subscriptions' => $this->subscriptions - )); - - return WCF::getTPL()->fetch('dashboardBoxPaidSubscriptionsSidebar'); - } - - return ''; - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/RecentActivityDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/RecentActivityDashboardBox.class.php deleted file mode 100644 index f0c44754a5..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/RecentActivityDashboardBox.class.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class RecentActivityDashboardBox extends AbstractContentDashboardBox { - /** - * true, if user can filter by followed users - * @var boolean - */ - public $canFilterByFollowedUsers = false; - - /** - * recent activity list - * @var \wcf\data\user\activity\event\ViewableUserActivityEventList - */ - public $eventList = null; - - /** - * true, if results were filtered by followed users - * @var boolean - */ - public $filteredByFollowedUsers = false; - - /** - * latest event time - * @var integer - */ - public $lastEventTime = 0; - - /** - * @see \wcf\system\dashboard\box\IDashboardBox::init() - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - if (WCF::getUser()->userID && count(WCF::getUserProfileHandler()->getFollowingUsers())) { - $this->canFilterByFollowedUsers = true; - } - - $this->eventList = new ViewableUserActivityEventList(); - if ($this->canFilterByFollowedUsers && WCF::getUser()->recentActivitiesFilterByFollowing) { - $this->filteredByFollowedUsers = true; - $this->eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers())); - } - $this->eventList->sqlLimit = RECENT_ACTIVITY_ITEMS; - $this->eventList->readObjects(); - $this->lastEventTime = $this->eventList->getLastEventTime(); - - // removes orphaned and non-accessable events - UserActivityEventHandler::validateEvents($this->eventList); - - $this->fetched(); - } - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - if (count($this->eventList) || $this->filteredByFollowedUsers) { - WCF::getTPL()->assign(array( - 'canFilterByFollowedUsers' => $this->canFilterByFollowedUsers, - 'eventList' => $this->eventList, - 'lastEventTime' => $this->lastEventTime, - 'filteredByFollowedUsers' => $this->filteredByFollowedUsers - )); - - return WCF::getTPL()->fetch('dashboardBoxRecentActivity'); - } - - return ''; - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/RecentActivitySidebarDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/RecentActivitySidebarDashboardBox.class.php deleted file mode 100644 index 27780d0feb..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/RecentActivitySidebarDashboardBox.class.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class RecentActivitySidebarDashboardBox extends AbstractSidebarDashboardBox { - /** - * recent activity list - * @var \wcf\data\user\activity\event\ViewableUserActivityEventList - */ - public $eventList = null; - - /** - * @see \wcf\system\dashboard\box\IDashboardBox::init() - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - $this->eventList = new ViewableUserActivityEventList(); - $this->eventList->sqlLimit = RECENT_ACTIVITY_SIDEBAR_ITEMS; - $this->eventList->readObjects(); - - // removes orphaned and non-accessable events - UserActivityEventHandler::validateEvents($this->eventList); - - $this->fetched(); - } - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - if (count($this->eventList)) { - $this->titleLink = LinkHandler::getInstance()->getLink('RecentActivityList'); - WCF::getTPL()->assign(array( - 'eventList' => $this->eventList - )); - - return WCF::getTPL()->fetch('dashboardBoxRecentActivitySidebar'); - } - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/RegisterButtonDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/RegisterButtonDashboardBox.class.php deleted file mode 100644 index 898846917e..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/RegisterButtonDashboardBox.class.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class RegisterButtonDashboardBox extends AbstractSidebarDashboardBox { - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::$templateName - */ - public $templateName = 'dashboardBoxRegisterButton'; - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - return ((!WCF::getUser()->userID && !REGISTER_DISABLED) ? true : false); - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/SignedInAsDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/SignedInAsDashboardBox.class.php deleted file mode 100644 index d4df84d02d..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/SignedInAsDashboardBox.class.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class SignedInAsDashboardBox extends AbstractSidebarDashboardBox { - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::$templateName - */ - public $templateName = 'dashboardBoxSignedInAs'; - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - return (WCF::getUser()->userID ? true : false); - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/StaffOnlineSidebarDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/StaffOnlineSidebarDashboardBox.class.php deleted file mode 100644 index 47c57859c3..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/StaffOnlineSidebarDashboardBox.class.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class StaffOnlineSidebarDashboardBox extends AbstractSidebarDashboardBox { - /** - * users online list - * @var \wcf\data\user\online\UsersOnlineList - */ - public $usersOnlineList = null; - - /** - * @see \wcf\system\dashboard\box\IDashboardBox::init() - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - if (MODULE_USERS_ONLINE) { - $this->usersOnlineList = new UsersOnlineList(); - $this->usersOnlineList->getConditionBuilder()->add('session.userID IN (SELECT userID FROM wcf'.WCF_N.'_user_to_group WHERE groupID IN (SELECT groupID FROM wcf'.WCF_N.'_user_group WHERE showOnTeamPage = ?))', array(1)); - $this->usersOnlineList->readObjects(); - } - - $this->fetched(); - } - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - if (empty($this->usersOnlineList) || !count($this->usersOnlineList->getObjects())) { - return ''; - } - - WCF::getTPL()->assign(array( - 'usersOnlineList' => $this->usersOnlineList - )); - return WCF::getTPL()->fetch('dashboardBoxStaffOnlineSidebar'); - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/StatsSidebarDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/StatsSidebarDashboardBox.class.php deleted file mode 100644 index 9ee9731083..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/StatsSidebarDashboardBox.class.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class StatsSidebarDashboardBox extends AbstractSidebarDashboardBox { - /** - * displayed stats - * @var array - */ - public $stats = null; - - /** - * @see \wcf\system\dashboard\box\IDashboardBox::init() - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - $this->stats = UserStatsCacheBuilder::getInstance()->getData(); - - $this->fetched(); - } - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - WCF::getTPL()->assign(array( - 'dashboardStats' => $this->stats - )); - - return WCF::getTPL()->fetch('dashboardBoxStatsSidebar'); - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/TodaysFollowingBirthdaysDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/TodaysFollowingBirthdaysDashboardBox.class.php deleted file mode 100644 index 6061e644b9..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/TodaysFollowingBirthdaysDashboardBox.class.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class TodaysFollowingBirthdaysDashboardBox extends AbstractSidebarDashboardBox { - /** - * user profiles - * @var UserProfile[] - */ - public $userProfiles = []; - - /** - * @inheritDoc - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - // get current date - $currentDay = DateUtil::format(null, 'm-d'); - $date = explode('-', DateUtil::format(null, 'Y-n-j')); - - // get user ids - $userIDs = UserBirthdayCache::getInstance()->getBirthdays($date[1], $date[2]); - $userIDs = array_intersect($userIDs, WCF::getUserProfileHandler()->getFollowingUsers()); - - if (!empty($userIDs)) { - $userProfiles = UserProfileRuntimeCache::getInstance()->getObjects($userIDs); - - $i = 0; - foreach ($userProfiles as $userProfile) { - if ($i == 10) break; - - if (!$userProfile->isProtected() && substr($userProfile->birthday, 5) == $currentDay) { - $this->userProfiles[] = $userProfile; - $i++; - } - } - } - - $this->fetched(); - } - - /** - * @inheritDoc - */ - protected function render() { - if (empty($this->userProfiles)) { - return ''; - } - - WCF::getTPL()->assign([ - 'birthdayUserProfiles' => $this->userProfiles - ]); - return WCF::getTPL()->fetch('dashboardBoxTodaysFollowingBirthdays'); - } -} diff --git a/wcfsetup/install/files/lib/system/dashboard/box/UsersOnlineSidebarDashboardBox.class.php b/wcfsetup/install/files/lib/system/dashboard/box/UsersOnlineSidebarDashboardBox.class.php deleted file mode 100644 index 04639ebf84..0000000000 --- a/wcfsetup/install/files/lib/system/dashboard/box/UsersOnlineSidebarDashboardBox.class.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.dashboard.box - * @category Community Framework - */ -class UsersOnlineSidebarDashboardBox extends AbstractSidebarDashboardBox { - /** - * users online list - * @var \wcf\data\user\online\UsersOnlineList - */ - public $usersOnlineList = null; - - /** - * @see \wcf\system\dashboard\box\IDashboardBox::init() - */ - public function init(DashboardBox $box, IPage $page) { - parent::init($box, $page); - - if (MODULE_USERS_ONLINE && WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList')) { - $this->usersOnlineList = new UsersOnlineList(); - $this->usersOnlineList->readStats(); - $this->usersOnlineList->checkRecord(); - $this->usersOnlineList->getConditionBuilder()->add('session.userID IS NOT NULL'); - $this->usersOnlineList->readObjects(); - } - - $this->fetched(); - } - - /** - * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render() - */ - protected function render() { - if (empty($this->usersOnlineList) || !count($this->usersOnlineList->getObjects())) { - return ''; - } - - $this->titleLink = LinkHandler::getInstance()->getLink('UsersOnlineList'); - WCF::getTPL()->assign(array( - 'usersOnlineList' => $this->usersOnlineList - )); - return WCF::getTPL()->fetch('dashboardBoxUsersOnlineSidebar'); - } -} diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 1159c31672..a90bb14427 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1945,31 +1945,8 @@ Fehler sind beispielsweise: - - - - - - - - - - - - - - - activityPoints} Punkt{if $activeMember->activityPoints != 1}e{/if}]]> - - - likesReceived} Like{if $likedMember->likesReceived != 1}s{/if}]]> - - - - - - - + activityPoints} Punkt{if $activeMember->activityPoints != 1}e{/if}]]> + likesReceived} Like{if $likedMember->likesReceived != 1}s{/if}]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 426e1a4f1d..0bcd5ecfca 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1947,31 +1947,8 @@ Errors are: - - - - - - - - - - - - - - - activityPoints} Point{if $activeMember->activityPoints != 1}s{/if}]]> - - - likesReceived} Like{if $likedMember->likesReceived != 1}s{/if}]]> - - - - - - - + activityPoints} Point{if $activeMember->activityPoints != 1}s{/if}]]> + likesReceived} Like{if $likedMember->likesReceived != 1}s{/if}]]> -- 2.20.1