public static function element($tagNameOrElementOptions, $contentValue = null, $contentType = Glaze::TYPE_TEXT) { $element = Prepare::element($tagNameOrElementOptions, $contentValue, $contentType); if (burntCheck($element, false) !== false) { $element->serve(); } }
function glazyMultipleFinishSiblings(&$glazyMultiple, $spacing = '') { $count = count($glazyMultiple['elements']); $i = 0; foreach ($glazyMultiple['elements'] as $preparedElement) { glazyElement($preparedElement[0], burntCheck($preparedElement[1]), burntCheck($preparedElement[2])); //call_user_func_array('glazyElement', $preparedElement); $i++; if ($i < $count) { echo $spacing; } } }
/** * Displays the element with its attributes and content. */ public function serve($options = null) { $serveResult = array(); $isRSS = burntCheck($options['isRSS'], false); $isXML = burntCheck($options['isXML'], $isRSS); $isRootElement = burntCheck($options['isRootElement'], false); if ($isXML && $isRootElement) { echo '<?xml version="1.0"?>' . "\n"; } $tagName = $this->tagName; $attributes = $this->attributes; echo "<{$tagName}"; if (!empty($attributes)) { self::serveAttributesArray($attributes); } $isSelfClosing = burntCheck($options['isSelfClosing'], self::tagIsSelfClosing($tagName, $options)); if ($isXML && $isSelfClosing) { echo ' />'; } else { echo '>'; } $addNewLineAfterOpening = burntCheck($options['addNewLineAfterOpening'], self::tagShouldAddNewLineAfterOpening($tagName, $options)); if ($addNewLineAfterOpening) { echo "\n"; } $innerPreparedItem = $this->innerPreparedItem; $innerServeResult = null; if (isset($innerPreparedItem)) { $childOptions = array_merge((array) $options, array('isRootElement' => false)); $innerServeResult = Serve::serve($innerPreparedItem, $childOptions); } if ($addNewLineAfterOpening && empty($innerServeResult['endedWithNewLine'])) { echo "\n"; } if (!$isSelfClosing) { echo "</{$tagName}>"; } $addNewLineAfterClosing = burntCheck($options['addNewLineAfterClosing'], self::tagShouldAddNewLineAfterClosing($tagName, $options)); if ($addNewLineAfterClosing) { echo "\n"; $serveResult['endedWithNewLine'] = true; } return $serveResult; }
function glazySetLatestOpenElementKeyReturningOldValue($key, $value) { global $glazyOpenElements; $latestOpenElement =& $glazyOpenElements[count($glazyOpenElements) - 1]; $oldValue = burntCheck($latestOpenElement[$key]); $latestOpenElement[$key] = $value; return $oldValue; }