Version 4.7.8
This commit is contained in:
1 parent
7b7404e741
commit
fd22d99e69
688 files changed
+19814
-10890
No files matched your search
@@ -81,11 +81,6 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\EditHistory,
|
||||
* @brief [Content] Key for hide reasons
|
||||
*/
|
||||
public static $hideLogKey = 'downloads-files';
|
||||
|
||||
/**
|
||||
* @brief Whether to track the sentiment scores in cloud_sentiment_scores for this content
|
||||
*/
|
||||
public $trackSentimentScore = true;
|
||||
|
||||
/**
|
||||
* Get URL for doing stuff
|
||||
|
||||
@@ -113,7 +113,8 @@ class _File extends \IPS\Content\Item implements
|
||||
'edit_member_name' => 'edit_name',
|
||||
'edit_show' => 'append_edit',
|
||||
'edit_reason' => 'edit_reason',
|
||||
'is_anon' => 'is_anon'
|
||||
'is_anon' => 'is_anon',
|
||||
'last_comment_anon' => 'last_comment_anon'
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -2416,6 +2417,7 @@ class _File extends \IPS\Content\Item implements
|
||||
$this->_primaryScreenshotThumb = FALSE;
|
||||
$this->syncTopic();
|
||||
}
|
||||
\IPS\Api\Webhook::fire( 'downloads_new_version', array( $this ) );
|
||||
}
|
||||
|
||||
/* !Embeddable */
|
||||
@@ -2740,4 +2742,25 @@ class _File extends \IPS\Content\Item implements
|
||||
|
||||
return parent::modAction( $action, $member, $reason, $immediately );
|
||||
}
|
||||
|
||||
/**
|
||||
* Can the member delete the pending version
|
||||
*
|
||||
* @param \IPS\Member|NULL $member
|
||||
* @return bool
|
||||
*/
|
||||
public function canDeletePendingVersion( \IPS\Member $member = NULL): bool
|
||||
{
|
||||
if( !$this->hasPendingVersion() )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( $this->canEdit($member) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,29 @@ class _PendingVersion extends \IPS\Content\Item implements \IPS\Content\Hideable
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can delete pending version?
|
||||
*
|
||||
* @param \IPS\Member|NULL $member The member to check for (NULL for currently logged in member)
|
||||
* @return bool
|
||||
*/
|
||||
public function canDelete( $member=NULL )
|
||||
{
|
||||
|
||||
$member = $member ?: \IPS\Member::loggedIn();
|
||||
if( !$member->member_id )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( !$this->author()->member_id == $member->member_id AND !$this->file()->canDeletePendingVersion( $member ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content
|
||||
@@ -288,6 +311,7 @@ class _PendingVersion extends \IPS\Content\Item implements \IPS\Content\Hideable
|
||||
{
|
||||
/* Moderator log */
|
||||
\IPS\Session::i()->modLog( 'modlog__action_newversion_approved', array( (string) $this->file()->url() => FALSE, $this->file()->name => FALSE ), $this->file() );
|
||||
\IPS\Api\Webhook::fire( 'downloads_new_version_approved', $this );
|
||||
}
|
||||
|
||||
return parent::modAction( $action, $member, $reason, $immediately );
|
||||
|
||||
@@ -85,11 +85,6 @@ class _Review extends \IPS\Content\Review implements \IPS\Content\EditHistory, \
|
||||
* @brief [Content] Key for hide reasons
|
||||
*/
|
||||
public static $hideLogKey = 'downloads-files-rev';
|
||||
|
||||
/**
|
||||
* @brief Whether to track the sentiment scores in cloud_sentiment_scores for this content
|
||||
*/
|
||||
public $trackSentimentScore = true;
|
||||
|
||||
/**
|
||||
* Get URL for doing stuff
|
||||
|
||||
Reference in new issue
Block a user