From ec5ed0cf4609054d9a16a9d2c3c98adbfd4b49d7 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 2 Aug 2021 12:10:03 +0000 Subject: [PATCH] Placeholder page for scheduled posts --- doc/Accesskeys.md | 4 +-- src/Module/BaseProfile.php | 25 +++++++++++++------ src/Module/Profile/Schedule.php | 43 +++++++++++++++++++++++++++++++++ static/routes.config.php | 1 + 4 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 src/Module/Profile/Schedule.php diff --git a/doc/Accesskeys.md b/doc/Accesskeys.md index 9158efd582..599d2b1190 100644 --- a/doc/Accesskeys.md +++ b/doc/Accesskeys.md @@ -17,7 +17,7 @@ General * p - Profile * n - Network * c - Community -* s - Search +* s - Search * a - Admin * f - Notifications * u - User menu @@ -35,6 +35,7 @@ General * v - Videos * e - Events and Calendar * t - Personal Notes +* o - Scheduled Posts * k - View Contacts ../contacts (contact list) @@ -66,7 +67,6 @@ General * t - Sort by Post Date * r - Conversation (Posts that mention or involve you) * w - New posts -* b - Bookmarks * m - Favourite Posts ../notifications diff --git a/src/Module/BaseProfile.php b/src/Module/BaseProfile.php index dca88f01c2..832c8fd2f8 100644 --- a/src/Module/BaseProfile.php +++ b/src/Module/BaseProfile.php @@ -70,14 +70,15 @@ class BaseProfile extends BaseModule 'id' => 'photo-tab', 'accesskey' => 'h', ], - [ - 'label' => DI::l10n()->t('Videos'), - 'url' => DI::baseUrl() . '/videos/' . $nickname, - 'sel' => $current == 'videos' ? 'active' : '', - 'title' => DI::l10n()->t('Videos'), - 'id' => 'video-tab', - 'accesskey' => 'v', - ], +// @todo Currently deactivated since it doesn't really work +// [ +// 'label' => DI::l10n()->t('Videos'), +// 'url' => DI::baseUrl() . '/videos/' . $nickname, +// 'sel' => $current == 'videos' ? 'active' : '', +// 'title' => DI::l10n()->t('Videos'), +// 'id' => 'video-tab', +// 'accesskey' => 'v', +// ], ]; // the calendar link for the full featured events calendar @@ -112,6 +113,14 @@ class BaseProfile extends BaseModule 'id' => 'notes-tab', 'accesskey' => 't', ]; + $tabs[] = [ + 'label' => DI::l10n()->t('Scheduled Posts'), + 'url' => $baseProfileUrl . '/schedule', + 'sel' => $current == 'schedule' ? 'active' : '', + 'title' => DI::l10n()->t('Posts that are scheduled for publishing'), + 'id' => 'schedule-tab', + 'accesskey' => 'o', + ]; } if (empty($profile['hide-friends'])) { diff --git a/src/Module/Profile/Schedule.php b/src/Module/Profile/Schedule.php new file mode 100644 index 0000000000..9ea5e0c6be --- /dev/null +++ b/src/Module/Profile/Schedule.php @@ -0,0 +1,43 @@ +. + * + */ + +namespace Friendica\Module\Profile; + +use Friendica\DI; +use Friendica\Module\BaseProfile; +use Friendica\Network\HTTPException; + +class Schedule extends BaseProfile +{ + public static function content(array $parameters = []) + { + if (!local_user()) { + throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); + } + + $a = DI::app(); + + $o = self::getTabsHTML($a, 'schedule', true, $a->user); + + $o .= DI::l10n()->t('Currently here is no functionality here. Please use an app to have a look at your scheduled posts.'); + return $o; + } +} diff --git a/static/routes.config.php b/static/routes.config.php index 40739de7e2..825be5a945 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -33,6 +33,7 @@ use Friendica\Module; $profileRoutes = [ '' => [Module\Profile\Index::class, [R::GET]], '/profile' => [Module\Profile\Profile::class, [R::GET]], + '/schedule' => [Module\Profile\Schedule::class, [R::GET]], '/contacts/common' => [Module\Profile\Common::class, [R::GET]], '/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]], '/status[/{category}[/{date1}[/{date2}]]]' => [Module\Profile\Status::class, [R::GET]],