44 public static function getImageTagByType(
string $a_type,
string $a_path,
bool $a_big =
false): string
48 $lng = $DIC->language();
56 return "<img src=\"" .
$filename .
"\" alt=\"" .
$lng->txt(
"obj_" . $a_type) .
"\" title=\"" .
$lng->txt(
58 ) .
"\" border=\"0\" vspace=\"0\"/>";
69 string $module_path =
"",
70 string $mode =
"output",
75 $styleDefinition = null;
76 if (isset($DIC[
"styleDefinition"])) {
77 $styleDefinition = $DIC[
"styleDefinition"];
80 if (is_int(strpos(
$_SERVER[
"PHP_SELF"],
"setup.php"))) {
83 if ($module_path !=
"") {
84 $module_path =
"/" . $module_path;
88 $default_img =
"." . $module_path .
"/templates/default/images/" .
$img;
94 if (is_object($styleDefinition)) {
95 $image_dir = $styleDefinition->getImageDirectory($current_style);
98 if ($current_skin ==
"default") {
99 $user_img =
"." . $module_path .
"/templates/default/" . $image_dir .
"/" .
$img;
100 $skin_img =
"." . $module_path .
"/templates/default/images/" .
$img;
101 } elseif (is_object($styleDefinition) && $current_skin !=
"default") {
102 $user_img =
"./Customizing/global/skin/" .
103 $current_skin . $module_path .
"/" . $image_dir .
"/" .
$img;
104 $skin_img =
"./Customizing/global/skin/" .
105 $current_skin . $module_path .
"/images/" .
$img;
110 return "./images/" .
$img;
111 } elseif (@file_exists($user_img) && $image_dir !=
"") {
113 } elseif (file_exists($skin_img)) {
128 if (substr($relative_path, 0, 2) ==
'./') {
129 $relative_path = (substr($relative_path, 1));
131 if (substr($relative_path, 0, 1) !=
'/') {
132 $relative_path =
'/' . $relative_path;
134 $htmlpath = ILIAS_HTTP_PATH . $relative_path;
149 string $mode =
"output",
150 string $a_css_name =
"",
151 string $a_css_location =
"" 159 $stylesheet_name = (strlen($a_css_name))
162 if (strlen($a_css_location) && (strcmp(substr($a_css_location, -1),
"/") != 0)) {
163 $a_css_location = $a_css_location .
"/";
170 ) .
"/" . $a_css_location . $stylesheet_name;
173 $filename =
"./" . $a_css_location .
"templates/default/" . $stylesheet_name;
175 $skin_version_appendix =
"";
176 if ($mode !==
"filesystem") {
179 $skin_version = $skin->getVersion();
180 $skin_version_appendix .= ($skin_version !==
'' ? str_replace(
".",
"-", $skin_version) :
'0');
181 $skin_version_appendix =
"?skin_version=" . $skin_version_appendix;
183 return $filename . $skin_version_appendix;
203 if (is_file(
"./" . $in_style)) {
206 return "templates/default/delos_cont.css";
216 public static function switchColor(
int $a_num,
string $a_css1,
string $a_css2): string
229 public static function makeClickable(
string $a_text,
bool $detectGotoLinks =
false): string
233 $ret = $DIC->refinery()->string()->makeClickable()->transform($a_text);
235 if ($detectGotoLinks) {
236 $goto =
'<a[^>]*href="(' . str_replace(
'@',
'\@', ILIAS_HTTP_PATH) .
'/goto';
237 $regExp = $goto .
'.php\?target=\w+_(\d+)[^"]*)"[^>]*>[^<]*</a>';
238 $ret = preg_replace_callback(
239 '@' . $regExp .
'@i',
240 [self::class,
'replaceLinkProperties'],
245 $regExp = $goto .
'_[^"><]*[a-z0-9]+_([0-9]+)\.html)"[^>]*>[^<]*</a>';
246 $ret = preg_replace_callback(
247 '@' . $regExp .
'@i',
248 [self::class,
'replaceLinkProperties'],
259 $cache = $DIC[
'ilObjDataCache'];
264 $obj_id = $cache->lookupObjId(
$ref_id);
266 $title = $cache->lookupTitle($obj_id);
267 $link =
'<a href="' . $matches[1] .
'" target="_self">' . $title .
'</a>';
287 if ($mailAddressParserFactory === null) {
292 $parser = $mailAddressParserFactory->getParser($a_email);
293 $addresses = $parser->parse();
303 public static function isLogin(
string $a_login): bool
305 if (empty($a_login)) {
309 if (strlen($a_login) < 3) {
316 if (!preg_match(
"/^[A-Za-z0-9_\.\+\*\@!\$\%\~\-]+$/", $a_login)) {
329 public static function img(
331 ?
string $a_alt = null,
338 $img =
'<img src="' . $a_src .
'"';
339 if (!is_null($a_alt)) {
340 $img .=
' alt="' . htmlspecialchars($a_alt) .
'"';
342 if ($a_width !=
"") {
343 $img .=
' width="' . htmlspecialchars($a_width) .
'"';
345 if ($a_height !=
"") {
346 $img .=
' height="' . htmlspecialchars($a_height) .
'"';
348 if ($a_class !=
"") {
349 $img .=
' class="' . $a_class .
'"';
352 $img .=
' id="' . $a_id .
'"';
365 string $mime =
"application/octet-stream" 369 Delivery::DIRECT_PHP_OUTPUT,
373 $delivery->setSendMimeType(
true);
374 $delivery->setDisposition(Delivery::DISP_ATTACHMENT);
375 $delivery->setDownloadFileName($a_filename);
376 $delivery->setConvertFileNameToAsci(
true);
377 $repsonse = $DIC->http()->response()->withBody(Streams::ofString($a_data));
378 $DIC->http()->saveResponse($repsonse);
379 $delivery->deliver();
391 $url = (is_int(strpos($a_url,
"?")))
392 ? $a_url . $amp . $a_par
393 : $a_url .
"?" . $a_par;
401 public static function stripSlashes(
string $a_str,
bool $a_strip_html =
true,
string $a_allow =
""): string
403 if (ini_get(
"magic_quotes_gpc")) {
404 $a_str = stripslashes($a_str);
415 if (ini_get(
"magic_quotes_gpc")) {
416 $a_str = stripslashes($a_str);
425 public static function secureString(
string $a_str,
bool $a_strip_html =
true,
string $a_allow =
""): string
429 $allow_tags = explode(
">", $a_allow);
432 foreach ($allow_tags as $allow) {
434 $allow = str_replace(
"<",
"", $allow);
436 if (!in_array($allow, $sec_tags)) {
437 $only_secure =
false;
439 $allow_array[] = $allow;
444 if (($only_secure || $a_allow ==
"") && $a_strip_html) {
445 if ($a_allow ===
"") {
464 $a_str = strip_tags($a_str);
508 private static function maskSecureTags(
string $a_str, array $allow_array): string
510 foreach ($allow_array as $t) {
523 [
"param" =>
"align",
"value" =>
"left"],
524 [
"param" =>
"align",
"value" =>
"center"],
525 [
"param" =>
"align",
"value" =>
"justify"],
526 [
"param" =>
"align",
"value" =>
"right"]
541 foreach ($allow_array as $t) {
554 [
"param" =>
"align",
"value" =>
"left"],
555 [
"param" =>
"align",
"value" =>
"center"],
556 [
"param" =>
"align",
"value" =>
"justify"],
557 [
"param" =>
"align",
"value" =>
"right"]
575 if (ini_get(
"magic_quotes_gpc")) {
576 return stripslashes($a_str);
600 bool $a_make_links_clickable,
601 bool $a_detect_goto_links =
false 605 if ($a_make_links_clickable) {
622 $numberOfMatches = preg_match_all(
623 '/(?:(?:http|https|ftp|ftps|mailto):|www\.)(?:[a-zA-Z0-9]|[;\/?:|&=+$,]|[\\-_.!~*\'()]|%[0-9a-fA-F]{2}|#|[;?:@&=+$,])+/',
631 foreach ($matches[0] as $match) {
632 $matched_text = $match[0];
636 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1, $pos2 - $pos1)));
642 $pos1 = $pos2 + strlen($matched_text);
644 if ($pos1 < strlen($a_str)) {
645 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1)));
648 $encoded = nl2br(htmlspecialchars($a_str));
653 private static function maskAttributeTag(
string $a_str,
string $tag,
string $tag_att): string
657 $ilLog = $DIC[
"ilLog"];
660 $att = $ws .
"[^>]*" . $ws;
663 '/<(' . $tag . $att .
'(' . $tag_att . $ws .
'="' . $ws .
'(([$@!*()~;,_0-9A-z\/:=%.&#?+\-])*)")' . $att .
')>/i',
668 $a_str = preg_replace(
669 "/<" . preg_quote($found[1],
"/") .
">/i",
670 '<' . $tag .
' ' . $tag_att . $tag_att .
'="' . $found[3] .
'">',
673 if ($old_str == $a_str) {
675 "ilUtil::maskA-" . htmlentities($old_str) .
" == " .
681 $a_str = str_ireplace(
693 $ilLog = $DIC[
"ilLog"];
696 '/<(' . $tag .
' ' . $tag_att . $tag_att .
'="(([$@!*()~;,_0-9A-z\/:=%.&#?+\-])*)")>/i',
701 $a_str = preg_replace(
702 "/<" . preg_quote($found[1],
"/") .
">/i",
706 if ($old_str == $a_str) {
708 "ilUtil::unmaskA-" . htmlentities($old_str) .
" == " .
714 $a_str = str_replace(
'</' . $tag .
'>',
'</' . $tag .
'>', $a_str);
718 public static function maskTag(
string $a_str,
string $tag, array $fix_param = []): string
720 $a_str = str_replace(
721 [
"<$tag>",
"<" . strtoupper($tag) .
">"],
722 "<" . $tag .
">",
725 $a_str = str_replace(
726 [
"</$tag>",
"</" . strtoupper($tag) .
">"],
727 "</" . $tag .
">",
731 foreach ($fix_param as $p) {
734 $a_str = str_replace(
736 "<" .
"$tag $k=\"$v\"" .
">",
744 private static function unmaskTag(
string $a_str,
string $tag, array $fix_param = []): string
746 $a_str = str_replace(
"<" . $tag .
">",
"<" . $tag .
">", $a_str);
747 $a_str = str_replace(
"</" . $tag .
">",
"</" . $tag .
">", $a_str);
749 foreach ($fix_param as $p) {
752 $a_str = str_replace(
753 "<$tag $k=\"$v\">",
754 "<" .
"$tag $k=\"$v\"" .
">",
766 $a_str = str_ireplace(
"javascript",
"jvscrpt", $a_str);
767 $a_str = str_ireplace([
"%00",
786 public static function stripScriptHTML(
string $a_str,
string $a_allow =
"",
bool $a_rm_js =
true): string
788 $negativestr =
"a,abbr,acronym,address,applet,area,base,basefont," .
789 "big,blockquote,body,br,button,caption,center,cite,code,col," .
790 "colgroup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,form,frame," .
791 "frameset,h1,h2,h3,h4,h5,h6,head,hr,html,i,iframe,img,input,ins,isindex,kbd," .
792 "label,legend,li,link,map,menu,meta,noframes,noscript,object,ol," .
793 "optgroup,option,p,param,q,s,samp,script,select,small,span," .
794 "strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead," .
795 "title,tr,tt,u,ul,var";
796 $a_allow = strtolower($a_allow);
797 $negatives = explode(
",", $negativestr);
799 while ($outer_old_str != $a_str) {
800 $outer_old_str = $a_str;
801 foreach ($negatives as $item) {
802 $pos = strpos($a_allow,
"<$item>");
805 if ($pos ===
false) {
807 while ($old_str != $a_str) {
809 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s*>/i",
"", $a_str);
810 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s+([^>]*)>/i",
"", $a_str);
818 $a_str = preg_replace(
"/<\s*\w*(\/?)(\s+[^>]*)?(\s+on[^>]*)>/i",
"", $a_str);
821 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*javascript[^>]*>/i",
"", $a_str);
825 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*expression[^>]*>/i",
"", $a_str);
837 if (filter_var($url, FILTER_VALIDATE_URL) ===
false &&
838 filter_var(
"http://" . $url, FILTER_VALIDATE_URL) ===
false &&
839 filter_var(
"http:" . $url, FILTER_VALIDATE_URL) ===
false &&
840 filter_var(
"http://de.de" . $url, FILTER_VALIDATE_URL) ===
false &&
841 filter_var(
"http://de.de/" . $url, FILTER_VALIDATE_URL) ===
false) {
844 if (trim(strtolower(parse_url($url, PHP_URL_SCHEME))) ==
"javascript") {
847 $url = htmlspecialchars($url, ENT_QUOTES);
859 while (($spos = strpos($a_parstr,
"=")) && $ok) {
861 $cpar = substr($a_parstr, 0, $spos);
862 $a_parstr = substr($a_parstr, $spos, strlen($a_parstr) - $spos);
863 while (substr($cpar, 0, 1) ==
"," || substr($cpar, 0, 1) ==
" " || substr($cpar, 0, 1) == chr(13) || substr(
868 $cpar = substr($cpar, 1, strlen($cpar) - 1);
870 while (substr($cpar, strlen($cpar) - 1, 1) ==
" " || substr($cpar, strlen($cpar) - 1, 1) == chr(
872 ) || substr($cpar, strlen($cpar) - 1, 1) == chr(10)) {
873 $cpar = substr($cpar, 0, strlen($cpar) - 1);
878 while ($cpar != $cpar_old) {
880 $cpar = preg_replace(
"/[^a-zA-Z0-9_]/i",
"", $cpar);
885 if ($spos = strpos($a_parstr,
"\"")) {
886 $a_parstr = substr($a_parstr, $spos + 1, strlen($a_parstr) - $spos);
887 $spos = strpos($a_parstr,
"\"");
889 $cval = substr($a_parstr, 0, $spos);
891 $a_parstr = substr($a_parstr, $spos + 1, strlen($a_parstr) - $spos - 1);
901 return $ok ? $par : [];
907 public static function yn2tf(
string $a_yn): bool
909 if (strtolower($a_yn) ===
"y") {
919 public static function tf2yn(
bool $a_tf): string
935 if (($a_mime ==
"image/gif") || ($a_mime ==
"image/jpeg") ||
936 ($a_mime ==
"image/png") || ($a_mime ==
"application/x-shockwave-flash") ||
937 ($a_mime ==
"image/tiff") || ($a_mime ==
"image/x-ms-bmp") ||
938 ($a_mime ==
"image/psd") || ($a_mime ==
"image/iff")) {
948 public static function redirect(
string $a_script): void
952 if (!isset($DIC[
'ilCtrl']) || !$DIC[
'ilCtrl'] instanceof
ilCtrl) {
955 $DIC->ctrl()->redirectToURL($a_script);
967 if (substr($a_value, 0, 4) ==
"il__") {
968 $a_value =
"il_" .
IL_INST_ID .
"_" . substr($a_value, 4, strlen($a_value) - 4);
989 $ilDB = $DIC->database();
992 if (isset($DIC[
"ilErr"])) {
996 if (empty($a_group_name)) {
997 $message = __METHOD__ .
": No groupname given!";
1001 $clause = ($a_id !== null) ?
" AND obj_id != " .
$ilDB->quote($a_id) .
" " :
"";
1003 $q =
"SELECT obj_id FROM object_data " .
1004 "WHERE title = " .
$ilDB->quote($a_group_name,
"text") .
" " .
1005 "AND type = " .
$ilDB->quote(
"grp",
"text") .
1008 $r =
$ilDB->query($q);
1010 return $r->numRows() > 0;
1018 return (strtolower(substr(php_uname(), 0, 3)) ===
"win");
1026 public static function now(): string
1028 return date(
"Y-m-d H:i:s");
1061 string $a_operation,
1067 $ilDB = $DIC->database();
1068 $rbacreview = $DIC->rbac()->review();
1069 $ilAccess = $DIC->access();
1072 $tree = $DIC->repositoryTree();
1074 if (!is_array($a_obj_type)) {
1075 $where =
"WHERE type = " .
$ilDB->quote($a_obj_type,
"text") .
" ";
1077 $where =
"WHERE " .
$ilDB->in(
"type", $a_obj_type,
false,
"text") .
" ";
1089 $a_usr_id = $a_usr_id ?:
$ilUser->getId();
1090 $a_roles = $rbacreview->assignedRoles($a_usr_id);
1095 $query =
"SELECT ref_id FROM object_reference obr LEFT JOIN object_data obd ON obr.obj_id = obd.obj_id " .
1096 "LEFT JOIN tree ON obr.ref_id = tree.child " .
1103 while ($row =
$ilDB->fetchObject(
$res)) {
1109 if ($counter++ >= $limit) {
1113 $ref_ids[] = $row->ref_id;
1119 if ($a_operation ==
'edit_permissions' or strpos($a_operation,
'create') !==
false) {
1120 $check_owner =
") ";
1122 $check_owner =
"OR owner = " .
$ilDB->quote($a_usr_id,
"integer") .
") ";
1126 $ops_id = $ops_ids[0];
1128 $and =
"AND ((" .
$ilDB->in(
"rol_id", $a_roles,
false,
"integer") .
" ";
1130 $query =
"SELECT DISTINCT(obr.ref_id),obr.obj_id,type FROM object_reference obr " .
1131 "JOIN object_data obd ON obd.obj_id = obr.obj_id " .
1132 "LEFT JOIN rbac_pa ON obr.ref_id = rbac_pa.ref_id " .
1135 "AND (" .
$ilDB->like(
"ops_id",
"text",
"%i:" . $ops_id .
"%") .
" " .
1136 "OR " .
$ilDB->like(
"ops_id",
"text",
"%:\"" . $ops_id .
"\";%") .
")) " .
1143 if ($counter >= $limit) {
1153 if ($ilAccess->checkAccessOfUser($a_usr_id, $a_operation,
'', $row->ref_id, $row->type, $row->obj_id)) {
1155 $ref_ids[] = $row->ref_id;
1158 return $ref_ids ?: [];
1169 public static function isHTML(
string $a_text): bool
1171 if (strlen(strip_tags($a_text)) < strlen($a_text)) {
1186 $test_str = explode(
'_', $role_title);
1187 $prefix = $test_str[0] ??
'';
1189 if ($prefix ===
'il') {
1190 $ref_id = $test_str[3] ?? null;
1206 $test_str = explode(
'_', $ilias_id);
1208 $parsed_inst_id = (
int) ($test_str[1] ?? 0);
1209 $prefix = $test_str[0] ??
'';
1211 if ($prefix ===
'il' && $parsed_inst_id === $inst_id && count($test_str) === 4) {
1212 return is_numeric($test_str[3]) ? (
int) $test_str[3] : null;
1223 public static function _sortIds(array $a_ids,
string $a_table,
string $a_field,
string $a_id_name): array
1227 $ilDB = $DIC->database();
1234 $where =
"WHERE " . $a_id_name .
" IN (";
1238 $query =
"SELECT " . $a_id_name .
" FROM " . $a_table .
" " .
1240 "ORDER BY " . $a_field;
1245 $ids[] = $row->$a_id_name;
1261 $box_factory = $DIC->ui()->factory()->messageBox();
1264 $box = $box_factory->info($a_txt);
1267 $box = $box_factory->success($a_txt);
1270 $box = $box_factory->confirmation($a_txt);
1273 $box = $box_factory->failure($a_txt);
1279 return $DIC->ui()->renderer()->render($box);
1286 string $a_cookie_name,
1287 string $a_cookie_value =
'',
1288 bool $a_also_set_super_global =
true,
1289 bool $a_set_cookie_invalid =
false 1293 $http = $DIC->http();
1294 $cookie_jar =
$http->cookieJar();
1298 $cookie_expire = null;
1299 if (defined(
'IL_COOKIE_EXPIRE') && is_numeric(IL_COOKIE_EXPIRE) && IL_COOKIE_EXPIRE > 0) {
1300 $cookie_expire = (
int) IL_COOKIE_EXPIRE;
1304 if ($a_set_cookie_invalid) {
1305 $expires = time() - 10;
1306 } elseif ($cookie_expire > 0) {
1307 $expires = time() + $cookie_expire;
1310 $cookie = $cookie_factory->create($a_cookie_name, $a_cookie_value)
1311 ->withExpires($expires)
1312 ->withSecure(defined(
'IL_COOKIE_SECURE') ? IL_COOKIE_SECURE :
false)
1314 ->withDomain(defined(
'IL_COOKIE_DOMAIN') ? IL_COOKIE_DOMAIN :
'')
1315 ->withHttpOnly(defined(
'IL_COOKIE_HTTPONLY') ? IL_COOKIE_HTTPONLY :
false);
1319 defined(
'IL_COOKIE_SECURE') && IL_COOKIE_SECURE &&
1320 (!isset(session_get_cookie_params()[
'samesite']) || strtolower(session_get_cookie_params()[
'samesite']) !==
'strict')
1322 $cookie = $cookie->withSamesite(Cookie::SAMESITE_LAX);
1324 $jar = $cookie_jar->with($cookie);
1338 if ((isset(
$_SERVER[
'SHELL']) &&
$_SERVER[
'SHELL']) || PHP_SAPI ===
'cli' ||
1343 return ILIAS_HTTP_PATH;
1363 $exploded = explode(
'_', $a_import_id);
1365 $parsed[
'orig'] = $a_import_id;
1366 if ($exploded[0] ==
'il') {
1367 $parsed[
'prefix'] = $exploded[0];
1369 if (is_numeric($exploded[1])) {
1370 $parsed[
'inst_id'] = (
int) $exploded[1];
1372 $parsed[
'type'] = $exploded[2];
1374 if (is_numeric($exploded[3])) {
1375 $parsed[
'id'] = (
int) $exploded[3];
1391 int $a_decimals = 0,
1392 string $a_dec_point = null,
1393 string $a_thousands_sep = null,
1394 bool $a_suppress_dot_zero =
false 1398 $lng = $DIC->language();
1400 if ($a_dec_point === null) {
1403 if ($a_dec_point ===
'-lang_sep_decimal-') {
1407 if ($a_thousands_sep === null) {
1408 $a_thousands_sep =
$lng->txt(
'lang_sep_thousand');
1410 if ($a_thousands_sep ===
'-lang_sep_thousand-') {
1411 $a_thousands_sep =
",";
1414 $txt = number_format($a_float, $a_decimals, $a_dec_point, $a_thousands_sep);
1417 if (($a_suppress_dot_zero == 0 || $a_decimals == 0)
1418 && substr(
$txt, -2) == $a_dec_point .
'0' 1422 if ($a_float == 0 and
$txt ==
"") {
1449 $lng = $DIC->language();
1450 if ($a_lng == null) {
1456 if ($size >= $mag * $mag * $mag) {
1457 $scaled_size = $size / $mag / $mag / $mag;
1458 $scaled_unit =
'lang_size_gb';
1460 if ($size >= $mag * $mag) {
1461 $scaled_size = $size / $mag / $mag;
1462 $scaled_unit =
'lang_size_mb';
1464 if ($size >= $mag) {
1465 $scaled_size = $size / $mag;
1466 $scaled_unit =
'lang_size_kb';
1468 $scaled_size = $size;
1469 $scaled_unit =
'lang_size_bytes';
1474 $result = self::fmtFloat(
1477 ==
'lang_size_bytes') ? 0 : 1,
1478 $a_lng->txt(
'lang_sep_decimal'),
1479 $a_lng->txt(
'lang_sep_thousand'),
1482 .
' ' . $a_lng->txt($scaled_unit);
1483 if ($a_mode ==
'long' && $size > $mag) {
1484 $result .=
' (' . self::fmtFloat(
1487 $a_lng->txt(
'lang_sep_decimal'),
1488 $a_lng->txt(
'lang_sep_thousand')
1490 . $a_lng->txt(
'lang_size_bytes') .
')';
setMimeType(string $mime_type)
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
static quoteArray(array $a_array)
Quotes all members of an array for usage in DB query statement.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
Class InitCtrlService wraps the initialization of ilCtrl.
static is_email(string $a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
static usesHTTP()
Uses HTTP aka browser.
static isHTML(string $a_text)
Checks if a given string contains HTML or not.
static switchColor(int $a_num, string $a_css1, string $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
static secureString(string $a_str, bool $a_strip_html=true, string $a_allow="")
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static stripScriptHTML(string $a_str, string $a_allow="", bool $a_rm_js=true)
static getImageTagByType(string $a_type, string $a_path, bool $a_big=false)
Builds an html image tag.
static maskTag(string $a_str, string $tag, array $fix_param=[])
static maskSecureTags(string $a_str, array $allow_array)
static replaceLinkProperties(array $matches)
static _getOperationIdsByName(array $operations)
get ops_id's by name.
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
static secureLink(string $a_str)
static secureUrl(string $url)
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static now()
Return current timestamp in Y-m-d H:i:s format.
static fmtFloat(float $a_float, int $a_decimals=0, string $a_dec_point=null, string $a_thousands_sep=null, bool $a_suppress_dot_zero=false)
format a float
static getNewContentStyleSheetLocation(string $mode="output")
get full style sheet file name (path inclusive) of current user
static htmlencodePlainString(string $a_str, bool $a_make_links_clickable, bool $a_detect_goto_links=false)
Encodes a plain text string into HTML for display in a browser.
Class ilMailRfc822AddressParserFactory.
static unmaskAttributeTag(string $a_str, string $tag, string $tag_att)
static securePlainString(string $a_str)
static getCurrentSkin()
get the current skin use always this function instead of getting the account's skin the current skin ...
static setCookie(string $a_cookie_name, string $a_cookie_value='', bool $a_also_set_super_global=true, bool $a_set_cookie_invalid=false)
static formatSize(int $size, string $a_mode='short', ?ilLanguage $a_lng=null)
Returns the specified file size value in a human friendly form.
static isLogin(string $a_login)
static unmaskSecureTags(string $a_str, array $allow_array)
static getHtmlPath(string $relative_path)
get url of path
static _getObjectsByOperations( $a_obj_type, string $a_operation, int $a_usr_id=0, int $limit=0)
Get all objects of a specific type and check access This function is not recursive, instead it parses the serialized rbac_pa entries.
static parseImportId(string $a_import_id)
Parse an ilias import id Typically of type il_[IL_INST_ID]_[OBJ_TYPE]_[OBJ_ID] returns array( 'orig' ...
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.
static redirect(string $a_script)
static maskAttributeTag(string $a_str, string $tag, string $tag_att)
static deducibleSize(string $a_mime)
checks if mime type is provided by getimagesize()
static extractParameterString(string $a_parstr)
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
static groupNameExists(string $a_group_name, ?int $a_id=null)
checks if group name already exists.
static yn2tf(string $a_yn)
static getCurrentStyle()
get the current style or sub style use always this function instead of getting the account's style th...
static unmaskTag(string $a_str, string $tag, array $fix_param=[])
static insertInstIntoID(string $a_value)
inserts installation id into ILIAS id
static makeClickable(string $a_text, bool $detectGotoLinks=false)
static __extractRefId(string $role_title)
extract ref id from role title, e.g.
static stripOnlySlashes(string $a_str)