Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

@@ -420,6 +420,8 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
*/
public function form( &$form )
{
$database = \IPS\cms\Databases::load( \IPS\Request::i()->database_id );
/* Build form */
$form->addTab( 'content_content_form_tab__config' );
@@ -481,7 +483,7 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
$class = \get_called_class();
$form->add( new \IPS\Helpers\Form\Node( 'category_parent_id', ( ! $this->id ) ? ( isset( \IPS\Request::i()->parent ) ? \IPS\Request::i()->parent : 0 ) : $this->parent_id, FALSE, array(
'class' => '\IPS\cms\Categories' . \IPS\Request::i()->database_id,
'class' => '\IPS\cms\Categories' . $database->id,
'disabled' => false,
'zeroVal' => 'node_no_parent',
'permissionCheck' => function( $node ) use ( $class )
@@ -543,6 +545,17 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
'database_forum_delete'
)
), NULL, NULL, NULL, 'category_forum_override' ) );
try
{
\IPS\Db::i()->select( '*', 'core_queue', [ "`app`=? AND `key`=? AND `data` LIKE CONCAT( '%', ?, '%' )", 'cms', 'MoveComments', 'databaseID":' . $database->id ] )->first();
\IPS\Member::loggedIn()->language()->words['database_forum_record_desc'] = \IPS\Member::loggedIn()->language()->addToStack( 'database_forum_comments_in_progress' );
$disabled = true;
}
catch( \UnderflowException $e )
{
$disabled = FALSE;
}
$form->add( new \IPS\Helpers\Form\YesNo( 'database_forum_record', $this->id ? $this->forum_record : FALSE, FALSE, array( 'togglesOn' => array(
'database_forum_comments',
@@ -550,9 +563,10 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
'database_forum_prefix',
'database_forum_suffix',
'database_forum_delete'
) ), NULL, NULL, NULL, 'database_forum_record' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'database_forum_comments', $this->id ? $this->forum_comments : FALSE, FALSE, array(), NULL, NULL, NULL, 'database_forum_comments' ) );
),
'disabled' => $disabled ), NULL, NULL, NULL, 'database_forum_record' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'database_forum_comments', $this->id ? $this->forum_comments : FALSE, FALSE, array( 'disabled' => $disabled ), NULL, NULL, NULL, 'database_forum_comments' ) );
$form->add( new \IPS\Helpers\Form\Node( 'database_forum_forum', $this->id ? $this->forum_forum : NULL, FALSE, array(
'class' => '\IPS\forums\Forum',
@@ -579,8 +593,7 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
$cats = $this->id ? ( $this->fields === NULL ? '*' : $this->fields ) : '*';
$options = array();
$fieldClass = 'IPS\cms\Fields' . \IPS\Request::i()->database_id;
$database = \IPS\cms\Databases::load( \IPS\Request::i()->database_id );
$fieldClass = 'IPS\cms\Fields' . $database->id;
foreach( $fieldClass::data( NULL, NULL, $fieldClass::FIELD_SKIP_TITLE_CONTENT ) as $field )
{
@@ -318,7 +318,23 @@ class _Dispatcher extends \IPS\Dispatcher
\IPS\Dispatcher::i()->dispatcherController = $controller;
\IPS\Output::i()->defaultSearchOption = array( "cms_records{$this->databaseId}", "cms_records{$this->databaseId}_pl" );
/* Is this the default application? Default app should search all */
if ( ! \IPS\Application::load('cms')->default )
{
/* If database doesn't allow search, default to all */
if ( ! $database->search )
{
\IPS\Output::i()->defaultSearchOption = array( 'all', 'search_everything' );
}
else
{
\IPS\Output::i()->defaultSearchOption = array( "cms_records{$this->databaseId}", "cms_records{$this->databaseId}_pl" );
}
}
else
{
\IPS\Output::i()->defaultSearchOption = array( 'all', 'search_everything' );
}
/* Add database key to body classes for easier database specific themeing */
\IPS\Output::i()->bodyClasses[] = 'cCmsDatabase_' . $database->key;
+5 -2
View File
@@ -1524,7 +1524,10 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
$results[] = $item;
}
return \IPS\Theme::i()->getTemplate( 'global', 'cms', 'front' )->basicRelationship( $results );
if( \count( $results ) )
{
return \IPS\Theme::i()->getTemplate( 'global', 'cms', 'front' )->basicRelationship( $results );
}
}
return NULL;
@@ -2872,7 +2875,7 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
{
try
{
\IPS\Db::i()->dropColumn( static::$contentDatabaseTable, "field_{$this->id}" );
\IPS\Db::i()->dropColumn( 'cms_custom_database_' . static::$customDatabaseId, "field_{$this->id}" );
}
catch( \IPS\Db\Exception $e ) { }
}
+22 -4
View File
@@ -1861,11 +1861,17 @@ class _Records extends \IPS\Content\Item implements
* Return forum sync forum
*
* @return int
* @throws \UnderflowException
*/
public function get__forum_forum()
public function get__forum_forum(): int
{
if ( $this->container()->forum_override and static::database()->use_categories )
{
if( !$this->container()->forum_forum )
{
throw new \UnderflowException('forum_sync_disabled');
}
return $this->container()->forum_forum;
}
@@ -2143,7 +2149,11 @@ class _Records extends \IPS\Content\Item implements
try
{
$recordClass = 'IPS\cms\Records' . $record['map_origin_database_id'];
$return[ $record['map_field_id'] ][] = $recordClass::load( $record['map_origin_item_id'] );
$linkedRecord = $recordClass::load( $record['map_origin_item_id'] );
if( $linkedRecord->canView() )
{
$return[ $record['map_field_id'] ][] = $linkedRecord;
}
}
catch ( \Exception $ex ) { }
}
@@ -3823,11 +3833,18 @@ class _Records extends \IPS\Content\Item implements
$url = NULL;
}
/* Remove Lazyload from fields */
$fields = [];
foreach( $this->fieldValues() as $k => $v )
{
$fields[ $k ] = \is_string( $v ) ? \IPS\Text\Parser::removeLazyLoad( $v ) : $v;
}
$return = array(
'id' => $this->primary_id_field,
'title' => $this->_title,
'category' => $this->container() ? $this->container()->apiOutput() : null,
'fields' => $this->fieldValues(),
'fields' => $fields,
'author' => $this->author()->apiOutput( $authorizedMember ),
'date' => \IPS\DateTime::ts( $this->record_saved )->rfc3339(),
'description' => \IPS\Text\Parser::removeLazyLoad( $this->content() ),
@@ -3896,9 +3913,10 @@ class _Records extends \IPS\Content\Item implements
* @param bool $joinAuthor If true, will join the members table for the author
* @param bool $joinLastCommenter If true, will join the members table for the last commenter
* @param bool $showMovedLinks If true, moved item links are included in the results
* @param array|null $location Array of item lat and long
* @return \IPS\Patterns\ActiveRecordIterator|int
*/
public static function getItemsWithPermission( $where=array(), $order=NULL, $limit=10, $permissionKey='read', $includeHiddenItems=\IPS\Content\Hideable::FILTER_AUTOMATIC, $queryFlags=0, \IPS\Member $member=NULL, $joinContainer=FALSE, $joinComments=FALSE, $joinReviews=FALSE, $countOnly=FALSE, $joins=NULL, $skipPermission=FALSE, $joinTags=TRUE, $joinAuthor=TRUE, $joinLastCommenter=TRUE, $showMovedLinks=FALSE )
public static function getItemsWithPermission( $where=array(), $order=NULL, $limit=10, $permissionKey='read', $includeHiddenItems=\IPS\Content\Hideable::FILTER_AUTOMATIC, $queryFlags=0, \IPS\Member $member=NULL, $joinContainer=FALSE, $joinComments=FALSE, $joinReviews=FALSE, $countOnly=FALSE, $joins=NULL, $skipPermission=FALSE, $joinTags=TRUE, $joinAuthor=TRUE, $joinLastCommenter=TRUE, $showMovedLinks=FALSE, $location=NULL )
{
$where = static::getItemsWithPermissionWhere( $where, $permissionKey, $member, $joinContainer, $skipPermission );
return parent::getItemsWithPermission( $where, $order, $limit, $permissionKey, $includeHiddenItems, $queryFlags, $member, $joinContainer, $joinComments, $joinReviews, $countOnly, $joins, $skipPermission, $joinTags, $joinAuthor, $joinLastCommenter, $showMovedLinks );
+1 -1
View File
@@ -173,7 +173,7 @@ class _Widget extends \IPS\Widget
{
$data = json_decode( $row['area_widgets'], TRUE );
if ( \count( $data ) )
if ( is_countable( $data ) AND \count( $data ) )
{
foreach( $data as $widget )
{