diff options
author | Arthur <arthur@hoa.ro> | 2015-11-08 13:29:32 +0100 |
---|---|---|
committer | Arthur <arthur@hoa.ro> | 2015-11-08 13:29:32 +0100 |
commit | fd006c630b64146edc402b68d8503c716f8a55d6 (patch) | |
tree | e53904cc6232c7f2fe8e1de6f23c9a5d6c5403ad /tests/plugins/test/test.php | |
parent | 70df947af60afb05529024bb2d3825eaf6cc7950 (diff) | |
parent | 056107ab4eae0a4867cf8d55de77d31f8868b899 (diff) | |
download | Shaarli-fd006c630b64146edc402b68d8503c716f8a55d6.tar.gz Shaarli-fd006c630b64146edc402b68d8503c716f8a55d6.tar.zst Shaarli-fd006c630b64146edc402b68d8503c716f8a55d6.zip |
Merge pull request #275 from shaarli/plugin-proposition
Plugin proposition
Diffstat (limited to 'tests/plugins/test/test.php')
-rw-r--r-- | tests/plugins/test/test.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/plugins/test/test.php b/tests/plugins/test/test.php new file mode 100644 index 00000000..3d750c90 --- /dev/null +++ b/tests/plugins/test/test.php | |||
@@ -0,0 +1,21 @@ | |||
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * Hook for test. | ||
5 | * | ||
6 | * @param array $data - data passed to plugin. | ||
7 | * | ||
8 | * @return mixed altered data. | ||
9 | */ | ||
10 | function hook_test_random($data) | ||
11 | { | ||
12 | if (isset($data['_PAGE_']) && $data['_PAGE_'] == 'test') { | ||
13 | $data[1] = 'page test'; | ||
14 | } else if (isset($data['_LOGGEDIN_']) && $data['_LOGGEDIN_'] === true) { | ||
15 | $data[1] = 'loggedin'; | ||
16 | } else { | ||
17 | $data[1] = $data[0]; | ||
18 | } | ||
19 | |||
20 | return $data; | ||
21 | } | ||