diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-10-27 20:18:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 20:18:18 +0100 |
commit | b2b5ef3122e23ab68c5640aabfad5c7b0256cc04 (patch) | |
tree | 5419a51d724a3ce9a22981cabadd6d0dab44e7fb /application/front/controller/admin/ShaareAddController.php | |
parent | b8e5a253ab5521ce2be6c0d3e04e0101527df3c1 (diff) | |
parent | 34c8f558e595d4f90e46e3753c8455b0b515771a (diff) | |
download | Shaarli-b2b5ef3122e23ab68c5640aabfad5c7b0256cc04.tar.gz Shaarli-b2b5ef3122e23ab68c5640aabfad5c7b0256cc04.tar.zst Shaarli-b2b5ef3122e23ab68c5640aabfad5c7b0256cc04.zip |
Merge pull request #1587 from ArthurHoaro/feature/batch-bookmark-creation
Diffstat (limited to 'application/front/controller/admin/ShaareAddController.php')
-rw-r--r-- | application/front/controller/admin/ShaareAddController.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/application/front/controller/admin/ShaareAddController.php b/application/front/controller/admin/ShaareAddController.php new file mode 100644 index 00000000..8dc386b2 --- /dev/null +++ b/application/front/controller/admin/ShaareAddController.php | |||
@@ -0,0 +1,34 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Shaarli\Front\Controller\Admin; | ||
6 | |||
7 | use Shaarli\Formatter\BookmarkMarkdownFormatter; | ||
8 | use Shaarli\Render\TemplatePage; | ||
9 | use Slim\Http\Request; | ||
10 | use Slim\Http\Response; | ||
11 | |||
12 | class ShaareAddController extends ShaarliAdminController | ||
13 | { | ||
14 | /** | ||
15 | * GET /admin/add-shaare - Displays the form used to create a new bookmark from an URL | ||
16 | */ | ||
17 | public function addShaare(Request $request, Response $response): Response | ||
18 | { | ||
19 | $tags = $this->container->bookmarkService->bookmarksCountPerTag(); | ||
20 | if ($this->container->conf->get('formatter') === 'markdown') { | ||
21 | $tags[BookmarkMarkdownFormatter::NO_MD_TAG] = 1; | ||
22 | } | ||
23 | |||
24 | $this->assignView( | ||
25 | 'pagetitle', | ||
26 | t('Shaare a new link') .' - '. $this->container->conf->get('general.title', 'Shaarli') | ||
27 | ); | ||
28 | $this->assignView('tags', $tags); | ||
29 | $this->assignView('default_private_links', $this->container->conf->get('privacy.default_private_links', false)); | ||
30 | $this->assignView('async_metadata', $this->container->conf->get('general.enable_async_metadata', true)); | ||
31 | |||
32 | return $response->write($this->render(TemplatePage::ADDLINK)); | ||
33 | } | ||
34 | } | ||