FEATURE: add info about not-set homepage into contents overview

This commit is contained in:
Michal Kváček
2016-04-04 21:43:11 +02:00
parent 51b60440be
commit 743c6bdb07
4 changed files with 73 additions and 5 deletions
+36
View File
@@ -88,6 +88,42 @@ class Content extends Model
return $this->subpages;
}
/**
* Is current content draft?
*
* @return bool
*/
public function isDraft() {
return $this->status == self::STATUS_DRAFT;
}
/**
* Is current content visible for all visitors?
*
* @return bool
*/
public function isPublic() {
return $this->status == self::STATUS_PUBLIC;
}
/**
* Is current content visible only for logged users?
*
* @return bool
*/
public function isProtected() {
return $this->status == self::STATUS_PROTECTED;
}
/**
* Is current content visible for logged user OR for everyone?
*
* @return bool
*/
public function isVisible() {
return $this->isPublic() || $this->isProtected();
}
/**
* Returns list of all root pages - those pages, which parent_id is null
*