Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

@@ -55,6 +55,37 @@ class _Records
return NULL;
}
/**
* Can whatever is posted in this editor be moderated?
* If this returns TRUE, we must ensure the content is ran through word, link and image filters
*
* @param \IPS\Member $member The member
* @param \IPS\Helpers\Form\Editor $field The editor field
* @return bool
*/
public function canBeModerated( $member, $field )
{
/* Creating/editing a record */
if ( preg_match( '/^RecordField_(?:new|\d+)_\d+/', $field->options['autoSaveKey'] ) )
{
return TRUE;
}
/* Creating/editing a comment or review */
elseif ( preg_match( '/^(?:editComment|reply|review)\-cms\/records\d+\-\d+/', $field->options['autoSaveKey'] ) )
{
return TRUE;
}
/* Unknown */
else
{
if ( \IPS\IN_DEV )
{
throw new \RuntimeException( 'Unknown canBeModerated: ' . $field->options['autoSaveKey'] );
}
return FALSE;
}
}
/**
* Permission check for attachments
@@ -135,7 +135,7 @@ class _MoveComments
public function getProgress( $data, $offset )
{
$database = \IPS\cms\Databases::load( $data['databaseId'] );
return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack( 'moving_database_comments', NULL, array( 'sprintf' => array( $database->_title ) ) ), 'complete' => $data['done'] ? ( round( 100 / $data['count'] * $data['done'], 2 ) ) : 0 );
return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack( 'moving_database_comments', FALSE, array( 'sprintf' => array( $database->_title ) ) ), 'complete' => $data['done'] ? ( round( 100 / $data['count'] * $data['done'], 2 ) ) : 0 );
}
/**
@@ -168,11 +168,15 @@ class _MoveComments
}
/* I'm not sure how to do this properly yet */
$queued = 0;
$queued = $row->approved;
if ( $row->approved == 0 )
{
$queued = 1;
}
else if ( $row->approved == 1 )
{
$queued = 0;
}
else if ( $row->approved == -1 )
{
$queued = -1;
@@ -191,7 +195,10 @@ class _MoveComments
$post->edit_name = $row->edit_member_name;
$post->post_edit_reason = $row->edit_reason ?: '';
$post->save();
/* Update post before register */
\IPS\Db::i()->update( 'core_post_before_registering', array( 'class' => "\IPS\forums\Topic\Post", 'id' => $post->id ), array( 'class=? and id=?', $commentClass, $row->id ) );
\IPS\Content\Search\Index::i()->index( $post );
$data['lastId'] = $row->id;
@@ -252,14 +259,14 @@ class _MoveComments
{
$record = $recordClass::load( $row->topic_id, 'record_topicid' );
$approved = 1;
$approved = $row->queued;
if ( $row->queued == 1 )
{
$approved = 0;
}
else if ( $row->queued == -1 )
else if ( $row->queued == 0 )
{
$approved = -1;
$approved = 1;
}
$comment = new $commentClass;
@@ -275,7 +282,10 @@ class _MoveComments
$comment->edit_reason = $row->edit_reason;
$comment->edit_member_name = $row->edit_name;
$comment->save();
/* Update post before register */
\IPS\Db::i()->update( 'core_post_before_registering', array( 'class' => $commentClass, 'id' => $comment->id ), array( 'class=? and id=?', "\IPS\forums\Topic\Post", $row->id ) );
\IPS\Content\Search\Index::i()->index( $comment );
$row->delete();
@@ -180,6 +180,6 @@ class _MoveSingleRecord
$recordClass = '\IPS\cms\Records' . $data['databaseId'];
$record = $recordClass::load( $data['recordId'] );
return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack( 'moving_database_comments_single', NULL, array( 'sprintf' => array( $record->url(), $record->mapped('title') ) ) ), 'complete' => 100 / $data['count'] * $data['done'] );
return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack( 'moving_database_comments_single', FALSE, array( 'sprintf' => array( $record->url(), $record->mapped('title') ) ) ), 'complete' => 100 / $data['count'] * $data['done'] );
}
}
@@ -99,7 +99,7 @@ class _ResyncTopicContent
if ( ! $database->forum_record )
{
$cats = iterator_to_array( \IPS\Db::i()->select( 'category_id', 'cms_database_categories', array( 'category_forum_record=1 AND category_database_id=?', $data['databaseId'] ) ) );
$where = array( \IPS\Db::i()->in( 'category_id', $cats ) );
$where[] = array( \IPS\Db::i()->in( 'category_id', $cats ) );
}
if ( \IPS\Db::i()->checkForTable( 'cms_custom_database_' . $data['databaseId'] ) )