File: cssloader.php

package info (click to toggle)
kopano-webapp-plugin-files 2.1.5%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,540 kB
  • sloc: php: 15,863; xml: 494; java: 295; python: 72; sh: 44; makefile: 11
file content (38 lines) | stat: -rw-r--r-- 917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Files\Backend\FTP;

require_once __DIR__ . "/../class.abstract_css_loader.php";

use Files\Backend\AbstractCSSLoader;

class BackendCSSLoader extends AbstractCSSLoader
{
	function __construct()
	{
		$this->CSS_PATH = __DIR__ . "/css/";
	}

	/**
	 * Returns a combined CSS String
	 *
	 * @param bool $debug
	 * @return string
	 */
	public function get_combined_css($debug = false)
	{
		// Populate the list of directories to check against
		if (($directoryHandle = opendir($this->CSS_PATH)) !== FALSE) {
			while (($file = readdir($directoryHandle)) !== false) {
				// Make sure we're not dealing with a folder or a link to the parent directory
				if (is_dir($this->CSS_PATH . $file) || ($file == '.' || $file == '..') === true) {
					continue;
				}

				// Add file content to our buffer
				$this->cssBuffer .= file_get_contents($this->CSS_PATH . $file);
			}
		}

		return $this->cssBuffer;
	}
}