diff options
author | ArthurHoaro <arthur@hoa.ro> | 2019-07-27 12:30:33 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2019-07-27 12:30:33 +0200 |
commit | 1b8ed48a0d3964186f4d66d443783f4d250e7147 (patch) | |
tree | 23597f312507ba0c1b461755b9aa086106374a4d /plugins/demo_plugin/demo_plugin.php | |
parent | 1aa24ed8d2974cda98733f74b36844b02942cc11 (diff) | |
parent | ed3365325d231e044dedc32608fde87b1b39fa34 (diff) | |
download | Shaarli-1b8ed48a0d3964186f4d66d443783f4d250e7147.tar.gz Shaarli-1b8ed48a0d3964186f4d66d443783f4d250e7147.tar.zst Shaarli-1b8ed48a0d3964186f4d66d443783f4d250e7147.zip |
Merge tag 'v0.11.0' into latest
Release v0.11.0
Diffstat (limited to 'plugins/demo_plugin/demo_plugin.php')
-rw-r--r-- | plugins/demo_plugin/demo_plugin.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php index ca520d15..71ba7495 100644 --- a/plugins/demo_plugin/demo_plugin.php +++ b/plugins/demo_plugin/demo_plugin.php | |||
@@ -15,6 +15,8 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | use Shaarli\Config\ConfigManager; | 17 | use Shaarli\Config\ConfigManager; |
18 | use Shaarli\Plugin\PluginManager; | ||
19 | use Shaarli\Router; | ||
18 | 20 | ||
19 | /** | 21 | /** |
20 | * In the footer hook, there is a working example of a translation extension for Shaarli. | 22 | * In the footer hook, there is a working example of a translation extension for Shaarli. |
@@ -455,10 +457,29 @@ function hook_demo_plugin_render_feed($data) | |||
455 | } | 457 | } |
456 | 458 | ||
457 | /** | 459 | /** |
460 | * When plugin parameters are saved. | ||
461 | * | ||
462 | * @param array $data $_POST array | ||
463 | * | ||
464 | * @return array Updated $_POST array | ||
465 | */ | ||
466 | function hook_demo_plugin_save_plugin_parameters($data) | ||
467 | { | ||
468 | // Here we edit the provided value, but we can use this to generate config files, etc. | ||
469 | if (! empty($data['DEMO_PLUGIN_PARAMETER']) && ! endsWith($data['DEMO_PLUGIN_PARAMETER'], '_SUFFIX')) { | ||
470 | $data['DEMO_PLUGIN_PARAMETER'] .= '_SUFFIX'; | ||
471 | } | ||
472 | |||
473 | return $data; | ||
474 | } | ||
475 | |||
476 | /** | ||
458 | * This function is never called, but contains translation calls for GNU gettext extraction. | 477 | * This function is never called, but contains translation calls for GNU gettext extraction. |
459 | */ | 478 | */ |
460 | function demo_dummy_translation() | 479 | function demo_dummy_translation() |
461 | { | 480 | { |
462 | // meta | 481 | // meta |
463 | t('A demo plugin covering all use cases for template designers and plugin developers.'); | 482 | t('A demo plugin covering all use cases for template designers and plugin developers.'); |
483 | t('This is a parameter dedicated to the demo plugin. It\'ll be suffixed.'); | ||
484 | t('Other demo parameter'); | ||
464 | } | 485 | } |