45 public static function getImageTagByType(
string $a_type,
string $a_path,
bool $a_big =
false): string
57 return "<img src=\"" .
$filename .
"\" alt=\"" .
$lng->txt(
"obj_" . $a_type) .
"\" title=\"" .
$lng->txt(
59 ) .
"\" border=\"0\" vspace=\"0\"/>";
70 string $module_path =
"",
71 string $mode =
"output",
75 return "./images/" . $image_name;
79 $styleDefinition =
$DIC[
"styleDefinition"] ??
null;
81 if ($module_path !=
"") {
82 throw new \LogicException(
83 "\$module_path only supports '' as value."
89 if ($use_custom_skin) {
102 return "./assets/images/" . $image_name;
113 if (substr($relative_path, 0, 2) ==
'./') {
114 $relative_path = (substr($relative_path, 1));
116 if (substr($relative_path, 0, 1) !=
'/') {
117 $relative_path =
'/' . $relative_path;
119 $htmlpath = ILIAS_HTTP_PATH . $relative_path;
134 string $mode =
"output",
135 string $a_css_name =
""
137 $force_reload = ($mode !==
"filesystem");
138 $use_default_style_file = ($a_css_name ===
"");
143 if ($use_default_style_file) {
146 $stylesheet_name = $a_css_name;
149 if ($use_custom_skin) {
151 "./Customizing/skin/"
156 $filename =
"./assets/css/" . $stylesheet_name;
159 if (!$force_reload) {
167 $skin_version = $skin->getVersion();
168 if ($skin_version !==
"") {
169 $skin_version_appendix = str_replace(
".",
"-", $skin_version);
171 $skin_version_appendix =
'0';
174 return $filename .
"?skin_version=" . $skin_version_appendix;
194 if (is_file(
"./" . $in_style)) {
197 return "assets/css/delos_cont.css";
207 public static function switchColor(
int $a_num,
string $a_css1,
string $a_css2): string
222 bool $detectGotoLinks =
false,
223 ?
string $ilias_http_path =
null
227 $ret =
$DIC->refinery()->string()->makeClickable()->transform($a_text);
229 if ($detectGotoLinks) {
230 $ilias_http_path = $ilias_http_path ?? (defined(
'ILIAS_HTTP_PATH') ? ILIAS_HTTP_PATH :
'');
232 $goto =
'<a[^>]*href="(' . str_replace(
'@',
'\@', $ilias_http_path) .
'/goto';
233 $regExp = $goto .
'.php\?target=\w+_(\d+)[^"]*)"[^>]*>[^<]*</a>';
234 $ret = preg_replace_callback(
235 '@' . $regExp .
'@i',
236 [self::class,
'replaceLinkProperties'],
241 $regExp = $goto .
'_[^"><]*[a-z0-9]+_([0-9]+)\.html)"[^>]*>[^<]*</a>';
242 $ret = preg_replace_callback(
243 '@' . $regExp .
'@i',
244 [self::class,
'replaceLinkProperties'],
255 $cache =
$DIC[
'ilObjDataCache'];
260 $obj_id = $cache->lookupObjId(
$ref_id);
262 $title = $cache->lookupTitle($obj_id);
263 $link =
'<a href="' . $matches[1] .
'" target="_self">' . $title .
'</a>';
283 if ($mailAddressParserFactory === null) {
288 $parser = $mailAddressParserFactory->getParser($a_email);
289 $addresses = $parser->parse();
299 public static function isLogin(
string $a_login): bool
301 if (empty($a_login)) {
305 if (strlen($a_login) < 3) {
312 if (!preg_match(
"/^[A-Za-z0-9_\.\+\*\@!\$\%\~\-]+$/", $a_login)) {
325 public static function img(
327 ?
string $a_alt =
null,
334 $img =
'<img src="' . $a_src .
'"';
335 if (!is_null($a_alt)) {
336 $img .=
' alt="' . htmlspecialchars($a_alt) .
'"';
338 if ($a_width !=
"") {
339 $img .=
' width="' . htmlspecialchars($a_width) .
'"';
341 if ($a_height !=
"") {
342 $img .=
' height="' . htmlspecialchars($a_height) .
'"';
344 if ($a_class !=
"") {
345 $img .=
' class="' . $a_class .
'"';
348 $img .=
' id="' . $a_id .
'"';
361 string $mime =
"application/octet-stream"
365 Delivery::DIRECT_PHP_OUTPUT,
368 $delivery->setMimeType($mime);
369 $delivery->setSendMimeType(
true);
370 $delivery->setDisposition(Delivery::DISP_ATTACHMENT);
371 $delivery->setDownloadFileName($a_filename);
372 $delivery->setConvertFileNameToAsci(
true);
373 $repsonse =
$DIC->http()->response()->withBody(Streams::ofString($a_data));
374 $DIC->http()->saveResponse($repsonse);
375 $delivery->deliver();
387 $url = (is_int(strpos($a_url,
"?")))
388 ? $a_url . $amp . $a_par
389 : $a_url .
"?" . $a_par;
397 public static function stripSlashes(
string $a_str,
bool $a_strip_html =
true,
string $a_allow =
""): string
399 if (ini_get(
"magic_quotes_gpc")) {
400 $a_str = stripslashes($a_str);
411 if (ini_get(
"magic_quotes_gpc")) {
412 $a_str = stripslashes($a_str);
421 public static function secureString(
string $a_str,
bool $a_strip_html =
true,
string $a_allow =
""): string
425 $allow_tags = explode(
">", $a_allow);
428 foreach ($allow_tags as $allow) {
430 $allow = str_replace(
"<",
"", $allow);
432 if (!in_array($allow, $sec_tags)) {
433 $only_secure =
false;
435 $allow_array[] = $allow;
440 if (($only_secure || $a_allow ==
"") && $a_strip_html) {
441 if ($a_allow ===
"") {
460 $a_str = strip_tags($a_str);
504 private static function maskSecureTags(
string $a_str, array $allow_array): string
506 foreach ($allow_array as $t) {
519 [
"param" =>
"align",
"value" =>
"left"],
520 [
"param" =>
"align",
"value" =>
"center"],
521 [
"param" =>
"align",
"value" =>
"justify"],
522 [
"param" =>
"align",
"value" =>
"right"]
537 foreach ($allow_array as $t) {
550 [
"param" =>
"align",
"value" =>
"left"],
551 [
"param" =>
"align",
"value" =>
"center"],
552 [
"param" =>
"align",
"value" =>
"justify"],
553 [
"param" =>
"align",
"value" =>
"right"]
571 if (ini_get(
"magic_quotes_gpc")) {
572 return stripslashes($a_str);
596 bool $a_make_links_clickable,
597 bool $a_detect_goto_links =
false
601 if ($a_make_links_clickable) {
618 $numberOfMatches = preg_match_all(
619 '/(?:(?:http|https|ftp|ftps|mailto):|www\.)(?:[a-zA-Z0-9]|[;\/?:|&=+$,]|[\\-_.!~*\'()]|%[0-9a-fA-F]{2}|#|[;?:@&=+$,])+/',
627 foreach ($matches[0] as $match) {
628 $matched_text = $match[0];
632 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1, $pos2 - $pos1)));
638 $pos1 = $pos2 + strlen($matched_text);
640 if ($pos1 < strlen($a_str)) {
641 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1)));
644 $encoded = nl2br(htmlspecialchars($a_str));
649 private static function maskAttributeTag(
string $a_str,
string $tag,
string $tag_att): string
653 $ilLog =
$DIC[
"ilLog"];
656 $att = $ws .
"[^>]*" . $ws;
659 '/<(' . $tag . $att .
'(' . $tag_att . $ws .
'="' . $ws .
'(([$@!*()~;,_0-9A-z\/:=%.&#?+\-])*)")' . $att .
')>/i',
664 $a_str = preg_replace(
665 "/<" . preg_quote($found[1],
"/") .
">/i",
666 '<' . $tag .
' ' . $tag_att . $tag_att .
'="' . $found[3] .
'">',
669 if ($old_str == $a_str) {
671 "ilUtil::maskA-" . htmlentities($old_str) .
" == " .
677 $a_str = str_ireplace(
689 $ilLog =
$DIC[
"ilLog"];
692 '/<(' . $tag .
' ' . $tag_att . $tag_att .
'="(([$@!*()~;,_0-9A-z\/:=%.&#?+\-])*)")>/i',
697 $a_str = preg_replace(
698 "/<" . preg_quote($found[1],
"/") .
">/i",
702 if ($old_str == $a_str) {
704 "ilUtil::unmaskA-" . htmlentities($old_str) .
" == " .
710 $a_str = str_replace(
'</' . $tag .
'>',
'</' . $tag .
'>', $a_str);
714 public static function maskTag(
string $a_str,
string $tag, array $fix_param = []): string
716 $a_str = str_replace(
717 [
"<$tag>",
"<" . strtoupper($tag) .
">"],
718 "<" . $tag .
">",
721 $a_str = str_replace(
722 [
"</$tag>",
"</" . strtoupper($tag) .
">"],
723 "</" . $tag .
">",
727 foreach ($fix_param as $p) {
730 $a_str = str_replace(
732 "<" .
"$tag $k=\"$v\"" .
">",
740 private static function unmaskTag(
string $a_str,
string $tag, array $fix_param = []): string
742 $a_str = str_replace(
"<" . $tag .
">",
"<" . $tag .
">", $a_str);
743 $a_str = str_replace(
"</" . $tag .
">",
"</" . $tag .
">", $a_str);
745 foreach ($fix_param as $p) {
748 $a_str = str_replace(
749 "<$tag $k=\"$v\">",
750 "<" .
"$tag $k=\"$v\"" .
">",
762 $a_str = str_ireplace(
"javascript",
"jvscrpt", $a_str);
763 $a_str = str_ireplace([
"%00",
782 public static function stripScriptHTML(
string $a_str,
string $a_allow =
"",
bool $a_rm_js =
true): string
784 $negativestr =
"a,abbr,acronym,address,applet,area,base,basefont," .
785 "big,blockquote,body,br,button,caption,center,cite,code,col," .
786 "colgroup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,form,frame," .
787 "frameset,h1,h2,h3,h4,h5,h6,head,hr,html,i,iframe,img,input,ins,isindex,kbd," .
788 "label,legend,li,link,map,menu,meta,noframes,noscript,object,ol," .
789 "optgroup,option,p,param,q,s,samp,script,select,small,span," .
790 "strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead," .
791 "title,tr,tt,u,ul,var";
792 $a_allow = strtolower($a_allow);
793 $negatives = explode(
",", $negativestr);
795 while ($outer_old_str != $a_str) {
796 $outer_old_str = $a_str;
797 foreach ($negatives as $item) {
798 $pos = strpos($a_allow,
"<$item>");
801 if ($pos ===
false) {
803 while ($old_str != $a_str) {
805 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s*>/i",
"", $a_str);
806 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s+([^>]*)>/i",
"", $a_str);
814 $a_str = preg_replace(
"/<\s*\w*(\/?)(\s+[^>]*)?(\s+on[^>]*)>/i",
"", $a_str);
817 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*javascript[^>]*>/i",
"", $a_str);
821 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*expression[^>]*>/i",
"", $a_str);
833 if (filter_var(
$url, FILTER_VALIDATE_URL) ===
false &&
834 filter_var(
"http://" .
$url, FILTER_VALIDATE_URL) ===
false &&
835 filter_var(
"http:" .
$url, FILTER_VALIDATE_URL) ===
false &&
836 filter_var(
"http://de.de" .
$url, FILTER_VALIDATE_URL) ===
false &&
837 filter_var(
"http://de.de/" .
$url, FILTER_VALIDATE_URL) ===
false) {
840 if (trim(strtolower(parse_url(
$url, PHP_URL_SCHEME) ??
'')) ===
"javascript") {
844 return htmlspecialchars(
$url, ENT_QUOTES);
855 while (($spos = strpos($a_parstr,
"=")) && $ok) {
857 $cpar = substr($a_parstr, 0, $spos);
858 $a_parstr = substr($a_parstr, $spos, strlen($a_parstr) - $spos);
859 while (substr($cpar, 0, 1) ==
"," || substr($cpar, 0, 1) ==
" " || substr($cpar, 0, 1) == chr(13) || substr(
864 $cpar = substr($cpar, 1, strlen($cpar) - 1);
866 while (substr($cpar, strlen($cpar) - 1, 1) ==
" " || substr($cpar, strlen($cpar) - 1, 1) == chr(
868 ) || substr($cpar, strlen($cpar) - 1, 1) == chr(10)) {
869 $cpar = substr($cpar, 0, strlen($cpar) - 1);
874 while ($cpar != $cpar_old) {
876 $cpar = preg_replace(
"/[^a-zA-Z0-9_]/i",
"", $cpar);
881 if ($spos = strpos($a_parstr,
"\"")) {
882 $a_parstr = substr($a_parstr, $spos + 1, strlen($a_parstr) - $spos);
883 $spos = strpos($a_parstr,
"\"");
885 $cval = substr($a_parstr, 0, $spos);
887 $a_parstr = substr($a_parstr, $spos + 1, strlen($a_parstr) - $spos - 1);
897 return $ok ? $par : [];
903 public static function yn2tf(
string $a_yn): bool
905 if (strtolower($a_yn) ===
"y") {
915 public static function tf2yn(
bool $a_tf): string
931 if (($a_mime ==
"image/gif") || ($a_mime ==
"image/jpeg") ||
932 ($a_mime ==
"image/png") || ($a_mime ==
"application/x-shockwave-flash") ||
933 ($a_mime ==
"image/tiff") || ($a_mime ==
"image/x-ms-bmp") ||
934 ($a_mime ==
"image/psd") || ($a_mime ==
"image/iff")) {
944 public static function redirect(
string $a_script): void
948 if (!isset(
$DIC[
'ilCtrl']) || !
$DIC[
'ilCtrl'] instanceof
ilCtrl) {
951 $DIC->ctrl()->redirectToURL($a_script);
963 if (substr($a_value, 0, 4) ==
"il__") {
964 $a_value =
"il_" .
IL_INST_ID .
"_" . substr($a_value, 4, strlen($a_value) - 4);
988 if (isset(
$DIC[
"ilErr"])) {
992 if (empty($a_group_name)) {
993 $message = __METHOD__ .
": No groupname given!";
997 $clause = ($a_id !==
null) ?
" AND obj_id != " .
$ilDB->quote($a_id) .
" " :
"";
999 $q =
"SELECT obj_id FROM object_data " .
1000 "WHERE title = " .
$ilDB->quote($a_group_name,
"text") .
" " .
1001 "AND type = " .
$ilDB->quote(
"grp",
"text") .
1006 return $r->numRows() > 0;
1014 return (strtolower(substr(php_uname(), 0, 3)) ===
"win");
1022 public static function now(): string
1024 return date(
"Y-m-d H:i:s");
1057 string $a_operation,
1064 $rbacreview =
$DIC->rbac()->review();
1065 $ilAccess =
$DIC->access();
1066 $ilUser =
$DIC->user();
1068 $tree =
$DIC->repositoryTree();
1070 if (!is_array($a_obj_type)) {
1071 $where =
"WHERE type = " .
$ilDB->quote($a_obj_type,
"text") .
" ";
1073 $where =
"WHERE " .
$ilDB->in(
"type", $a_obj_type,
false,
"text") .
" ";
1085 $a_usr_id = $a_usr_id ?: $ilUser->getId();
1086 $a_roles = $rbacreview->assignedRoles($a_usr_id);
1091 $query =
"SELECT ref_id FROM object_reference obr LEFT JOIN object_data obd ON obr.obj_id = obd.obj_id " .
1092 "LEFT JOIN tree ON obr.ref_id = tree.child " .
1099 while ($row =
$ilDB->fetchObject(
$res)) {
1109 $ref_ids[] = $row->ref_id;
1115 if ($a_operation ==
'edit_permissions' or strpos($a_operation,
'create') !==
false) {
1116 $check_owner =
") ";
1118 $check_owner =
"OR owner = " .
$ilDB->quote($a_usr_id,
"integer") .
") ";
1122 $ops_id = $ops_ids[0];
1124 $and =
"AND ((" .
$ilDB->in(
"rol_id", $a_roles,
false,
"integer") .
" ";
1126 $query =
"SELECT DISTINCT(obr.ref_id),obr.obj_id,type FROM object_reference obr " .
1127 "JOIN object_data obd ON obd.obj_id = obr.obj_id " .
1128 "LEFT JOIN rbac_pa ON obr.ref_id = rbac_pa.ref_id " .
1131 "AND (" .
$ilDB->like(
"ops_id",
"text",
"%i:" . $ops_id .
"%") .
" " .
1132 "OR " .
$ilDB->like(
"ops_id",
"text",
"%:\"" . $ops_id .
"\";%") .
")) " .
1149 if ($ilAccess->checkAccessOfUser($a_usr_id, $a_operation,
'', $row->ref_id, $row->type, $row->obj_id)) {
1151 $ref_ids[] = $row->ref_id;
1154 return $ref_ids ?: [];
1165 public static function isHTML(
string $a_text): bool
1167 if (strlen(strip_tags($a_text)) < strlen($a_text)) {
1182 $test_str = explode(
'_', $role_title);
1183 $prefix = $test_str[0] ??
'';
1185 if ($prefix ===
'il') {
1186 $ref_id = $test_str[3] ??
null;
1202 $test_str = explode(
'_', $ilias_id);
1204 $parsed_inst_id = (
int) ($test_str[1] ?? 0);
1205 $prefix = $test_str[0] ??
'';
1207 if ($prefix ===
'il' && $parsed_inst_id === $inst_id && count($test_str) === 4) {
1208 return is_numeric($test_str[3]) ? (
int) $test_str[3] :
null;
1219 public static function _sortIds(array $a_ids,
string $a_table,
string $a_field,
string $a_id_name): array
1230 $where =
"WHERE " . $a_id_name .
" IN (";
1234 $query =
"SELECT " . $a_id_name .
" FROM " . $a_table .
" " .
1236 "ORDER BY " . $a_field;
1241 $ids[] = $row->$a_id_name;
1257 $box_factory =
$DIC->ui()->factory()->messageBox();
1260 $box = $box_factory->info($a_txt);
1263 $box = $box_factory->success($a_txt);
1266 $box = $box_factory->confirmation($a_txt);
1269 $box = $box_factory->failure($a_txt);
1272 throw new InvalidArgumentException();
1275 return $DIC->ui()->renderer()->render($box);
1282 string $a_cookie_name,
1283 string $a_cookie_value =
'',
1284 bool $a_also_set_super_global =
true,
1285 bool $a_set_cookie_invalid =
false
1290 $cookie_jar =
$http->cookieJar();
1294 $cookie_expire =
null;
1295 if (defined(
'IL_COOKIE_EXPIRE') && is_numeric(IL_COOKIE_EXPIRE) && IL_COOKIE_EXPIRE > 0) {
1296 $cookie_expire = (
int) IL_COOKIE_EXPIRE;
1300 if ($a_set_cookie_invalid) {
1301 $expires = time() - 10;
1302 } elseif ($cookie_expire > 0) {
1303 $expires = time() + $cookie_expire;
1306 $cookie = $cookie_factory->create($a_cookie_name, $a_cookie_value)
1307 ->withExpires($expires)
1308 ->withSecure(defined(
'IL_COOKIE_SECURE') ? IL_COOKIE_SECURE :
false)
1310 ->withDomain(defined(
'IL_COOKIE_DOMAIN') ? IL_COOKIE_DOMAIN :
'')
1311 ->withHttpOnly(defined(
'IL_COOKIE_HTTPONLY') ? IL_COOKIE_HTTPONLY :
false);
1315 defined(
'IL_COOKIE_SECURE') && IL_COOKIE_SECURE &&
1316 (!isset(session_get_cookie_params()[
'samesite']) || strtolower(session_get_cookie_params()[
'samesite']) !==
'strict')
1318 $cookie = $cookie->withSamesite(Cookie::SAMESITE_LAX);
1320 $jar = $cookie_jar->with($cookie);
1334 if ((isset(
$_SERVER[
'SHELL']) &&
$_SERVER[
'SHELL']) || PHP_SAPI ===
'cli' ||
1339 return ILIAS_HTTP_PATH;
1359 $exploded = explode(
'_', $a_import_id);
1361 $parsed[
'orig'] = $a_import_id;
1362 if ($exploded[0] ==
'il') {
1363 $parsed[
'prefix'] = $exploded[0];
1365 if (is_numeric($exploded[1])) {
1366 $parsed[
'inst_id'] = (
int) $exploded[1];
1368 $parsed[
'type'] = $exploded[2];
1370 if (is_numeric($exploded[3])) {
1371 $parsed[
'id'] = (
int) $exploded[3];
1387 int $a_decimals = 0,
1388 ?
string $a_dec_point =
null,
1389 ?
string $a_thousands_sep =
null,
1390 bool $a_suppress_dot_zero =
false
1396 if ($a_dec_point ===
null) {
1399 if ($a_dec_point ===
'-lang_sep_decimal-') {
1403 if ($a_thousands_sep ===
null) {
1404 $a_thousands_sep =
$lng->txt(
'lang_sep_thousand');
1406 if ($a_thousands_sep ===
'-lang_sep_thousand-') {
1407 $a_thousands_sep =
",";
1410 $txt = number_format($a_float, $a_decimals, $a_dec_point, $a_thousands_sep);
1413 if (($a_suppress_dot_zero == 0 || $a_decimals == 0)
1414 && substr(
$txt, -2) == $a_dec_point .
'0'
1418 if ($a_float == 0 and
$txt ==
"") {
1446 if ($a_lng ==
null) {
1452 if ($size >= $mag * $mag * $mag) {
1453 $scaled_size = $size / $mag / $mag / $mag;
1454 $scaled_unit =
'lang_size_gb';
1456 if ($size >= $mag * $mag) {
1457 $scaled_size = $size / $mag / $mag;
1458 $scaled_unit =
'lang_size_mb';
1460 if ($size >= $mag) {
1461 $scaled_size = $size / $mag;
1462 $scaled_unit =
'lang_size_kb';
1464 $scaled_size = $size;
1465 $scaled_unit =
'lang_size_bytes';
1470 $result = self::fmtFloat(
1473 ==
'lang_size_bytes') ? 0 : 1,
1474 $a_lng->txt(
'lang_sep_decimal'),
1475 $a_lng->txt(
'lang_sep_thousand'),
1478 .
' ' . $a_lng->txt($scaled_unit);
1479 if ($a_mode ==
'long' && $size > $mag) {
1480 $result .=
' (' . self::fmtFloat(
1483 $a_lng->txt(
'lang_sep_decimal'),
1484 $a_lng->txt(
'lang_sep_thousand')
1486 . $a_lng->txt(
'lang_size_bytes') .
')';
const IL_COOKIE_PATH(isset($_GET['client_id']))
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Class InitCtrlService wraps the initialization of ilCtrl.
static quoteArray(array $a_array)
Quotes all members of an array for usage in DB query statement.
static usesHTTP()
Uses HTTP aka browser.
Class ilCtrl provides processing control methods.
Base class for ILIAS Exception handling.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _getOperationIdsByName(array $operations)
get ops_id's by name.
static getCurrentSkin()
get the current skin use always this function instead of getting the account's skin the current skin ...
static getCurrentStyle()
get the current style or sub style use always this function instead of getting the account's style th...
Util class various functions, usage as namespace.
static getHtmlPath(string $relative_path)
get url of path
static makeClickable(string $a_text, bool $detectGotoLinks=false, ?string $ilias_http_path=null)
static getImageTagByType(string $a_type, string $a_path, bool $a_big=false)
Builds an html image tag.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static formatSize(int $size, string $a_mode='short', ?ilLanguage $a_lng=null)
Returns the specified file size value in a human friendly form.
static unmaskAttributeTag(string $a_str, string $tag, string $tag_att)
static maskSecureTags(string $a_str, array $allow_array)
static groupNameExists(string $a_group_name, ?int $a_id=null)
checks if group name already exists.
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 getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
static __extractRefId(string $role_title)
extract ref id from role title, e.g.
static isHTML(string $a_text)
Checks if a given string contains HTML or not.
static stripOnlySlashes(string $a_str)
static maskTag(string $a_str, string $tag, array $fix_param=[])
static is_email(string $a_email, ?ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
static deducibleSize(string $a_mime)
checks if mime type is provided by getimagesize()
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static secureString(string $a_str, bool $a_strip_html=true, string $a_allow="")
static replaceLinkProperties(array $matches)
static isLogin(string $a_login)
static now()
Return current timestamp in Y-m-d H:i:s format.
static unmaskTag(string $a_str, string $tag, array $fix_param=[])
static extractParameterString(string $a_parstr)
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
static yn2tf(string $a_yn)
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
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,...
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 securePlainString(string $a_str)
static maskAttributeTag(string $a_str, string $tag, string $tag_att)
static secureUrl(string $url)
static insertInstIntoID(string $a_value)
inserts installation id into ILIAS id
static unmaskSecureTags(string $a_str, array $allow_array)
static secureLink(string $a_str)
static getNewContentStyleSheetLocation(string $mode="output")
get full style sheet file name (path inclusive) of current user
static redirect(string $a_script)
static setCookie(string $a_cookie_name, string $a_cookie_value='', bool $a_also_set_super_global=true, bool $a_set_cookie_invalid=false)
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 stripScriptHTML(string $a_str, string $a_allow="", bool $a_rm_js=true)
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.
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,...
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
if(!file_exists('../ilias.ini.php'))