From d5cb2ff75dd6734d5de50fe27a6bc224b1809b15 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 16 Sep 2014 12:37:44 +0200 Subject: backport 7 fixes --- templates/7.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ templates/index.php | 17 +++++++++++------ 2 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 templates/7.php (limited to 'templates') diff --git a/templates/7.php b/templates/7.php new file mode 100644 index 000000000..24dde55b4 --- /dev/null +++ b/templates/7.php @@ -0,0 +1,45 @@ + + * @author Bernhard Posselt + * @copyright Alessandro Cosentino 2012 + * @copyright Bernhard Posselt 2012, 2014 + */ + + +/** + * Shortcut for adding 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 script($app, $file) { + if(is_array($file)) { + foreach($file as $f) { + OC_Util::addScript($app, $f); + } + } else { + OC_Util::addScript($app, $file); + } +} + +/** + * Shortcut for adding 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 style($app, $file) { + if(is_array($file)) { + foreach($file as $f) { + OC_Util::addStyle($app, $f); + } + } else { + OC_Util::addStyle($app, $file); + } +} \ No newline at end of file diff --git a/templates/index.php b/templates/index.php index 4e40cfc04..3d277dbbf 100644 --- a/templates/index.php +++ b/templates/index.php @@ -1,4 +1,15 @@ 7 && $version[1] <= 8) { + style('news', '7'); +} + script('news', [ 'vendor/es6-shim/es6-shim.min', 'vendor/angular/angular.min', @@ -15,12 +26,6 @@ style('news', [ 'settings', 'custom' ]); - -// owncloud 7 backported style sheets -$version = \OCP\Util::getVersion(); -if($version[0] > 7 && $version[1] <= 8) { - style('news', '7'); -} ?> -- cgit v1.2.3