| Server IP : 37.9.174.138 / Your IP : 216.73.216.117 Web Server : Apache System : Linux vps6.backend.sk 6.12.100+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.100-1 (2026-07-30) x86_64 User : ftpuser ( 1001) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/backend-accounting.sk/app/app/constants/ |
Upload File : |
<?php
namespace app\constants;
class State {
CONST ACTIVE = "ACTIVE";
CONST DISABLED = "DISABLED";
CONST CREATED = "CREATED";
CONST APPROVED = "APPROVED";
CONST ARCHIVED = "ARCHIVED";
CONST DELETED = "DELETED";
CONST DISMISSED = "DISMISSED";
private static $messages = array(
self::ACTIVE => "Aktívne",
self::DISABLED => "Neaktívne",
self::CREATED => "Vytvorené",
self::APPROVED => "Schválené",
self::ARCHIVED => "Archivované",
self::DELETED => "Zmazané",
self::DISMISSED => "Zamietnuté"
);
private static $labels = array(
self::ACTIVE => "success",
self::DISABLED => "warning",
self::CREATED => "default",
self::APPROVED => "primary",
self::ARCHIVED => "danger",
self::DELETED => "danger",
self::DISMISSED => "danger"
);
static function getConstants() {
$oClass = new \ReflectionClass(__CLASS__);
return $oClass->getConstants();
}
public static function getStateMessage($state = false) {
$t = \app\classes\Translator::getInstance();
if ($state === false) {
return array_map(array($t, "_get"), self::$messages);
}
return isset(self::$messages[$state]) ? $t->_get(self::$messages[$state]) : FALSE;
}
public static function getLabelClass($state) {
return isset(self::$labels[$state]) ? self::$labels[$state] : FALSE;
}
public static function ADMIN_STATES($archived = true) {
return $archived ? array(\app\constants\State::ACTIVE, \app\constants\State::DISABLED, \app\constants\State::ARCHIVED) : array(\app\constants\State::ACTIVE, \app\constants\State::DISABLED);
}
public static function ALL_STATES() {
return array(\app\constants\State::ACTIVE, \app\constants\State::DISABLED, \app\constants\State::ARCHIVED, \app\constants\State::DELETED);
}
}