Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+16 -16
View File
@@ -12,7 +12,7 @@
namespace IPS\cms;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -280,9 +280,9 @@ class _Theme extends \IPS\Theme
public function getRawTemplates( $app=array(), $location=array(), $group=array(), $returnType=null, $returnThisSetOnly=false )
{
$returnType = ( $returnType === null ) ? self::RETURN_ALL : $returnType;
$app = ( is_string( $app ) AND $app != '' ) ? array( $app ) : $app;
$location = ( is_string( $location ) AND $location != '' ) ? array( $location ) : $location;
$group = ( is_string( $group ) AND $group != '' ) ? array( $group ) : $group;
$app = ( \is_string( $app ) AND ! empty( $app ) ) ? array( $app ) : $app;
$location = ( \is_string( $location ) AND ! empty( $location ) ) ? array( $location ) : $location;
$group = ( \is_string( $group ) AND ! empty( $group ) ) ? array( $group ) : $group;
$where = array();
$templates = array();
@@ -294,7 +294,7 @@ class _Theme extends \IPS\Theme
foreach( new \DirectoryIterator( static::_getHtmlPath('cms') ) as $location )
{
if ( ! in_array( $location->getFilename(), $fixedLocations ) AND $location->isDir() AND mb_substr( $location->getFilename(), 0, 1 ) !== '.' )
if ( ! \in_array( $location->getFilename(), $fixedLocations ) AND $location->isDir() AND mb_substr( $location->getFilename(), 0, 1 ) !== '.' )
{
$allowedLocations = array();
if ( $returnType & static::RETURN_ONLY_TEMPLATE )
@@ -329,7 +329,7 @@ class _Theme extends \IPS\Theme
}
}
if ( count( $allowedLocations ) and ! in_array( $location->getFilename(), $allowedLocations ) )
if ( \count( $allowedLocations ) and ! \in_array( $location->getFilename(), $allowedLocations ) )
{
continue;
}
@@ -338,7 +338,7 @@ class _Theme extends \IPS\Theme
{
if ( $file->isDir() AND mb_substr( $file->getFilename(), 0, 1 ) !== '.' )
{
if ( $group === NULL or ! count( $group ) or ( in_array( $file->getFilename(), $group ) ) )
if ( $group === NULL or ! \count( $group ) or ( \in_array( $file->getFilename(), $group ) ) )
{
foreach( new \DirectoryIterator( static::_getHtmlPath( 'cms', $location->getFilename(), $file->getFilename() ) ) as $template )
{
@@ -353,7 +353,7 @@ class _Theme extends \IPS\Theme
$params = \IPS\cms\Theme\Template::extractParamsFromTag( $contents );
$container = NULL;
if ( in_array( $key, $seenKeys ) )
if ( \in_array( $key, $seenKeys ) )
{
$key .= filemtime( static::_getHtmlPath( 'cms', $location->getFilename(), $file->getFilename() ) . '/' . $template->getFilename() ) . mt_rand();
}
@@ -416,12 +416,12 @@ class _Theme extends \IPS\Theme
}
else
{
if ( is_array( $location ) AND count( $location ) )
if ( \is_array( $location ) AND \count( $location ) )
{
$where[] = "template_location IN ('" . implode( "','", $location ) . "')";
}
if ( is_array( $group ) AND count( $group ) )
if ( \is_array( $group ) AND \count( $group ) )
{
$where[] = "template_group IN ('" . implode( "','", $group ) . "')";
}
@@ -435,7 +435,7 @@ class _Theme extends \IPS\Theme
{
$where[] = "template_type='js'";
}
$templateNames = array();
$rawTemplates = array();
$originalGroups = array();
@@ -455,7 +455,7 @@ class _Theme extends \IPS\Theme
}
}
if ( count( $originalGroups ) )
if ( \count( $originalGroups ) )
{
foreach( \IPS\Db::i()->select( '*', 'cms_templates', array( array( 'template_original_group = template_group '), array( \IPS\Db::i()->in( 'template_original_group', $originalGroups ) ) ) ) as $row )
{
@@ -471,7 +471,7 @@ class _Theme extends \IPS\Theme
{
foreach( $names as $name )
{
if ( ! in_array( $name, $templateNames[ $group ] ) )
if ( ! \in_array( $name, $templateNames[ $group ] ) )
{
$rawTemplates[] = array_merge( $originalTemplates[ $group . '_' . $name ], array( 'template_group' => $groupMap[ $group ]) );
}
@@ -562,7 +562,7 @@ class _Theme extends \IPS\Theme
{
if ( ! isset( $this->templates[ $app ][ $location ][ $group ] ) )
{
if ( $app === 'cms' AND ! in_array( $location, array( 'admin', 'front', 'global' ) ) )
if ( $app === 'cms' AND ! \in_array( $location, array( 'admin', 'front', 'global' ) ) )
{
$this->templates[ $app ][ $location ][ $group ] = new \IPS\cms\Theme\Template( $app, $location, $group );
}
@@ -579,7 +579,7 @@ class _Theme extends \IPS\Theme
/* Group is saved clean */
$group = static::cleanGroupName( $group );
if ( ( $app !== 'cms' ) OR ( $app === 'cms' AND in_array( $location, array( 'admin', 'front', 'global' ) ) ) )
if ( ( $app !== 'cms' ) OR ( $app === 'cms' AND \in_array( $location, array( 'admin', 'front', 'global' ) ) ) )
{
return \IPS\Theme::i()->getTemplate( $group, $app, $location );
}
@@ -587,7 +587,7 @@ class _Theme extends \IPS\Theme
$key = \strtolower( 'template_cms_' .static::makeBuiltTemplateLookupHash( $app, $location, $group ) . '_' . static::cleanGroupName( $group ) );
/* Still here */
if ( !in_array( $key, array_keys( static::$calledTemplates ) ) )
if ( !\in_array( $key, array_keys( static::$calledTemplates ) ) )
{
/* If we don't have a compiled template, do that now */
if ( !isset( \IPS\Data\Store::i()->$key ) )