mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Code style update in Content.php
This commit is contained in:
parent
e359659529
commit
7fb89d4c50
@ -410,12 +410,12 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
public function canArchive()
|
||||
{
|
||||
// Currently global content can not be archived
|
||||
if(!$this->contentcontainer_id) {
|
||||
if (!$this->contentcontainer_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// No need to archive content on an archived container, content is marked as archived already
|
||||
if($this->content->content->getContainer()->isArchived()) {
|
||||
if ($this->content->content->getContainer()->isArchived()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -582,9 +582,9 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
* HActiveRecordContent (e.g. Post) to overwrite this behavior.
|
||||
* e.g. in case there is no wall entry available for this content.
|
||||
*
|
||||
* @since 0.11.1
|
||||
* @param boolean $scheme
|
||||
* @return string the URL
|
||||
* @since 0.11.1
|
||||
*/
|
||||
public function getUrl($scheme = false)
|
||||
{
|
||||
@ -637,8 +637,8 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
* Relation to ContentContainer model
|
||||
* Note: this is not a Space or User instance!
|
||||
*
|
||||
* @since 1.1
|
||||
* @return \yii\db\ActiveQuery
|
||||
* @since 1.1
|
||||
*/
|
||||
public function getContentContainer()
|
||||
{
|
||||
@ -648,8 +648,8 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
/**
|
||||
* Returns the ContentTagRelation query.
|
||||
*
|
||||
* @since 1.2.2
|
||||
* @return \yii\db\ActiveQuery
|
||||
* @since 1.2.2
|
||||
*/
|
||||
public function getTagRelations()
|
||||
{
|
||||
@ -659,8 +659,8 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
/**
|
||||
* Returns all content related tags ContentTags related to this content.
|
||||
*
|
||||
* @since 1.2.2
|
||||
* @return \yii\db\ActiveQuery
|
||||
* @since 1.2.2
|
||||
*/
|
||||
public function getTags($tagClass = ContentTag::class)
|
||||
{
|
||||
@ -670,9 +670,9 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
/**
|
||||
* Adds a new ContentTagRelation for this content and the given $tag instance.
|
||||
*
|
||||
* @since 1.2.2
|
||||
* @param ContentTag $tag
|
||||
* @return bool if the provided tag is part of another ContentContainer
|
||||
* @since 1.2.2
|
||||
*/
|
||||
public function addTag(ContentTag $tag)
|
||||
{
|
||||
@ -693,8 +693,8 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
/**
|
||||
* Adds the given ContentTag array to this content.
|
||||
*
|
||||
* @since 1.3
|
||||
* @param $tags ContentTag[]
|
||||
* @since 1.3
|
||||
*/
|
||||
public function addTags($tags)
|
||||
{
|
||||
@ -780,11 +780,11 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
/**
|
||||
* Checks if user can view this content.
|
||||
*
|
||||
* @since 1.1
|
||||
* @param User|integer $user
|
||||
* @return boolean can view this content
|
||||
* @throws Exception
|
||||
* @throws \Throwable
|
||||
* @since 1.1
|
||||
*/
|
||||
public function canView($user = null)
|
||||
{
|
||||
@ -795,7 +795,7 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
}
|
||||
|
||||
// Check global content visibility, private global content is visible for all users
|
||||
if(empty($this->contentcontainer_id) && !Yii::$app->user->isGuest) {
|
||||
if (empty($this->contentcontainer_id) && !Yii::$app->user->isGuest) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -843,15 +843,15 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
}
|
||||
|
||||
// GLobal content
|
||||
if(!$this->container) {
|
||||
if (!$this->container) {
|
||||
return $this->isPublic();
|
||||
}
|
||||
|
||||
if($this->container instanceof Space) {
|
||||
if ($this->container instanceof Space) {
|
||||
return $this->isPublic() && $this->container->visibility == Space::VISIBILITY_ALL;
|
||||
}
|
||||
|
||||
if($this->container instanceof User) {
|
||||
if ($this->container instanceof User) {
|
||||
return $this->isPublic() && $this->container->visibility == User::VISIBILITY_ALL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user