summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-12-17 11:45:59 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-12-17 11:45:59 +0100
commit63255263b4afc6201cd551e99a0e07368f5f25f9 (patch)
tree226ee6c743628baae668a08edee9fc765fd6c8d8 /plugin
parentaf95556560f2474ca504218c0a18eef267e7cd16 (diff)
add client side plugins
Diffstat (limited to 'plugin')
-rw-r--r--plugin/client/plugin.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/plugin/client/plugin.php b/plugin/client/plugin.php
new file mode 100644
index 000000000..2be110e5a
--- /dev/null
+++ b/plugin/client/plugin.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * ownCloud - News
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Alessandro Cosentino <cosenal@gmail.com>
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright Alessandro Cosentino 2012
+ * @copyright Bernhard Posselt 2012, 2014
+ */
+
+namespace OCA\News\Plugin\Client;
+
+/**
+ * We actually really want to avoid this global list of plugins. A way would be
+ * for News plugin apps to register themselves in a special database table
+ * and the News app would just pull out the scripts that should be attached
+ * but atm there is no really good way since there is no uninstall hook which
+ * would remove the plugin from the apps so fk it :)
+ */
+class Plugin {
+
+ private static $scripts = [];
+ private static $styles = [];
+
+ public static function registerStyle($appName, $styleName) {
+ self::$styles[$appName] = $styleName;
+ }
+
+ public static function registerScript($appName, $scriptName) {
+ self::$scripts[$appName] = $scriptName;
+ }
+
+ public static function getStyles() {
+ return self::$styles;
+ }
+
+ public static function getScripts() {
+ return self::$scripts;
+ }
+
+} \ No newline at end of file