diff options
Diffstat (limited to 'app/class')
-rw-r--r-- | app/class/Model.php | 6 | ||||
-rw-r--r-- | app/class/Page.php | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/app/class/Model.php b/app/class/Model.php index 3bf3675..e3b0c17 100644 --- a/app/class/Model.php +++ b/app/class/Model.php @@ -98,6 +98,12 @@ abstract class Model 'error' => 'error' ]; + public const SECURE_LEVELS = [ + 0 => 'public', + 1 => 'private', + 2 => 'not_published' + ]; + public const COLUMNS = [ 'id', 'favicon', diff --git a/app/class/Page.php b/app/class/Page.php index b1c6b49..a369aed 100644 --- a/app/class/Page.php +++ b/app/class/Page.php @@ -225,15 +225,7 @@ class Page extends Dbitem public function secure($type = 'int') { if ($type == 'string') { - if ($this->secure == 0) { - $secure = 'public'; - } - if ($this->secure == 1) { - $secure = 'private'; - } - if ($this->secure == 2) { - $secure = 'not_published'; - } + return Model::SECURE_LEVELS[$this->secure]; } else { return $this->secure; } |