3 declare(strict_types
=1);
5 namespace Shaarli\Front\Controller\Admin
;
7 use Shaarli\Formatter\BookmarkMarkdownFormatter
;
8 use Shaarli\Render\TemplatePage
;
10 use Slim\Http\Response
;
12 class ShaareAddController
extends ShaarliAdminController
15 * GET /admin/add-shaare - Displays the form used to create a new bookmark from an URL
17 public function addShaare(Request
$request, Response
$response): Response
19 $tags = $this->container
->bookmarkService
->bookmarksCountPerTag();
20 if ($this->container
->conf
->get('formatter') === 'markdown') {
21 $tags[BookmarkMarkdownFormatter
::NO_MD_TAG
] = 1;
26 t('Shaare a new link') .' - '. $this->container
->conf
->get('general.title', 'Shaarli')
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));
32 return $response->write($this->render(TemplatePage
::ADDLINK
));