Commit db84791b authored by Individual IT Services's avatar Individual IT Services
Browse files

Todo for myself to eliminate double code

This will be in a new PR
parent 2e42f99d
......@@ -444,6 +444,7 @@ class OC_Util {
*/
public static function addScript($application, $file = null, $prepend = false) {
$path = OC_Util::generatePath($application, 'js', $file);
//TODO eliminate double code
if (!in_array($path, self::$scripts)) {
// core js files need separate handling
if ($application !== 'core' && $file !== null) {
......@@ -468,6 +469,7 @@ class OC_Util {
*/
public static function addVendorScript($application, $file = null, $prepend = false) {
$path = OC_Util::generatePath($application, 'vendor', $file);
//TODO eliminate double code
if (! in_array ( $path, self::$scripts )) {
if ($prepend === true) {
array_unshift ( self::$scripts, $path );
......@@ -493,6 +495,7 @@ class OC_Util {
} else {
$path = "l10n/$languageCode";
}
//TODO eliminate double code
if (!in_array($path, self::$scripts)) {
if ($prepend === true) {
array_unshift ( self::$scripts, $path );
......@@ -512,6 +515,7 @@ class OC_Util {
*/
public static function addStyle($application, $file = null, $prepend = false) {
$path = OC_Util::generatePath($application, 'css', $file);
//TODO eliminate double code
if (!in_array($path, self::$styles)) {
if ($prepend === true) {
array_unshift ( self::$styles, $path );
......@@ -531,6 +535,7 @@ class OC_Util {
*/
public static function addVendorStyle($application, $file = null, $prepend = false) {
$path = OC_Util::generatePath($application, 'vendor', $file);
//TODO eliminate double code
if (!in_array($path, self::$styles)) {
if ($prepend === true) {
array_unshift ( self::$styles, $path );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment