<?php
\defined('JPATH_PLATFORM') or die;
abstract
class HTMLHelper
{
public static $formatOptions = array('format.depth' => 0, 'format.eol' => "\n", 'format.indent' => "\t");
protected static $includePaths = array();
protected static $registry = array();
protected static $serviceRegistry;
protected static function extract(
$key)
{
'Support for a three segment service key is deprecated and will be removed in Joomla 5.0, use the service registry instead',
);
}
}
final public static function _(
string $key, ...$methodArgs)
{
}
if (
$prefix ===
'JHtml' && $file !==
'' && static::getServiceRegistry()->hasService($file)) {
$service = static::getServiceRegistry()->getService($file);
$toCall = array($service, $func);
throw new \InvalidArgumentException(
sprintf(
'%s::%s not found.', $file, $func), 500);
}
static::register(
$key, $toCall);
return static::call($toCall, $methodArgs);
}
throw new \InvalidArgumentException(
sprintf(
'%s %s not found.',
$prefix, $file), 500);
}
}
}
throw new \InvalidArgumentException('Access to internal class methods is not allowed.');
}
}
throw new \InvalidArgumentException(
sprintf(
'%s::%s not found.',
$className, $func), 500);
}
static::register(
$key, $toCall);
return static::call($toCall, $methodArgs);
}
{
'Support for registering functions is deprecated and will be removed in Joomla 5.0, use the service registry instead',
);
return true;
}
public static function unregister(
$key)
{
'Support for registering functions is deprecated and will be removed in Joomla 5.0, use the service registry instead',
);
if (isset(static::$registry[
$key])) {
unset(static::$registry[
$key]);
return true;
}
return false;
}
public static function isRegistered(
$key)
{
return isset(static::$registry[
$key]);
}
public static function getServiceRegistry(): Registry
{
if (!static::$serviceRegistry) {
}
return static::$serviceRegistry;
}
protected static function call(callable
$function, $args)
{
foreach ($args as &$arg) {
}
}
{
}
}
{
}
return '<iframe src="' .
$url .
'" ' .
$attribs .
' name="' .
$name .
'">' . $noFrames .
'</iframe>';
}
{
$debugMode = false;
$debugMode = true;
}
if (
strpos($file,
'http') === 0 ||
strpos($file,
'//') === 0) {
$includes = [$file];
} else {
$includes = [];
if ($detectBrowser) {
$browser = $navigator->getBrowser();
$major = $navigator->getMajor();
$minor = $navigator->getMinor();
$minExt = '';
$minExt = '.min';
}
$potential = [
$strip . $minExt,
$strip . '_' . $browser . $minExt,
$strip . '_' . $browser . '_' . $major . $minExt,
$strip . '_' . $browser . '_' . $major . '_' . $minor . $minExt,
];
} else {
$potential = [$strip];
}
if ($relative) {
$client =
$app->isClient(
'administrator') ===
true ?
'administrator' :
'site';
$templaPath =
JPATH_ROOT .
"/media/templates/$client";
}
foreach ($potential as $strip) {
$files = [];
$files[] = $strip . '.' . $ext;
foreach ($files as $file) {
$found = static::addFileToBuffer("$templaPath/$template->template/$folder/$file", $ext, $debugMode);
if (empty($found)) {
$found = static::addFileToBuffer("$templaPath/$template->parent/$folder/$file", $ext, $debugMode);
}
} else {
$found = static::addFileToBuffer("$templaPath/$template->template/$folder/$file", $ext, $debugMode);
}
if (!empty($found)) {
$includes[] = $found;
break;
} else {
list($element, $file) =
explode(
'/', $file, 2);
$found = static::addFileToBuffer(
JPATH_ROOT .
"/media/$extension/$element/$folder/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
$found = static::addFileToBuffer(
JPATH_ROOT .
"/media/$extension/$folder/$element/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
$found = static::addFileToBuffer("$templaPath/$template->template/$folder/system/$element/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
$found = static::addFileToBuffer("$templaPath/$template->parent/$folder/system/$element/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
} else {
$found = static::addFileToBuffer(
JPATH_ROOT .
"/media/system/$folder/$element/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
}
} else {
$found = static::addFileToBuffer(
JPATH_ROOT .
"/media/$extension/$folder/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
$found = static::addFileToBuffer("$templaPath/$template->template/$folder/system/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
$found = static::addFileToBuffer("$templaPath/$template->parent/$folder/system/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
} else {
$found = static::addFileToBuffer("$templaPath/$template->template/$folder/system/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
}
$found = static::addFileToBuffer(
JPATH_ROOT .
"/media/system/$folder/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
}
} else {
$found = static::addFileToBuffer(
JPATH_ROOT .
"/media/system/$folder/$file", $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
}
}
}
}
} else {
foreach ($potential as $strip) {
$files = [];
$files[] = $strip . '.' . $ext;
foreach ($files as $file) {
$found = static::addFileToBuffer(
$path, $ext, $debugMode);
if (!empty($found)) {
$includes[] = $found;
break;
}
}
}
}
}
return $includes;
}
public static function cleanImageURL(
$url)
{
$obj = new \stdClass();
$obj->attributes = [
'width' => 0,
'height' => 0,
];
}
return $obj;
}
if ($mediaUri->hasVar('joomla_image_height')) {
$height = (int) $mediaUri->getVar(
'joomla_image_height');
$width = (int) $mediaUri->getVar(
'joomla_image_width');
$mediaUri->delVar('joomla_image_height');
$mediaUri->delVar('joomla_image_width');
} else {
$fragmentUri =
new Uri($mediaUri->getFragment());
$width = (int) $fragmentUri->getVar(
'width', 0);
$height = (int) $fragmentUri->getVar(
'height', 0);
}
$obj->attributes[
'width'] =
$width;
}
$obj->attributes[
'height'] =
$height;
}
$mediaUri->setFragment('');
$obj->url = $mediaUri->toString();
return $obj;
}
{
$returnPath = (int) $returnPath;
$arguments = '';
if ($pos1 !== false || $pos2 !== false) {
}
if ($returnPath !== -1) {
$path = \count($includes) ? $includes[0] :
null;
}
if ($returnPath === 1) {
return $file;
}
}
if (
strpos($attribute,
'=') ===
false) {
continue;
}
}
}
}
public static function stylesheet($file,
$options = array(),
$attribs = array())
{
if (\
count($includes) === 0) {
return;
}
if (\
count($includes) === 1) {
return $includes[0];
}
return $includes;
}
foreach ($includes as $include) {
if ($pos =
strpos($include,
'?') !==
false) {
}
}
}
{
if (\
count($includes) === 0) {
return;
}
if (\
count($includes) === 1) {
return $includes[0];
}
return $includes;
}
foreach ($includes as $include) {
if ($pos =
strpos($include,
'?') !==
false) {
}
}
}
public static function setFormatOptions(
$options)
{
if (isset(static::$formatOptions[
$key])) {
}
}
}
public static function date(
$input =
'now',
$format =
null, $tz =
true, $gregorian =
false)
{
if ($tz === true) {
$date->setTimezone(
$app->getIdentity()->getTimezone());
} else {
}
}
if ($gregorian) {
}
}
{
foreach (array('image', 'text', 'href', 'alt', 'class') as $param) {
}
}
} else {
}
}
}
$tip =
'<a href="' .
$href .
'">' .
$text .
'</a>';
} else {
}
}
} else {
}
return '<span class="' .
$class .
'" title="' .
$tooltip .
'">' . $tip .
'</span>';
}
public static function tooltipText(
$title =
'',
$content =
'', $translate =
true, $escape =
true)
{
}
if ($translate) {
}
} else {
}
if ($escape) {
}
}
}
{
$calendar =
$lang->getCalendar();
$helperPath = 'system/fields/calendar-locales/date/gregorian/date-helper.min.js';
$helperPath =
'system/fields/calendar-locales/date/' .
strtolower($calendar) .
'/date-helper.min.js';
}
$todayBtn =
$attribs[
'todayBtn'] ??
true;
$weekNumbers =
$attribs[
'weekNumbers'] ??
true;
$showTime =
$attribs[
'showTime'] ??
false;
$fillTable =
$attribs[
'fillTable'] ??
true;
$timeFormat =
$attribs[
'timeFormat'] ?? 24;
$singleHeader =
$attribs[
'singleHeader'] ??
false;
$showTime = ($showTime) ? "1" : "0";
$todayBtn = ($todayBtn) ? "1" : "0";
$weekNumbers = ($weekNumbers) ? "1" : "0";
$fillTable = ($fillTable) ? "1" : "0";
$singleHeader = ($singleHeader) ? "1" : "0";
$tz = date_default_timezone_get();
date_default_timezone_set('UTC');
date_default_timezone_set($tz);
} else {
}
'filter' => $filter,
'todaybutton' => $todayBtn,
'weeknumbers' => $weekNumbers,
'showtime' => $showTime,
'filltable' => $fillTable,
'timeformat' => $timeFormat,
'singleheader' => $singleHeader,
'tag' => $tag,
'helperPath' => $helperPath,
'minYear' => $minYear,
'maxYear' => $maxYear,
'dataAttribute' => '',
'dataAttributes' => '',
'calendar' => $calendar,
'firstday' =>
$lang->getFirstDay(),
);
}
public static function addIncludePath(
$path =
'')
{
'Support for registering lookup paths is deprecated and will be removed in Joomla 5.0, use the service registry instead',
);
}
}
return static::$includePaths;
}
protected static function addFileToBuffer(
$path =
'', $ext =
'', $debugMode =
false)
{
if ($debugMode) {
return self::checkFileOrder($minifiedPath, $nonMinifiedPath);
}
return self::checkFileOrder($nonMinifiedPath, $minifiedPath);
}
$minifiedPath = pathinfo(
$path, PATHINFO_DIRNAME) .
'/' . pathinfo(
$path, PATHINFO_FILENAME) .
'.min.' . $ext;
if ($debugMode) {
return self::checkFileOrder($minifiedPath,
$path);
}
return self::checkFileOrder(
$path, $minifiedPath);
}
protected static function convertToRelativePath(
$path)
{
return str_replace(DIRECTORY_SEPARATOR,
'/', $relativeFilePath);
}
private static function checkFileOrder($first, $second)
{
if (is_file($second)) {
return static::convertToRelativePath($second);
}
if (is_file($first)) {
return static::convertToRelativePath($first);
}
return '';
}
}