From fa7cee16af88e21e198fa4f879f24260b91b3ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3na=20Lore?= Date: Sat, 25 Jun 2016 08:36:22 +0200 Subject: [PATCH] Provides the ability to use variant for e107::library(load). --- e107_handlers/e107_class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 16cc82a08..d117a3daa 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -1707,13 +1707,19 @@ class e107 * - 'load': Loads a library. * @param string $library * The name of the library to detect/load. + * @param string $variant + * (Optional for 'load') The name of the variant to load. Note that only one variant of a library can be loaded + * within a single request. The variant that has been passed first is used; different variant names in subsequent + * calls are ignored. * * @return array|boolean * - In case of 'detect': An associative array containing registered information for the library specified by * $name, or FALSE if the library $name is not registered. * - In case of 'load': An associative array of the library information. + * - In case of 'info': An associative array containing registered information for all libraries, the registered + * information for the library specified by $name, or FALSE if the library $name is not registered. */ - public static function library($action = '', $library = null) + public static function library($action = '', $library = null, $variant = null) { $libraryHandler = e107::getLibrary(); @@ -1724,7 +1730,7 @@ class e107 break; case 'load': - return $libraryHandler->load($library); + return $libraryHandler->load($library, $variant); break; case 'info':