45 public static function getImageTagByType(
string $a_type,
string $a_path,
bool $a_big =
false): string
49 $lng = $DIC->language();
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
220 public static function makeClickable(
string $a_text,
bool $detectGotoLinks =
false): string
224 $ret = $DIC->refinery()->string()->makeClickable()->transform($a_text);
226 if ($detectGotoLinks) {
227 $goto =
'<a[^>]*href="(' . str_replace(
'@',
'\@', ILIAS_HTTP_PATH) .
'/goto';
228 $regExp = $goto .
'.php\?target=\w+_(\d+)[^"]*)"[^>]*>[^<]*</a>';
229 $ret = preg_replace_callback(
230 '@' . $regExp .
'@i',
231 [self::class,
'replaceLinkProperties'],
236 $regExp = $goto .
'_[^"><]*[a-z0-9]+_([0-9]+)\.html)"[^>]*>[^<]*</a>';
237 $ret = preg_replace_callback(
238 '@' . $regExp .
'@i',
239 [self::class,
'replaceLinkProperties'],
250 $cache = $DIC[
'ilObjDataCache'];
255 $obj_id = $cache->lookupObjId(
$ref_id);
257 $title = $cache->lookupTitle($obj_id);
258 $link =
'<a href="' . $matches[1] .
'" target="_self">' . $title .
'</a>';
278 if ($mailAddressParserFactory ===
null) {
283 $parser = $mailAddressParserFactory->getParser($a_email);
284 $addresses = $parser->parse();
294 public static function isLogin(
string $a_login): bool
296 if (empty($a_login)) {
300 if (strlen($a_login) < 3) {
307 if (!preg_match(
"/^[A-Za-z0-9_\.\+\*\@!\$\%\~\-]+$/", $a_login)) {
320 public static function img(
322 ?
string $a_alt =
null,
329 $img =
'<img src="' . $a_src .
'"';
330 if (!is_null($a_alt)) {
331 $img .=
' alt="' . htmlspecialchars($a_alt) .
'"';
333 if ($a_width !=
"") {
334 $img .=
' width="' . htmlspecialchars($a_width) .
'"';
336 if ($a_height !=
"") {
337 $img .=
' height="' . htmlspecialchars($a_height) .
'"';
339 if ($a_class !=
"") {
340 $img .=
' class="' . $a_class .
'"';
343 $img .=
' id="' . $a_id .
'"';
356 string $mime =
"application/octet-stream" 360 Delivery::DIRECT_PHP_OUTPUT,
364 $delivery->setSendMimeType(
true);
365 $delivery->setDisposition(Delivery::DISP_ATTACHMENT);
366 $delivery->setDownloadFileName($a_filename);
367 $delivery->setConvertFileNameToAsci(
true);
368 $repsonse = $DIC->http()->response()->withBody(Streams::ofString($a_data));
369 $DIC->http()->saveResponse($repsonse);
370 $delivery->deliver();
382 $url = (is_int(strpos($a_url,
"?")))
383 ? $a_url . $amp . $a_par
384 : $a_url .
"?" . $a_par;
392 public static function stripSlashes(
string $a_str,
bool $a_strip_html =
true,
string $a_allow =
""): string
394 if (ini_get(
"magic_quotes_gpc")) {
395 $a_str = stripslashes($a_str);
406 if (ini_get(
"magic_quotes_gpc")) {
407 $a_str = stripslashes($a_str);
416 public static function secureString(
string $a_str,
bool $a_strip_html =
true,
string $a_allow =
""): string
420 $allow_tags = explode(
">", $a_allow);
423 foreach ($allow_tags as $allow) {
425 $allow = str_replace(
"<",
"", $allow);
427 if (!in_array($allow, $sec_tags)) {
428 $only_secure =
false;
430 $allow_array[] = $allow;
435 if (($only_secure || $a_allow ==
"") && $a_strip_html) {
436 if ($a_allow ===
"") {
455 $a_str = strip_tags($a_str);
499 private static function maskSecureTags(
string $a_str, array $allow_array): string
501 foreach ($allow_array as $t) {
514 [
"param" =>
"align",
"value" =>
"left"],
515 [
"param" =>
"align",
"value" =>
"center"],
516 [
"param" =>
"align",
"value" =>
"justify"],
517 [
"param" =>
"align",
"value" =>
"right"]
532 foreach ($allow_array as $t) {
545 [
"param" =>
"align",
"value" =>
"left"],
546 [
"param" =>
"align",
"value" =>
"center"],
547 [
"param" =>
"align",
"value" =>
"justify"],
548 [
"param" =>
"align",
"value" =>
"right"]
566 if (ini_get(
"magic_quotes_gpc")) {
567 return stripslashes($a_str);
591 bool $a_make_links_clickable,
592 bool $a_detect_goto_links =
false 596 if ($a_make_links_clickable) {
613 $numberOfMatches = preg_match_all(
614 '/(?:(?:http|https|ftp|ftps|mailto):|www\.)(?:[a-zA-Z0-9]|[;\/?:|&=+$,]|[\\-_.!~*\'()]|%[0-9a-fA-F]{2}|#|[;?:@&=+$,])+/',
622 foreach ($matches[0] as $match) {
623 $matched_text = $match[0];
627 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1, $pos2 - $pos1)));
633 $pos1 = $pos2 + strlen($matched_text);
635 if ($pos1 < strlen($a_str)) {
636 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1)));
639 $encoded = nl2br(htmlspecialchars($a_str));
644 private static function maskAttributeTag(
string $a_str,
string $tag,
string $tag_att): string
648 $ilLog = $DIC[
"ilLog"];
651 $att = $ws .
"[^>]*" . $ws;
654 '/<(' . $tag . $att .
'(' . $tag_att . $ws .
'="' . $ws .
'(([$@!*()~;,_0-9A-z\/:=%.&#?+\-])*)")' . $att .
')>/i',
659 $a_str = preg_replace(
660 "/<" . preg_quote($found[1],
"/") .
">/i",
661 '<' . $tag .
' ' . $tag_att . $tag_att .
'="' . $found[3] .
'">',
664 if ($old_str == $a_str) {
666 "ilUtil::maskA-" . htmlentities($old_str) .
" == " .
672 $a_str = str_ireplace(
684 $ilLog = $DIC[
"ilLog"];
687 '/<(' . $tag .
' ' . $tag_att . $tag_att .
'="(([$@!*()~;,_0-9A-z\/:=%.&#?+\-])*)")>/i',
692 $a_str = preg_replace(
693 "/<" . preg_quote($found[1],
"/") .
">/i",
697 if ($old_str == $a_str) {
699 "ilUtil::unmaskA-" . htmlentities($old_str) .
" == " .
705 $a_str = str_replace(
'</' . $tag .
'>',
'</' . $tag .
'>', $a_str);
709 public static function maskTag(
string $a_str,
string $tag, array $fix_param = []): string
711 $a_str = str_replace(
712 [
"<$tag>",
"<" . strtoupper($tag) .
">"],
713 "<" . $tag .
">",
716 $a_str = str_replace(
717 [
"</$tag>",
"</" . strtoupper($tag) .
">"],
718 "</" . $tag .
">",
722 foreach ($fix_param as $p) {
725 $a_str = str_replace(
727 "<" .
"$tag $k=\"$v\"" .
">",
735 private static function unmaskTag(
string $a_str,
string $tag, array $fix_param = []): string
737 $a_str = str_replace(
"<" . $tag .
">",
"<" . $tag .
">", $a_str);
738 $a_str = str_replace(
"</" . $tag .
">",
"</" . $tag .
">", $a_str);
740 foreach ($fix_param as $p) {
743 $a_str = str_replace(
744 "<$tag $k=\"$v\">",
745 "<" .
"$tag $k=\"$v\"" .
">",
757 $a_str = str_ireplace(
"javascript",
"jvscrpt", $a_str);
758 $a_str = str_ireplace([
"%00",
777 public static function stripScriptHTML(
string $a_str,
string $a_allow =
"",
bool $a_rm_js =
true): string
779 $negativestr =
"a,abbr,acronym,address,applet,area,base,basefont," .
780 "big,blockquote,body,br,button,caption,center,cite,code,col," .
781 "colgroup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,form,frame," .
782 "frameset,h1,h2,h3,h4,h5,h6,head,hr,html,i,iframe,img,input,ins,isindex,kbd," .
783 "label,legend,li,link,map,menu,meta,noframes,noscript,object,ol," .
784 "optgroup,option,p,param,q,s,samp,script,select,small,span," .
785 "strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead," .
786 "title,tr,tt,u,ul,var";
787 $a_allow = strtolower($a_allow);
788 $negatives = explode(
",", $negativestr);
790 while ($outer_old_str != $a_str) {
791 $outer_old_str = $a_str;
792 foreach ($negatives as $item) {
793 $pos = strpos($a_allow,
"<$item>");
796 if ($pos ===
false) {
798 while ($old_str != $a_str) {
800 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s*>/i",
"", $a_str);
801 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s+([^>]*)>/i",
"", $a_str);
809 $a_str = preg_replace(
"/<\s*\w*(\/?)(\s+[^>]*)?(\s+on[^>]*)>/i",
"", $a_str);
812 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*javascript[^>]*>/i",
"", $a_str);
816 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*expression[^>]*>/i",
"", $a_str);
828 if (filter_var($url, FILTER_VALIDATE_URL) ===
false &&
829 filter_var(
"http://" . $url, FILTER_VALIDATE_URL) ===
false &&
830 filter_var(
"http:" . $url, FILTER_VALIDATE_URL) ===
false &&
831 filter_var(
"http://de.de" . $url, FILTER_VALIDATE_URL) ===
false &&
832 filter_var(
"http://de.de/" . $url, FILTER_VALIDATE_URL) ===
false) {
835 if (trim(strtolower(parse_url($url, PHP_URL_SCHEME) ??
'')) ===
"javascript") {
839 return htmlspecialchars($url, ENT_QUOTES);
850 while (($spos = strpos($a_parstr,
"=")) && $ok) {
852 $cpar = substr($a_parstr, 0, $spos);
853 $a_parstr = substr($a_parstr, $spos, strlen($a_parstr) - $spos);
854 while (substr($cpar, 0, 1) ==
"," || substr($cpar, 0, 1) ==
" " || substr($cpar, 0, 1) == chr(13) || substr(
859 $cpar = substr($cpar, 1, strlen($cpar) - 1);
861 while (substr($cpar, strlen($cpar) - 1, 1) ==
" " || substr($cpar, strlen($cpar) - 1, 1) == chr(
863 ) || substr($cpar, strlen($cpar) - 1, 1) == chr(10)) {
864 $cpar = substr($cpar, 0, strlen($cpar) - 1);
869 while ($cpar != $cpar_old) {
871 $cpar = preg_replace(
"/[^a-zA-Z0-9_]/i",
"", $cpar);
876 if ($spos = strpos($a_parstr,
"\"")) {
877 $a_parstr = substr($a_parstr, $spos + 1, strlen($a_parstr) - $spos);
878 $spos = strpos($a_parstr,
"\"");
880 $cval = substr($a_parstr, 0, $spos);
882 $a_parstr = substr($a_parstr, $spos + 1, strlen($a_parstr) - $spos - 1);
892 return $ok ? $par : [];
898 public static function yn2tf(
string $a_yn): bool
900 if (strtolower($a_yn) ===
"y") {
910 public static function tf2yn(
bool $a_tf): string
926 if (($a_mime ==
"image/gif") || ($a_mime ==
"image/jpeg") ||
927 ($a_mime ==
"image/png") || ($a_mime ==
"application/x-shockwave-flash") ||
928 ($a_mime ==
"image/tiff") || ($a_mime ==
"image/x-ms-bmp") ||
929 ($a_mime ==
"image/psd") || ($a_mime ==
"image/iff")) {
939 public static function redirect(
string $a_script): void
943 if (!isset($DIC[
'ilCtrl']) || !$DIC[
'ilCtrl'] instanceof
ilCtrl) {
946 $DIC->ctrl()->redirectToURL($a_script);
958 if (substr($a_value, 0, 4) ==
"il__") {
959 $a_value =
"il_" .
IL_INST_ID .
"_" . substr($a_value, 4, strlen($a_value) - 4);
980 $ilDB = $DIC->database();
983 if (isset($DIC[
"ilErr"])) {
987 if (empty($a_group_name)) {
988 $message = __METHOD__ .
": No groupname given!";
992 $clause = ($a_id !==
null) ?
" AND obj_id != " .
$ilDB->quote($a_id) .
" " :
"";
994 $q =
"SELECT obj_id FROM object_data " .
995 "WHERE title = " .
$ilDB->quote($a_group_name,
"text") .
" " .
996 "AND type = " .
$ilDB->quote(
"grp",
"text") .
1001 return $r->numRows() > 0;
1009 return (strtolower(substr(php_uname(), 0, 3)) ===
"win");
1017 public static function now(): string
1019 return date(
"Y-m-d H:i:s");
1052 string $a_operation,
1058 $ilDB = $DIC->database();
1059 $rbacreview = $DIC->rbac()->review();
1060 $ilAccess = $DIC->access();
1061 $ilUser = $DIC->user();
1063 $tree = $DIC->repositoryTree();
1065 if (!is_array($a_obj_type)) {
1066 $where =
"WHERE type = " .
$ilDB->quote($a_obj_type,
"text") .
" ";
1068 $where =
"WHERE " .
$ilDB->in(
"type", $a_obj_type,
false,
"text") .
" ";
1080 $a_usr_id = $a_usr_id ?: $ilUser->getId();
1081 $a_roles = $rbacreview->assignedRoles($a_usr_id);
1086 $query =
"SELECT ref_id FROM object_reference obr LEFT JOIN object_data obd ON obr.obj_id = obd.obj_id " .
1087 "LEFT JOIN tree ON obr.ref_id = tree.child " .
1094 while ($row =
$ilDB->fetchObject(
$res)) {
1100 if ($counter++ >= $limit) {
1104 $ref_ids[] = $row->ref_id;
1110 if ($a_operation ==
'edit_permissions' or strpos($a_operation,
'create') !==
false) {
1111 $check_owner =
") ";
1113 $check_owner =
"OR owner = " .
$ilDB->quote($a_usr_id,
"integer") .
") ";
1117 $ops_id = $ops_ids[0];
1119 $and =
"AND ((" .
$ilDB->in(
"rol_id", $a_roles,
false,
"integer") .
" ";
1121 $query =
"SELECT DISTINCT(obr.ref_id),obr.obj_id,type FROM object_reference obr " .
1122 "JOIN object_data obd ON obd.obj_id = obr.obj_id " .
1123 "LEFT JOIN rbac_pa ON obr.ref_id = rbac_pa.ref_id " .
1126 "AND (" .
$ilDB->like(
"ops_id",
"text",
"%i:" . $ops_id .
"%") .
" " .
1127 "OR " .
$ilDB->like(
"ops_id",
"text",
"%:\"" . $ops_id .
"\";%") .
")) " .
1134 if ($counter >= $limit) {
1144 if ($ilAccess->checkAccessOfUser($a_usr_id, $a_operation,
'', $row->ref_id, $row->type, $row->obj_id)) {
1146 $ref_ids[] = $row->ref_id;
1149 return $ref_ids ?: [];
1160 public static function isHTML(
string $a_text): bool
1162 if (strlen(strip_tags($a_text)) < strlen($a_text)) {
1177 $test_str = explode(
'_', $role_title);
1178 $prefix = $test_str[0] ??
'';
1180 if ($prefix ===
'il') {
1197 $test_str = explode(
'_', $ilias_id);
1199 $parsed_inst_id = (
int) ($test_str[1] ?? 0);
1200 $prefix = $test_str[0] ??
'';
1202 if ($prefix ===
'il' && $parsed_inst_id === $inst_id && count($test_str) === 4) {
1203 return is_numeric($test_str[3]) ? (
int) $test_str[3] :
null;
1214 public static function _sortIds(array $a_ids,
string $a_table,
string $a_field,
string $a_id_name): array
1218 $ilDB = $DIC->database();
1225 $where =
"WHERE " . $a_id_name .
" IN (";
1229 $query =
"SELECT " . $a_id_name .
" FROM " . $a_table .
" " .
1231 "ORDER BY " . $a_field;
1236 $ids[] = $row->$a_id_name;
1252 $box_factory = $DIC->ui()->factory()->messageBox();
1255 $box = $box_factory->info($a_txt);
1258 $box = $box_factory->success($a_txt);
1261 $box = $box_factory->confirmation($a_txt);
1264 $box = $box_factory->failure($a_txt);
1270 return $DIC->ui()->renderer()->render($box);
1277 string $a_cookie_name,
1278 string $a_cookie_value =
'',
1279 bool $a_also_set_super_global =
true,
1280 bool $a_set_cookie_invalid =
false 1284 $http = $DIC->http();
1285 $cookie_jar =
$http->cookieJar();
1289 $cookie_expire =
null;
1290 if (defined(
'IL_COOKIE_EXPIRE') && is_numeric(IL_COOKIE_EXPIRE) && IL_COOKIE_EXPIRE > 0) {
1291 $cookie_expire = (
int) IL_COOKIE_EXPIRE;
1295 if ($a_set_cookie_invalid) {
1296 $expires = time() - 10;
1297 } elseif ($cookie_expire > 0) {
1298 $expires = time() + $cookie_expire;
1301 $cookie = $cookie_factory->create($a_cookie_name, $a_cookie_value)
1302 ->withExpires($expires)
1303 ->withSecure(defined(
'IL_COOKIE_SECURE') ? IL_COOKIE_SECURE :
false)
1305 ->withDomain(defined(
'IL_COOKIE_DOMAIN') ? IL_COOKIE_DOMAIN :
'')
1306 ->withHttpOnly(defined(
'IL_COOKIE_HTTPONLY') ? IL_COOKIE_HTTPONLY :
false);
1310 defined(
'IL_COOKIE_SECURE') && IL_COOKIE_SECURE &&
1311 (!isset(session_get_cookie_params()[
'samesite']) || strtolower(session_get_cookie_params()[
'samesite']) !==
'strict')
1313 $cookie = $cookie->withSamesite(Cookie::SAMESITE_LAX);
1315 $jar = $cookie_jar->with($cookie);
1329 if ((isset(
$_SERVER[
'SHELL']) &&
$_SERVER[
'SHELL']) || PHP_SAPI ===
'cli' ||
1334 return ILIAS_HTTP_PATH;
1354 $exploded = explode(
'_', $a_import_id);
1356 $parsed[
'orig'] = $a_import_id;
1357 if ($exploded[0] ==
'il') {
1358 $parsed[
'prefix'] = $exploded[0];
1360 if (is_numeric($exploded[1])) {
1361 $parsed[
'inst_id'] = (
int) $exploded[1];
1363 $parsed[
'type'] = $exploded[2];
1365 if (is_numeric($exploded[3])) {
1366 $parsed[
'id'] = (
int) $exploded[3];
1382 int $a_decimals = 0,
1383 ?
string $a_dec_point =
null,
1384 ?
string $a_thousands_sep =
null,
1385 bool $a_suppress_dot_zero =
false 1389 $lng = $DIC->language();
1391 if ($a_dec_point ===
null) {
1394 if ($a_dec_point ===
'-lang_sep_decimal-') {
1398 if ($a_thousands_sep ===
null) {
1399 $a_thousands_sep =
$lng->txt(
'lang_sep_thousand');
1401 if ($a_thousands_sep ===
'-lang_sep_thousand-') {
1402 $a_thousands_sep =
",";
1405 $txt = number_format($a_float, $a_decimals, $a_dec_point, $a_thousands_sep);
1408 if (($a_suppress_dot_zero == 0 || $a_decimals == 0)
1409 && substr(
$txt, -2) == $a_dec_point .
'0' 1413 if ($a_float == 0 and
$txt ==
"") {
1440 $lng = $DIC->language();
1441 if ($a_lng ==
null) {
1447 if ($size >= $mag * $mag * $mag) {
1448 $scaled_size = $size / $mag / $mag / $mag;
1449 $scaled_unit =
'lang_size_gb';
1451 if ($size >= $mag * $mag) {
1452 $scaled_size = $size / $mag / $mag;
1453 $scaled_unit =
'lang_size_mb';
1455 if ($size >= $mag) {
1456 $scaled_size = $size / $mag;
1457 $scaled_unit =
'lang_size_kb';
1459 $scaled_size = $size;
1460 $scaled_unit =
'lang_size_bytes';
1465 $result = self::fmtFloat(
1468 ==
'lang_size_bytes') ? 0 : 1,
1469 $a_lng->txt(
'lang_sep_decimal'),
1470 $a_lng->txt(
'lang_sep_thousand'),
1473 .
' ' . $a_lng->txt($scaled_unit);
1474 if ($a_mode ==
'long' && $size > $mag) {
1475 $result .=
' (' . self::fmtFloat(
1478 $a_lng->txt(
'lang_sep_decimal'),
1479 $a_lng->txt(
'lang_sep_thousand')
1481 . $a_lng->txt(
'lang_size_bytes') .
')';
setMimeType(string $mime_type)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
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 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 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 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 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.
static is_email(string $a_email, ?ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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 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)
const IL_COOKIE_PATH(isset($_GET['client_id']))
static __extractRefId(string $role_title)
extract ref id from role title, e.g.
static stripOnlySlashes(string $a_str)