]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/plugins/test/test.php
Plugin system - CORE
[github/shaarli/Shaarli.git] / tests / plugins / test / test.php
diff --git a/tests/plugins/test/test.php b/tests/plugins/test/test.php
new file mode 100755 (executable)
index 0000000..3d750c9
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Hook for test.
+ *
+ * @param array $data - data passed to plugin.
+ *
+ * @return mixed altered data.
+ */
+function hook_test_random($data)
+{
+    if (isset($data['_PAGE_']) && $data['_PAGE_'] == 'test') {
+        $data[1] = 'page test';
+    } else if (isset($data['_LOGGEDIN_']) && $data['_LOGGEDIN_'] === true) {
+        $data[1] = 'loggedin';
+    } else {
+        $data[1] = $data[0];
+    }
+
+    return $data;
+}