CoolFace
Apppublic

kenken999/php

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
layout.php95 linesDownload Raw Back to classes
1<?php2class TLayout3{4	var $containers = array();5	var $container_properties = array();6	var $blocks = array();7	var $name = "";8	var $version;9	var $style = "";10	var $styleMobile = "";11	var $skins = array();12	var $skinsparams = array();13	var $bootstrapTheme = "";14	var $customCssPageName = "";15 16	function __construct($name, $style, $styleMobile)17	{18		$this->name = $name;19		$this->style = $style;20		$this->styleMobile = $styleMobile;21	}22 23	function pdfStyle()24	{25		return "Pdf".substr($this->styleMobile,6);26	}27 28	function isBrickSet($brickName)29	{30		foreach($this->containers as $container)31		{32			foreach($container as $brick)33			{34				if($brick["name"] == $brickName)35				{36					return true;37				}38			}39		}40		return false;41	}42 43	function getBrickTableName($brickName)44	{45		foreach($this->containers as $container)46		{47			foreach($container as $brick)48			{49				if($brick["name"] == $brickName)50				{51					return $brick["table"];52				}53			}54		}55		return "";56	}57	58	/**59	 *  Returns list of CSS files required for displaying the layout60	 */61	public function getCSSFiles($rtl = false, $mobile = false, $pdf = false)62	{63		$files = array();64		$suffix = "";65		if( $rtl )66			$suffix = "RTL";67			68		$files[] = "include/bootstrap/css/bootstrap.min.css";69		if(strlen($this->bootstrapTheme))70			$files[] = "styles/bootstrap/".$this->bootstrapTheme."/css/bootstrap-theme.min.css";71		else72			$files[] = "include/bootstrap/css/bootstrap-theme.min.css";73 74		if($pdf)75			$files[] = "styles/pdf.css";76 77		$files[] = "styles/bs".$suffix.".css";78 79		// tweaks.css must follow bs.css80		if(strlen($this->bootstrapTheme))81		{82			if( file_exists( getabspath( "styles/bootstrap/".$this->bootstrapTheme."/css/tweaks".$suffix.".css" ) ) )83				$files[] = "styles/bootstrap/".$this->bootstrapTheme."/css/tweaks".$suffix.".css";84		}85 86		if( file_exists( getabspath( "styles/custom/custom.css" ) ) )87			$files[] = "styles/custom/custom".$suffix.".css";88		89		if( strlen( $this->customCssPageName ) && file_exists( getabspath( "styles/custom/".$this->customCssPageName.".css" ) ) )90			$files[] = "styles/custom/".$this->customCssPageName.$suffix.".css";91 92		return $files;93	}94};95?>