37 return "<img src=\"".ilUtil::getImagePath(
$filename).
"\" alt=\"".$lng->txt(
"obj_".$a_type).
"\" title=\"".$lng->txt(
"obj_".$a_type).
"\" border=\"0\" vspace=\"0\"/>";
56 if($ilSetting->get(
"custom_icons"))
63 include_once(
'./Services/Container/classes/class.ilContainer.php');
96 global $ilias, $styleDefinition,
$ilCtrl;
98 if (is_int(strpos($_SERVER[
"PHP_SELF"],
"setup.php")))
102 if ($module_path !=
"")
104 $module_path =
"/".$module_path;
108 $default_img =
".".$module_path.
"/templates/default/images/".
$img;
110 if (is_object($styleDefinition))
112 $image_dir = $styleDefinition->getImageDirectory($ilias->account->prefs[
"style"]);
114 if ($ilUser->skin ==
"default")
116 $user_img =
".".$module_path.
"/templates/default/".$image_dir.
"/".
$img;
117 $skin_img =
".".$module_path.
"/templates/default/images/".
$img;
119 else if (is_object($styleDefinition) && $ilUser->skin !=
"default")
121 $user_img =
"./Customizing/global/skin/".
122 $ilias->account->skin.$module_path.
"/".$image_dir.
"/".
$img;
123 $skin_img =
"./Customizing/global/skin/".
124 $ilias->account->skin.$module_path.
"/images/".
$img;
129 return "./images/".$img;
131 else if (@file_exists($user_img) && $image_dir !=
"")
135 else if (file_exists($skin_img))
153 if (substr($relative_path, 0, 2) ==
'./')
155 $relative_path = (substr($relative_path, 1));
157 if (substr($relative_path, 0, 1) !=
'/')
159 $relative_path =
'/' . $relative_path;
161 $htmlpath = ILIAS_HTTP_PATH . $relative_path;
180 $stylesheet_name = (strlen($a_css_name)) ? $a_css_name : $ilias->account->prefs[
"style"].
".css";
181 if (strlen($a_css_location) && (strcmp(substr($a_css_location, -1),
"/") != 0)) $a_css_location = $a_css_location .
"/";
184 if ($ilias->account->skin !=
"default")
186 $filename =
"./Customizing/global/skin/".$ilias->account->skin.
"/".$a_css_location.$stylesheet_name;
190 $filename =
"./" . $a_css_location .
"templates/default/".$stylesheet_name;
193 if ($mode !=
"filesystem")
195 $vers = str_replace(
" ",
"-", $ilias->getSetting(
"ilias_version"));
196 $vers =
"?vers=".str_replace(
".",
"-", $vers);
209 function getJSLocation($a_js_name, $a_js_location =
"", $add_version = FALSE)
214 $js_name = $a_js_name;
215 if (strlen($a_js_location) && (strcmp(substr($a_js_location, -1),
"/") != 0)) $a_js_location = $a_js_location .
"/";
218 if ($ilias->account->skin !=
"default")
220 $filename =
"./Customizing/global/skin/".$ilias->account->skin.
"/".$a_js_location.$js_name;
224 $filename =
"./" . $a_js_location .
"templates/default/".$js_name;
229 $vers = str_replace(
" ",
"-", $ilias->getSetting(
"ilias_version"));
230 $vers =
"?vers=".str_replace(
".",
"-", $vers);
244 if (defined(
"ILIAS_MODULE"))
249 $base .=
"../Services/Privacy/";
254 $base =
"./Services/Privacy/";
257 if (is_file($base.
"w3c/p3p.xml"))
259 return ILIAS_HTTP_PATH.
"w3c/p3p.xml";
263 return ILIAS_HTTP_PATH.
"/w3c/p3p_template.xml";
277 if ($mode !=
"filesystem")
279 $vers = str_replace(
" ",
"-", $ilias->getSetting(
"ilias_version"));
280 $vers =
"?vers=".str_replace(
".",
"-", $vers);
283 if ($ilias->account->skin ==
"default")
285 $in_style =
"./templates/".$ilias->account->skin.
"/".$ilias->account->prefs[
"style"].
"_cont.css";
289 $in_style =
"./Customizing/global/skin/".$ilias->account->skin.
"/".$ilias->account->prefs[
"style"].
"_cont.css";
292 if (is_file(
"./".$in_style))
294 return $base.$in_style.$vers;
298 return $base.
"templates/default/delos_cont.css".$vers;
318 public static function formSelect($selected,$varname,$options,$multiple =
false,$direct_text =
false,
$size =
"0",
319 $style_class =
"", $attribs =
"",$disabled =
false)
323 if ($multiple ==
true)
325 $multiple =
" multiple=\"multiple\"";
333 if ($style_class !=
"")
335 $class =
" class=\"".$style_class.
"\"";
342 if (is_array($attribs))
344 foreach ($attribs as
$key => $val)
346 $attributes .=
" ".$key.
"=\"".$val.
"\"";
351 $disabled =
' disabled=\"disabled\"';
354 $str =
"<select name=\"".$varname .
"\"".$multiple.
" $class size=\"".
$size.
"\" $attributes $disabled>\n";
356 foreach ($options as
$key => $val)
360 $style = $val[
"style"];
364 $sty = ($style !=
"")
365 ?
' style="'.$style.
'" '
370 $str .=
" <option $sty value=\"".$key.
"\"";
374 $str .=
" <option $sty value=\"".$val.
"\"";
376 if (is_array($selected) )
378 if (in_array(
$key,$selected))
380 $str .=
" selected=\"selected\"";
383 else if ($selected ==
$key)
385 $str .=
" selected=\"selected\"";
390 $str .=
">".$val.
"</option>\n";
394 $str .=
">".$lng->txt($val).
"</option>\n";
398 $str .=
"</select>\n";
412 return($values[$selected]);
424 public static function formCheckbox ($checked,$varname,$value,$disabled =
false)
426 $str =
"<input type=\"checkbox\" name=\"".$varname.
"\"";
430 $str .=
" checked=\"checked\"";
435 $str .=
" disabled=\"disabled\"";
440 if (substr($varname,-2) ==
"[]")
448 $varname_id = substr($varname,0,-2).
"_".$value;
452 $varname_id = $varname;
456 $varname_id = ereg_replace(
"\[",
"_",$varname_id);
457 $varname_id = ereg_replace(
"\]",
"",$varname_id);
459 $str .=
" value=\"".$value.
"\" id=\"".$varname_id.
"\" />\n";
476 $str =
"<input disabled type=\"radio\" name=\"".$varname.
"\"";
479 $str =
"<input type=\"radio\" name=\"".$varname.
"\"";
483 $str .=
" checked=\"checked\"";
486 $str .=
" value=\"".$value.
"\"";
487 $str .=
" id=\"".$value.
"\" />\n";
504 $str =
"<input type=\"radio\" name=\"".$varname.
"\"";
507 $str .=
" checked=\"checked\"";
510 $str .=
" value=\"".$value.
"\"";
512 $str .=
" id=\"".$value.
"\" />\n";
529 $str =
"<input type=\"input\" name=\"".$varname.
"\"";
535 $str .=
" value=\"".$value.
"\"";
537 $str .=
" id=\"".$value.
"\" />\n";
560 if (
"" != $a_path &&
"/" != substr($a_path, -1))
605 $tpltab =
new ilTemplate(
"tpl.tabs.html",
true,
true);
607 for ($i=1; $i<=4; $i++)
609 $tpltab->setCurrentBlock(
"tab");
612 $tabtype =
"tabactive";
617 $tabtype =
"tabinactive";
624 $txt = $lng->txt(
"view_content");
627 $txt = $lng->txt(
"edit_properties");
630 $txt = $lng->txt(
"perm_settings");
633 $txt = $lng->txt(
"show_owner");
636 $tpltab->setVariable(
"CONTENT", $txt);
637 $tpltab->setVariable(
"TABTYPE", $tabtype);
638 $tpltab->setVariable(
"TAB",
$tab);
639 $tpltab->setVariable(
"LINK", $a_o[
"LINK".$i]);
640 $tpltab->parseCurrentBlock();
643 return $tpltab->get();
659 foreach ($emptyFields as
$key => $val)
662 if ($feedback !=
"") $feedback .=
", ";
692 function Linkbar ($AScript,$AHits,$ALimit,$AOffset,$AParams = array(),$ALayout = array(), $prefix =
'')
697 $layout_prev =
"<<";
698 $layout_next =
">>";
701 if (count($ALayout > 0))
703 if ($ALayout[
"link"])
705 $layout_link =
" class=\"".$ALayout[
"link"].
"\"";
708 if ($ALayout[
"prev"])
710 $layout_prev = $ALayout[
"prev"];
713 if ($ALayout[
"next"])
715 $layout_next = $ALayout[
"next"];
721 if ($AHits > $ALimit || $AOffset > 0)
723 if (!empty($AParams))
725 foreach ($AParams as
$key => $value)
731 if(strpos($AScript,
'&'))
733 $link = $AScript.
"&".
$params.$prefix.
"offset=";
737 $link = $AScript.
"?".
$params.$prefix.
"offset=";
743 $prevoffset = $AOffset - $ALimit;
744 if ($prevoffset < 0) $prevoffset = 0;
745 $LinkBar .=
"<a".$layout_link.
" href=\"".$link.$prevoffset.
"\">".$layout_prev.
" </a>";
749 $pages=intval($AHits/$ALimit);
752 if (($AHits % $ALimit))
759 for ($i = 1 ;$i <= $pages ; $i++)
761 $newoffset=$ALimit*($i-1);
763 if ($newoffset == $AOffset)
765 $LinkBar .=
"[".$i.
"] ";
769 $LinkBar .=
'<a '.$layout_link.
' href="'.
770 $link.$newoffset.
'">['.$i.
']</a> ';
777 if (! ( ($AOffset/$ALimit)==($pages-1) ) && ($pages!=1) )
779 $newoffset=$AOffset+$ALimit;
780 $LinkBar .=
"<a".$layout_link.
" href=\"".$link.$newoffset.
"\"> ".$layout_next.
"</a>";
806 $ret = eregi_replace(
"(^|[[:space:]]+)(www\.)([[:alnum:]#?/&=\.-]+)",
807 "\\1http://\\2\\3",
$ret);
810 $ret = eregi_replace(
"(^|[[:space:]]+)(ftp\.)([[:alnum:]#?/&=\.-]+)",
811 "\\1ftp://\\2\\3",
$ret);
818 $ret = str_replace(
'src="http://',
'"***masked_im_start***',
$ret);
820 include_once(
"./Services/Utilities/classes/class.ilMWParserAdapter.php");
822 $ret = $parser->replaceFreeExternalLinks(
$ret);
825 $ret = str_replace(
'"***masked_im_start***',
'src="http://',
$ret);
829 if ($detectGotoLinks)
832 $regExp =
"<a[^>]*href=\"(".str_replace(
"/",
"\/",ILIAS_HTTP_PATH).
"\/goto.php\?target=\w+_(\d+)[^\"]*)\"[^>]*>[^<]*<\/a>";
834 $ret = preg_replace_callback(
836 array(
"ilUtil",
"replaceLinkProperties"),
840 $regExp =
"<a[^>]*href=\"(".str_replace(
"/",
"\/",ILIAS_HTTP_PATH).
"\/goto_.*[a-z0-9]+_([0-9]+)\.html)\"[^>]*>[^<]*<\/a>";
842 $ret = preg_replace_callback(
844 array(
"ilUtil",
"replaceLinkProperties"),
873 $link =
"<a href=".$matches[1].
" target=\"_self\">".
$title.
"</a>";
897 $m = explode(
" ",microtime());
924 function makeDateSelect($prefix, $year =
"", $month =
"", $day =
"", $startyear =
"",$a_long_month =
true,$a_further_options = array(), $emptyoption =
false)
929 if(isset($a_further_options[
'disabled']) and $a_further_options[
'disabled'])
931 $disabled =
'disabled="disabled" ';
937 if (!strlen($year)) $year = $now[
"year"];
938 if (!strlen($month)) $month = $now[
"mon"];
939 if (!strlen($day)) $day = $now[
"mday"];
943 $month = (int) $month;
948 $sel_day .=
'<select ';
949 if(isset($a_further_options[
'select_attributes']))
951 foreach($a_further_options[
'select_attributes'] as
$name => $value)
953 $sel_day .= (
$name.
'="'.$value.
'" ');
957 $sel_day .= $disabled.
"name=\"".$prefix.
"[d]\" id=\"".$prefix.
"_d\">\n";
959 if ($emptyoption) $sel_day .=
"<option value=\"0\">--</option>\n";
960 for ($i = 1; $i <= 31; $i++)
962 $sel_day .=
"<option value=\"$i\">" . sprintf(
"%02d", $i) .
"</option>\n";
964 $sel_day .=
"</select>\n";
965 $sel_day = preg_replace(
"/(value\=\"$day\")/",
"$1 selected=\"selected\"", $sel_day);
968 $sel_month =
'<select ';
969 if(isset($a_further_options[
'select_attributes']))
971 foreach($a_further_options[
'select_attributes'] as
$name => $value)
973 $sel_month .= (
$name.
'="'.$value.
'" ');
976 $sel_month .= $disabled.
"name=\"".$prefix.
"[m]\" id=\"".$prefix.
"_m\">\n";
978 if ($emptyoption) $sel_month .=
"<option value=\"0\">--</option>\n";
979 for ($i = 1; $i <= 12; $i++)
983 $sel_month .=
"<option value=\"$i\">" . $lng->txt(
"month_" . sprintf(
"%02d", $i) .
"_long") .
"</option>\n";
987 $sel_month .=
"<option value=\"$i\">" . $i .
"</option>\n";
990 $sel_month .=
"</select>\n";
991 $sel_month = preg_replace(
"/(value\=\"$month\")/",
"$1 selected=\"selected\"", $sel_month);
994 $sel_year =
'<select ';
995 if(isset($a_further_options[
'select_attributes']))
997 foreach($a_further_options[
'select_attributes'] as
$name => $value)
999 $sel_year .= (
$name.
'="'.$value.
'" ');
1002 $sel_year .= $disabled.
"name=\"".$prefix.
"[y]\" id=\"".$prefix.
"_y\">\n";
1003 if ((strlen($startyear) == 0) || ($startyear > $year))
1005 if (!$emptyoption || $year != 0) $startyear = $year - 5;
1008 if(($year + 5) < (date(
'Y',time()) + 5))
1010 $end_year = date(
'Y',time()) + 5;
1014 $end_year = $year + 5;
1017 if ($emptyoption) $sel_year .=
"<option value=\"0\">----</option>\n";
1018 for ($i = $startyear; $i <= $end_year; $i++)
1020 $sel_year .=
"<option value=\"$i\">" . sprintf(
"%04d", $i) .
"</option>\n";
1022 $sel_year .=
"</select>\n";
1023 $sel_year = preg_replace(
"/(value\=\"$year\")/",
"$1 selected=\"selected\"", $sel_year);
1026 $dateformat =
"d-m-Y";
1027 $dateformat = strtolower(preg_replace(
"/\W/",
"", $dateformat));
1028 $dateformat = strtolower(preg_replace(
"/(\w)/",
"%%$1", $dateformat));
1029 $dateformat = preg_replace(
"/%%d/", $sel_day, $dateformat);
1030 $dateformat = preg_replace(
"/%%m/", $sel_month, $dateformat);
1031 $dateformat = preg_replace(
"/%%y/", $sel_year, $dateformat);
1051 function makeTimeSelect($prefix, $short =
true, $hour =
"", $minute =
"", $second =
"",$a_use_default =
true,$a_further_options = array())
1057 if(count($a_further_options))
1059 if(isset($a_further_options[
'minute_steps']))
1061 $minute_steps = $a_further_options[
'minute_steps'];
1063 if(isset($a_further_options[
'disabled']) and $a_further_options[
'disabled'])
1065 $disabled =
'disabled="disabled" ';
1069 if ($a_use_default and !strlen(
"$hour$minute$second")) {
1076 $minute = (int)$minute;
1077 $second = (int)$second;
1080 $sel_hour =
'<select ';
1081 if(isset($a_further_options[
'select_attributes']))
1083 foreach($a_further_options[
'select_attributes'] as
$name => $value)
1085 $sel_hour .=
$name.
'='.$value.
' ';
1088 $sel_hour .=
" ".$disabled.
"name=\"".$prefix.
"[h]\" id=\"".$prefix.
"_h\">\n";
1090 for ($i = 0; $i <= 23; $i++)
1092 $sel_hour .=
"<option value=\"$i\">" . sprintf(
"%02d", $i) .
"</option>\n";
1094 $sel_hour .=
"</select>\n";
1095 $sel_hour = preg_replace(
"/(value\=\"$hour\")/",
"$1 selected=\"selected\"", $sel_hour);
1098 $sel_minute .=
"<select ".$disabled.
"name=\"".$prefix.
"[m]\" id=\"".$prefix.
"_m\">\n";
1100 for ($i = 0; $i <= 59; $i = $i + $minute_steps)
1102 $sel_minute .=
"<option value=\"$i\">" . sprintf(
"%02d", $i) .
"</option>\n";
1104 $sel_minute .=
"</select>\n";
1105 $sel_minute = preg_replace(
"/(value\=\"$minute\")/",
"$1 selected=\"selected\"", $sel_minute);
1109 $sel_second .=
"<select ".$disabled.
"name=\"".$prefix.
"[s]\" id=\"".$prefix.
"_s\">\n";
1111 for ($i = 0; $i <= 59; $i++)
1113 $sel_second .=
"<option value=\"$i\">" . sprintf(
"%02d", $i) .
"</option>\n";
1115 $sel_second .=
"</select>\n";
1116 $sel_second = preg_replace(
"/(value\=\"$second\")/",
"$1 selected=\"selected\"", $sel_second);
1118 $timeformat = $lng->text[
"lang_timeformat"];
1119 if (strlen($timeformat) == 0) $timeformat =
"H:i:s";
1120 $timeformat = strtolower(preg_replace(
"/\W/",
"", $timeformat));
1121 $timeformat = preg_replace(
"/(\w)/",
"%%$1", $timeformat);
1122 $timeformat = preg_replace(
"/%%h/", $sel_hour, $timeformat);
1123 $timeformat = preg_replace(
"/%%i/", $sel_minute, $timeformat);
1125 $timeformat = preg_replace(
"/%%s/",
"", $timeformat);
1127 $timeformat = preg_replace(
"/%%s/", $sel_second, $timeformat);
1150 $successfulInclude = @include_once (
'Services/Mail/classes/class.ilMail.php');
1156 require_once
'Mail/RFC822.php';
1157 $parser = &
new Mail_RFC822();
1160 $addresses = $parser->parseAddressList($a_email,
'ilias',
false,
true);
1161 if (! is_a($addresses,
'PEAR_Error') &&
1162 count($addresses) == 1 && $addresses[0]->host !=
'ilias')
1177 "AC|AD|AE|AERO|AF|AG|AI|AL|AM|AN|AO|AQ|AR|ARPA|AS|ASIA|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BIZ|BJ|BM|BN|BO|BR|BS|BT|BV|BW|BY|".
1178 "BZ|CA|CAT|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|COM|COOP|CR|CU|CV|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EDU|EE|EG|".
1179 "ER|ES|ET|EU|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GG|GH|GI|GL|GM|GN|GOV|GP|GQ|GR|GS|GT|GU|GW|GY|HK|HM|HN|HR|HT|".
1180 "HU|ID|IE|IL|IM|IN|INFO|INT|IO|IQ|IR|IS|IT|JE|JM|JO|JOBS|JP|KE|KG|KH|KI|KM|KN|KP|KR|KW|KY|KZ|LA|LB|LC|".
1181 "LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|ME|MG|MH|MIL|MK|ML|MM|MN|MO|MOBI|MP|MQ|MR|MS|MT|MU|MUSEUM|MV|MW|MX|".
1182 "MY|MZ|NA|NAME|NC|NE|NET|NF|NG|NI|NL|NO|NP|NR|NU|NZ|OM|ORG|PA|PE|PF|PG|PH|PK|PL|PM|PN|PR|PRO|PS|".
1183 "PT|PW|PY|QA|RE|RO|RS|RU|RW|SA|SB|SC|SD|SE|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SR|ST|SU|SV|SY|SZ|TC|TD|TEL|".
1184 "TF|TG|TH|TJ|TK|TL|TM|TN|TO|TP|TR|TRAVEL|TT|TV|TW|TZ|UA|UG|UK|US|UY|UZ|VA|VC|VE|VG|VI|VN|VU|".
1185 "WF|WS|XN|YE|YT|YU|ZA|ZM|ZW");
1187 return(preg_match(
"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(".$tlds.
")|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$a_email));
1201 $a_custom_error =
'';
1204 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
1211 if( $a_passwd ==
'' )
1213 $custom_error = $lng->txt(
'password_empty');
1217 if( $security->getPasswordMinLength() > 0 &&
1218 strlen($a_passwd) < $security->getPasswordMinLength() )
1220 $custom_error = sprintf( $lng->txt(
'password_to_short'), $security->getPasswordMinLength() );
1224 elseif( $security->getPasswordMaxLength() > 0 &&
1225 strlen($a_passwd) > $security->getPasswordMaxLength() )
1227 $custom_error = sprintf( $lng->txt(
'password_to_long'), $security->getPasswordMaxLength() );
1233 if( $security->isPasswordCharsAndNumbersEnabled() )
1235 $reg =
'/[A-Za-z]+/';
1236 if( !preg_match($reg,$a_passwd) )
1238 $custom_error = $lng->txt(
'password_must_chars_and_numbers');
1243 if( !preg_match($reg,$a_passwd) )
1245 $custom_error = $lng->txt(
'password_must_chars_and_numbers');
1253 if (!preg_match(
"/^[A-Za-z0-9]+/", $a_passwd))
1260 if( $security->isPasswordSpecialCharsEnabled() )
1262 #$reg = '/[_\.\+\?\#\-\*\@!\$\%\~]+/';
1263 $reg =
'/[_\.\+\?\#\-\*\@!\$\%\/\:\;\~]+/';
1265 if( !preg_match($reg,$a_passwd) )
1267 $custom_error = $lng->txt(
'password_must_special_chars');
1274 if (!preg_match(
"/^[_\.\+\?\#\-\*\@!\$\%\~]+/", $a_passwd))
1283 if (empty($a_passwd))
1287 if (strlen($a_passwd) < 6)
1294 if (!preg_match(
"/^[A-Za-z0-9_\.\+\?\#\-\*\@!\$\%\~]+$/", $a_passwd))
1313 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
1318 if( $security->isPasswordCharsAndNumbersEnabled() )
1322 else $ok .=
'A-Za-z0-9';
1323 if( $security->isPasswordSpecialCharsEnabled() )
1325 $ok .=
'_.+?#-*@!$%/:;~';
1327 else $ok .=
'_.+?#-*@!$%~';
1331 $ok .=
'A-Za-z0-9_.+?#-*@!$%~';
1334 return sprintf($lng->txt(
'password_allow_chars'),
$ok);
1345 if (empty($a_login))
1350 if (strlen($a_login) < 3)
1358 if (!ereg(
"^[A-Za-z0-9_\.\+\*\@!\$\%\~\-]+$", $a_login))
1377 public static function shortenText ($a_str, $a_len, $a_dots =
false, $a_next_blank =
false,
1378 $a_keep_extension =
false)
1380 include_once(
"./Services/Utilities/classes/class.ilStr.php");
1396 if ($a_keep_extension)
1398 $p = strrpos($a_str,
'.');
1400 if ($p ===
false || $p == 0 || strlen($a_str) - $p > $a_len)
1405 $a_str .=
"\xe2\x80\xa6";
1412 $a_str =
ilStr::subStr($a_str,0,$len - (strlen($a_str) - $p + 1)).
"\xe2\x80\xa6".substr($a_str, $p);
1416 $a_str =
ilStr::subStr($a_str,0,$len - (strlen($a_str) - $p + 1)).substr($a_str, $p);
1434 include_once(
"./Services/Utilities/classes/class.ilStr.php");
1435 $str_arr = explode(
" ", $a_str);
1437 for ($i = 0; $i < count($str_arr); $i++)
1444 $str_arr[$i].=
"...";
1449 return implode($str_arr,
" ");
1462 while (is_int(strpos($a_str,
"=")))
1464 $eq_pos = strpos($a_str,
"=");
1465 $qu1_pos = strpos($a_str,
"\"");
1466 $qu2_pos = strpos(substr($a_str, $qu1_pos + 1),
"\"") + $qu1_pos + 1;
1467 if (is_int($eq_pos) && is_int($qu1_pos) && is_int($qu2_pos))
1469 $var = trim(substr($a_str, 0, $eq_pos));
1470 $val = trim(substr($a_str, $qu1_pos + 1, ($qu2_pos - $qu1_pos) - 1));
1471 $attribs[$var] = $val;
1472 $a_str = substr($a_str, $qu2_pos + 1);
1491 function rCopy ($a_sdir, $a_tdir, $preserveTimeAttributes =
false)
1494 if (!@is_dir($a_sdir) or
1501 $dir = opendir($a_sdir);
1505 if (
$file !=
"." and
1509 if (@is_dir($a_sdir.
"/".
$file))
1511 if (!@is_dir($a_tdir.
"/".
$file))
1526 if (@is_file($a_sdir.
"/".
$file))
1528 if (!copy($a_sdir.
"/".
$file,$a_tdir.
"/".
$file))
1532 if ($preserveTimeAttributes)
1533 touch($a_tdir.
"/".
$file, filectime($a_sdir.
"/".
$file));
1551 if ($mode ==
"filesystem")
1553 return "./".ILIAS_WEB_DIR.
"/".$ilias->client_id;
1557 if (defined(
"ILIAS_MODULE"))
1559 return "../".ILIAS_WEB_DIR.
"/".$ilias->client_id;
1563 return "./".ILIAS_WEB_DIR.
"/".$ilias->client_id;
1575 return CLIENT_DATA_DIR;
1590 include_once(
"./Services/User/classes/class.ilObjUser.php");
1604 include_once(
"./Services/User/classes/class.ilObjUser.php");
1616 if (!is_dir($temp_path))
1620 $temp_name = tempnam($temp_path,
"tmp");
1626 $temp_name = str_replace(
"\\",
"/", $temp_name);
1651 function unzip($a_file, $overwrite =
false)
1653 $pathinfo = pathinfo($a_file);
1654 $dir = $pathinfo[
"dirname"];
1655 $file = $pathinfo[
"basename"];
1660 $unzip = PATH_TO_UNZIP;
1665 $unzipcmd =
"-Z -1 ".ilUtil::escapeShellArg(
$file);
1669 foreach($arr as $line)
1671 if(is_int(strpos($line,
"/")))
1673 $zdir = substr($line, 0, strrpos($line,
"/"));
1674 $nr = substr_count($zdir,
"/");
1678 $nr = substr_count($zdir,
"/");
1679 $zdirs[$zdir] = $nr;
1681 $zdir = substr($zdir, 0, strrpos($zdir,
"/"));
1688 foreach($zdirs as $zdir => $nr)
1700 $unzipcmd =
"-o ".ilUtil::escapeShellArg(
$file);
1710 function zip($a_dir, $a_file, $compress_content =
false)
1714 if($compress_content)
1717 $pathinfo = pathinfo($a_dir);
1718 chdir($pathinfo[
"dirname"]);
1721 $pathinfo = pathinfo($a_file);
1722 $dir = $pathinfo[
"dirname"];
1723 $file = $pathinfo[
"basename"];
1725 if(!$compress_content)
1738 if (is_array($a_dir))
1741 foreach($a_dir as
$dir)
1743 $name = basename($dir);
1744 $source.=
" ".ilUtil::escapeShellArg(
$name);
1749 $name = basename($a_dir);
1750 if (trim(
$name) !=
"*")
1760 $zipcmd =
"-r ".ilUtil::escapeShellArg($a_file).
" ".$source;
1770 $pathinfo = pathinfo($a_dir);
1771 chdir($pathinfo[
"dirname"]);
1773 $pathinfo = pathinfo($a_file);
1774 $dir = $pathinfo[
"dirname"];
1775 $file = $pathinfo[
"basename"];
1777 $mkisofs = PATH_TO_MKISOFS;
1784 $name = basename($a_dir);
1788 $zipcmd = $mkisofs.
" -r -J -o ".$a_file.
" ".$source;
1799 return PATH_TO_CONVERT;
1812 function convertImage($a_from, $a_to, $a_target_format =
"", $a_geometry =
"",
1813 $a_background_color =
"")
1817 $format_str = ($a_target_format !=
"")
1818 ? strtoupper($a_target_format).
":"
1820 $geometry = ($a_geometry !=
"")
1821 ?
" -geometry ".$a_geometry.
"x".$a_geometry.
" "
1823 $bg_color = ($a_background_color !=
"")
1824 ?
" -background color ".$a_background_color.
" "
1829 system($convert_cmd);
1840 function resizeImage($a_from, $a_to, $a_width, $a_height, $a_constrain_prop =
false)
1842 if ($a_constrain_prop)
1844 $size =
" -geometry ".$a_width.
"x".$a_height.
" ";
1848 $size =
" -resize ".$a_width.
"x".$a_height.
"! ";
1853 system($convert_cmd);
1859 function img($a_src, $a_alt =
"", $a_width =
"", $a_height =
"", $a_border = 0)
1861 $img =
'<img src="'.$a_src.
'"';
1864 $img.=
' alt="'.$a_alt.
'" title="'.$a_alt.
'"';
1868 $img.=
' width="'.$a_width.
'"';
1870 if ($a_height !=
"")
1872 $img.=
' height="'.$a_height.
'"';
1874 $img.=
' border="'.(int) $a_border.
'"/>';
1886 $html_file = str_replace(
".pdf",
".html",$pdf_file);
1888 $fp = fopen( $html_file ,
"wb");
1903 $htmldoc_path = PATH_TO_HTMLDOC;
1905 $htmldoc = $htmldoc_path.
" ";
1906 $htmldoc .=
"--no-toc ";
1907 $htmldoc .=
"--no-jpeg ";
1908 $htmldoc .=
"--webpage ";
1910 $htmldoc .=
"--bodyfont Arial ";
1911 $htmldoc .=
"--charset iso-8859-15 ";
1912 $htmldoc .=
"--color ";
1913 $htmldoc .=
"--size A4 ";
1914 $htmldoc .=
"--format pdf ";
1915 $htmldoc .=
"--footer ... ";
1916 $htmldoc .=
"--header ... ";
1917 $htmldoc .=
"--left 60 ";
1919 $htmldoc .= $html_file;
1927 public static function deliverData($a_data, $a_filename, $mime =
"application/octet-stream", $charset =
"")
1929 $disposition =
"attachment";
1932 include_once
'./classes/class.ilHTTPS.php';
1942 #header("Pragma: ");
1943 #header("Cache-Control: ");
1944 #header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
1945 #header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
1946 #header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
1947 #header("Cache-Control: post-check=0, pre-check=0", false);
1949 else if ($disposition ==
"attachment")
1951 header(
"Cache-control: private");
1955 header(
"Cache-Control: no-cache, must-revalidate");
1956 header(
"Pragma: no-cache");
1961 if (strlen($charset))
1963 $charset =
"; charset=$charset";
1965 header(
"Content-Type: $mime$charset");
1966 header(
"Content-Disposition:$disposition; filename=\"".$ascii_filename.
"\"");
1967 header(
"Content-Description: ".$ascii_filename);
1968 header(
"Content-Length: ".(
string)(strlen($a_data)));
1973 header(
'Cache-Control: must-revalidate, post-check=0, pre-check=0');
1974 header(
'Pragma: public');
1977 header(
"Connection: close");
1988 function deliverFile($a_file, $a_filename,$a_mime =
'', $isInline =
false, $removeAfterDelivery =
false)
1991 $disposition =
"inline";
1993 $disposition =
"attachment";
2004 $mime =
"application/octet-stream";
2008 if ($disposition ==
"attachment")
2010 header(
"Cache-control: private");
2014 header(
"Cache-Control: no-cache, must-revalidate");
2015 header(
"Pragma: no-cache");
2020 header(
"Content-Type: $mime");
2021 header(
"Content-Disposition:$disposition; filename=\"".$ascii_filename.
"\"");
2022 header(
"Content-Description: ".$ascii_filename);
2023 header(
"Content-Length: ".(
string)(filesize($a_file)));
2025 include_once
'./classes/class.ilHTTPS.php';
2029 header(
'Cache-Control: must-revalidate, post-check=0, pre-check=0');
2030 header(
'Pragma: public');
2033 header(
"Connection: close");
2035 if ($removeAfterDelivery)
2051 $chunksize = 1*(1024*1024);
2053 $handle = fopen($a_file,
'rb');
2054 if ($handle ===
false)
2058 while (!feof($handle))
2060 $buffer = fread($handle, $chunksize);
2063 return fclose($handle);
2091 $user_agent = strtolower($_SERVER[
"HTTP_USER_AGENT"]);
2092 if ((is_integer(strpos($user_agent,
"msie"))) && is_integer(strpos($user_agent,
"win")))
2097 $ascii_filename = utf8_decode($a_filename);
2104 $ascii_filename = htmlentities($a_filename,ENT_NOQUOTES,
'UTF-8');
2105 $ascii_filename = preg_replace(
'/\&(.)[^;]*;/',
'\\1', $ascii_filename);
2106 $ascii_filename = preg_replace(
'/[\x7f-\xff]/',
'_', $ascii_filename);
2113 $ascii_filename = preg_replace(
'/[:\x5c\/\*\?\"<>\|]/',
'_', $ascii_filename);
2116 return $ascii_filename;
2125 $sep =
'###HTMLTAG###';
2127 preg_match_all(
"@<[^>]*>@", $htmlText, $matches);
2128 $tmp = preg_replace(
"@(<[^>]*>)@", $sep, $htmlText);
2129 $tmp = explode($sep, $tmp);
2131 for ($i=0; $i<count($tmp); $i++)
2132 $tmp[$i] = htmlentities($tmp[$i], ENT_COMPAT,
"UTF-8");
2134 $tmp = join($sep, $tmp);
2136 for ($i=0; $i<count($matches[0]); $i++)
2137 $tmp = preg_replace(
"@$sep@", $matches[0][$i], $tmp, 1);
2147 return PATH_TO_JAVA;
2159 $url = (is_int(strpos($a_url,
"?")))
2161 : $a_url.
"?".$a_par;
2182 $a_dir = trim($a_dir);
2185 if (substr($a_dir,-1) ==
"/")
2187 $a_dir = substr($a_dir,0,-1);
2191 if (!($path = substr($a_dir,0, strrpos($a_dir,
"/") - strlen($a_dir))))
2198 return @mkdir($a_dir,fileperms($path));
2216 $dirs = array($a_dir);
2217 $a_dir = dirname($a_dir);
2219 while($last_dirname != $a_dir)
2221 array_unshift(
$dirs, $a_dir);
2222 $last_dirname = $a_dir;
2223 $a_dir = dirname($a_dir);
2227 $reverse_paths = array_reverse(
$dirs, TRUE);
2229 foreach ($reverse_paths as
$key => $value)
2231 if ($found_index == -1)
2235 $found_index =
$key;
2244 if ($dirindex >= $found_index)
2246 if (! file_exists(
$dir))
2248 if (strcmp(substr(
$dir,strlen(
$dir)-1,1),
"/") == 0)
2254 if (! mkdir(
$dir, $umask))
2256 error_log(
"Can't make directory: $dir");
2262 error_log(
"$dir is not a directory");
2268 $umask = fileperms(
$dir);
2282 function delDir($a_dir, $a_clean_only =
false)
2284 if (!is_dir($a_dir) || is_int(strpos($a_dir,
"..")))
2289 $current_dir = opendir($a_dir);
2298 while($entryname = readdir($current_dir))
2305 if(is_dir($a_dir.
"/".$file) and ($file !=
"." and $file!=
".."))
2309 elseif ($file !=
"." and $file !=
"..")
2311 unlink(${a_dir}.
"/".${file});
2315 closedir($current_dir);
2328 $current_dir = opendir($a_dir);
2332 while($entry = readdir($current_dir))
2334 if(is_dir($a_dir.
"/".$entry))
2336 $dirs[$entry] = array(
"type" =>
"dir",
"entry" => $entry);
2340 if ($entry !=
"." && $entry !=
"..")
2342 $size = filesize($a_dir.
"/".$entry);
2343 $files[$entry] = array(
"type" =>
"file",
"entry" => $entry,
2359 if (is_array($a_arr))
2361 foreach ($a_arr as $k => $v)
2375 if (is_array($a_data))
2377 foreach ($a_data as $k => $v)
2402 public static function stripSlashes($a_str, $a_strip_html =
true, $a_allow =
"")
2404 if (ini_get(
"magic_quotes_gpc"))
2406 $a_str = stripslashes($a_str);
2419 if (ini_get(
"magic_quotes_gpc"))
2421 $a_str = stripslashes($a_str);
2433 $only_secure =
true;
2434 $allow_tags = explode(
">", $a_allow);
2436 $allow_array = array();
2437 foreach($allow_tags as $allow)
2441 $allow = str_replace(
"<",
"", $allow);
2443 if (!in_array($allow, $sec_tags))
2445 $only_secure =
false;
2447 $allow_array[] = $allow;
2452 if (($only_secure || $a_allow ==
"") && $a_strip_html)
2456 $allow_array = array (
"b",
"i",
"strong",
"em",
"code",
"cite",
2457 "gap",
"sub",
"sup",
"pre",
"strike");
2463 $a_str = strip_tags($a_str);
2488 return array(
"strong",
"em",
"u",
"strike",
"ol",
"li",
"ul",
"p",
"div",
2489 "i",
"b",
"code",
"sup",
"sub",
"pre",
"gap",
"a",
"img");
2494 foreach ($allow_array as
$t)
2509 array(
"param" =>
"align",
"value" =>
"left"),
2510 array(
"param" =>
"align",
"value" =>
"center"),
2511 array(
"param" =>
"align",
"value" =>
"justify"),
2512 array(
"param" =>
"align",
"value" =>
"right")
2527 foreach ($allow_array as
$t)
2542 array(
"param" =>
"align",
"value" =>
"left"),
2543 array(
"param" =>
"align",
"value" =>
"center"),
2544 array(
"param" =>
"align",
"value" =>
"justify"),
2545 array(
"param" =>
"align",
"value" =>
"right")
2564 if (ini_get(
"magic_quotes_gpc"))
2566 return stripslashes($a_str);
2591 if ($a_make_links_clickable)
2609 $numberOfMatches = preg_match_all(
'/(?:(?:http|https|ftp|ftps|mailto):|www\.)(?:[a-zA-Z0-9]|[;\/?:|&=+$,]|[\\-_.!~*\'()]|%[0-9a-fA-F]{2}|#|[;?:@&=+$,])+/',$a_str, $matches, PREG_OFFSET_CAPTURE);
2612 foreach ($matches as $match)
2615 foreach ($matches[0] as $match)
2617 $matched_text = $match[0];
2619 if ($matched_offset != previous_offset)
2622 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1, $pos2 - $pos1)));
2628 $pos1 = $pos2 + strlen($matched_text);
2630 if ($pos1 < strlen($a_str))
2632 $encoded .= nl2br(htmlspecialchars(substr($a_str, $pos1)));
2637 $encoded = nl2br(htmlspecialchars($a_str));
2647 $ws =
"[ \t\r\f\v\n]*";
2648 $att = $ws.
"[^>]*".$ws;
2650 while (eregi(
"<($tag$att($tag_att$ws=$ws\"(([\$@!*()~;,_0-9A-z/:=%\\.&#?+\\-])*)\")$att)>",
2653 $un = array(
".",
"-",
"+",
"?",
'$',
"*",
"(",
")");
2659 $ff = str_replace($un, $esc, $found[1]);
2662 $a_str = eregi_replace(
"<".$ff.
">",
2663 "<$tag $tag_att$tag_att=\"".$found[3].
"\">", $a_str);
2664 if ($old_str == $a_str)
2666 $ilLog->write(
"ilUtil::maskA-".htmlentities($old_str).
" == ".
2667 htmlentities($a_str));
2671 $a_str = str_ireplace(
"</$tag>",
2672 "</$tag>", $a_str);
2680 while (eregi(
"<($tag $tag_att$tag_att=\"(([\$@!*()~;,_0-9A-z/:=%\\.&#?+\\-])*)\")>",
2683 $un = array(
".",
"-",
"+",
"?",
'$',
"*",
"(",
")");
2689 $ff = str_replace($un, $esc, $found[1]);
2692 $a_str = eregi_replace(
"<".$ff.
">",
2693 "<$tag $tag_att=\"".ilUtil::secureLink($found[2]).
"\">", $a_str);
2694 if ($old_str == $a_str)
2696 $ilLog->write(
"ilUtil::unmaskA-".htmlentities($old_str).
" == ".
2697 htmlentities($a_str));
2701 $a_str = str_replace(
"</$tag>",
"</$tag>", $a_str);
2707 $a_str = str_replace(array(
"<$t>",
"<".strtoupper(
$t).
">"),
2708 "<".
$t.
">", $a_str);
2709 $a_str = str_replace(array(
"</$t>",
"</".strtoupper(
$t).
">"),
2710 "</".
$t.
">", $a_str);
2712 if (is_array($fix_param))
2714 foreach ($fix_param as $p)
2718 $a_str = str_replace(
"<$t $k=\"$v\">",
2719 "<".
"$t $k=\"$v\"".
">", $a_str);
2728 $a_str = str_replace(
"<".
$t.
">",
"<".$t.
">", $a_str);
2729 $a_str = str_replace(
"</".
$t.
">",
"</".$t.
">", $a_str);
2731 if (is_array($fix_param))
2733 foreach ($fix_param as $p)
2737 $a_str = str_replace(
"<$t $k=\"$v\">",
2738 "<".
"$t $k=\"$v\"".
">", $a_str);
2746 $a_str = str_ireplace(
"javascript",
"jvscrpt", $a_str);
2747 $a_str = str_ireplace(array(
"%00",
"%0a",
"%0d",
"%1a",
"�",
"�",
2748 "�",
"�",
"
",
"
",
" ",
" "),
"-", $a_str);
2767 $negativestr =
"a,abbr,acronym,address,applet,area,b,base,basefont,".
2768 "bdo,big,blockquote,body,br,button,caption,center,cite,code,col,".
2769 "colgroup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,form,frame,".
2770 "frameset,h1,h2,h3,h4,h5,h6,head,hr,html,i,iframe,img,input,ins,isindex,kbd,".
2771 "label,legend,li,link,map,menu,meta,noframes,noscript,object,ol,".
2772 "optgroup,option,p,param,q,s,samp,script,select,small,span,".
2773 "strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,".
2774 "title,tr,tt,u,ul,var";
2775 $a_allow = strtolower ($a_allow);
2776 $negatives = split (
",",$negativestr);
2777 $outer_old_str =
"";
2778 while($outer_old_str != $a_str)
2780 $outer_old_str = $a_str;
2781 foreach ($negatives as $item)
2783 $pos = strpos($a_allow,
"<$item>");
2789 while($old_str != $a_str)
2792 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s*>/i",
"", $a_str);
2793 $a_str = preg_replace(
"/<\/?\s*$item(\/?)\s+([^>]*)>/i",
"", $a_str);
2802 $a_str = preg_replace(
"/<\s*\w*(\/?)(\s+[^>]*)?(\s+on[^>]*)>/i",
"", $a_str);
2805 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*javascript[^>]*>/i",
"", $a_str);
2809 $a_str = preg_replace(
"/<\s*\w*(\/?)\s+[^>]*expression[^>]*>/i",
"", $a_str);
2823 if (ini_get(
"magic_quotes_gpc"))
2829 return addslashes($a_str);
2848 $a_str = htmlspecialchars($a_str);
2852 $a_str = str_replace(
"{",
"{", $a_str);
2853 $a_str = str_replace(
"}",
"}", $a_str);
2870 return addslashes($a_str);
2898 while(($spos=strpos($a_parstr,
"=")) &&
$ok)
2901 $cpar = substr($a_parstr,0,$spos);
2902 $a_parstr = substr($a_parstr,$spos,strlen($a_parstr)-$spos);
2903 while(substr($cpar,0,1)==
"," ||substr($cpar,0,1)==
" " || substr($cpar,0,1)==chr(13) || substr($cpar,0,1)==chr(10))
2904 $cpar = substr($cpar,1,strlen($cpar)-1);
2905 while(substr($cpar,strlen($cpar)-1,1)==
" " || substr($cpar,strlen($cpar)-1,1)==chr(13) || substr($cpar,strlen($cpar)-1,1)==chr(10))
2906 $cpar = substr($cpar,0,strlen($cpar)-1);
2910 while($cpar != $cpar_old)
2913 $cpar = eregi_replace(
"[^a-zA-Z0-9_]",
"", $cpar);
2919 if($spos=strpos($a_parstr,
"\""))
2921 $a_parstr = substr($a_parstr,$spos+1,strlen($a_parstr)-$spos);
2922 $spos=strpos($a_parstr,
"\"");
2925 $cval = substr($a_parstr,0,$spos);
2927 $a_parstr = substr($a_parstr,$spos+1,strlen($a_parstr)-$spos-1);
2937 if(
$ok)
return $par;
else return false;
2942 if (is_array($a_par_arr))
2945 foreach ($a_par_arr as $par => $val)
2961 for($i=0; $i<strlen($a_str); $i++)
2963 $ret.= ord(substr($a_str,$i,1)).
" ";
2974 if(strtolower($a_yn) ==
"y")
3009 global $array_sortby,$array_sortorder;
3013 if ($array_sortorder ==
"asc")
3018 if ($array_sortorder ==
"desc")
3020 return !
ilStr::strCmp($a[$array_sortby], $b[$array_sortby]);
3035 global $array_sortby,$array_sortorder;
3037 if ($array_sortorder ==
"asc")
3039 return $a[
"$array_sortby"] > $b[
"$array_sortby"];
3042 if ($array_sortorder ==
"desc")
3044 return $a[
"$array_sortby"] < $b[
"$array_sortby"];
3057 public static function sortArray($array,$a_array_sortby,$a_array_sortorder = 0,$a_numeric =
false,
3058 $a_keep_keys =
false)
3060 include_once(
"./Services/Utilities/classes/class.ilStr.php");
3063 if (! $a_keep_keys) {
3068 global $array_sortby,$array_sortorder;
3070 $array_sortby = $a_array_sortby;
3072 if ($a_array_sortorder ==
"desc")
3074 $array_sortorder =
"desc";
3078 $array_sortorder =
"asc";
3084 uasort($array, array(
"ilUtil",
"sort_func_numeric"));
3088 usort($array, array(
"ilUtil",
"sort_func_numeric"));
3095 uasort($array, array(
"ilUtil",
"sort_func"));
3099 usort($array, array(
"ilUtil",
"sort_func"));
3119 function stableSortArray($array,$a_array_sortby,$a_array_sortorder = 0,$a_numeric =
false)
3121 global $array_sortby,$array_sortorder;
3123 $array_sortby = $a_array_sortby;
3125 if ($a_array_sortorder ==
"desc")
3127 $array_sortorder =
"desc";
3131 $array_sortorder =
"asc";
3135 $sort_array = array_values($array);
3150 if (count($array) < 2)
return;
3153 $halfway = count($array) / 2;
3154 $array1 = array_slice($array, 0, $halfway);
3155 $array2 = array_slice($array, $halfway);
3162 if (call_user_func($cmp_function, end($array1), $array2[0]) < 1) {
3163 $array = array_merge($array1, $array2);
3170 while ($ptr1 < count($array1) && $ptr2 < count($array2)) {
3171 if (call_user_func($cmp_function, $array1[$ptr1], $array2[$ptr2]) < 1) {
3172 $array[] = $array1[$ptr1++];
3175 $array[] = $array2[$ptr2++];
3180 while ($ptr1 < count($array1)) $array[] = $array1[$ptr1++];
3181 while ($ptr2 < count($array2)) $array[] = $array2[$ptr2++];
3199 $existing_sub_key_values = array();
3201 foreach ($array as
$key=>$sub_array)
3203 if (!in_array($sub_array[$sub_key], $existing_sub_key_values))
3205 $existing_sub_key_values[] = $sub_array[$sub_key];
3206 $target[
$key] = $sub_array;
3223 $a_desired_type = strtolower($a_desired_type);
3225 $im_types = ImageTypes();
3227 switch($a_desired_type)
3230 if ($im_types & IMG_JPG)
return "jpg";
3231 if ($im_types & IMG_GIF)
return "gif";
3232 if ($im_types & IMG_PNG)
return "png";
3236 if ($im_types & IMG_GIF)
return "gif";
3237 if ($im_types & IMG_JPG)
return "jpg";
3238 if ($im_types & IMG_PNG)
return "png";
3242 if ($im_types & IMG_PNG)
return "png";
3243 if ($im_types & IMG_JPG)
return "jpg";
3244 if ($im_types & IMG_GIF)
return "gif";
3260 if (($a_mime ==
"image/gif") || ($a_mime ==
"image/jpeg") ||
3261 ($a_mime ==
"image/png") || ($a_mime ==
"application/x-shockwave-flash") ||
3262 ($a_mime ==
"image/tiff") || ($a_mime ==
"image/x-ms-bmp") ||
3263 ($a_mime ==
"image/psd") || ($a_mime ==
"image/iff"))
3281 global
$log, $PHP_SELF;
3285 header(
"Location: ".$a_script);
3296 if (substr($a_value, 0, 4) ==
"il__")
3298 $a_value =
"il_".IL_INST_ID.
"_".substr($a_value, 4, strlen($a_value) - 4);
3316 if (empty($a_group_name))
3318 $message = get_class($this).
"::_NameExists(): No groupname given!";
3319 $ilErr->raiseError($message,$ilErr->WARNING);
3322 $clause = ($a_id) ?
" AND obj_id != ".$ilDB->quote($a_id).
" " :
"";
3324 $q =
"SELECT obj_id FROM object_data ".
3325 "WHERE title = ".$ilDB->quote($a_group_name,
"text").
" ".
3326 "AND type = ".$ilDB->quote(
"grp",
"text").
3329 $r = $ilDB->query(
$q);
3352 "FROM object_data ,object_reference ".
3353 "WHERE (".$ilDB->like(
"object_data.title",
"text",
"%".$a_search_str.
"%").
" ".
3354 "OR ".$ilDB->like(
"object_data.description",
"text",
"%".$a_search_str.
"%").
") ".
3355 "AND object_data.type = 'grp' ".
3356 "AND object_data.obj_id = object_reference.obj_id ".
3365 $ids[
$row->obj_id] = array(
3366 "ref_id" =>
$row->ref_id,
3367 "title" =>
$row->title,
3368 "description" =>
$row->description);
3371 return $ids ? $ids : array();
3379 $my_pid = getmypid();
3380 return (
"MEMORY USAGE (% KB PID ): ".`ps -eo%mem,rss,pid | grep $my_pid`);
3388 if (strtolower(substr(php_uname(), 0, 3)) ==
"win")
3398 setlocale(LC_CTYPE,
"UTF8",
"en_US.UTF-8");
3400 return escapeshellarg($a_arg);
3412 if(ini_get(
'safe_mode') == 1)
3416 setlocale(LC_CTYPE,
"UTF8",
"en_US.UTF-8");
3417 return escapeshellcmd($a_arg);
3432 $cmd =
'"'.$cmd.
'"';
3437 if (version_compare(phpversion(),
"5.2",
"<") && strpos($args,
'"') !==
false)
3439 $cmd =
'"'.$cmd.
" ".$args.
'"';
3477 function excelTime($year =
"", $month =
"", $day =
"", $hour =
"", $minute =
"", $second =
"")
3479 $starting_time = mktime(0, 0, 0, 1, 2, 1970);
3480 if (strcmp(
"$year$month$day$hour$minute$second",
"") == 0)
3482 $target_time = time();
3491 $target_time = mktime($hour, $minute, $second, $month, $day, $year);
3492 $difference = $target_time - $starting_time;
3493 $days = (($difference - ($difference % 86400)) / 86400);
3494 $difference = $difference - ($days * 86400) + 3600;
3495 return ($days + 25570 + ($difference / 86400));
3503 $def_arr = explode(
",", SUFFIX_REPL_DEFAULT);
3504 foreach ($def_arr as $def)
3509 $def_arr = explode(
",", SUFFIX_REPL_ADDITIONAL);
3510 foreach ($def_arr as $def)
3528 if ($a_dir ==
"/" || $a_dir ==
"" || is_int(strpos($a_dir,
".."))
3529 || trim($a_old_suffix) ==
"")
3535 if (!@is_dir($a_dir))
3541 $dir = opendir($a_dir);
3545 if (
$file !=
"." and
3549 if (@is_dir($a_dir.
"/".
$file))
3555 if (@is_file($a_dir.
"/".
$file))
3558 if(strrpos(
$file,
'.') == (strlen(
$file) - 1))
3560 rename($a_dir.
'/'.
$file,substr($a_dir.
'/'.
$file,0,-1));
3564 $path_info = pathinfo($a_dir.
"/".
$file);
3566 if (strtolower($path_info[
"extension"]) ==
3567 strtolower($a_old_suffix))
3569 $pos = strrpos($a_dir.
"/".
$file,
".");
3570 $new_name = substr($a_dir.
"/".
$file, 0, $pos).
".".$a_new_suffix;
3571 rename($a_dir.
"/".
$file, $new_name);
3580 return strpos($_SERVER[
"SCRIPT_FILENAME"],
"api") !==
false ||
3581 strpos($_SERVER[
"SCRIPT_FILENAME"],
"dummy") !==
false;
3585 if (preg_match(
"/&" . $paramName .
"=/", $qstring)) {
3586 return preg_replace(
"/&" . $paramName .
"=[^&]+/",
"&" . $paramName .
"=" . urlencode($paramValue), $qstring);
3588 return $qstring .
"&" . $paramName .
"=" . urlencode($paramValue);
3594 foreach ($parametersArray as $paramName => $paramValue ) {
3606 srand((
double) microtime()*1000000);
3608 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
3611 for ($i=1; $i<=$a_number; $i++)
3613 $min = ($security->getPasswordMinLength() > 0)
3614 ? $security->getPasswordMinLength()
3616 $max = ($security->getPasswordMaxLength() > 0)
3617 ? $security->getPasswordMaxLength()
3623 $length = rand($min,$max);
3626 $consonants =
"bcdfghjklmnpqrstvwxyz";
3627 $numbers =
"1234567890";
3628 $special =
"_.+?#-*@!$%~";
3632 if ($security->isPasswordCharsAndNumbersEnabled())
3634 $num_pos = rand(0, $length - 1);
3638 if ($security->isPasswordSpecialCharsEnabled())
3640 $spec_pos = rand(0, $length - 1);
3641 if ($security->isPasswordCharsAndNumbersEnabled())
3643 if ($num_pos == $spec_pos)
3656 for ($j=0; $j < $length; $j++)
3658 if ($security->isPasswordCharsAndNumbersEnabled() && $num_pos == $j)
3660 $pw.= $numbers[rand(0,strlen($numbers)-1)];
3662 else if ($security->isPasswordSpecialCharsEnabled() && $spec_pos == $j)
3664 $pw.= $special[rand(0,strlen($special)-1)];
3671 $pw.= $consonants[rand(0,strlen($consonants)-1)];
3676 $pw.= $vowels[rand(0,strlen($vowels)-1)];
3690 $path = preg_replace(
"/[\/\\\]+$/",
"", $path);
3709 foreach(
$data as $k=>$datum)
3711 if(is_null($datum))
$data[$k] =
'null';
3712 if(is_string($datum))
$data[$k] =
"'" . $datum .
"'";
3716 return "[" . implode(
', ',
$data) .
"]";
3727 if (IL_VIRUS_SCANNER !=
"None")
3729 require_once(
"classes/class.ilVirusScannerFactory.php");
3731 if (($vs_txt = $vs->scanFile($a_file, $a_orig_name)) !=
"")
3733 if ($a_clean && (IL_VIRUS_CLEAN_COMMAND !=
""))
3735 $clean_txt = $vs->cleanFile($a_file, $a_orig_name);
3736 if ($vs->fileCleaned())
3738 $vs_txt.=
"<br />".$lng->txt(
"cleaned_file").
3739 "<br />".$clean_txt;
3740 $vs_txt.=
"<br />".$lng->txt(
"repeat_scan");
3741 if (($vs2_txt = $vs->scanFile($a_file, $a_orig_name)) !=
"")
3743 return array(
false, nl2br($vs_txt).
"<br />".$lng->txt(
"repeat_scan_failed").
3744 "<br />".nl2br($vs2_txt));
3748 return array(
true, nl2br($vs_txt).
"<br />".$lng->txt(
"repeat_scan_succeded"));
3753 return array(
false, nl2br($vs_txt).
"<br />".$lng->txt(
"cleaning_failed"));
3758 return array(
false, nl2br($vs_txt));
3763 return array(
true,
"");
3772 global
$lng, $ilias;
3775 if (!is_file($a_file))
3777 if ($a_raise_errors)
3779 $ilias->raiseError($lng->txt(
"upload_error_file_not_found"), $ilias->error_obj->MESSAGE);
3793 if ($a_raise_errors)
3795 $ilias->raiseError($lng->txt(
"file_is_infected").
"<br />".
3797 $ilias->error_obj->MESSAGE);
3812 return move_uploaded_file($a_file, $a_target);
3821 list($datum, $uhrzeit) = explode (
" ",$mysql_date_time);
3822 list($jahr, $monat, $tag) = explode(
"-", $datum);
3823 list($std, $min, $sec) = explode(
":", $uhrzeit);
3824 return mktime ((
int) $std, (
int) $min, (
int) $sec, (
int) $monat, (
int) $tag, (
int) $jahr);
3832 return date(
"Y-m-d H:i:s");
3850 $resultarray = array();
3851 foreach (
$row as $rowindex => $entry)
3858 if (strpos($entry,
"\"") !== FALSE)
3860 $entry = str_replace(
"\"",
"\"\"", $entry);
3867 if ($compatibleWithMSExcel)
3870 $entry = str_replace(chr(13).chr(10), chr(10), $entry);
3876 $resultarray[$rowindex] =
"\"" . $entry .
"\"";
3880 $resultarray[$rowindex] = utf8_decode(
"\"" . $entry .
"\"");
3887 $resultarray[$rowindex] = $entry;
3891 $resultarray[$rowindex] = utf8_decode($entry);
3895 return $resultarray;
3901 return(preg_match(
"/^[a-z]+([a-z0-9-]*[a-z0-9]+)?(\.([a-z]+([a-z0-9-]*[a-z0-9]+)?)+)*$/",$a_str));
3907 return(preg_match(
"/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.".
3908 "(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/",$a_str));
3940 global
$ilDB,$rbacreview,$ilAccess,$ilUser,$ilias,$tree;
3942 if(!is_array($a_obj_type))
3944 $where =
"WHERE type = ".$ilDB->quote($a_obj_type,
"text").
" ";
3948 $where =
"WHERE ".$ilDB->in(
"type", $a_obj_type,
false,
"text").
" ";
3954 $limit = $ilias->getSetting(
'search_max_hits',100);
3962 $a_usr_id = $a_usr_id ? $a_usr_id : $ilUser->getId();
3963 $a_roles = $rbacreview->assignedRoles($a_usr_id);
3967 if($rbacreview->isAssigned($a_usr_id,SYSTEM_ROLE_ID))
3969 $query =
"SELECT ref_id FROM object_reference obr LEFT JOIN object_data obd ON obr.obj_id = obd.obj_id ".
3970 "LEFT JOIN tree ON obr.ref_id = tree.child ".
3976 while(
$row = $ilDB->fetchObject(
$res))
3979 if($tree->isGrandChild(RECOVERY_FOLDER_ID,
$row->ref_id))
3984 if($counter++ >= $limit)
3989 $ref_ids[] =
$row->ref_id;
3991 return $ref_ids ? $ref_ids : array();
3995 if($a_operation ==
'edit_permissions' or strpos($a_operation,
'create') !==
false)
3997 $check_owner =
") ";
4001 $check_owner =
"OR owner = ".$ilDB->quote($a_usr_id,
"integer").
") ";
4005 $ops_id = $ops_ids[0];
4007 $and =
"AND ((".$ilDB->in(
"rol_id", $a_roles,
false,
"integer").
" ";
4009 $query =
"SELECT DISTINCT(obr.ref_id),obr.obj_id,type FROM object_reference obr ".
4010 "JOIN object_data obd ON obd.obj_id = obr.obj_id ".
4011 "JOIN rbac_pa ON obr.ref_id = rbac_pa.ref_id ".
4014 "AND (".$ilDB->like(
"ops_id",
"text",
"%i:".$ops_id.
"%").
" ".
4015 "OR ".$ilDB->like(
"ops_id",
"text",
"%:\"".$ops_id.
"\";%").
")) ".
4022 if($counter >= $limit)
4028 if($tree->isGrandChild(RECOVERY_FOLDER_ID,
$row->ref_id))
4034 if($ilAccess->checkAccessOfUser($a_usr_id,$a_operation,
'',
$row->ref_id,
$row->type,
$row->obj_id))
4037 $ref_ids[] =
$row->ref_id;
4040 return $ref_ids ? $ref_ids : array();
4049 function insertLatexImages($a_text, $a_start =
"\[tex\]", $a_end =
"\[\/tex\]", $a_cgi = URL_TO_LATEX)
4054 include_once
"./Services/Administration/classes/class.ilSetting.php";
4055 $jsMathSetting =
new ilSetting(
"jsMath");
4057 $jsMathSetting->get(
"enable") && ($ilUser->getPref(
"js_math") || ($ilUser->getPref(
"js_math") === FALSE && ($jsMathSetting->get(
"makedefault"))));
4062 if (!$tpl->out_jsmath_info)
4064 include_once
"./classes/class.ilTemplate.php";
4065 $template =
new ilTemplate(
"tpl.jsmath_warning.html", TRUE, TRUE);
4066 $lng->loadLanguageModule(
"jsmath");
4067 $template->setVariable(
"TEXT_JSMATH_NO_JAVASCRIPT", $lng->txt(
"jsmath_no_javascript"));
4068 $info = $template->get();
4069 $tpl->out_jsmath_info = TRUE;
4071 $a_text = preg_replace(
"/\\\\([RZN])([^a-zA-Z]|<\/span>)/",
"\\mathbb{".
"$1".
"}".
"$2", $a_text);
4072 $tpl->addJavaScript($jsMathSetting->get(
"path_to_jsmath") .
"/easy/load.js");
4077 $o_start = $a_start;
4079 $a_start = str_replace(
"\\",
"", $a_start);
4080 $a_end = str_replace(
"\\",
"", $a_end);
4087 while (is_int($spos = stripos($a_text, $a_start, $cpos)))
4089 if (is_int ($epos = stripos($a_text, $a_end, $spos + 1)))
4091 $tex = substr($a_text, $spos + strlen($a_start), $epos - $spos - strlen($a_start));
4094 if (!is_int(strpos($tex,
"</div>")))
4098 $a_text = substr($a_text, 0, $spos).
4099 "<img alt=\"".htmlentities($tex).
"\" src=\"".$a_cgi.
"?".
4100 rawurlencode(str_replace(
'&',
'&', str_replace(
'>',
'>', str_replace(
'<',
'<', $tex)))).
"\" ".
4102 substr($a_text, $epos + strlen($a_end));
4106 $tex = $a_start.$tex.$a_end;
4109 preg_replace(
'/' . $o_start .
'(.*?)' . $o_end .
'/ie',
4110 "'<span class=\"math\">' . preg_replace('/[\\\\\\\\\\]{2}/', '\\cr', str_replace('<', '<', str_replace('<br/>', '', str_replace('<br />', '', str_replace('<br>', '', '$1'))))) . '</span>[[info]]'", $tex);
4113 $a_text = substr($a_text, 0, $spos).
4115 substr($a_text, $epos + strlen($a_end));
4124 $a_text = str_replace(
"[[info]]", $info, $a_text);
4127 $result_text = $a_text;
4135 return $result_text;
4152 include_once
"./Services/Administration/classes/class.ilSetting.php";
4153 $jsMathSetting =
new ilSetting(
"jsMath");
4154 if ($jsMathSetting->get(
"enable") && ($ilUser->getPref(
"js_math") || ($ilUser->getPref(
"js_math") === FALSE && ($jsMathSetting->get(
"makedefault")))))
4157 if (!$tpl->out_jsmath_info)
4159 include_once
"./classes/class.ilTemplate.php";
4160 $template =
new ilTemplate(
"tpl.jsmath_warning.html", TRUE, TRUE);
4161 $lng->loadLanguageModule(
"jsmath");
4162 $template->setVariable(
"TEXT_JSMATH_NO_JAVASCRIPT", $lng->txt(
"jsmath_no_javascript"));
4163 $info = $template->get();
4164 $tpl->out_jsmath_info = TRUE;
4166 $a_text = preg_replace(
"/\\\\([RZN])([^a-zA-Z]|<\/span>)/",
"\\mathbb{".
"$1".
"}".
"$2", $a_text);
4167 $result_text = preg_replace(
'/' . $a_start .
'(.*?)' . $a_end .
'/ie',
4168 "'<span class=\"math\">' . preg_replace('/[\\\\\\\\\\]{2}/', '\\cr', str_replace('<', '<', str_replace('<br/>', '', str_replace('<br />', '', str_replace('<br>', '', '$1'))))) . '</span>[[info]]'", $a_text);
4170 $result_text = str_replace(
"[[info]]", $info, $result_text);
4171 $tpl->addJavaScript($jsMathSetting->get(
"path_to_jsmath") .
"/easy/load.js");
4175 $result_text = preg_replace(
'/' . $a_start .
'(.*?)' . $a_end .
'/ie',
4176 "'<img alt=\"'.htmlentities('$1').'\" src=\"$a_cgi?'.rawurlencode(str_replace('&', '&', str_replace('>', '>', str_replace('<', '<', '$1')))).'\" ".
4180 return $result_text;
4189 function buildLatexImages($a_text, $a_dir ,$a_start =
"\[tex\]", $a_end =
"\[\/tex\]", $a_cgi = URL_TO_LATEX)
4191 $result_text = $a_text;
4195 while (preg_match(
'/' . $a_start .
'(.*?)' . $a_end .
'/ie', $result_text, $found))
4197 $cnt = (int)
$GLOBALS[
"teximgcnt"]++;
4199 $fpr = @fopen($a_cgi.
"?".rawurlencode($found[1]),
"r");
4205 $buf = fread($fpr, 1024);
4208 if (is_int(strpos(strtoupper(substr($buf, 0, 5)),
"GIF")))
4216 $fpw = fopen($a_dir.
"/teximg/img".$cnt.
".".$suffix,
"w");
4226 $img_str =
"./teximg/img".$cnt.
".".$suffix;
4227 $result_text = str_replace($found[0],
4228 '<img alt="'.$found[1].
'" src="'.$img_str.
'" />', $result_text);
4232 return $result_text;
4245 $is_html = $this->isHTML(
$result);
4246 if ($prepare_for_latex_output)
4261 if (preg_match_all(
"/(<pre>.*?<\/pre>)/ims",
$result, $matches))
4263 foreach ($matches[0] as $found)
4266 if (strpos(
"\n", $found) === FALSE)
4268 $replacement =
"\n";
4270 $removed = preg_replace(
"/<br\s*?\/>/ims", $replacement, $found);
4275 if ($prepare_for_latex_output)
4296 if (!is_array($periods))
4299 'years' => 31536000,
4300 'months' => 2592000,
4309 $seconds = (float) $seconds;
4310 foreach ($periods as $period => $value)
4312 $count = floor($seconds / $value);
4319 $values[$period] = $count;
4320 $seconds = $seconds % $value;
4341 if (!is_array($duration))
4346 foreach ($duration as
$key => $value) {
4351 $segment_name =
$key;
4352 $segment_name = $lng->txt($segment_name);
4353 $segment = $value .
' ' . $segment_name;
4357 $segment_name = substr(
$key, 0, -1);
4358 $segment_name = $lng->txt($segment_name);
4359 $segment = $value .
' ' . $segment_name;
4362 $array[] = $segment;
4364 $len = count($array);
4368 $array=array_slice($array,0,(3-$len));
4371 $str = implode(
', ', $array);
4381 $umf=get_cfg_var(
"upload_max_filesize");
4383 $pms=get_cfg_var(
"post_max_size");
4386 $max_filesize=min($umf, $pms);
4387 if (!$max_filesize) $max_filesize=max($umf, $pms);
4389 return $lng->txt(
"file_notice").
" $max_filesize.";
4401 $test_str = explode(
'_',$role_title);
4403 if ($test_str[0] ==
'il')
4405 $test2 = (int) $test_str[3];
4406 return is_numeric ($test2) ? (int) $test2 :
false;
4423 $test_str = explode(
'_',$ilias_id);
4425 if ($test_str[0] ==
'il' && $test_str[1] == $inst_id && count($test_str) == 4)
4427 $test2 = (int) $test_str[3];
4428 return is_numeric ($test2) ? (int) $test2 :
false;
4455 $where =
"WHERE ".$a_id_name.
" IN (";
4459 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
4461 "ORDER BY ".$a_field;
4466 $ids[] =
$row->$a_id_name;
4468 return $ids ? $ids : array();
4493 if(!is_array($a_array) or !count($a_array))
4498 foreach($a_array as $k => $item)
4500 $a_array[$k] = $ilDB->quote($item);
4512 public static function sendInfo($a_info =
"",$a_keep =
false)
4515 $tpl->setMessage(
"info", $a_info, $a_keep);
4527 $tpl->setMessage(
"failure", $a_info, $a_keep);
4539 $tpl->setMessage(
"question", $a_info, $a_keep);
4551 $tpl->setMessage(
"success", $a_info, $a_keep);
4560 $tpl->addBlockFile(
"INFOPANEL",
"infopanel",
"tpl.infopanel.html");
4561 $tpl->setCurrentBlock(
"infopanel");
4563 if (!empty(
$_SESSION[
"infopanel"][
"text"]))
4565 $link =
"<a href=\"".$dir.$_SESSION[
"infopanel"][
"link"].
"\" target=\"".
4568 $link .= $lng->txt(
$_SESSION[
"infopanel"][
"text"]);
4573 if (!empty(
$_SESSION[
"infopanel"][
"img"]))
4575 $link .=
"<td><a href=\"".$_SESSION[
"infopanel"][
"link"].
"\" target=\"".
4578 $link .=
"<img src=\"".$ilias->tplPath.$ilias->account->prefs[
"skin"].
"/images/".
4579 $_SESSION[
"infopanel"][
"img"].
"\" border=\"0\" vspace=\"0\"/>";
4580 $link .=
"</a></td>";
4583 $tpl->setVariable(
"INFO_ICONS",$link);
4584 $tpl->parseCurrentBlock();
4589 session_unregister(
"infopanel");
4603 if (!is_dir($directory))
4607 $size = @filesize($directory);
4611 if ($DIR = opendir($directory))
4613 while (($dirfile = readdir($DIR)) !==
false)
4615 if (is_link($directory . DIRECTORY_SEPARATOR . $dirfile) || $dirfile ==
'.' || $dirfile ==
'..')
4617 if (is_file($directory . DIRECTORY_SEPARATOR . $dirfile))
4618 $size += filesize($directory . DIRECTORY_SEPARATOR . $dirfile);
4619 else if (is_dir($directory . DIRECTORY_SEPARATOR . $dirfile))
4622 $dirSize =
ilUtil::dirsize($directory . DIRECTORY_SEPARATOR . $dirfile);
4636 return md5(rand(1,9999999) + str_replace(
" ",
"", (
string) microtime()));
4639 public static function setCookie($a_cookie_name,$a_cookie_value =
'', $a_also_set_super_global =
true, $a_set_cookie_invalid =
false)
4646 if(!(
bool)$a_set_cookie_invalid) $expire = 0;
4647 else $expire = time() - (365*24*60*60);
4651 if( version_compare(PHP_VERSION,
'5.2.0',
'>=') )
4654 setcookie( $a_cookie_name, $a_cookie_value, $expire,
4655 IL_COOKIE_PATH, IL_COOKIE_DOMAIN, IL_COOKIE_SECURE, IL_COOKIE_HTTPONLY
4661 setcookie( $a_cookie_name, $a_cookie_value, $expire,
4662 IL_COOKIE_PATH, IL_COOKIE_DOMAIN, IL_COOKIE_SECURE
4666 if((
bool)$a_also_set_super_global)
$_COOKIE[$a_cookie_name] = $a_cookie_value;
4671 return strip_tags(self::stripSlashes($a_filename));