summaryrefslogtreecommitdiffstats
path: root/lib/Plugin/Client/Plugin.php
blob: 373968056bb916ec1f82a65c94463604fdf28f29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
 * Nextcloud - 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 2012 Alessandro Cosentino
 * @copyright 2012-2014 Bernhard Posselt
 */

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): void
    {
        self::$styles[$appName] = $styleName;
    }

    public static function registerScript($appName, $scriptName): void
    {
        self::$scripts[$appName] = $scriptName;
    }

    public static function getStyles()
    {
        return self::$styles;
    }

    public static function getScripts()
    {
        return self::$scripts;
    }
}