Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -140,4 +140,35 @@ class _Review extends \IPS\Content\Review implements \IPS\Content\EditHistory, \
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'embed.css', 'nexus', 'front' ) );
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'nexus' )->embedProductReview( $this, $this->item(), $renewalTerm, $this->url()->setQueryString( $params ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Do stuff after creating (abstracted as comments and reviews need to do different things)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function postCreate()
|
||||
{
|
||||
parent::postCreate();
|
||||
|
||||
/* If this review is moderated, then let the parent class do it's thing and if it didn't find a reason, see if this specific product requires reviews to be approved */
|
||||
if ( $this->hidden() === 1 )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\core\Approval::loadFromContent( \get_called_class(), $this->id );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
/* No reason found - see if product requires approval of reviews */
|
||||
if ( $this->item()->review_moderate )
|
||||
{
|
||||
$log = new \IPS\core\Approval;
|
||||
$log->content_class = \get_called_class();
|
||||
$log->content_id = $this->id;
|
||||
$log->held_reason = 'item';
|
||||
$log->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user