Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/vote/lib/vote/ |
Upload File : |
<?php /** * Bitrix Framework * @package bitrix * @subpackage vote * @copyright 2001-2016 Bitrix */ namespace Bitrix\Vote\Vote; use \Bitrix\Main\Localization\Loc; Loc::loadMessages(__FILE__); class Anonymity { const UNDEFINED = 0; const PUBLICLY = 1; const ANONYMOUSLY = 2; /** * Gets types list * @return array */ public static function getList() { return (new \ReflectionClass(__CLASS__))->getConstants(); } /** * Gets types list * @return array */ public static function getTitledList() { $res = (new \ReflectionClass(__CLASS__))->getConstants(); $result = array(); foreach ($res as $code => $id) { $result[$id] = Loc::getMessage("VOTE_ANONYMITY_TYPE_".$code); } return $result; } /** * @return array */ public static function getValues() { return array_values(self::getList()); } /** * Returns visibility user voting result for others. * @param bool $userValue * @param $voteValue * @return bool */ public static function isUserVoteVisible(bool $userValue, int $voteValue) { if ($voteValue === self::ANONYMOUSLY) return false; else if ($voteValue === self::PUBLICLY) return true; return $userValue !== false; } public static function getTitle() { return Loc::getMessage("VOTE_ANONYMITY_TITLE"); } public static function validate($value) { } }