From d763b320486a3cd475c0e7a1537b0954341287d6 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 3 Nov 2014 11:18:17 +0100 Subject: ability to add bower resources * add addVendorScript & addVendorStyle * refactoring of addScript and addStyle * add shortcuts vendorScript and vendorStyle --- lib/private/template/functions.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'lib/private/template') 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 @@ -39,6 +39,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 @@ -55,6 +71,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 -- cgit v1.2.3