diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | appinfo/app.json | 2 | ||||
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | templates/7.php | 45 | ||||
-rw-r--r-- | templates/index.php | 17 |
5 files changed, 59 insertions, 9 deletions
@@ -23,7 +23,7 @@ For further developer and user documentation please visit [the wiki](https://git ## Dependencies * PHP >= 5.4 * php-curl -* ownCloud >= 7.0.3 +* ownCloud >= 7 ## Supported Databases * PostgreSQL diff --git a/appinfo/app.json b/appinfo/app.json index 737d3b95d..14f155e62 100644 --- a/appinfo/app.json +++ b/appinfo/app.json @@ -36,7 +36,7 @@ "categories": ["Multimedia"], "dependencies": { "php": ">=5.4", - "owncloud": ">=7.0.3", + "owncloud": ">=7", "libs": { "curl": "*" } diff --git a/appinfo/info.xml b/appinfo/info.xml index 260297f11..d5125f02b 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -6,5 +6,5 @@ <licence>AGPL</licence> <author>Alessandro Cosentino, Bernhard Posselt, Jan-Christoph Borchardt. Powered by SimplePie (Ryan Parman, Geoffrey Sneddon, Ryan McCue and contributors).</author> <version>3.001</version> - <require>7.0.3</require> + <require>7</require> </info> 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 @@ +<?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 + */ + + +/** + * 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 @@ <?php +// owncloud 7 backported style sheets +$version = \OCP\Util::getVersion(); + +if ($version[0] === 7 && $version[1] === 0 && $version[2] < 3) { + require_once __DIR__ . '/7.php'; +} + +if($version[0] > 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'); -} ?> |