diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-11-03 11:18:17 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-11-03 20:54:40 +0100 |
commit | d763b320486a3cd475c0e7a1537b0954341287d6 (patch) | |
tree | 5d8d536d1be75cd6558bb41698328664dd0f29fb /lib/private/template | |
parent | d2276215a475062c781f57d80f912f421f4b69fe (diff) | |
download | nextcloud-server-d763b320486a3cd475c0e7a1537b0954341287d6.tar.gz nextcloud-server-d763b320486a3cd475c0e7a1537b0954341287d6.zip |
ability to add bower resources
* add addVendorScript & addVendorStyle
* refactoring of addScript and addStyle
* add shortcuts vendorScript and vendorStyle
Diffstat (limited to 'lib/private/template')
-rw-r--r-- | lib/private/template/functions.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/private/template/functions.php b/lib/private/template/functions.php index dede604c01d..0e2c5775c46 100644 --- a/lib/private/template/functions.php +++ b/lib/private/template/functions.php @@ -40,6 +40,22 @@ function script($app, $file) { } /** + * Shortcut for adding vendor scripts to a page + * @param string $app the appname + * @param string|string[] $file the filename, + * if an array is given it will add all scripts + */ +function vendorScript($app, $file) { + if(is_array($file)) { + foreach($file as $f) { + OC_Util::addVendorScript($app, $f); + } + } else { + OC_Util::addVendorScript($app, $file); + } +} + +/** * Shortcut for adding styles to a page * @param string $app the appname * @param string|string[] $file the filename, @@ -56,6 +72,22 @@ function style($app, $file) { } /** + * Shortcut for adding vendor styles to a page + * @param string $app the appname + * @param string|string[] $file the filename, + * if an array is given it will add all styles + */ +function vendorStyle($app, $file) { + if(is_array($file)) { + foreach($file as $f) { + OC_Util::addVendorStyle($app, $f); + } + } else { + OC_Util::addVendorStyle($app, $file); + } +} + +/** * Shortcut for adding translations to a page * @param string $app the appname * if an array is given it will add all styles |