43 public static function getImageTagByType(
string $a_type,
string $a_path,
bool $a_big =
false): string
47 $lng = $DIC->language();
55 return "<img src=\"" .
$filename .
"\" alt=\"" .
$lng->txt(
"obj_" . $a_type) .
"\" title=\"" .
$lng->txt(
57 ) .
"\" border=\"0\" vspace=\"0\"/>";
68 string $module_path =
"",
69 string $mode =
"output",
74 $styleDefinition = null;
75 if (isset($DIC[
"styleDefinition"])) {
76 $styleDefinition = $DIC[
"styleDefinition"];
79 if ($module_path !=
"") {
80 $module_path =
"/" . $module_path;
84 $default_img =
"." . $module_path .
"/templates/default/images/" . $img;
90 if (is_object($styleDefinition)) {
91 $image_dir = $styleDefinition->getImageDirectory($current_style);
93 $image_dir =
"images";
98 if ($current_skin ==
"default") {
99 $skin_img =
"." . $module_path .
"/templates/default/" . $image_dir .
"/" . $img;
100 } elseif (is_object($styleDefinition) && $current_skin !=
"default") {
101 $skin_img =
"./Customizing/global/skin/" .
102 $current_skin .
"/" . $current_style .
"/" . $module_path . $image_dir .
"/" . $img;
106 return "./images/" . $img;
107 } elseif (file_exists($skin_img)) {
122 if (substr($relative_path, 0, 2) ==
'./') {
123 $relative_path = (substr($relative_path, 1));
125 if (substr($relative_path, 0, 1) !=
'/') {
126 $relative_path =
'/' . $relative_path;
128 $htmlpath = ILIAS_HTTP_PATH . $relative_path;
143 string $mode =
"output",
144 string $a_css_name =
"",
145 string $a_css_location =
"" 154 $stylesheet_name = (strlen($a_css_name))
157 if (strlen($a_css_location) && (strcmp(substr($a_css_location, -1),
"/") != 0)) {
158 $a_css_location = $a_css_location .
"/";
168 $filename =
"./" . $a_css_location .
"templates/default/" . $stylesheet_name;
170 $skin_version_appendix =
"";
171 if ($mode !==
"filesystem") {
174 $skin_version = $skin->getVersion();
175 $skin_version_appendix .= ($skin_version !==
'' ? str_replace(
".",
"-", $skin_version) :
'0');
176 $skin_version_appendix =
"?skin_version=" . $skin_version_appendix;
178 return $filename . $skin_version_appendix;
198 if (is_file(
"./" . $in_style)) {
201 return "templates/default/delos_cont.css";
211 public static function switchColor(
int $a_num,
string $a_css1,
string $a_css2): string
224 public static function makeClickable(
string $a_text,
bool $detectGotoLinks =
false): string
228 $ret = $DIC->refinery()->string()->makeClickable()->transform($a_text);
230 if ($detectGotoLinks) {
231 $goto =
'<a[^>]*href="(' . str_replace(
'@',
'\@', ILIAS_HTTP_PATH) .
'/goto';
232 $regExp = $goto .
'.php\?target=\w+_(\d+)[^"]*)"[^>]*>[^<]*</a>';
233 $ret = preg_replace_callback(
234 '@' . $regExp .
'@i',
235 [self::class,
'replaceLinkProperties'],
240 $regExp = $goto .
'_[^"><]*[a-z0-9]+_([0-9]+)\.html)"[^>]*>[^<]*</a>';
241 $ret = preg_replace_callback(
242 '@' . $regExp .
'@i',
243 [self::class,
'replaceLinkProperties'],
254 $cache = $DIC[
'ilObjDataCache'];
259 $obj_id = $cache->lookupObjId(
$ref_id);
261 $title = $cache->lookupTitle($obj_id);
262 $link =
'<a href="' . $matches[1] .
'" target="_self">' . $title .
'</a>';
282 if ($mailAddressParserFactory === null) {
287 $parser = $mailAddressParserFactory->getParser($a_email);
288 $addresses = $parser->parse();
298 public static function isLogin(
string $a_login): bool
300 if (empty($a_login)) {
304 if (strlen($a_login) < 3) {
311 if (!preg_match(
"/^[A-Za-z0-9_\.\+\*\@!\$\%\~\-]+$/", $a_login)) {
324 public static function img(
326 ?
string $a_alt = null,
333 $img =
'<img src="' . $a_src .
'"';
334 if (!is_null($a_alt)) {
335 $img .=
' alt="' . htmlspecialchars($a_alt) .
'"';
337 if ($a_width !=
"") {
338 $img .=
' width="' . htmlspecialchars($a_width) .
'"';
340 if ($a_height !=
"") {
341 $img .=
' height="' . htmlspecialchars($a_height) .
'"';
343 if ($a_class !=
"") {
344 $img .=
' class="' . $a_class .
'"';
347 $img .=
' id="' . $a_id .
'"';
360 string $mime =
"application/octet-stream" 364 Delivery::DIRECT_PHP_OUTPUT,
368 $delivery->setSendMimeType(
true);
369 $delivery->setDisposition(Delivery::DISP_ATTACHMENT);
370 $delivery->setDownloadFileName($a_filename);
371 $delivery->setConvertFileNameToAsci(
true);
372 $repsonse = $DIC->http()->response()->withBody(Streams::ofString($a_data));
373 $DIC->http()->saveResponse($repsonse);
374 $delivery->deliver();
386 $url = (is_int(strpos($a_url,
"?")))
387 ? $a_url . $amp . $a_par
388 : $a_url .
"?" . $a_par;
396 public static function stripSlashes(
string $a_str,
bool $a_strip_html =
true,
string $a_allow =
""): string
398 if (ini_get(
"magic_quotes_gpc")) {
399 $a_str = stripslashes($a_str);
410 if (ini_get(
"magic_quotes_gpc")) {
411 $a_str = stripslashes($a_str);
420 public static function secureString(
string $a_str,
bool $a_strip_html =
true,
string $a_allow =
""): string
424 $allow_tags = explode(
">", $a_allow);
427 foreach ($allow_tags as $allow) {
429 $allow = str_replace(
"<",
"", $allow);
431 if (!in_array($allow, $sec_tags)) {
432 $only_secure =
false;
434 $allow_array[] = $allow;
439 if (($only_secure || $a_allow ==
"") && $a_strip_html) {
440 if ($a_allow ===
"") {
459 $a_str = strip_tags($a_str);
503 private static function maskSecureTags(
string $a_str, array $allow_array): string
505 foreach ($allow_array as $t) {
518 [
"param" =>
"align",
"value" =>
"left"],
519 [
"param" =>
"align",
"value" =>
"center"],
520 [
"param" =>
"align",
"value" =>
"justify"],
521 [
"param" =>
"align",
"value" =>
"right"]
536 foreach ($allow_array as $t) {
549 [
"param" =>
"align",
"value" =>
"left"],
550 [
"param" =>
"align",
"value" =>
"center"],
551 [
"param" =>
"align",
"value" =>
"justify"],
552 [
"param" =>
"align",
"value" =>
"right"]
570 if (ini_get(
"magic_quotes_gpc")) {
571 return stripslashes($a_str);
595 bool $a_make_links_clickable,
596 bool $a_detect_goto_links =
false 600 if ($a_make_links_clickable) {
617 $numberOfMatches = preg_match_all(
618 '/(?:(?:http|https|ftp|ftps|mailto):|www\.)(?:[a-zA-Z0-9]|[;\/?:|&=+$,]|[\\-_.!~*\'()]|%[0-9a-fA-F]{2}|#|[;?:@&=+$,])+/',
626 foreach ($matches[0] as $match) {
627 $matched_text = $match[0];
631 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1, $pos2 - $pos1)));
637 $pos1 = $pos2 + strlen($matched_text);
639 if ($pos1 < strlen($a_str)) {
640 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1)));
643 $encoded = nl2br(htmlspecialchars($a_str));
648 private static function maskAttributeTag(
string $a_str,
string $tag,
string $tag_att): string
652 $ilLog = $DIC[
"ilLog"];
655 $att = $ws .
"[^>]*" . $ws;
658 '/<(' . $tag . $att .
'(' . $tag_att . $ws .
'="' . $ws .
'(([$@!*()~;,_0-9A-z\/:=%.&#?+\-])*)")' . $att .
')>/i',
663 $a_str = preg_replace(
664 "/<" . preg_quote($found[1],
"/") .
">/i",
665 '<' . $tag .
' ' . $tag_att . $tag_att .
'="' . $found[3] .
'">',
668 if ($old_str == $a_str) {
670 "ilUtil::maskA-" . htmlentities($old_str) .
" == " .
676 $a_str = str_ireplace(
688 $ilLog = $DIC[
"ilLog"];
691 '/<(' . $tag .
' ' . $tag_att . $tag_att .
'="(([$@!*()~;,_0-9A-z\/:=%.&#?+\-])*)")>/i',
696 $a_str = preg_replace(
697 "/<" . preg_quote($found[1],
"/") .
">/i",
701 if ($old_str == $a_str) {
703 "ilUtil::unmaskA-" . htmlentities($old_str) .
" == " .
709 $a_str = str_replace(
'</' . $tag .
'>',
'</' . $tag .
'>', $a_str);
713 public static function maskTag(
string $a_str,
string $tag, array $fix_param = []): string
715 $a_str = str_replace(
716 [
"<$tag>",
"<" . strtoupper($tag) .
">"],
717 "<" . $tag .
">",
720 $a_str = str_replace(
721 [
"</$tag>",
"</" . strtoupper($tag) .
">"],
722 "</" . $tag .
">",
726 foreach ($fix_param as $p) {
729 $a_str = str_replace(
731 "<" .
"$tag $k=\"$v\"" .
">",
739 private static function unmaskTag(
string $a_str,
string $tag, array $fix_param = []): string
741 $a_str = str_replace(
"<" . $tag .
">",
"<" . $tag .
">", $a_str);
742 $a_str = str_replace(
"</" . $tag .
">",
"</" . $tag .
">", $a_str);
744 foreach ($fix_param as $p) {
747 $a_str = str_replace(
748 "<$tag $k=\"$v\">",
749 "<" .
"$tag $k=\"$v\"" .
">",
761 $a_str = str_ireplace(
"javascript",
"jvscrpt", $a_str);
762 $a_str = str_ireplace([
"%00",
781 public static function stripScriptHTML(
string $a_str,
string $a_allow =
"",
bool $a_rm_js =
true): string
783 $negativestr =
"a,abbr,acronym,address,applet,area,base,basefont," .
784 "big,blockquote,body,br,button,caption,center,cite,code,col," .
785 "colgroup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,form,frame," .
786 "frameset,h1,h2,h3,h4,h5,h6,head,hr,html,i,iframe,img,input,ins,isindex,kbd," .
787 "label,legend,li,link,map,menu,meta,noframes,noscript,object,ol," .
788 "optgroup,option,p,param,q,s,samp,script,select,small,span," .
789 "strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead," .
790 "title,tr,tt,u,ul,var";
791 $a_allow = strtolower($a_allow);
792 $negatives = explode(
",", $negativestr);
794 while ($outer_old_str != $a_str) {
795 $outer_old_str = $a_str;
796 foreach ($negatives as $item) {
797 $pos = strpos($a_allow,
"<$item>");
800 if ($pos ===
false) {
802 while ($old_str != $a_str) {
804 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s*>/i",
"", $a_str);
805 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s+([^>]*)>/i",
"", $a_str);
813 $a_str = preg_replace(
"/<\s*\w*(\/?)(\s+[^>]*)?(\s+on[^>]*)>/i",
"", $a_str);
816 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*javascript[^>]*>/i",
"", $a_str);
820 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*expression[^>]*>/i",
"", $a_str);
832 if (filter_var($url, FILTER_VALIDATE_URL) ===
false &&
833 filter_var(
"http://" . $url, FILTER_VALIDATE_URL) ===
false &&
834 filter_var(
"http:" . $url, FILTER_VALIDATE_URL) ===
false &&
835 filter_var(
"http://de.de" . $url, FILTER_VALIDATE_URL) ===
false &&
836 filter_var(
"http://de.de/" . $url, FILTER_VALIDATE_URL) ===
false) {
839 if (trim(strtolower(parse_url($url, PHP_URL_SCHEME) ??
'')) ===
"javascript") {
843 return htmlspecialchars($url, ENT_QUOTES);
854 while (($spos = strpos($a_parstr,
"=")) && $ok) {
856 $cpar = substr($a_parstr, 0, $spos);
857 $a_parstr = substr($a_parstr, $spos, strlen($a_parstr) - $spos);
858 while (substr($cpar, 0, 1) ==
"," || substr($cpar, 0, 1) ==
" " || substr($cpar, 0, 1) == chr(13) || substr(
863 $cpar = substr($cpar, 1, strlen($cpar) - 1);
865 while (substr($cpar, strlen($cpar) - 1, 1) ==
" " || substr($cpar, strlen($cpar) - 1, 1) == chr(
867 ) || substr($cpar, strlen($cpar) - 1, 1) == chr(10)) {
868 $cpar = substr($cpar, 0, strlen($cpar) - 1);
873 while ($cpar != $cpar_old) {
875 $cpar = preg_replace(
"/[^a-zA-Z0-9_]/i",
"", $cpar);
880 if ($spos = strpos($a_parstr,
"\"")) {
881 $a_parstr = substr($a_parstr, $spos + 1, strlen($a_parstr) - $spos);
882 $spos = strpos($a_parstr,
"\"");
884 $cval = substr($a_parstr, 0, $spos);
886 $a_parstr = substr($a_parstr, $spos + 1, strlen($a_parstr) - $spos - 1);
896 return $ok ? $par : [];
902 public static function yn2tf(
string $a_yn): bool
904 if (strtolower($a_yn) ===
"y") {
914 public static function tf2yn(
bool $a_tf): string
930 if (($a_mime ==
"image/gif") || ($a_mime ==
"image/jpeg") ||
931 ($a_mime ==
"image/png") || ($a_mime ==
"application/x-shockwave-flash") ||
932 ($a_mime ==
"image/tiff") || ($a_mime ==
"image/x-ms-bmp") ||
933 ($a_mime ==
"image/psd") || ($a_mime ==
"image/iff")) {
943 public static function redirect(
string $a_script): void
947 if (!isset($DIC[
'ilCtrl']) || !$DIC[
'ilCtrl'] instanceof
ilCtrl) {
950 $DIC->ctrl()->redirectToURL($a_script);
962 if (substr($a_value, 0, 4) ==
"il__") {
963 $a_value =
"il_" .
IL_INST_ID .
"_" . substr($a_value, 4, strlen($a_value) - 4);
984 $ilDB = $DIC->database();
987 if (isset($DIC[
"ilErr"])) {
991 if (empty($a_group_name)) {
992 $message = __METHOD__ .
": No groupname given!";
996 $clause = ($a_id !== null) ?
" AND obj_id != " .
$ilDB->quote($a_id) .
" " :
"";
998 $q =
"SELECT obj_id FROM object_data " .
999 "WHERE title = " .
$ilDB->quote($a_group_name,
"text") .
" " .
1000 "AND type = " .
$ilDB->quote(
"grp",
"text") .
1005 return $r->numRows() > 0;
1013 return (strtolower(substr(php_uname(), 0, 3)) ===
"win");
1021 public static function now(): string
1023 return date(
"Y-m-d H:i:s");
1056 string $a_operation,
1062 $ilDB = $DIC->database();
1063 $rbacreview = $DIC->rbac()->review();
1064 $ilAccess = $DIC->access();
1065 $ilUser = $DIC->user();
1067 $tree = $DIC->repositoryTree();
1069 if (!is_array($a_obj_type)) {
1070 $where =
"WHERE type = " .
$ilDB->quote($a_obj_type,
"text") .
" ";
1072 $where =
"WHERE " .
$ilDB->in(
"type", $a_obj_type,
false,
"text") .
" ";
1084 $a_usr_id = $a_usr_id ?: $ilUser->getId();
1085 $a_roles = $rbacreview->assignedRoles($a_usr_id);
1090 $query =
"SELECT ref_id FROM object_reference obr LEFT JOIN object_data obd ON obr.obj_id = obd.obj_id " .
1091 "LEFT JOIN tree ON obr.ref_id = tree.child " .
1098 while ($row =
$ilDB->fetchObject(
$res)) {
1104 if ($counter++ >= $limit) {
1108 $ref_ids[] = $row->ref_id;
1114 if ($a_operation ==
'edit_permissions' or strpos($a_operation,
'create') !==
false) {
1115 $check_owner =
") ";
1117 $check_owner =
"OR owner = " .
$ilDB->quote($a_usr_id,
"integer") .
") ";
1121 $ops_id = $ops_ids[0];
1123 $and =
"AND ((" .
$ilDB->in(
"rol_id", $a_roles,
false,
"integer") .
" ";
1125 $query =
"SELECT DISTINCT(obr.ref_id),obr.obj_id,type FROM object_reference obr " .
1126 "JOIN object_data obd ON obd.obj_id = obr.obj_id " .
1127 "LEFT JOIN rbac_pa ON obr.ref_id = rbac_pa.ref_id " .
1130 "AND (" .
$ilDB->like(
"ops_id",
"text",
"%i:" . $ops_id .
"%") .
" " .
1131 "OR " .
$ilDB->like(
"ops_id",
"text",
"%:\"" . $ops_id .
"\";%") .
")) " .
1138 if ($counter >= $limit) {
1148 if ($ilAccess->checkAccessOfUser($a_usr_id, $a_operation,
'', $row->ref_id, $row->type, $row->obj_id)) {
1150 $ref_ids[] = $row->ref_id;
1153 return $ref_ids ?: [];
1164 public static function isHTML(
string $a_text): bool
1166 if (strlen(strip_tags($a_text)) < strlen($a_text)) {
1181 $test_str = explode(
'_', $role_title);
1182 $prefix = $test_str[0] ??
'';
1184 if ($prefix ===
'il') {
1185 $ref_id = $test_str[3] ?? null;
1201 $test_str = explode(
'_', $ilias_id);
1203 $parsed_inst_id = (
int) ($test_str[1] ?? 0);
1204 $prefix = $test_str[0] ??
'';
1206 if ($prefix ===
'il' && $parsed_inst_id === $inst_id && count($test_str) === 4) {
1207 return is_numeric($test_str[3]) ? (
int) $test_str[3] : null;
1218 public static function _sortIds(array $a_ids,
string $a_table,
string $a_field,
string $a_id_name): array
1222 $ilDB = $DIC->database();
1229 $where =
"WHERE " . $a_id_name .
" IN (";
1233 $query =
"SELECT " . $a_id_name .
" FROM " . $a_table .
" " .
1235 "ORDER BY " . $a_field;
1240 $ids[] = $row->$a_id_name;
1256 $box_factory = $DIC->ui()->factory()->messageBox();
1259 $box = $box_factory->info($a_txt);
1262 $box = $box_factory->success($a_txt);
1265 $box = $box_factory->confirmation($a_txt);
1268 $box = $box_factory->failure($a_txt);
1274 return $DIC->ui()->renderer()->render($box);
1281 string $a_cookie_name,
1282 string $a_cookie_value =
'',
1283 bool $a_also_set_super_global =
true,
1284 bool $a_set_cookie_invalid =
false 1288 $http = $DIC->http();
1289 $cookie_jar =
$http->cookieJar();
1293 $cookie_expire = null;
1294 if (defined(
'IL_COOKIE_EXPIRE') && is_numeric(IL_COOKIE_EXPIRE) && IL_COOKIE_EXPIRE > 0) {
1295 $cookie_expire = (
int) IL_COOKIE_EXPIRE;
1299 if ($a_set_cookie_invalid) {
1300 $expires = time() - 10;
1301 } elseif ($cookie_expire > 0) {
1302 $expires = time() + $cookie_expire;
1305 $cookie = $cookie_factory->create($a_cookie_name, $a_cookie_value)
1306 ->withExpires($expires)
1307 ->withSecure(defined(
'IL_COOKIE_SECURE') ? IL_COOKIE_SECURE :
false)
1309 ->withDomain(defined(
'IL_COOKIE_DOMAIN') ? IL_COOKIE_DOMAIN :
'')
1310 ->withHttpOnly(defined(
'IL_COOKIE_HTTPONLY') ? IL_COOKIE_HTTPONLY :
false);
1314 defined(
'IL_COOKIE_SECURE') && IL_COOKIE_SECURE &&
1315 (!isset(session_get_cookie_params()[
'samesite']) || strtolower(session_get_cookie_params()[
'samesite']) !==
'strict')
1317 $cookie = $cookie->withSamesite(Cookie::SAMESITE_LAX);
1319 $jar = $cookie_jar->with($cookie);
1333 if ((isset(
$_SERVER[
'SHELL']) &&
$_SERVER[
'SHELL']) || PHP_SAPI ===
'cli' ||
1338 return ILIAS_HTTP_PATH;
1358 $exploded = explode(
'_', $a_import_id);
1360 $parsed[
'orig'] = $a_import_id;
1361 if ($exploded[0] ==
'il') {
1362 $parsed[
'prefix'] = $exploded[0];
1364 if (is_numeric($exploded[1])) {
1365 $parsed[
'inst_id'] = (
int) $exploded[1];
1367 $parsed[
'type'] = $exploded[2];
1369 if (is_numeric($exploded[3])) {
1370 $parsed[
'id'] = (
int) $exploded[3];
1386 int $a_decimals = 0,
1387 string $a_dec_point = null,
1388 string $a_thousands_sep = null,
1389 bool $a_suppress_dot_zero =
false 1393 $lng = $DIC->language();
1395 if ($a_dec_point === null) {
1398 if ($a_dec_point ===
'-lang_sep_decimal-') {
1402 if ($a_thousands_sep === null) {
1403 $a_thousands_sep =
$lng->txt(
'lang_sep_thousand');
1405 if ($a_thousands_sep ===
'-lang_sep_thousand-') {
1406 $a_thousands_sep =
",";
1409 $txt = number_format($a_float, $a_decimals, $a_dec_point, $a_thousands_sep);
1412 if (($a_suppress_dot_zero == 0 || $a_decimals == 0)
1413 && substr(
$txt, -2) == $a_dec_point .
'0' 1417 if ($a_float == 0 and
$txt ==
"") {
1444 $lng = $DIC->language();
1445 if ($a_lng == null) {
1451 if ($size >= $mag * $mag * $mag) {
1452 $scaled_size = $size / $mag / $mag / $mag;
1453 $scaled_unit =
'lang_size_gb';
1455 if ($size >= $mag * $mag) {
1456 $scaled_size = $size / $mag / $mag;
1457 $scaled_unit =
'lang_size_mb';
1459 if ($size >= $mag) {
1460 $scaled_size = $size / $mag;
1461 $scaled_unit =
'lang_size_kb';
1463 $scaled_size = $size;
1464 $scaled_unit =
'lang_size_bytes';
1469 $result = self::fmtFloat(
1472 ==
'lang_size_bytes') ? 0 : 1,
1473 $a_lng->txt(
'lang_sep_decimal'),
1474 $a_lng->txt(
'lang_sep_thousand'),
1477 .
' ' . $a_lng->txt($scaled_unit);
1478 if ($a_mode ==
'long' && $size > $mag) {
1479 $result .=
' (' . self::fmtFloat(
1482 $a_lng->txt(
'lang_sep_decimal'),
1483 $a_lng->txt(
'lang_sep_thousand')
1485 . $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)