summaryrefslogtreecommitdiffstats
path: root/lib/private/util.php
diff options
context:
space:
mode:
authorIndividual IT Services <info@individual-it.net>2015-09-25 15:41:55 +0545
committerIndividual IT Services <info@individual-it.net>2015-09-25 15:41:55 +0545
commit2e42f99d007f9897cb6a7d017dce91bd8b1a6546 (patch)
treeed84a3e23d75940e0b97347bda738182b12b93b9 /lib/private/util.php
parent5a11e145da68cb5df781060c76c5bdca27228e40 (diff)
downloadnextcloud-server-2e42f99d007f9897cb6a7d017dce91bd8b1a6546.tar.gz
nextcloud-server-2e42f99d007f9897cb6a7d017dce91bd8b1a6546.zip
add $prepend option to addStyle() & addVendorStyle()
Diffstat (limited to 'lib/private/util.php')
-rw-r--r--lib/private/util.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index 117e57f66d7..9702f38a48f 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -507,12 +507,17 @@ class OC_Util {
*
* @param string $application application id
* @param string|null $file filename
+ * @param bool $prepend prepend the Style to the beginning of the list
* @return void
*/
- public static function addStyle($application, $file = null) {
+ public static function addStyle($application, $file = null, $prepend = false) {
$path = OC_Util::generatePath($application, 'css', $file);
if (!in_array($path, self::$styles)) {
- self::$styles[] = $path;
+ if ($prepend === true) {
+ array_unshift ( self::$styles, $path );
+ } else {
+ self::$styles[] = $path;
+ }
}
}
@@ -521,12 +526,17 @@ class OC_Util {
*
* @param string $application application id
* @param string|null $file filename
+ * @param bool $prepend prepend the Style to the beginning of the list
* @return void
*/
- public static function addVendorStyle($application, $file = null) {
+ public static function addVendorStyle($application, $file = null, $prepend = false) {
$path = OC_Util::generatePath($application, 'vendor', $file);
if (!in_array($path, self::$styles)) {
- self::$styles[] = $path;
+ if ($prepend === true) {
+ array_unshift ( self::$styles, $path );
+ } else {
+ self::$styles[] = $path;
+ }
}
}