Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -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;
|
||||
@@ -37,7 +37,7 @@ class _Widget extends \IPS\Widget
|
||||
{
|
||||
$widgets = json_decode( $item['area_widgets'], TRUE );
|
||||
|
||||
if( is_array( $widgets ) )
|
||||
if( \is_array( $widgets ) )
|
||||
{
|
||||
foreach( $widgets as $widget )
|
||||
{
|
||||
@@ -87,7 +87,7 @@ class _Widget extends \IPS\Widget
|
||||
$blocks[ $row['block_key'] ] = $row;
|
||||
}
|
||||
|
||||
if ( count( $blocks ) )
|
||||
if ( \count( $blocks ) )
|
||||
{
|
||||
$uniqueIds = array();
|
||||
foreach( \IPS\Db::i()->select( '*', 'cms_page_widget_areas' ) as $item )
|
||||
@@ -96,9 +96,9 @@ class _Widget extends \IPS\Widget
|
||||
|
||||
foreach( $widgets as $widget )
|
||||
{
|
||||
if ( $widget['app'] === 'cms' and $widget['key'] === 'Blocks' and isset( $widget['unique'] ) and isset( $widget['configuration'] ) and isset( $widget['configuration']['cms_widget_custom_block'] ) )
|
||||
if ( ( isset( $widget['app'] ) and $widget['app'] === 'cms' ) and $widget['key'] === 'Blocks' and isset( $widget['unique'] ) and isset( $widget['configuration'] ) and isset( $widget['configuration']['cms_widget_custom_block'] ) )
|
||||
{
|
||||
if ( in_array( $widget['configuration']['cms_widget_custom_block'], array_keys( $blocks ) ) )
|
||||
if ( \in_array( $widget['configuration']['cms_widget_custom_block'], array_keys( $blocks ) ) )
|
||||
{
|
||||
$uniqueIds[] = $widget['unique'];
|
||||
}
|
||||
@@ -112,9 +112,9 @@ class _Widget extends \IPS\Widget
|
||||
|
||||
foreach( $widgets as $widget )
|
||||
{
|
||||
if ( $widget['app'] === 'cms' and $widget['key'] === 'Blocks' and isset( $widget['unique'] ) and isset( $widget['configuration'] ) and isset( $widget['configuration']['cms_widget_custom_block'] ) )
|
||||
if ( ( isset( $widget['app'] ) and $widget['app'] === 'cms' ) and $widget['key'] === 'Blocks' and isset( $widget['unique'] ) and isset( $widget['configuration'] ) and isset( $widget['configuration']['cms_widget_custom_block'] ) )
|
||||
{
|
||||
if ( in_array( $widget['configuration']['cms_widget_custom_block'], array_keys( $blocks ) ) )
|
||||
if ( \in_array( $widget['configuration']['cms_widget_custom_block'], array_keys( $blocks ) ) )
|
||||
{
|
||||
$uniqueIds[] = $widget['unique'];
|
||||
}
|
||||
@@ -122,7 +122,7 @@ class _Widget extends \IPS\Widget
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $uniqueIds ) )
|
||||
if ( \count( $uniqueIds ) )
|
||||
{
|
||||
$widgetRow = \IPS\Db::i()->select( '*', 'core_widgets', array( '`key`=? and app=?', 'Blocks', 'cms' ) )->first();
|
||||
|
||||
@@ -130,7 +130,7 @@ class _Widget extends \IPS\Widget
|
||||
{
|
||||
$caches = json_decode( $widgetRow['caches'], TRUE );
|
||||
|
||||
if ( is_array( $caches ) )
|
||||
if ( \is_array( $caches ) )
|
||||
{
|
||||
$save = $caches;
|
||||
foreach( $caches as $key => $time )
|
||||
@@ -149,9 +149,9 @@ class _Widget extends \IPS\Widget
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $save ) !== count( $caches ) )
|
||||
if ( \count( $save ) !== \count( $caches ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_widgets', array( 'caches' => ( count( $save ) ? json_encode( $save ) : NULL ) ), array( 'id=?', $widgetRow['id'] ) );
|
||||
\IPS\Db::i()->update( 'core_widgets', array( 'caches' => ( \count( $save ) ? json_encode( $save ) : NULL ) ), array( 'id=?', $widgetRow['id'] ) );
|
||||
unset( \IPS\Data\Store::i()->widgets );
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ class _Widget extends \IPS\Widget
|
||||
{
|
||||
$data = json_decode( $row['area_widgets'], TRUE );
|
||||
|
||||
if ( count( $data ) )
|
||||
if ( \count( $data ) )
|
||||
{
|
||||
foreach( $data as $widget )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user