26 if (empty($initFolders))
28 $initFolders = Translate\Config::getInitPath();
29 if (empty($initFolders))
31 $initFolders = array(Translate\Config::getDefaultPath());
35 $path = (string)$path;
37 foreach ($initFolders as $oneFolder)
39 if (\mb_strpos($path, $oneFolder) === 0)
92 public static function canView($checkUser): bool
94 if (!($checkUser instanceof \CUser) && !($checkUser instanceof Main\Engine\
CurrentUser))
99 if (self::isAdmin($checkUser))
106 $userRights = \CMain::getUserRight(
'translate', $checkUser->getUserGroups());
108 elseif ($checkUser instanceof \CUser)
110 $userRights = \CMain::getUserRight(
'translate', $checkUser->getUserGroupArray());
113 return ($userRights >= self::READ);
123 public static function canEdit($checkUser): bool
125 if (!($checkUser instanceof \CUser) && !($checkUser instanceof Main\Engine\
CurrentUser))
130 if (self::isAdmin($checkUser))
137 $userRights = \CMain::getUserRight(
'translate', $checkUser->getUserGroups());
139 elseif ($checkUser instanceof \CUser)
141 $userRights = \CMain::getUserRight(
'translate', $checkUser->getUserGroupArray());
144 return ($userRights >= self::WRITE);