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

+14 -15
View File
@@ -12,7 +12,7 @@
namespace IPS\cms\widgets;
/* 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;
@@ -51,11 +51,6 @@ class _RecordFeed extends \IPS\Content\Widget
*/
public function configuration( &$form=null )
{
if ( $form === null )
{
$form = new \IPS\Helpers\Form;
}
$databases = array();
$database = NULL;
foreach( \IPS\cms\Databases::databases() as $obj )
@@ -71,6 +66,8 @@ class _RecordFeed extends \IPS\Content\Widget
static::$class = '\IPS\cms\Records' . $database->id;
}
}
$form = parent::configuration( $form );
if ( isset( $this->configuration['cms_rf_database'] ) )
{
@@ -115,7 +112,7 @@ class _RecordFeed extends \IPS\Content\Widget
foreach( $FieldsClass::data() as $id => $field )
{
if ( in_array( $field->type, array( 'checkbox', 'multiselect', 'attachments' ) ) )
if ( \in_array( $field->type, array( 'checkbox', 'multiselect', 'attachments' ) ) )
{
continue;
}
@@ -202,10 +199,10 @@ class _RecordFeed extends \IPS\Content\Widget
foreach( $values as $k => $v )
{
/* We need to reformat this a little */
if ( is_array( $v ) and isset( $v['start'] ) and isset( $v['end'] ) )
if ( \is_array( $v ) and isset( $v['start'] ) and isset( $v['end'] ) )
{
$start = ( $v['start'] instanceof \IPS\DateTime ) ? $v['start']->getTimestamp() : intval( $v['start'] );
$end = ( $v['end'] instanceof \IPS\DateTime ) ? $v['end']->getTimestamp() : intval( $v['end'] );
$start = ( $v['start'] instanceof \IPS\DateTime ) ? $v['start']->getTimestamp() : \intval( $v['start'] );
$end = ( $v['end'] instanceof \IPS\DateTime ) ? $v['end']->getTimestamp() : \intval( $v['end'] );
$values[ $k ] = array( 'start' => $start, 'end' => $end );
}
@@ -221,6 +218,8 @@ class _RecordFeed extends \IPS\Content\Widget
*/
protected function buildWhere()
{
static::$class = '\IPS\cms\Records' . $this->configuration['cms_rf_database'];
$where = parent::buildWhere();
$fieldClass = 'IPS\cms\Fields' . $this->configuration['cms_rf_database'];
@@ -231,12 +230,12 @@ class _RecordFeed extends \IPS\Content\Widget
$k = 'field_' . $f;
if ( isset( $customFields[ $f ] ) and $v !== '___any___' AND $v !== NULL )
{
if ( is_array( $v ) )
if ( \is_array( $v ) )
{
if ( array_key_exists( 'start', $v ) or array_key_exists( 'end', $v ) )
{
$start = ( $v['start'] instanceof \IPS\DateTime ) ? $v['start']->getTimestamp() : intval( $v['start'] );
$end = ( $v['end'] instanceof \IPS\DateTime ) ? $v['end']->getTimestamp() : intval( $v['end'] );
$start = ( $v['start'] instanceof \IPS\DateTime ) ? $v['start']->getTimestamp() : \intval( $v['start'] );
$end = ( $v['end'] instanceof \IPS\DateTime ) ? $v['end']->getTimestamp() : \intval( $v['end'] );
if ( $start or $end )
{
@@ -246,7 +245,7 @@ class _RecordFeed extends \IPS\Content\Widget
else
{
$like = array();
if ( count( $v ) )
if ( \count( $v ) )
{
foreach( $v as $val )
{
@@ -256,7 +255,7 @@ class _RecordFeed extends \IPS\Content\Widget
}
}
$where[] = array( '( ' . \IPS\Db::i()->in( $k, $v ) . ( count( $like ) ? " OR (" . implode( ' OR ', $like ) . ') )' : ')' ) );
$where[] = array( '( ' . \IPS\Db::i()->in( $k, $v ) . ( \count( $like ) ? " OR (" . implode( ' OR ', $like ) . ') )' : ')' ) );
}
}
}