Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

+18 -11
View File
@@ -11,32 +11,39 @@
namespace IPS\Output\Plugin;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use IPS\Theme;
use function defined;
use function in_array;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Template Plugin - Template
*/
class _Template
class Template
{
/**
* @brief Can be used when compiling CSS
*/
public static $canBeUsedInCss = FALSE;
public static bool $canBeUsedInCss = FALSE;
/**
* Run the plug-in
*
* @param string $data The initial data from the tag
* @param array $options Array of options
* @return string Code to eval
* @param string $data The initial data from the tag
* @param array $options Array of options
* @param string|null $functionName
* @param string $calledClass
* @return array|string Code to eval
*/
public static function runPlugin( $data, $options, $functionName=NULL, $calledClass='IPS\Theme' )
public static function runPlugin( string $data, array $options, ?string $functionName=NULL, string $calledClass='IPS\Theme' ): array|string
{
$params = ( \in_array( 'params', array_keys( $options ) ) ) ? $options['params'] : '';
$params = ( in_array( 'params', array_keys( $options ) ) ) ? $options['params'] : '';
if( mb_strpos( $data, '$' ) === 0 )
{
$data = '{' . $data . '}';
@@ -63,7 +70,7 @@ class _Template
if ( isset( $options['if'] ) )
{
$it['pre'] = "if ( " . \IPS\Theme::expandShortcuts( $options['if'] ) . " ):\n";
$it['pre'] = "if ( " . Theme::expandShortcuts( $options['if'] ) . " ):\n";
$it['post'] = "\nendif;";
}