Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

+13 -4
View File
@@ -38,7 +38,7 @@ class _ItemController extends \IPS\Api\Controller
/* Containers */
if ( $containerParam and isset( \IPS\Request::i()->$containerParam ) )
{
$where[] = array( \IPS\Db::i()->in( $class::$databasePrefix . $class::$databaseColumnMap['container'], array_map( 'intval', array_filter( explode( ',', \IPS\Request::i()->$containerParam ) ) ) ) );
$where[] = array( \IPS\Db::i()->in( $class::$databaseTable . '.' . $class::$databasePrefix . $class::$databaseColumnMap['container'], array_map( 'intval', array_filter( explode( ',', \IPS\Request::i()->$containerParam ) ) ) ) );
}
/* Authors */
@@ -383,7 +383,7 @@ class _ItemController extends \IPS\Api\Controller
* @param string $firstPostParam The parameter which contains the body for the first comment
* @return \IPS\Content\Item
*/
protected function _create( \IPS\Node\Model $container = NULL, \IPS\Member $author, $firstPostParam = 'post' )
protected function _create( ?\IPS\Node\Model $container, \IPS\Member $author, $firstPostParam = 'post' )
{
$class = $this->class;
@@ -423,10 +423,17 @@ class _ItemController extends \IPS\Api\Controller
\IPS\Content\Search\Index::i()->index( $item );
}
/* Send notifications */
/* Send webhooks */
if ( \in_array( $item->hidden(), array( -1, 0, 1 ) ) ) // i.e. not post before register or pending deletion
{
\IPS\Api\Webhook::fire( str_replace( '\\', '', \substr( \get_class( $item ), 3 ) ) . '_create', $item, $item->webhookFilters() );
}
/* Send notifications and dish out points */
if ( !$item->hidden() )
{
$item->sendNotifications();
$author->achievementAction( 'core', 'NewContentItem', $item );
}
elseif( !\in_array( $item->hidden(), array( -1, -3 ) ) )
{
@@ -482,6 +489,8 @@ class _ItemController extends \IPS\Api\Controller
$poll->setDataFromForm( $formatted, TRUE );
$poll->save();
$item->author()->achievementAction( 'core', 'NewPoll', $poll );
$item->poll_state = $poll->pid;
}
@@ -554,4 +563,4 @@ class _ItemController extends \IPS\Api\Controller
isset( \IPS\Request::i()->perPage ) ? \IPS\Request::i()->perPage : NULL
);
}
}
}