1<?php
2
3/**
4 * e107 website system
5 *
6 * Copyright (C) 2008-2017 e107 Inc (e107.org)
7 * Released under the terms and conditions of the
8 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
9 *
10 * @file
11 * Provides information about external libraries.
12 */
13
14
15/**
16 * Class theme_library.
17 */
18class theme_library
19{
20
21	/**
22	 * Provides information about external libraries.
23	 */
24	function config()
25	{
26		// TODO - bootswatch...
27		return array();
28	}
29
30    /**
31     * Alters library information before detection and caching takes place.
32     * @param $libraries
33     */
34	function config_alter(&$libraries)
35	{
36		$bootswatch = e107::pref('theme', 'bootswatch', false);
37
38		if(!empty($bootswatch))
39		{
40			// Disable Bootstrap CSS.
41			unset($libraries['cdn.bootstrap']['files']['css']);
42			unset($libraries['cdn.bootstrap']['variants']['dev']['files']['css']);
43			unset($libraries['bootstrap']['files']['css']);
44			unset($libraries['bootstrap']['variants']['dev']['files']['css']);
45		}
46	}
47
48}
49