diff options
Diffstat (limited to 'application')
-rw-r--r-- | application/bookmark/BookmarkInitializer.php | 74 | ||||
-rw-r--r-- | application/front/controller/admin/PluginsController.php | 1 | ||||
-rw-r--r-- | application/plugin/PluginManager.php | 29 |
3 files changed, 79 insertions, 25 deletions
diff --git a/application/bookmark/BookmarkInitializer.php b/application/bookmark/BookmarkInitializer.php index cd2d1724..815047e3 100644 --- a/application/bookmark/BookmarkInitializer.php +++ b/application/bookmark/BookmarkInitializer.php | |||
@@ -34,25 +34,77 @@ class BookmarkInitializer | |||
34 | public function initialize() | 34 | public function initialize() |
35 | { | 35 | { |
36 | $bookmark = new Bookmark(); | 36 | $bookmark = new Bookmark(); |
37 | $bookmark->setTitle(t('My secret stuff... - Pastebin.com')); | 37 | $bookmark->setTitle('quicksilver (loop) on Vimeo ' . t('(private bookmark with thumbnail demo)')); |
38 | $bookmark->setUrl('http://sebsauvage.net/paste/?8434b27936c09649#bR7XsXhoTiLcqCpQbmOpBi3rq2zzQUC5hBI7ZT1O3x8='); | 38 | $bookmark->setUrl('https://vimeo.com/153493904'); |
39 | $bookmark->setDescription(t('Shhhh! I\'m a private link only YOU can see. You can delete me too.')); | 39 | $bookmark->setDescription(t( |
40 | $bookmark->setTagsString('secretstuff'); | 40 | 'Shaarli will automatically pick up the thumbnail for links to a variety of websites. |
41 | |||
42 | Explore your new Shaarli instance by trying out controls and menus. | ||
43 | Visit the project on [Github](https://github.com/shaarli/Shaarli) or [the documentation](https://shaarli.readthedocs.io/en/master/) to learn more about Shaarli. | ||
44 | |||
45 | Now you can edit or delete the default shaares. | ||
46 | ' | ||
47 | )); | ||
48 | $bookmark->setTagsString('shaarli help thumbnail'); | ||
49 | $bookmark->setPrivate(true); | ||
50 | $this->bookmarkService->add($bookmark, false); | ||
51 | |||
52 | $bookmark = new Bookmark(); | ||
53 | $bookmark->setTitle(t('Note: Shaare descriptions')); | ||
54 | $bookmark->setDescription(t( | ||
55 | 'Adding a shaare without entering a URL creates a text-only "note" post such as this one. | ||
56 | This note is private, so you are the only one able to see it while logged in. | ||
57 | |||
58 | You can use this to keep notes, post articles, code snippets, and much more. | ||
59 | |||
60 | The Markdown formatting setting allows you to format your notes and bookmark description: | ||
61 | |||
62 | ### Title headings | ||
63 | |||
64 | #### Multiple headings levels | ||
65 | * bullet lists | ||
66 | * _italic_ text | ||
67 | * **bold** text | ||
68 | * ~~strike through~~ text | ||
69 | * `code` blocks | ||
70 | * images | ||
71 | * [links](https://en.wikipedia.org/wiki/Markdown) | ||
72 | |||
73 | Markdown also supports tables: | ||
74 | |||
75 | | Name | Type | Color | Qty | | ||
76 | | ------- | --------- | ------ | ----- | | ||
77 | | Orange | Fruit | Orange | 126 | | ||
78 | | Apple | Fruit | Any | 62 | | ||
79 | | Lemon | Fruit | Yellow | 30 | | ||
80 | | Carrot | Vegetable | Red | 14 | | ||
81 | ' | ||
82 | )); | ||
83 | $bookmark->setTagsString('shaarli help'); | ||
41 | $bookmark->setPrivate(true); | 84 | $bookmark->setPrivate(true); |
42 | $this->bookmarkService->add($bookmark, false); | 85 | $this->bookmarkService->add($bookmark, false); |
43 | 86 | ||
44 | $bookmark = new Bookmark(); | 87 | $bookmark = new Bookmark(); |
45 | $bookmark->setTitle(t('The personal, minimalist, super-fast, database free, bookmarking service')); | 88 | $bookmark->setTitle( |
46 | $bookmark->setUrl('https://shaarli.readthedocs.io', []); | 89 | 'Shaarli - ' . t('The personal, minimalist, super-fast, database free, bookmarking service') |
90 | ); | ||
47 | $bookmark->setDescription(t( | 91 | $bookmark->setDescription(t( |
48 | 'Welcome to Shaarli! This is your first public bookmark. ' | 92 | 'Welcome to Shaarli! |
49 | . 'To edit or delete me, you must first login. | 93 | |
94 | Shaarli allows you to bookmark your favorite pages, and share them with others or store them privately. | ||
95 | You can add a description to your bookmarks, such as this one, and tag them. | ||
96 | |||
97 | Create a new shaare by clicking the `+Shaare` button, or using any of the recommended tools (browser extension, mobile app, bookmarklet, REST API, etc.). | ||
50 | 98 | ||
51 | To learn how to use Shaarli, consult the link "Documentation" at the bottom of this page. | 99 | You can easily retrieve your links, even with thousands of them, using the internal search engine, or search through tags (e.g. this Shaare is tagged with `shaarli` and `help`). |
100 | Hashtags such as #shaarli #help are also supported. | ||
101 | You can also filter the available [RSS feed](/feed/atom) and picture wall by tag or plaintext search. | ||
52 | 102 | ||
53 | You use the community supported version of the original Shaarli project, by Sebastien Sauvage.' | 103 | We hope that you will enjoy using Shaarli, maintained with ❤️ by the community! |
104 | Feel free to open [an issue](https://github.com/shaarli/Shaarli/issues) if you have a suggestion or encounter an issue. | ||
105 | ' | ||
54 | )); | 106 | )); |
55 | $bookmark->setTagsString('opensource software'); | 107 | $bookmark->setTagsString('shaarli help'); |
56 | $this->bookmarkService->add($bookmark, false); | 108 | $this->bookmarkService->add($bookmark, false); |
57 | } | 109 | } |
58 | } | 110 | } |
diff --git a/application/front/controller/admin/PluginsController.php b/application/front/controller/admin/PluginsController.php index 0e09116e..8e059681 100644 --- a/application/front/controller/admin/PluginsController.php +++ b/application/front/controller/admin/PluginsController.php | |||
@@ -62,6 +62,7 @@ class PluginsController extends ShaarliAdminController | |||
62 | 62 | ||
63 | if (isset($parameters['parameters_form'])) { | 63 | if (isset($parameters['parameters_form'])) { |
64 | unset($parameters['parameters_form']); | 64 | unset($parameters['parameters_form']); |
65 | unset($parameters['token']); | ||
65 | foreach ($parameters as $param => $value) { | 66 | foreach ($parameters as $param => $value) { |
66 | $this->container->conf->set('plugins.'. $param, escape($value)); | 67 | $this->container->conf->set('plugins.'. $param, escape($value)); |
67 | } | 68 | } |
diff --git a/application/plugin/PluginManager.php b/application/plugin/PluginManager.php index 7881e3be..1b2197c9 100644 --- a/application/plugin/PluginManager.php +++ b/application/plugin/PluginManager.php | |||
@@ -100,20 +100,17 @@ class PluginManager | |||
100 | */ | 100 | */ |
101 | public function executeHooks($hook, &$data, $params = array()) | 101 | public function executeHooks($hook, &$data, $params = array()) |
102 | { | 102 | { |
103 | if (!empty($params['target'])) { | 103 | $metadataParameters = [ |
104 | $data['_PAGE_'] = $params['target']; | 104 | 'target' => '_PAGE_', |
105 | } | 105 | 'loggedin' => '_LOGGEDIN_', |
106 | 106 | 'basePath' => '_BASE_PATH_', | |
107 | if (isset($params['loggedin'])) { | 107 | 'bookmarkService' => '_BOOKMARK_SERVICE_', |
108 | $data['_LOGGEDIN_'] = $params['loggedin']; | 108 | ]; |
109 | } | 109 | |
110 | 110 | foreach ($metadataParameters as $parameter => $metaKey) { | |
111 | if (isset($params['basePath'])) { | 111 | if (array_key_exists($parameter, $params)) { |
112 | $data['_BASE_PATH_'] = $params['basePath']; | 112 | $data[$metaKey] = $params[$parameter]; |
113 | } | 113 | } |
114 | |||
115 | if (isset($params['bookmarkService'])) { | ||
116 | $data['_BOOKMARK_SERVICE_'] = $params['bookmarkService']; | ||
117 | } | 114 | } |
118 | 115 | ||
119 | foreach ($this->loadedPlugins as $plugin) { | 116 | foreach ($this->loadedPlugins as $plugin) { |
@@ -128,6 +125,10 @@ class PluginManager | |||
128 | } | 125 | } |
129 | } | 126 | } |
130 | } | 127 | } |
128 | |||
129 | foreach ($metadataParameters as $metaKey) { | ||
130 | unset($data[$metaKey]); | ||
131 | } | ||
131 | } | 132 | } |
132 | 133 | ||
133 | /** | 134 | /** |