Public Member Functions | |
| getImageTagByType ($a_type, $a_path, $a_big=false) | |
| Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Code to your template file public. | |
| getImagePath ($img, $in_module=false, $mode="output", $offline=false) | |
| get image path (for images located in a template directory) | |
| getHtmlPath ($relative_path) | |
| get url of path | |
| getJSPath ($a_js) | |
| getStyleSheetLocation ($mode="output") | |
| get full style sheet file name (path inclusive) of current user | |
| formSelect ($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0") | |
| Builds a select form field with options and shows the selected option first. | |
| getSelectName ($selected, $values) | |
| ??? | |
| formCheckbox ($checked, $varname, $value, $disabled=false) | |
| ??? public | |
| formRadioButton ($checked, $varname, $value) | |
| ??? public | |
| checkInput ($vars) | |
| ??? | |
| setPathStr ($a_path) | |
| ??? public | |
| switchColor ($a_num, $a_css1, $a_css2) | |
| switches style sheets for each even $a_num (used for changing colors of different result rows) | |
| showTabs ($a_hl, $a_o) | |
| show the tabs in admin section | |
| getObjectsByOperations ($a_type, $a_operation, $a_checkpath=true) | |
| Get all objects of a specific type and check access. | |
| checkFormEmpty ($emptyFields) | |
| ??? public | |
| Linkbar ($AScript, $AHits, $ALimit, $AOffset, $AParams=array(), $ALayout=array()) | |
| Linkbar Diese Funktion erzeugt einen typischen Navigationsbalken mit "Previous"- und "Next"-Links und den entsprechenden Seitenzahlen. | |
| makeClickable ($a_text) | |
| makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen | |
| StopWatch ($begin=-1) | |
| StopWatch benchmark scriptcode. | |
| makeDateSelect ($prefix, $year="", $month="", $day="", $startyear="") | |
| Creates a combination of HTML selects for date inputs. | |
| makeTimeSelect ($prefix, $short=true, $hour="", $minute="", $second="") | |
| Creates a combination of HTML selects for time inputs. | |
| is_email ($a_email) | |
| isPassword ($a_passwd) | |
| isLogin ($a_login) | |
| shortenText ($a_str, $a_len, $a_dots="false") | |
| shorten a string to given length. | |
| attribsToArray ($a_str) | |
| converts a string of format var1 = "val1" var2 = "val2" ... | |
| rCopy ($a_sdir, $a_tdir) | |
| Copies content of a directory $a_sdir recursively to a directory $a_tdir. | |
| getWebspaceDir ($mode="filesystem") | |
| get webspace directory | |
| getDataDir () | |
| get data directory (outside webspace) | |
| getUsersOnline ($a_user_id=0) | |
| reads all active sessions from db and returns users that are online OR returns only one active user if a user_id is given | |
| getAssociatedUsersOnline ($a_user_id) | |
| reads all active sessions from db and returns users that are online and who have a local role in a group or a course for which the the current user has also a local role. | |
| ilTempnam () | |
| Create a temporary file in an ILIAS writable directory. | |
| createDirectory ($a_dir, $a_mod=0755) | |
| create directory | |
| unzip ($a_file, $overwrite=false) | |
| unzip file | |
| zip ($a_dir, $a_file) | |
| zips given directory/file into given zip.file | |
| getConvertCmd () | |
| get convert command | |
| convertImage ($a_from, $a_to, $a_target_format="", $a_geometry="") | |
| convert image | |
| resizeImage ($a_from, $a_to, $a_width, $a_height) | |
| resize image | |
| html2pdf ($html, $pdf_file) | |
| produce pdf out of html with htmldoc | |
| deliverData ($a_data, $a_filename, $mime="application/octet-stream", $charset="") | |
| deliver data for download via browser. | |
| deliverFile ($a_file, $a_filename) | |
| deliver file for download via browser. | |
| readFile ($a_file) | |
| there are some known problems with the original readfile method, which sometimes truncates delivered files regardless of php.ini setting (see http://de.php.net/manual/en/function.readfile.php) use this method to avoid these problems. | |
| getASCIIFilename ($a_filename) | |
| convert utf8 to ascii filename | |
| getJavaPath () | |
| get full java path (dir + java command) | |
| appendUrlParameterString ($a_url, $a_par) | |
| append URL parameter string ("par1=value1&par2=value2...") to given URL string | |
| makeDir ($a_dir) | |
| creates a new directory and inherits all filesystem permissions of the parent directory You may pass only the name of your new directory or with the entire path or relative path information. | |
| makeDirParents ($a_dir) | |
| Create a new directory and all parent directories. | |
| delDir ($a_dir) | |
| removes a dir and all its content (subdirs and files) recursively | |
| getDir ($a_dir) | |
| get directory | |
| getGroupId ($a_parent_ref) | |
| get the tree_id of a group where an object with the passed ref_id belongs to. | |
| stripSlashes ($a_str, $a_strip_html=true, $a_allow="") | |
| strip slashes if magic qoutes is enabled | |
| stripScriptHTML ($a_str, $a_allow="", $a_rm_js=true) | |
| strip only html tags (4.0) from text $allowed contains tags to be allowed, in format tags a and b are allowed todo: needs to be optimized-> not very efficient | |
| addSlashes ($a_str) | |
| add slashes if magic qoutes is disabled don't use that for db inserts/updates! use prepareDBString instead | |
| prepareFormOutput ($a_str, $a_strip=false) | |
| prepares string output for html forms public | |
| prepareDBString ($a_str) | |
| prepare a string for db writing (insert/update) | |
| removeItemFromDesktops ($a_id) | |
| removes object from all user's desktops public | |
| extractParameterString ($a_parstr) | |
| extracts parameter value pairs from a string into an array | |
| assembleParameterString ($a_par_arr) | |
| dumpString ($a_str) | |
| dumps ord values of every character of string $a_str | |
| yn2tf ($a_yn) | |
| convert "y"/"n" to true/false | |
| tf2yn ($a_tf) | |
| convert true/false to "y"/"n" | |
| sort_func ($a, $b) | |
| sub-function to sort an array | |
| sort_func_numeric ($a, $b) | |
| sub-function to sort an array | |
| sortArray ($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false) | |
| sortArray | |
| unique_multi_array ($array, $sub_key) | |
| Make a multi-dimensional array to have only DISTINCT values for a certain "column". | |
| getGDSupportedImageType ($a_desired_type) | |
| returns the best supported image type by this PHP build | |
| deducibleSize ($a_mime) | |
| checks if mime type is provided by getimagesize() | |
| redirect ($a_script) | |
| http redirect to other script | |
| insertInstIntoID ($a_value) | |
| inserts installation id into ILIAS id | |
| groupNameExists ($a_group_name, $a_id=0) | |
| checks if group name already exists. | |
| searchGroups ($a_search_str) | |
| getMemString () | |
| get current memory usage as string | |
| isWindows () | |
| check wether the current client system is a windows system | |
| escapeShellArg ($a_arg) | |
| excelTime ($year="", $month="", $day="", $hour="", $minute="", $second="") | |
| renameExecutables ($a_dir) | |
| rename uploaded executables for security reasons | |
| rRenameSuffix ($a_dir, $a_old_suffix, $a_new_suffix) | |
| Copies content of a directory $a_sdir recursively to a directory $a_tdir. | |
| isAPICall () | |
| KT_replaceParam ($qstring, $paramName, $paramValue) | |
| replaceUrlParameterString ($url, $parametersArray) | |
| generatePasswords ($a_number) | |
| removeTrailingPathSeparators ($path) | |
| array_php2js ($data) | |
| convert php arrays to javascript arrays | |
| virusHandling ($a_file, $a_orig_name="", $a_clean=true) | |
| scan file for viruses and clean files if possible | |
| moveUploadedFile ($a_file, $a_name, $a_target, $a_raise_errors=true) | |
| move uploaded file | |
| date_mysql2time ($mysql_date_time) | |
| make time object from mysql_date_time | |
| & | processCSVRow (&$row, $quoteAll=FALSE, $separator=";", $outUTF8=FALSE, $compatibleWithMSExcel=TRUE) |
| Convertes an array for CSV usage. | |
| isDN ($a_str) | |
| isIPv4 ($a_str) | |
Definition at line 34 of file class.ilUtil.php.
| ilUtil::addSlashes | ( | $ | a_str | ) |
add slashes if magic qoutes is disabled don't use that for db inserts/updates! use prepareDBString instead
Definition at line 1933 of file class.ilUtil.php.
Referenced by createNewOperation(), ilObjUser::saveAsNew(), and updateObjectValue().
{
if (ini_get("magic_quotes_gpc"))
{
return $a_str;
}
else
{
return addslashes($a_str);
}
}
Here is the caller graph for this function:| ilUtil::appendUrlParameterString | ( | $ | a_url, | |
| $ | a_par | |||
| ) |
append URL parameter string ("par1=value1&par2=value2...") to given URL string
Definition at line 1636 of file class.ilUtil.php.
Referenced by ilObjectListGUI::appendRepositoryFrameParameter(), ilCtrl::appendTransitClasses(), ilInternalLinkGUI::changeTargetObject(), ilCtrl::getUrlParameters(), ilEditClipboardGUI::insert(), ilCtrl::returnToParent(), ilInternalLinkGUI::selectRepositoryItem(), ilObjectGUI::setLocator(), and ilInternalLinkGUI::showLinkHelp().
{
$url = (is_int(strpos($a_url, "?")))
? $a_url."&".$a_par
: $a_url."?".$a_par;
return $url;
}
Here is the caller graph for this function:| ilUtil::array_php2js | ( | $ | data | ) |
convert php arrays to javascript arrays
| array |
Definition at line 2587 of file class.ilUtil.php.
References $data.
Referenced by ilObjRoleGUI::__showAssignedUsersTable(), ilObjiLincCourseGUI::__showMembersTable(), ilObjCourseGUI::__showMembersTable(), ilObjGroupGUI::__showMembersTable(), ilObjExerciseGUI::__showMembersTable(), ilObjUserGUI::__showRolesTable(), ilObjRoleFolderGUI::__showRolesTable(), ilObjiLincCourseGUI::__showSearchGroupTable(), ilObjCourseGUI::__showSearchGroupTable(), ilObjRoleGUI::__showSearchGroupTable(), ilObjGroupGUI::__showSearchGroupTable(), ilObjiLincCourseGUI::__showSearchRoleTable(), ilObjCourseGUI::__showSearchRoleTable(), ilObjRoleGUI::__showSearchRoleTable(), ilObjGroupGUI::__showSearchRoleTable(), ilObjiLincCourseGUI::__showSearchUserTable(), ilObjCourseGUI::__showSearchUserTable(), ilObjRoleGUI::__showSearchUserTable(), ilObjGroupGUI::__showSearchUserTable(), ilObjCourseGUI::__showSubscribersTable(), ilObjCourseGUI::__showWaitingListTable(), ilObjContentObjectGUI::editPublicSection(), ilPublicSectionSelector::formatObject(), ilObjRoleTemplateGUI::permObject(), ilObjRoleGUI::permObject(), ilObjUserFolderGUI::showActions(), and ilObjectGUI::showActions().
{
if (empty($data))
{
$data = array();
}
foreach($data as $k=>$datum)
{
if(is_null($datum)) $data[$k] = 'null';
if(is_string($datum)) $data[$k] = "'" . $datum . "'";
if(is_array($datum)) $data[$k] = array_php2js($datum);
}
return "[" . implode(', ', $data) . "]";
}
Here is the caller graph for this function:| ilUtil::assembleParameterString | ( | $ | a_par_arr | ) |
Definition at line 2050 of file class.ilUtil.php.
References $target_arr.
Referenced by ilMediaItem::getParameterString().
{
if (is_array($a_par_arr))
{
$target_arr = array();
foreach ($a_par_arr as $par => $val)
{
$target_arr[] = "$par=\"$val\"";
}
$target_str = implode(", ", $target_arr);
}
return $target_str;
}
Here is the caller graph for this function:| ilUtil::attribsToArray | ( | $ | a_str | ) |
converts a string of format var1 = "val1" var2 = "val2" ...
into an array
| string | $a_str string in format: var1 = "val1" var2 = "val2" ... |
Definition at line 987 of file class.ilUtil.php.
Referenced by ilPCParagraph::input2xml(), and ilPCParagraph::xml2output().
{
$attribs = array();
while (is_int(strpos($a_str, "=")))
{
$eq_pos = strpos($a_str, "=");
$qu1_pos = strpos($a_str, "\"");
$qu2_pos = strpos(substr($a_str, $qu1_pos + 1), "\"") + $qu1_pos + 1;
if (is_int($eq_pos) && is_int($qu1_pos) && is_int($qu2_pos))
{
$var = trim(substr($a_str, 0, $eq_pos));
$val = trim(substr($a_str, $qu1_pos + 1, ($qu2_pos - $qu1_pos) - 1));
$attribs[$var] = $val;
$a_str = substr($a_str, $qu2_pos + 1);
}
else
{
$a_str = "";
}
}
return $attribs;
}
Here is the caller graph for this function:| ilUtil::checkFormEmpty | ( | $ | emptyFields | ) |
??? public
| array |
Definition at line 552 of file class.ilUtil.php.
{
$feedback = "";
foreach ($emptyFields as $key => $val)
{
if ($val == "") {
if ($feedback != "") $feedback .= ", ";
$feedback .= $key;
}
}
return $feedback;
}
| ilUtil::checkInput | ( | $ | vars | ) |
???
| string |
Definition at line 341 of file class.ilUtil.php.
{
// TO DO:
// Diese Funktion soll Formfeldeingaben berprfen (empty und required)
}
| ilUtil::convertImage | ( | $ | a_from, | |
| $ | a_to, | |||
| $ | a_target_format = "", |
|||
| $ | a_geometry = "" | |||
| ) |
convert image
| string | $a_from source file | |
| string | $a_to target file | |
| string | $a_target_format target image file format |
Definition at line 1374 of file class.ilUtil.php.
References escapeShellArg(), and getConvertCmd().
Referenced by ASS_OrderingQuestion::from_xml(), ASS_MatchingQuestion::from_xml(), ilMediaItem::getThumbnailTarget(), ilQTIParser::handlerParseEndTag(), ilMediaItem::makeMapWorkCopy(), ASS_OrderingQuestion::set_image_file(), and ASS_MatchingQuestion::set_image_file().
{
$format_str = ($a_target_format != "")
? strtoupper($a_target_format).":"
: "";
$geometry = ($a_geometry != "")
? " -geometry ".$a_geometry."x".$a_geometry." "
: "";
$convert_cmd = ilUtil::getConvertCmd()." ".
ilUtil::escapeShellArg($a_from)." ".$geometry.ilUtil::escapeShellArg($format_str.$a_to);
system($convert_cmd);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::createDirectory | ( | $ | a_dir, | |
| $ | a_mod = 0755 | |||
| ) |
create directory
deprecated use makeDir() instead!
Definition at line 1242 of file class.ilUtil.php.
References makeDir().
Referenced by ilObjCategoryGUI::_importCategories(), ilMediaItem::createWorkDirectory(), ilTempnam(), and unzip().
{
ilUtil::makeDir($a_dir);
//@mkdir($a_dir);
//@chmod($a_dir, $a_mod);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::date_mysql2time | ( | $ | mysql_date_time | ) |
make time object from mysql_date_time
Definition at line 2695 of file class.ilUtil.php.
Referenced by ilObjTestGUI::outPrintUserResults(), and ilObjTestGUI::outShowAnswersDetails().
{
list($datum, $uhrzeit) = explode (" ",$mysql_date_time);
list($jahr, $monat, $tag) = explode("-", $datum);
list($std, $min, $sec) = explode(":", $uhrzeit);
return mktime ((int) $std, (int) $min, (int) $sec, (int) $monat, (int) $tag, (int) $jahr);
}
Here is the caller graph for this function:| ilUtil::deducibleSize | ( | $ | a_mime | ) |
checks if mime type is provided by getimagesize()
| string | $a_mime mime format |
Definition at line 2262 of file class.ilUtil.php.
Referenced by ilPCMediaObjectGUI::create(), ilObjMediaObjectGUI::editObject(), ilMediaItem::getOriginalSize(), and ilObjMediaObjectGUI::saveObject().
{
if (($a_mime == "image/gif") || ($a_mime == "image/jpeg") ||
($a_mime == "image/png") || ($a_mime == "application/x-shockwave-flash") ||
($a_mime == "image/tiff") || ($a_mime == "image/x-ms-bmp") ||
($a_mime == "image/psd") || ($a_mime == "image/iff"))
{
return true;
}
else
{
return false;
}
}
Here is the caller graph for this function:| ilUtil::delDir | ( | $ | a_dir | ) |
removes a dir and all its content (subdirs and files) recursively
public
| string | dir to delete |
Definition at line 1755 of file class.ilUtil.php.
References $file.
Referenced by ilFileDataChat::__deleteOld(), ilFileDataChat::_ilFileDataChat(), ilObjFile::clearDataDirectory(), ilClient::delete(), ilObjSAHSLearningModule::delete(), ilObjFileBasedLM::delete(), ilObjContentObject::delete(), ilObjAICCLearningModule::delete(), ilObjMediaObject::delete(), ilObjFile::delete(), ilFileDataCourse::deleteDirectory(), ilObjGlossaryGUI::deleteExportFile(), ilObjContentObjectGUI::deleteExportFile(), ilObjSurveyQuestionPoolGUI::deleteExportFileObject(), ilObjSurveyGUI::deleteExportFileObject(), ilObjTestGUI::deleteExportFileObject(), ilObjQuestionPoolGUI::deleteExportFileObject(), ilFileSystemGUI::deleteFile(), ilObjMediaObjectGUI::deleteFileObject(), ilObjGlossary::exportHTML(), ilObjContentObject::exportHTML(), ilObjContentObject::exportSCORM(), ilFileDataChat::ilFileDataChat(), ilObjUserFolderGUI::importCancelledObject(), ilObjGlossaryGUI::importFileObject(), ilObjContentObjectGUI::importFileObject(), ilObjSurvey::importObject(), ilObjUserFolderGUI::importUserRoleAssignmentObject(), ilObjUserFolderGUI::importUsersObject(), ilObjTestGUI::importVerifiedFileObject(), ilObjQuestionPoolGUI::importVerifiedFileObject(), ilFileDataImportMail::unlinkLast(), ilFileDataImportGroup::unlinkLast(), ilFileDataImportForum::unlinkLast(), ilSetup::updateNewClient(), ilObjQuestionPoolGUI::uploadQplObject(), and ilObjTestGUI::uploadTstObject().
{
if (!is_dir($a_dir) || is_int(strpos($a_dir, "..")))
{
return;
}
$current_dir = opendir($a_dir);
$files = array();
// this extra loop has been necessary because of a strange bug
// at least on MacOS X. A looped readdir() didn't work
// correctly with larger directories
// when an unlink happened inside the loop. Getting all files
// into the memory first solved the problem.
while($entryname = readdir($current_dir))
{
$files[] = $entryname;
}
foreach($files as $file)
{
if(is_dir($a_dir."/".$file) and ($file != "." and $file!=".."))
{
ilUtil::delDir(${a_dir}."/".${file});
}
elseif ($file != "." and $file != "..")
{
unlink(${a_dir}."/".${file});
}
}
closedir($current_dir);
rmdir(${a_dir});
}
Here is the caller graph for this function:| ilUtil::deliverData | ( | $ | a_data, | |
| $ | a_filename, | |||
| $ | mime = "application/octet-stream", |
|||
| $ | charset = "" | |||
| ) |
deliver data for download via browser.
We need to set the following headers to make downloads work using IE in HTTPS mode.
Definition at line 1443 of file class.ilUtil.php.
References exit, and getASCIIFilename().
Referenced by ilObjTestGUI::evalSelectedUsersObject(), ilObjSurveyGUI::evaluationObject(), ilObjSurveyGUI::evaluationuserObject(), ilObjChatGUI::export(), ilLMPresentationGUI::exportbibinfo(), ilObjChatGUI::exportRecordingObject(), ilObjUserGUI::insertPublicProfile(), and ilPageObject::send_paragraph().
{
$disposition = "attachment"; // "inline" to view file in browser or "attachment" to download to hard disk
// $mime = "application/octet-stream"; // or whatever the mime type is
if (isset($_SERVER["HTTPS"])) {
// Added different handling for IE and HTTPS => send pragma after content informations
#header("Pragma: ");
#header("Cache-Control: ");
#header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
#header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
#header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
#header("Cache-Control: post-check=0, pre-check=0", false);
}
else if ($disposition == "attachment")
{
header("Cache-control: private");
}
else
{
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
}
$ascii_filename = ilUtil::getASCIIFilename($a_filename);
if (strlen($charset))
{
$charset = "; charset=$charset";
}
header("Content-Type: $mime$charset");
header("Content-Disposition:$disposition; filename=\"".$ascii_filename."\"");
header("Content-Description: ".$ascii_filename);
header("Content-Length: ".(string)(strlen($a_data)));
if($_SERVER['HTTPS'])
{
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
}
header("Connection: close");
echo $a_data;
exit;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::deliverFile | ( | $ | a_file, | |
| $ | a_filename | |||
| ) |
deliver file for download via browser.
We need to set the following headers to make downloads work using IE in HTTPS mode.
Definition at line 1496 of file class.ilUtil.php.
References exit, getASCIIFilename(), and readFile().
Referenced by ilObjChatGUI::__exportRooms(), ilObjCourseGUI::downloadArchivesObject(), ilObjGlossaryGUI::downloadExportFile(), ilObjContentObjectGUI::downloadExportFile(), ilLMPresentationGUI::downloadExportFile(), ilGlossaryPresentationGUI::downloadExportFile(), ilObjSurveyQuestionPoolGUI::downloadExportFileObject(), ilObjSurveyGUI::downloadExportFileObject(), ilObjUserFolderGUI::downloadExportFileObject(), ilObjTestGUI::downloadExportFileObject(), ilObjQuestionPoolGUI::downloadExportFileObject(), ilFileSystemGUI::downloadFile(), ilObjExerciseGUI::downloadFileObject(), ilExerciseMembers::downloadMultipleFiles(), ilObjContentObjectGUI::downloadPDFFile(), ilExerciseMembers::downloadSingleFile(), ilObjDlBook::export(), ilObjQuestionPoolGUI::exportQuestionObject(), ilLMPresentationGUI::offlineexport(), and ilObjFile::sendFile().
{
$disposition = "attachment"; // "inline" to view file in browser or "attachment" to download to hard disk
$mime = "application/octet-stream"; // or whatever the mime type is
if (isset($_SERVER["HTTPS"]))
{
// Added different handling for IE and HTTPS => send pragma after content informations
#header("Pragma: ");
#header("Pragma: no-cache");
#header("Cache-Control: ");
#header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
#header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
#header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
##header("Cache-Control: post-check=0, pre-check=0", false);
}
else if ($disposition == "attachment")
{
header("Cache-control: private");
}
else
{
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
}
$ascii_filename = ilUtil::getASCIIFilename($a_filename);
header("Content-Type: $mime");
header("Content-Disposition:$disposition; filename=\"".$ascii_filename."\"");
header("Content-Description: ".$ascii_filename);
header("Content-Length: ".(string)(filesize($a_file)));
if($_SERVER['HTTPS'])
{
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
}
header("Connection: close");
ilUtil::readFile( $a_file );
exit;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::dumpString | ( | $ | a_str | ) |
dumps ord values of every character of string $a_str
Definition at line 2068 of file class.ilUtil.php.
{
$ret = $a_str.": ";
for($i=0; $i<strlen($a_str); $i++)
{
$ret.= ord(substr($a_str,$i,1))." ";
}
return $ret;
}
| ilUtil::escapeShellArg | ( | $ | a_arg | ) |
Definition at line 2395 of file class.ilUtil.php.
References isWindows().
Referenced by convertImage(), ilFileDataExercise::delete(), ilFileDataExercise::downloadAllDeliveredFiles(), ilExerciseMembers::downloadMultipleFiles(), ilObjFile::getXMLZip(), html2pdf(), resizeImage(), unzip(), and zip().
{
global $PHP_OS;
if (ini_get("safe_mode") == 1 || ilUtil::isWindows())
{
return $a_arg;
}
else
{
return escapeshellarg($a_arg);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::excelTime | ( | $ | year = "", |
|
| $ | month = "", |
|||
| $ | day = "", |
|||
| $ | hour = "", |
|||
| $ | minute = "", |
|||
| $ | second = "" | |||
| ) |
Definition at line 2429 of file class.ilUtil.php.
Referenced by ilObjUserFolder::createExcelExport(), and ilObjTestGUI::evalSelectedUsersObject().
{
$starting_time = mktime(0, 0, 0, 1, 2, 1970);
if (strcmp("$year$month$day$hour$minute$second", "") == 0)
{
$target_time = time();
}
else
{
if ($year < 1970)
{
return 0;
}
}
$target_time = mktime($hour, $minute, $second, $month, $day, $year);
$difference = $target_time - $starting_time;
$days = (($difference - ($difference % 86400)) / 86400);
$difference = $difference - ($days * 86400) + 3600;
return ($days + 25570 + ($difference / 86400));
}
Here is the caller graph for this function:| ilUtil::extractParameterString | ( | $ | a_parstr | ) |
extracts parameter value pairs from a string into an array
| string | $a_parstr parameter string (format: par1="value1", par2="value2", ...) |
Definition at line 2014 of file class.ilUtil.php.
Referenced by ilPCMediaObjectGUI::saveAliasProperties(), and ilMediaItem::setParameters().
{
// parse parameters in array
$par = array();
$ok=true;
while(($spos=strpos($a_parstr,"=")) && $ok)
{
// extract parameter
$cpar = substr($a_parstr,0,$spos);
$a_parstr = substr($a_parstr,$spos,strlen($a_parstr)-$spos);
while(substr($cpar,0,1)=="," ||substr($cpar,0,1)==" " || substr($cpar,0,1)==chr(13) || substr($cpar,0,1)==chr(10))
$cpar = substr($cpar,1,strlen($cpar)-1);
while(substr($cpar,strlen($cpar)-1,1)==" " || substr($cpar,strlen($cpar)-1,1)==chr(13) || substr($cpar,strlen($cpar)-1,1)==chr(10))
$cpar = substr($cpar,0,strlen($cpar)-1);
// extract value
if($spos=strpos($a_parstr,"\""))
{
$a_parstr = substr($a_parstr,$spos+1,strlen($a_parstr)-$spos);
$spos=strpos($a_parstr,"\"");
if(is_int($spos))
{
$cval = substr($a_parstr,0,$spos);
$par[$cpar]=$cval;
$a_parstr = substr($a_parstr,$spos+1,strlen($a_parstr)-$spos-1);
}
else
$ok=false;
}
else
$ok=false;
}
if($ok) return $par; else return false;
}
Here is the caller graph for this function:| ilUtil::formCheckbox | ( | $ | checked, | |
| $ | varname, | |||
| $ | value, | |||
| $ | disabled = false | |||
| ) |
??? public
| string | ||
| string | ||
| string | ||
| boolean | disabled checked checkboxes (default: false) |
Definition at line 274 of file class.ilUtil.php.
Referenced by ilSearchGUI::__formatDigiLibResult(), ilSearchGUI::__formatGroupResult(), ilSearchGUI::__formatLearningModuleResult(), ilSearchGUI::__formatUserResult(), ilSearchAdministrationGUI::__showFolders(), ilSearchResultPresentationGUI::addStandardRow(), ilObjUserFolderGUI::appliedUsersObject(), ilObjCourseGUI::archiveAdminObject(), ilObjCourseGUI::archiveObject(), ilCourseObjectivesGUI::assignChapterSelect(), ilCourseObjectivesGUI::assignLMSelect(), ilCourseObjectivesGUI::assignQuestionSelect(), ilObjCategoryGUI::assignRolesObject(), ilObjChatGUI::blockedUsersObject(), ilCourseContentInterface::cci_edit(), ilObjiLincCourseGUI::createObject(), ilObjUserGUI::createObject(), ilObjiLincCourseGUI::displayEditForm(), displayForm(), ilObjUserFolderGUI::editAppliedUsersObject(), ilObjLinkResourceGUI::editItemObject(), ilObjLinkResourceGUI::editItemsObject(), ilObjCourseGUI::editMemberObject(), ilObjCourseGUI::editObject(), ilObjUserGUI::editObject(), ilObjExerciseGUI::editObject(), ilCourseObjectivesGUI::editQuestionAssignment(), ilObjContentObjectGUI::linkChecker(), ilObjLinkResourceGUI::linkCheckerObject(), ilCourseObjectivesGUI::listAssignedLM(), ilCourseObjectivesGUI::listAssignedQuestions(), ilConditionHandlerInterface::listConditions(), ilObjCourseGUI::listGroupingsObject(), ilCourseObjectivesGUI::listObjectives(), ilObjiLincCourseGUI::listUsersGroupObject(), ilObjCourseGUI::listUsersGroupObject(), ilObjRoleGUI::listUsersGroupObject(), ilObjGroupGUI::listUsersGroupObject(), ilObjCategoryGUI::listUsersObject(), ilObjiLincCourseGUI::listUsersRoleObject(), ilObjCourseGUI::listUsersRoleObject(), ilObjRoleGUI::listUsersRoleObject(), ilObjGroupGUI::listUsersRoleObject(), ilObjCourseGUI::membersObject(), ilObjExerciseGUI::membersObject(), ilObjCourseGroupingGUI::otherSelectAssign(), ilObjPaymentSettingsGUI::payMethodsObject(), ilPaymentTrusteeGUI::performSearch(), ilObjChatGUI::recordingsObject(), ilObjPaymentSettingsGUI::searchObject(), ilObjiLincCourseGUI::searchObject(), ilObjCourseGUI::searchObject(), ilObjRoleGUI::searchObject(), ilObjGroupGUI::searchObject(), ilObjCourseGroupingGUI::selectCourse(), ilObjCourseGUI::selectStarterObject(), ilSearchresultGUI::showResults(), ilSearchGUI::showSearch(), ilPaymentTrusteeGUI::showTrustees(), ilObjPaymentSettingsGUI::vendorsObject(), and ilObjChatGUI::viewObject().
{
$str = "<input type=\"checkbox\" name=\"".$varname."\"";
if ($checked == 1)
{
$str .= " checked=\"checked\"";
}
if ($disabled)
{
$str .= " disabled=\"disabled\"";
}
$array_var = false;
if (substr($varname,-2) == "[]")
{
$array_var = true;
}
// if varname ends with [], use varname[-2] + _ + value as id tag (e.g. "user_id[]" => "user_id_15")
if ($array_var)
{
$varname_id = substr($varname,0,-2)."_".$value;
}
else
{
$varname_id = $varname;
}
// dirty removal of other "[]" in string
$varname_id = ereg_replace("\[","_",$varname_id);
$varname_id = ereg_replace("\]","",$varname_id);
$str .= " value=\"".$value."\" id=\"".$varname_id."\" />\n";
return $str;
}
Here is the caller graph for this function:| ilUtil::formRadioButton | ( | $ | checked, | |
| $ | varname, | |||
| $ | value | |||
| ) |
??? public
| string | ||
| string | ||
| string |
Definition at line 322 of file class.ilUtil.php.
Referenced by ilCourseObjectivesGUI::assignTestSelect(), ilObjiLincCourseGUI::changeMemberObject(), ilObjiLincClassroomGUI::createObject(), ilObjGroupGUI::createObject(), ilObjForumGUI::createObject(), ilObjiLincClassroomGUI::displayEditForm(), ilObjCourseGUI::editObject(), ilObjGroupGUI::editObject(), ilObjForumGUI::editObject(), ilObjExerciseGUI::newMembersObject(), ilObjRoleTemplateGUI::permObject(), ilObjRoleGUI::permObject(), ilObjiLincCourseGUI::searchUserFormObject(), ilObjRoleGUI::searchUserFormObject(), ilObjGroupGUI::searchUserFormObject(), ilObjCourseGUI::searchUserObject(), ilObjSearchSettingsGUI::settingsObject(), ilPaymentBillAdminGUI::showBillData(), ilPaymentPurchaseGUI::showDetails(), ilSearchGUI::showSearch(), and ilObjExerciseGUI::viewObject().
{
$str = "<input type=\"radio\" name=\"".$varname."\"";
if ($checked == 1)
{
$str .= " checked=\"checked\"";
}
$str .= " value=\"".$value."\"";
$str .= " id=\"".$value."\" />\n";
return $str;
}
Here is the caller graph for this function:| ilUtil::formSelect | ( | $ | selected, | |
| $ | varname, | |||
| $ | options, | |||
| $ | multiple = false, |
|||
| $ | direct_text = false, |
|||
| $ | size = "0" | |||
| ) |
Builds a select form field with options and shows the selected option first.
public
| string/array | value to be selected | |
| string | variable name in formular | |
| array | array with $options (key = lang_key, value = long name) | |
| boolean | ||
| boolean | if true, the option values are displayed directly, otherwise they are handled as language variable keys and the corresponding language variable is displayed |
Definition at line 200 of file class.ilUtil.php.
Referenced by ilMDEditorGUI::__fillSubelements(), ilSearchGUI::__show(), ilObjCourseGUI::__showMembersTable(), ilObjExerciseGUI::__showMembersTable(), ilObjCourseGUI::__showSubscribersTable(), ilObjPaymentSettingsGUI::__showVendorsTable(), ilObjCourseGUI::__showWaitingListTable(), ilConditionHandlerInterface::add(), ilObjSystemFolderGUI::benchmarkObject(), ilObjGroupGUI::changeMemberObject(), ilRepositoryGUI::copyChilds(), ilObjCourseGroupingGUI::create(), displayForm(), ilObjCourseGroupingGUI::edit(), ilPaymentStatisticGUI::editStatistic(), ilObjPaymentSettingsGUI::editStatisticObject(), ilObjUserFolderGUI::importUserRoleAssignmentObject(), ilObjCourseGUI::selectArchiveLanguageObject(), ilObjSearchSettingsGUI::settingsObject(), ilRepositoryGUI::showActionSelect(), ilLOListGUI::showActionSelect(), ilInternalLinkGUI::showLinkHelp(), and ilPageObjectGUI::showPage().
{
global $lng;
if ($multiple == true)
{
$multiple = "multiple";
}
else
{
$multiple = "";
$size = 0;
}
$str = "<select name=\"".$varname ."\"".$multiple." size=\"".$size."\">\n";
foreach ($options as $key => $val)
{
if ($direct_text)
{
$str .= " <option value=\"".$key."\"";
}
else
{
$str .= " <option value=\"".$val."\"";
}
if (is_array($selected) )
{
if (in_array($key,$selected))
{
$str .= " selected=\"selected\"";
}
}
else if ($selected == $key)
{
$str .= " selected=\"selected\"";
}
if ($direct_text)
{
$str .= ">".$val."</option>\n";
}
else
{
$str .= ">".$lng->txt($val)."</option>\n";
}
}
$str .= "</select>\n";
return $str;
}
Here is the caller graph for this function:| ilUtil::generatePasswords | ( | $ | a_number | ) |
Definition at line 2537 of file class.ilUtil.php.
Referenced by saveForm().
{
$ret = array();
srand((double) microtime()*1000000);
for ($i=1; $i<=$a_number; $i++)
{
$length = rand(6,10);
$next = rand(1,2);
//$chars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$vowels = "aeiou";
$consonants = "bcdfghjklmnpqrstvwxyz";
$pw = "";
for ($j=0; $j < $length; $j++)
{
switch ($next)
{
case 1:
$pw.= $consonants[rand(0,strlen($consonants)-1)];
$next = 2;
break;
case 2:
$pw.= $vowels[rand(0,strlen($vowels)-1)];
$next = 1;
break;
}
}
$ret[] = $pw;
}
return $ret;
}
Here is the caller graph for this function:| ilUtil::getASCIIFilename | ( | $ | a_filename | ) |
convert utf8 to ascii filename
| string | $a_filename utf8 filename |
Implementation note: /// The proper way to convert charsets is mb_convert_encoding. /// Unfortunately Multibyte String functions are not an /// installation requirement for ILIAS 3. /// Codelines behind three slashes '///' show how we would do /// it using mb_convert_encoding. /// Note that mb_convert_encoding has the bad habit of /// substituting unconvertable characters with HTML /// entitities. Thats why we need a regular expression which /// replaces HTML entities with their first character. /// e.g. ä => a
$ascii_filename = mb_convert_encoding($a_filename, 'ISO_8859-1','UTF-8'); ///$ascii_filename = preg_replace('/&(.)[^;]*;/","\1', $ascii_filename);
$ascii_filename = mb_convert_encoding($a_filename,'US-ASCII','UTF-8'); ///$ascii_filename = preg_replace('/&(.)[^;]*;/','\1', $ascii_filename);
Definition at line 1573 of file class.ilUtil.php.
Referenced by deliverData(), and deliverFile().
{
// The filename must be converted to ASCII, as of RFC 2183,
// section 2.3.
// Despite the RFC, Internet Explorer on Windows supports
// ISO 8895-1 encoding for the file name. We use this fact, to
// produce a better result, if the user uses IE.
$user_agent = strtolower($_SERVER["HTTP_USER_AGENT"]);
if ((is_integer(strpos($user_agent, "msie"))) && is_integer(strpos($user_agent, "win")))
{
$ascii_filename = utf8_decode($a_filename);
}
else
{
$ascii_filename = htmlentities($a_filename,ENT_NOQUOTES,'UTF-8');
$ascii_filename = preg_replace('/\&(.)[^;]*;/','\\1', $ascii_filename);
$ascii_filename = preg_replace('/[\x7f-\xff]/','_', $ascii_filename);
}
// Windows does not allow the following characters in filenames:
// \/:*?"<>|
if (is_integer(strpos($user_agent, "win")))
{
$ascii_filename = preg_replace('/[:\x5c\/\*\?\"<>\|]/','_', $ascii_filename);
}
return $ascii_filename;
}
Here is the caller graph for this function:| ilUtil::getAssociatedUsersOnline | ( | $ | a_user_id | ) |
reads all active sessions from db and returns users that are online and who have a local role in a group or a course for which the the current user has also a local role.
| integer | user_id User ID of the current user. |
Definition at line 1149 of file class.ilUtil.php.
References $ilias, $q, $row, $user, and $users.
Referenced by ilPersonalDesktopGUI::displayUsersOnline().
{
global $ilias;
// The difference between active time and session time
$time_diff = 0;
// Get a list of object id's of all courses and groups for which
// the current user has local roles.
// Note: we have to use DISTINCT here, because a user may assume
// multiple roles in a group or a course.
$q = "SELECT DISTINCT dat.obj_id as obj_id ".
"FROM rbac_ua AS ua ".
"JOIN rbac_fa AS fa ON fa.rol_id = ua.rol_id ".
"JOIN object_reference AS r1 ON r1.ref_id = fa.parent ".
"JOIN tree ON tree.child = r1.ref_id ".
"JOIN object_reference AS r2 ON r2.ref_id = tree.parent ".
"JOIN object_data AS dat ON dat.obj_id = r2.obj_id ".
"WHERE ua.usr_id = ".$a_user_id." ".
"AND fa.assign = 'y' ".
"AND dat.type IN ('grp','crs')";
$r = $ilias->db->query($q);
while ($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
$groups_and_courses_of_user[] = $row["obj_id"];
}
// If the user is not in a course or a group, he has no associated users.
if (count($groups_and_courses_of_user) == 0)
{
$q = "SELECT count(user_id) as num,user_id,data,firstname,lastname,title,login,last_login ".
"FROM usr_session ".
"JOIN usr_data ON user_id=usr_id ".
"WHERE user_id = ".$a_user_id." ".
"AND expires > UNIX_TIMESTAMP() - ".$time_diff." ".
"GROUP BY user_id";
}
else
{
$q = "SELECT count(user_id) as num,s.user_id,s.data,ud.firstname,ud.lastname,ud.title,ud.login,ud.last_login ".
"FROM usr_session AS s ".
"JOIN usr_data AS ud ON ud.usr_id = s.user_id ".
"JOIN rbac_ua AS ua ON ua.usr_id = s.user_id ".
"JOIN rbac_fa AS fa ON fa.rol_id = ua.rol_id ".
"JOIN tree ON tree.child = fa.parent ".
"JOIN object_reference AS or1 ON or1.ref_id = tree.parent ".
"JOIN object_data AS od ON od.obj_id = or1.obj_id ".
"WHERE s.user_id != 0 ".
"AND s.expires > UNIX_TIMESTAMP() - ".$time_diff." ".
"AND fa.assign = 'y' ".
"AND od.obj_id IN (".implode(",",$groups_and_courses_of_user).") ".
"GROUP BY s.user_id ".
"ORDER BY ud.lastname, ud.firstname";
}
$r = $ilias->db->query($q);
while ($user = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
$users[$user["user_id"]] = $user;
}
return $users ? $users : array();
}
Here is the caller graph for this function:| ilUtil::getConvertCmd | ( | ) |
get convert command
Definition at line 1359 of file class.ilUtil.php.
Referenced by ilObjUser::_uploadPersonalPicture(), convertImage(), ilImagemapPreview::createPreview(), resizeImage(), and upload_file().
{
return PATH_TO_CONVERT;
//global $ilias;
//return $ilias->getSetting("convert_path");
}
Here is the caller graph for this function:| ilUtil::getDataDir | ( | ) |
get data directory (outside webspace)
Definition at line 1098 of file class.ilUtil.php.
Referenced by ilLuceneIndexer::__indexFiles(), ilObjTest::_createImportDirectory(), ilObjQuestionPool::_createImportDirectory(), ilObjCategoryGUI::_getImportDir(), ilObjTest::_getImportDirectory(), ilObjQuestionPool::_getImportDirectory(), ilObjFile::_lookupFileSize(), ilContObjParser::copyFileItems(), ilObjSurveyQuestionPool::createExportDirectory(), ilObjSurvey::createExportDirectory(), ilObjGlossary::createExportDirectory(), ilObjContentObject::createExportDirectory(), ilObjUserFolder::createExportDirectory(), ilObjTest::createExportDirectory(), ilObjQuestionPool::createExportDirectory(), ilObjSurveyQuestionPool::createImportDirectory(), ilObjSurvey::createImportDirectory(), ilObjGlossary::createImportDirectory(), ilObjContentObject::createImportDirectory(), ilObjTest::createImportDirectory(), ilMediaItem::createWorkDirectory(), ilObjSurveyQuestionPool::deleteAllData(), ilObjQuestionPool::deleteQuestionpool(), ilObjSurvey::deleteSurveyRecord(), ilObjTest::deleteTest(), ilObjContentObject::getDataDirectory(), ilObjFile::getDirectory(), ilObjSurveyQuestionPool::getExportDirectory(), ilObjSurvey::getExportDirectory(), ilObjGlossary::getExportDirectory(), ilObjContentObject::getExportDirectory(), ilObjUserFolder::getExportDirectory(), ilObjTest::getExportDirectory(), ilObjQuestionPool::getExportDirectory(), ilObjUserFolderGUI::getImportDir(), ilObjSurveyQuestionPool::getImportDirectory(), ilObjSurvey::getImportDirectory(), ilObjGlossary::getImportDirectory(), ilObjContentObject::getImportDirectory(), ilObjTest::getImportDirectory(), ilObjQuestionPool::getImportDirectory(), ilMediaItem::getWorkDirectory(), and ilTempnam().
{
return CLIENT_DATA_DIR;
//global $ilias;
//return $ilias->ini->readVariable("server", "data_dir");
}
Here is the caller graph for this function:| ilUtil::getDir | ( | $ | a_dir | ) |
get directory
Definition at line 1796 of file class.ilUtil.php.
References $size.
Referenced by ilObjMediaObjectGUI::editFilesObject(), ilObjUserFolderGUI::importUserRoleAssignmentObject(), and ilFileSystemGUI::listFiles().
{
$current_dir = opendir($a_dir);
$dirs = array();
$files = array();
while($entry = readdir($current_dir))
{
if(is_dir($a_dir."/".$entry))
{
$dirs[$entry] = array("type" => "dir", "entry" => $entry);
}
else
{
$size = filesize($a_dir."/".$entry);
$files[$entry] = array("type" => "file", "entry" => $entry,
"size" => $size);
}
}
ksort($dirs);
ksort($files);
return array_merge($dirs, $files);
}
Here is the caller graph for this function:| ilUtil::getGDSupportedImageType | ( | $ | a_desired_type | ) |
returns the best supported image type by this PHP build
| string | $desired_type desired image type ("jpg" | "gif" | "png") |
Definition at line 2225 of file class.ilUtil.php.
Referenced by ilMediaItem::getMapWorkCopyType().
{
$a_desired_type = strtolower($a_desired_type);
// get supported Image Types
$im_types = ImageTypes();
switch($a_desired_type)
{
case "jpg":
if ($im_types & IMG_JPG) return "jpg";
if ($im_types & IMG_GIF) return "gif";
if ($im_types & IMG_PNG) return "png";
break;
case "gif":
if ($im_types & IMG_GIF) return "gif";
if ($im_types & IMG_JPG) return "jpg";
if ($im_types & IMG_PNG) return "png";
break;
case "png":
if ($im_types & IMG_PNG) return "png";
if ($im_types & IMG_JPG) return "jpg";
if ($im_types & IMG_GIF) return "gif";
break;
}
return "";
}
Here is the caller graph for this function:| ilUtil::getGroupId | ( | $ | a_parent_ref | ) |
get the tree_id of a group where an object with the passed ref_id belongs to.
DEPRECATED
| string | ref_id of an object that is in a group public |
Definition at line 1829 of file class.ilUtil.php.
| ilUtil::getHtmlPath | ( | $ | relative_path | ) |
get url of path
| $relative_path | string complete path to file, relative to web root (e.g. /data/pfplms103/mobs/mm_732/athena_standing.jpg) |
Definition at line 125 of file class.ilUtil.php.
{
if (substr($relative_path, 0, 2) == './')
{
$relative_path = (substr($relative_path, 1));
}
if (substr($relative_path, 0, 1) != '/')
{
$relative_path = '/' . $relative_path;
}
$htmlpath = ILIAS_HTTP_PATH . $relative_path;
return $htmlpath;
}
| ilUtil::getImagePath | ( | $ | img, | |
| $ | in_module = false, |
|||
| $ | mode = "output", |
|||
| $ | offline = false | |||
| ) |
get image path (for images located in a template directory)
public
| string | full image filename (e.g. myimage.gif) | |
| boolean | should be set to true, if the image is within a module template directory (e.g. content/templates/default/images/test.gif) |
Definition at line 65 of file class.ilUtil.php.
References $ilias, and $styleDefinition.
Referenced by ilSearchGUI::__addAction(), ilSearchresultGUI::__formatTitle(), ilSearchAdministrationGUI::__formatTitle(), ilObjChatGUI::__showActiveUsers(), ilObjUserFolderGUI::__showAppliedUsersTable(), ilObjCourseGUI::__showArchivesAdminTable(), ilObjCourseGUI::__showArchivesTable(), ilObjRoleGUI::__showAssignedUsersTable(), ilObjectGUI::__showClipboardTable(), ilObjCourseGUI::__showDeleteMembersTable(), ilObjCourseGUI::__showDeleteSubscriberTable(), ilObjCourseGUI::__showEditMemberTable(), ilSearchAdministrationGUI::__showFolders(), ilSearchAdministrationGUI::__showHeader(), ilCourseContentInterface::__showHideLinks(), ilPaymentShoppingCartGUI::__showItemsTable(), ilObjiLincCourseGUI::__showMembersTable(), ilObjCourseGUI::__showMembersTable(), ilObjGroupGUI::__showMembersTable(), ilObjExerciseGUI::__showMembersTable(), ilCourseContentInterface::__showObjectives(), ilObjectStatusGUI::__showObjectSummaryTable(), ilObjChatGUI::__showOnlineUsers(), ilCourseContentInterface::__showOtherResources(), ilObjCourseGUI::__showRemoveFromWaitingListTable(), ilObjUserGUI::__showRolesTable(), ilObjRoleFolderGUI::__showRolesTable(), ilObjCategoryGUI::__showRolesTable(), ilObjiLincCourseGUI::__showSearchGroupTable(), ilObjCourseGUI::__showSearchGroupTable(), ilObjRoleGUI::__showSearchGroupTable(), ilObjGroupGUI::__showSearchGroupTable(), ilAdvancedSearchGUI::__showSearchInResults(), ilSearchGUI::__showSearchInResults(), ilObjiLincCourseGUI::__showSearchRoleTable(), ilObjCourseGUI::__showSearchRoleTable(), ilObjRoleGUI::__showSearchRoleTable(), ilObjGroupGUI::__showSearchRoleTable(), ilPaymentTrusteeGUI::__showSearchUserTable(), ilObjPaymentSettingsGUI::__showSearchUserTable(), ilObjiLincCourseGUI::__showSearchUserTable(), ilObjCourseGUI::__showSearchUserTable(), ilObjRoleGUI::__showSearchUserTable(), ilObjGroupGUI::__showSearchUserTable(), ilObjCourseGUI::__showSubscribersTable(), ilPaymentTrusteeGUI::__showTrusteesTable(), ilObjCategoryGUI::__showUsersTable(), ilObjPaymentSettingsGUI::__showVendorsTable(), ilObjCourseGUI::__showWaitingListTable(), ilObjQuestionPoolGUI::_deleteQuestionsObject(), ilConditionHandlerInterface::add(), ilSearchResultPresentationGUI::addHeaderRow(), ilPersonalDesktopGUI::addHeaderRow(), ilContainerGUI::addHeaderRow(), ilPaymentObjectGUI::addPrice(), ilPersonalDesktopGUI::addStandardRow(), ilObjRoleGUI::askDeleteDesktopItemObject(), ilObjCourseGUI::askDeleteGroupingObject(), ilObjLinkResourceGUI::askDeleteItemsObject(), ilCourseObjectivesGUI::askDeleteLM(), ilCourseObjectivesGUI::askDeleteObjective(), ilObjChatGUI::askDeleteRecordingsObject(), ilCourseObjectivesGUI::assignChapterSelect(), ilCourseObjectivesGUI::assignLMSelect(), ilCourseObjectivesGUI::assignQuestionSelect(), ilCourseObjectivesGUI::assignTestSelect(), ilObjChatGUI::blockedUsersObject(), ilCourseContentInterface::cci_edit(), ilCourseContentInterface::cci_start_objects(), ilCourseContentInterface::cci_view(), ilObjiLincCourseGUI::changeMemberObject(), ilObjGroupGUI::changeMemberObject(), ilObjContentObjectGUI::chapters(), ilObjiLincCourseGUI::confirmationObject(), ilObjGroupGUI::confirmationObject(), ilObjGlossaryGUI::confirmDeleteExportFile(), ilObjContentObjectGUI::confirmDeleteExportFile(), ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject(), ilObjSurveyGUI::confirmDeleteExportFileObject(), ilObjUserFolderGUI::confirmDeleteExportFileObject(), ilObjTestGUI::confirmDeleteExportFileObject(), ilObjQuestionPoolGUI::confirmDeleteExportFileObject(), ilObjMediaPoolGUI::confirmRemove(), ilObjGlossaryGUI::confirmTermDeletion(), ilRepositoryGUI::copyChilds(), ilObjForumGUI::createObject(), ilObjContentObjectGUI::delete(), ilBookmarkAdministrationGUI::delete(), ilObjStyleSheetGUI::deleteObject(), ilObjectGUI::deleteObject(), ilObjQuestionPoolGUI::deleteQuestionsObject(), ilObjStyleSheetFolderGUI::deleteStyleObject(), ilObjStyleSettingsGUI::deleteStyleObject(), ilObjExerciseGUI::deliverObject(), ilObjCourseGUI::detailsObject(), ilPersonalDesktopGUI::displayBookmarks(), ilPersonalDesktopGUI::displayUsersOnline(), ilObjCourseGroupingGUI::edit(), ilPCTableGUI::edit(), ilObjUserFolderGUI::editAppliedUsersObject(), ilPaymentObjectGUI::editDetails(), ilObjMediaObjectGUI::editFilesObject(), ilObjLinkResourceGUI::editItemObject(), ilObjLinkResourceGUI::editItemsObject(), ilObjMediaObjectGUI::editMapAreasObject(), ilObjCourseGUI::editObject(), ilObjTypeDefinitionGUI::editObject(), ilObjForumGUI::editObject(), ilPaymentObjectGUI::editPrices(), ASS_ImagemapQuestionGUI::editQuestion(), ilCourseObjectivesGUI::editQuestionAssignment(), ilPaymentStatisticGUI::editStatistic(), ilObjPaymentSettingsGUI::editStatisticObject(), ilObjPaymentSettingsGUI::editVendor(), ilObjSurveyGUI::evaluationObject(), exercise(), ilObjGlossary::exportHTML(), ilObjContentObject::exportHTML(), ilObjGlossaryGUI::exportList(), ilObjContentObjectGUI::exportList(), ilObjSurveyQuestionPoolGUI::exportObject(), ilObjSurveyGUI::exportObject(), ilObjUserFolderGUI::exportObject(), ilObjTestGUI::exportObject(), ilObjQuestionPoolGUI::exportObject(), ilSCORMPresentationGUI::finishSahs(), ilForumExplorer::formatHeader(), ilSCORMExplorer::formatObject(), ilHACPExplorer::formatObject(), ilPublicSectionSelector::formatObject(), ilAICCExplorer::formatObject(), ilForumExplorer::formatObject(), ilFileExplorer::formatObject(), ilObjPaymentSettingsGUI::generalSettingsObject(), ilLMTOCExplorer::getImage(), ilTableOfContentsExplorer::getImage(), ilExplorer::getImage(), ilSCORMExplorer::getOutputIcons(), ilObjSurvey::getQuestionblocksTable(), ilObjSurveyQuestionPool::getQuestionsTable(), ilObjSurvey::getQuestionsTable(), ilObjQuestionPool::getQuestionsTable(), ilLMPresentationGUI::ilLMNavigation(), ilLMPresentationGUI::ilMedia(), ilObjectListGUI::insertPayment(), ilObjUserGUI::insertPublicProfile(), ilSCORMPresentationGUI::launchSahs(), ilHACPPresentationGUI::launchSahs(), ilAICCPresentationGUI::launchSahs(), ilObjContentObjectGUI::linkChecker(), ilObjLinkResourceGUI::linkCheckerObject(), ilCourseObjectivesGUI::listAssignedLM(), ilCourseObjectivesGUI::listAssignedQuestions(), ilConditionHandlerInterface::listConditions(), ilObjRoleGUI::listDesktopItemsObject(), ilFileSystemGUI::listFiles(), ilObjCourseGUI::listGroupingsObject(), ilObjMediaPoolGUI::listMedia(), ilCourseObjectivesGUI::listObjectives(), ilObjCourseGUI::listStructureObject(), ilObjAssessmentFolderGUI::logsObject(), ilObjTestGUI::marksObject(), ilGlossaryPresentationGUI::media(), ilObjCourseGroupingGUI::otherSelectAssign(), ilObjTestGUI::outEvalSearchResultTable(), ilObjTestGUI::outIntroductionPage(), ilObjTestGUI::outShowAnswersDetails(), ilObjTestGUI::outTestResults(), ilObjTestGUI::outTestSummary(), ilObjSurveyGUI::outUserGroupTable(), ilObjTestGUI::outUserGroupTable(), ASS_OrderingQuestionGUI::outUserSolution(), ASS_MultipleChoiceGUI::outUserSolution(), ASS_MatchingQuestionGUI::outUserSolution(), ASS_ClozeTestGUI::outUserSolution(), ilObjTestGUI::outWorkingForm(), ilObjContentObjectGUI::pages(), ilObjPaymentSettingsGUI::payMethodsObject(), ilObjRoleTemplateGUI::permObject(), ilObjRoleGUI::permObject(), ilObjSurveyQuestionPoolGUI::phrasesObject(), ilSearchresultGUI::prepareOutput(), ilObjMediaPoolGUI::prepareOutput(), ilObjCourseGUI::printMembersObject(), ilObjContentObjectGUI::properties(), ilObjSurveyGUI::propertiesObject(), ilObjTestGUI::propertiesObject(), ilObjSurveyGUI::questionBrowser(), ilObjTestGUI::questionBrowser(), ilObjSurveyQuestionPoolGUI::questionsObject(), ilObjSurveyGUI::questionsObject(), ilObjTestGUI::questionsObject(), ilObjQuestionPoolGUI::questionsObject(), ilObjChatGUI::recordingsObject(), ilObjiLincClassroomGUI::removeClassroomObject(), ilTableGUI::render(), ilContainerGUI::renderObject(), ilObjSurveyGUI::searchQuestionsForm(), ilObjCourseGroupingGUI::selectCourse(), ilObjCourseGUI::selectStarterObject(), ilObjectGUIAdapter::setAdminTabs(), ilObjectGUI::setAdminTabs(), ilRepositoryGUI::setHeader(), ilStructureObjectGUI::setTabs(), ilObjContentObjectGUI::setTabs(), ilLMPageObjectGUI::setTabs(), ilMainMenuGUI::setTemplateVars(), ilObjContentObjectGUI::showActions(), ilLMObjectGUI::showActions(), ilObjUserFolderGUI::showActions(), ilObjStyleSheetFolderGUI::showActions(), ilObjStyleSettingsGUI::showActions(), ilObjectGUI::showActions(), ilPaymentBillAdminGUI::showBillData(), ilPurchaseBMFGUI::showCreditCard(), ilPurchaseBMFGUI::showDebitEntry(), ilPaymentPurchaseGUI::showDetails(), ilInternalLinkGUI::showLinkHelp(), ilObjMediaPoolGUI::showMedia(), ilObjGroupGUI::showNewRegistrationsObject(), ilPageObjectGUI::showPage(), ilPurchaseBMFGUI::showPaymentType(), ilPurchaseBMFGUI::showPersonalData(), ilLMPresentationGUI::showPrintView(), ilLMPresentationGUI::showPrintViewSelection(), ilCourseRegisterGUI::showRegistrationForm(), ilSearchresultGUI::showResults(), ilPaymentObjectGUI::showSelectedObject(), ilStructureObjectGUI::subchap(), ilObjQuestionPoolGUI::uploadQplObject(), ilObjTestGUI::uploadTstObject(), ilStructureObjectGUI::view(), ilEditClipboardGUI::view(), ilBookmarkAdministrationGUI::view(), ilObjExerciseGUI::viewObject(), and ilObjChatGUI::viewObject().
{
global $ilias, $styleDefinition;
if(defined("ILIAS_MODULE") and !defined("KEEP_IMAGE_PATH") and $mode != "filesystem")
{
// added to find path for MODULES like Services/Search
$base = '';
for($i = 1;$i < count(explode('/',ILIAS_MODULE));$i++)
{
$base .= "../";
}
$dir .= ($base.".");
}
else
{
$dir = "";
}
$base = "./";
if ($in_module)
{
$base.= ILIAS_MODULE."/";
}
$base .= "templates/";
if (is_object($styleDefinition))
{
$st_image_dir = $styleDefinition->getImageDirectory($ilias->account->prefs["style"]);
$user_skin_and_style = $base.$ilias->account->skin."/".
$st_image_dir.
"/images/".$img;
}
$user_skin = $base.$ilias->account->skin."/images/".$img;
$default = $base."default/images/".$img;
if ($offline)
{
return "./images/".$img;
}
else if (@file_exists($user_skin_and_style) && $st_image_dir != "")
{
return $dir.$user_skin_and_style;
}
else if (file_exists($user_skin))
{
return $dir.$user_skin;
}
return $dir.$default;
}
Here is the caller graph for this function:| ilUtil::getImageTagByType | ( | $ | a_type, | |
| $ | a_path, | |||
| $ | a_big = false | |||
| ) |
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Code to your template file public.
| string | object type | |
| string | tpl path |
Definition at line 43 of file class.ilUtil.php.
References $lng.
Referenced by ilObjiLincCourseGUI::confirmationObject(), ilObjGroupGUI::confirmationObject(), ilBookmarkAdministrationGUI::delete(), ilObjUserFolderGUI::deleteObject(), ilObjRoleFolderGUI::deleteObject(), ilObjectGUI::deleteObject(), ilObjTypeDefinitionGUI::displayList(), ilObjSystemFolderGUI::displayList(), ilObjObjectFolderGUI::displayList(), ilObjLanguageFolderGUI::displayList(), ilObjectGUI::displayList(), ilObjTypeDefinitionGUI::editObject(), ilObjiLincClassroomGUI::removeClassroomObject(), and ilObjectGUI::trashObject().
{
global $lng;
if ($a_big)
{
$big = "_b";
}
$filename = "icon_".$a_type."$big.gif";
return "<img src=\"".ilUtil::getImagePath($filename)."\" alt=\"".$lng->txt("obj_".$a_type)."\" title=\"".$lng->txt("obj_".$a_type)."\" border=\"0\" vspace=\"0\"/>";
//return "<img src=\"".$a_path."/images/"."icon_".$a_type."$big.gif\" alt=\"".$lng->txt("obj_".$a_type)."\" title=\"".$lng->txt("obj_".$a_type)."\" border=\"0\" vspace=\"0\"/>";
}
Here is the caller graph for this function:| ilUtil::getJavaPath | ( | ) |
get full java path (dir + java command)
Definition at line 1624 of file class.ilUtil.php.
Referenced by ilObjSCORMValidator::validateXML().
{
return PATH_TO_JAVA;
//global $ilias;
//return $ilias->getSetting("java_path");
}
Here is the caller graph for this function:| ilUtil::getJSPath | ( | $ | a_js | ) |
Definition at line 139 of file class.ilUtil.php.
References $ilias.
Referenced by ilPurchaseBMFGUI::__buildStylesheet(), ilPaymentPurchaseGUI::__buildStylesheet(), ilPaymentBaseGUI::__buildStylesheet(), ilObjAssessmentFolderGUI::logsObject(), ilObjSurveyGUI::propertiesObject(), ilObjTestGUI::propertiesObject(), and ilMainMenuGUI::setTemplateVars().
{
global $ilias;
if(defined("ILIAS_MODULE"))
{
$dir = ".";
}
else
{
$dir = "";
}
$in_style = "./templates/".$ilias->account->skin."/".$ilias->account->prefs["style"]."/".$a_js;
$default = "./templates/".$ilias->account->skin."/".$a_js;
if(@is_file($in_style))
{
return $dir.$in_style;
}
else
{
return $dir.$default;
}
}
Here is the caller graph for this function:| ilUtil::getMemString | ( | ) |
get current memory usage as string
Definition at line 2377 of file class.ilUtil.php.
{
$my_pid = getmypid();
return ("MEMORY USAGE (% KB PID ): ".`ps -eo%mem,rss,pid | grep $my_pid`);
}
| ilUtil::getObjectsByOperations | ( | $ | a_type, | |
| $ | a_operation, | |||
| $ | a_checkpath = true | |||
| ) |
Get all objects of a specific type and check access.
Get all objects of a specific type where access is granted for the given list of operations. This function does a checkAccess call for all objects in the object hierarchy and return only the objects of the given type. Please note if access is not granted to any object in the hierarchy the function skips all objects under it. Example: You want a list of all Courses that are visible and readable for the user. The function call would be: $your_list = IlUtil::GetObjectsByOperations ("crs", "visible,read"); Lets say there is a course A where the user would have access to according to his role assignments. Course A lies within a group object which is not readable for the user. Therefore course A won't appear in the result list although the queried operations 'visible' and 'read' would actually permit the user to access course A.
public
| string | object type | |
| string | permissions to check e.g. 'visible','read' | |
| boolean | if true, access of all parent nodes of each found object are checked too (default is true) |
Definition at line 462 of file class.ilUtil.php.
References $num, $path, $q, $rbacsystem, $row, and $tree.
Referenced by ilMainMenuGUI::_checkAdministrationPermission(), ilObjCourseGrouping::_getAllGroupings(), ilCronWebResourceCheck::check(), ilLOListGUI::displayList(), ilChatRoom::getAllRooms(), and ilObjCourseGroupingGUI::selectCourse().
{
global $ilDB, $rbacsystem, $tree;
$objects = array();
// return if root node ist not accessible
if ($a_checkpath === true and !$rbacsystem->checkAccess('read', ROOT_FOLDER_ID, $a_type))
{
return $objects;
}
// get all nodes of a_type that which are not deleted
$q = "SELECT * FROM tree ".
"LEFT JOIN object_reference ON tree.child=object_reference.ref_id ".
"LEFT JOIN object_data ON object_reference.obj_id=object_data.obj_id ".
"WHERE object_data.type = '".$a_type."' ".
"AND tree.tree = 1";
$r = $ilDB->query($q);
// check the desired operation of all found nodes
while ($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
if ($rbacsystem->checkAccess($a_operation, $row["ref_id"], $a_type))
{
$objects[] = $row;
}
}
// check access of nodes up in the tree for all accessible nodes
if ($a_checkpath === true)
{
$nodes_checked = array(ROOT_FOLDER_ID);
$nodes_passed = array(ROOT_FOLDER_ID);
foreach ($objects as $key => $node)
{
$path = $tree->getPathId($node["ref_id"],ROOT_FOLDER_ID);
array_push($nodes_checked,$node["ref_id"]);
array_push($nodes_passed,$node["ref_id"]);
if (($num = count($path)) > 2)
{
for ($i = 1; $i <= ($num - 2); $i++)
{
//echo "<br/>i:".$i;
if (in_array($path[$i],$nodes_passed))
{
//echo "<br/>".$i." already passed";
continue;
}
if (!in_array($path[$i],$nodes_checked))
{
array_push($nodes_checked,$path[$i]);
//echo "<br/>".$i." add to checked";
if ($rbacsystem->checkAccess($a_operation, $path[$i], $a_type))
{
array_push($nodes_passed,$path[$i]);
//echo "<br/>".$i." add to passed";
}
else
{
unset($objects[$key]);
// break for
break;
}
}
} // end for
} // end if $num
//var_dump("<pre>",$node["ref_id"],$path,$num,"</pre>");
} // end foreach
//var_dump("<pre>",$nodes_checked,$nodes_passed,"</pre>");
}
unset($nodes_checked);
unset($nodes_passed);
return $objects;
}
Here is the caller graph for this function:| ilUtil::getSelectName | ( | $ | selected, | |
| $ | values | |||
| ) |
???
public
| string | ||
| string |
Definition at line 260 of file class.ilUtil.php.
{
return($values[$selected]);
}
| ilUtil::getStyleSheetLocation | ( | $ | mode = "output" |
) |
get full style sheet file name (path inclusive) of current user
public
Definition at line 168 of file class.ilUtil.php.
References $ilias.
Referenced by ilPurchaseBMFGUI::__buildStylesheet(), ilPaymentPurchaseGUI::__buildStylesheet(), ilPaymentBaseGUI::__buildStylesheet(), ilObjChatGUI::__loadStylesheet(), ilObjChatGUIAdapter::__setStyleSheetLocation(), ilInternalLinkGUI::changeTargetObject(), ilPCParagraphGUI::edit(), ilSCORMPresentationGUI::explorer(), ilHACPPresentationGUI::explorer(), ilObjMediaPoolGUI::explorer(), ilObjFileBasedLMGUI::explorer(), ilObjContentObjectGUI::explorer(), ilAICCPresentationGUI::explorer(), ilLMPresentationGUI::exportbibinfo(), ilObjGlossary::exportHTML(), ilObjContentObject::exportHTML(), ilSCORMPresentationGUI::finishSahs(), ilLMPresentationGUI::glossary(), ilLMPresentationGUI::ilMedia(), ilLMPresentationGUI::ilTOC(), ilPCParagraphGUI::insert(), ilLMPresentationGUI::layout(), ilGlossaryPresentationGUI::media(), ilLMPresentationGUI::offlineexport(), ilInternalLinkGUI::selectRepositoryItem(), ilMainMenuGUI::setTemplateVars(), ilObjDlBookGUI::showAbstract(), ilObjDlBookGUI::showCitation(), ilLMPresentationGUI::showDownloadList(), ilWysiwygUtil::showFootnote(), ilWysiwygUtil::showItl(), ilInternalLinkGUI::showLinkHelp(), ilObjMediaPoolGUI::showMedia(), ilPageObjectGUI::showMediaFullscreen(), ilWysiwygUtil::showMoveCopyQuestion(), ilLMPresentationGUI::showPrintViewSelection(), ilLMPresentationGUI::showTableOfContents(), ilRepositoryGUI::showTree(), ilWysiwygUtil::showXtl(), ilSCORMPresentationGUI::unloadSahs(), ilSCORMPresentationGUI::view(), and ilAICCPresentationGUI::view().
{
global $ilias;
if(defined("ILIAS_MODULE") && $mode != "filesystem")
{
// added to find Stylesheet for MODULES like Services/Search
$base = '';
for($i = 0;$i < count(explode('/',ILIAS_MODULE));$i++)
{
$base .= "../";
}
}
else
{
$base = "./";
}
return $base."templates/".$ilias->account->skin."/".$ilias->account->prefs["style"].".css";
}
Here is the caller graph for this function:| ilUtil::getUsersOnline | ( | $ | a_user_id = 0 |
) |
reads all active sessions from db and returns users that are online OR returns only one active user if a user_id is given
| integer | user_id (optional) |
Definition at line 1113 of file class.ilUtil.php.
References $ilias, $q, $user, and $users.
Referenced by ilObjRole::_updateSessionRoles(), ilObjUserGUI::activeRoleSaveObject(), ilPersonalDesktopGUI::displayUsersOnline(), ilObjUserGUI::editObject(), ilChatRoom::getOnlineUsers(), and ilObjUser::updateActiveRoles().
{
global $ilias;
if ($a_user_id == 0)
{
$where = "WHERE user_id != 0";
}
else
{
$where = "WHERE user_id = '".$a_user_id."'";
}
$q = "SELECT count(user_id) as num,user_id,data,firstname,lastname,title,login,last_login FROM usr_session ".
"LEFT JOIN usr_data ON user_id=usr_id ".$where.
" AND expires>UNIX_TIMESTAMP() ".
"GROUP BY user_id ".
"ORDER BY lastname, firstname";
$r = $ilias->db->query($q);
while ($user = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
$users[$user["user_id"]] = $user;
}
return $users ? $users : array();
}
Here is the caller graph for this function:| ilUtil::getWebspaceDir | ( | $ | mode = "filesystem" |
) |
get webspace directory
| string | $mode use "filesystem" for filesystem operations and "output" for output operations, e.g. images |
Definition at line 1072 of file class.ilUtil.php.
References $ilias.
Referenced by ilObjMediaObject::_createThumbnailDirectory(), ilObjMediaObject::_getDirectory(), ilUserAgreement::_getText(), ilObjMediaObject::_getThumbnailDirectory(), ilObjUser::_uploadPersonalPicture(), ilObjMediaObjectGUI::assignFullscreenObject(), ilObjMediaObjectGUI::assignStandardObject(), ilContObjParser::copyMobFiles(), ilObjSAHSLearningModule::createDataDirectory(), ilObjMediaObjectGUI::createDirectoryObject(), ilObjUserFolder::createXMLExport(), ilObjStyleSheet::delete(), ilObjMediaObjectGUI::deleteFileObject(), ilPersonalDesktopGUI::displayUsersOnline(), ilObjMediaObjectGUI::editFilesObject(), ilObjMediaObjectGUI::editMapArea(), ilObjMediaObjectGUI::editMapAreasObject(), ilObjMediaObject::exportFiles(), ilObjGlossary::exportHTMLMOB(), ilObjContentObject::exportHTMLMOB(), ilObjStyleSheet::getContentStylePath(), ilObjSAHSLearningModule::getDataDirectory(), ilObjFileBasedLM::getDataDirectory(), ilObjMediaObject::getDataDirectory(), ilFileDataCourse::getOnlineLink(), ilLMPresentationGUI::ilMedia(), ilObjUserGUI::insertPublicProfile(), ilGlossaryPresentationGUI::media(), removePicture(), ilObjMediaPoolGUI::showMedia(), ilPageObjectGUI::showMediaFullscreen(), ilPageObjectGUI::showPage(), ilLMPresentationGUI::showPrintView(), upload_file(), ilObjMediaObjectGUI::uploadFileObject(), ilObjLanguageFolderGUI::viewObject(), and ilObjStyleSheet::writeCSSFile().
{
global $ilias;
if ($mode == "filesystem")
{
return "./".ILIAS_WEB_DIR."/".$ilias->client_id;
}
else
{
if (defined("ILIAS_MODULE"))
{
return "../".ILIAS_WEB_DIR."/".$ilias->client_id;
}
else
{
return "./".ILIAS_WEB_DIR."/".$ilias->client_id;
}
}
//return $ilias->ini->readVariable("server","webspace_dir");
}
Here is the caller graph for this function:| ilUtil::groupNameExists | ( | $ | a_group_name, | |
| $ | a_id = 0 | |||
| ) |
checks if group name already exists.
Groupnames must be unique for mailing purposes static function public
| string | groupname | |
| integer | obj_id of group to exclude from the check. |
Definition at line 2314 of file class.ilUtil.php.
Referenced by ilMail::checkRecipients(), ilObjGroup::ilClone(), ilObjGroupGUI::saveObject(), and ilObjGroupGUI::updateObject().
{
global $ilDB,$ilErr;
if (empty($a_group_name))
{
$message = get_class($this)."::_NameExists(): No groupname given!";
$ilErr->raiseError($message,$ilErr->WARNING);
}
$clause = ($a_id) ? " AND obj_id != '".$a_id."'" : "";
$q = "SELECT obj_id FROM object_data ".
"WHERE title = '".addslashes($a_group_name)."' ".
"AND type = 'grp'".
$clause;
$r = $ilDB->query($q);
if ($r->numRows() == 1)
{
return true;
}
else
{
return false;
}
}
Here is the caller graph for this function:| ilUtil::html2pdf | ( | $ | html, | |
| $ | pdf_file | |||
| ) |
produce pdf out of html with htmldoc
| html | String HTML-Data given to create pdf-file | |
| pdf_file | String Filename to save pdf in |
Definition at line 1408 of file class.ilUtil.php.
References escapeShellArg().
Referenced by ilPurchaseBMFGUI::__sendBill(), and ilLMPresentationGUI::offlineexport().
{
//global $ilias;
$html_file = str_replace(".pdf",".html",$pdf_file);
$fp = fopen( $html_file ,"wb");
fwrite($fp, $html);
fclose($fp);
$htmldoc_path = PATH_TO_HTMLDOC;
//$htmldoc_path = $ilias->getSetting("htmldoc_path");
$htmldoc = $htmldoc_path." ";
$htmldoc .= "--no-toc ";
$htmldoc .= "--no-jpeg ";
$htmldoc .= "--webpage ";
$htmldoc .= "--outfile " . ilUtil::escapeShellArg($pdf_file) . " ";
$htmldoc .= "--bodyfont Arial ";
$htmldoc .= "--charset iso-8859-15 ";
$htmldoc .= "--color ";
$htmldoc .= "--size A4 "; // --landscape
$htmldoc .= "--format pdf ";
$htmldoc .= "--footer ... ";
$htmldoc .= "--header ... ";
$htmldoc .= "--left 60 ";
// $htmldoc .= "--right 200 ";
$htmldoc .= $html_file;
exec($htmldoc);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::ilTempnam | ( | ) |
Create a temporary file in an ILIAS writable directory.
Definition at line 1218 of file class.ilUtil.php.
References createDirectory(), and getDataDir().
Referenced by ilFileDataExercise::downloadAllDeliveredFiles(), ilExerciseMembers::downloadMultipleFiles(), ilImagemapPreview::ilImagemapPreview(), and ilUserImportParser::saveTempImage().
{
$temp_path = ilUtil::getDataDir() . "/temp";
if (!is_dir($temp_path))
{
ilUtil::createDirectory($temp_path);
}
$temp_name = tempnam($temp_path, "tmp");
// --->
// added the following line because tempnam creates a backslash on some
// Windows systems which leads to problems, because the "...\tmp..." can be
// interpreted as "...{TAB-CHARACTER}...". The normal slash works fine
// even under windows (Helmut Schottmüller, 2005-08-31)
$temp_name = str_replace("\\", "/", $temp_name);
// --->
unlink($temp_name);
return $temp_name;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::insertInstIntoID | ( | $ | a_value | ) |
inserts installation id into ILIAS id
e.g. "il__pg_3" -> "il_43_pg_3"
Definition at line 2296 of file class.ilUtil.php.
Referenced by ilObjMediaObject::modifyExportIdentifier(), ilObjTest::modifyExportIdentifier(), and ilObjQuestionPool::modifyExportIdentifier().
{
if (substr($a_value, 0, 4) == "il__")
{
$a_value = "il_".IL_INST_ID."_".substr($a_value, 4, strlen($a_value) - 4);
}
return $a_value;
}
Here is the caller graph for this function:| ilUtil::is_email | ( | $ | a_email | ) |
Definition at line 895 of file class.ilUtil.php.
Referenced by ilSoapUserAdministration::__validateUserData(), ilSetup::checkClientContact(), ilMail::checkRecipients(), ilObjSystemFolderGUI::displayBasicSettings(), ilSetupGUI::displayContactData(), ilMail::getEmailOfSender(), saveForm(), ilObjUserGUI::saveObject(), ilObjUserGUI::updateObject(), and ilObjCourse::validate().
{
return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)|(([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));
}
Here is the caller graph for this function:| ilUtil::isAPICall | ( | ) |
Definition at line 2516 of file class.ilUtil.php.
Referenced by ilRepositoryGUI::ilRepositoryGUI().
{
return strpos($_SERVER["SCRIPT_FILENAME"],"api") !== false ||
strpos($_SERVER["SCRIPT_FILENAME"],"dummy") !== false;
}
Here is the caller graph for this function:| ilUtil::isDN | ( | $ | a_str | ) |
Definition at line 2766 of file class.ilUtil.php.
Referenced by ilRADIUSAuthentication::_validateServers(), and ilObjExternalToolsSettingsGUI::saveiLincObject().
{
return(preg_match("/^[a-z]+([a-z0-9-]*[a-z0-9]+)?(\.([a-z]+([a-z0-9-]*[a-z0-9]+)?)+)*$/",$a_str));
}
Here is the caller graph for this function:| ilUtil::isIPv4 | ( | $ | a_str | ) |
Definition at line 2772 of file class.ilUtil.php.
Referenced by ilRADIUSAuthentication::_validateServers(), and ilObjExternalToolsSettingsGUI::saveiLincObject().
{
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])\.(\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));
}
Here is the caller graph for this function:| ilUtil::isLogin | ( | $ | a_login | ) |
Definition at line 934 of file class.ilUtil.php.
Referenced by ilSoapUserAdministration::__validateUserData(), saveForm(), ilObjUserGUI::saveObject(), and ilObjUserGUI::updateObject().
{
if (empty($a_login))
{
return false;
}
if (strlen($a_login) < 4)
{
return false;
}
if (!ereg("^[A-Za-z0-9_\.\+-\*\@!\$\%\~]+$", $a_login))
{
return false;
}
return true;
}
Here is the caller graph for this function:| ilUtil::isPassword | ( | $ | a_passwd | ) |
Definition at line 906 of file class.ilUtil.php.
Referenced by ilSoapUserAdministration::__validateUserData(), change_password(), saveForm(), ilObjUserGUI::saveObject(), submitAssignPasswordForm(), ilObjUserGUI::updateObject(), and ilObjGroupGUI::updateObject().
{
if (empty($a_passwd))
{
return false;
}
if (strlen($a_passwd) < 6)
{
return false;
}
// due to bug in php does not work
//if (!ereg("^[A-Za-z0-9_\.\+\-\*\@!\$\%\~]+$", $a_passwd))
if (!preg_match("/^[A-Za-z0-9_\.\+\?\#\-\*\@!\$\%\~]+$/", $a_passwd))
{
return false;
}
return true;
}
Here is the caller graph for this function:| ilUtil::isWindows | ( | ) |
check wether the current client system is a windows system
Definition at line 2386 of file class.ilUtil.php.
Referenced by escapeShellArg().
{
if (strtolower(substr(php_uname(), 0, 3)) == "win")
{
return true;
}
return false;
}
Here is the caller graph for this function:| ilUtil::KT_replaceParam | ( | $ | qstring, | |
| $ | paramName, | |||
| $ | paramValue | |||
| ) |
Definition at line 2521 of file class.ilUtil.php.
Referenced by replaceUrlParameterString().
{
if (preg_match("/&" . $paramName . "=/", $qstring)) {
return preg_replace("/&" . $paramName . "=[^&]+/", "&" . $paramName . "=" . urlencode($paramValue), $qstring);
} else {
return $qstring . "&" . $paramName . "=" . urlencode($paramValue);
}
}
Here is the caller graph for this function:| ilUtil::Linkbar | ( | $ | AScript, | |
| $ | AHits, | |||
| $ | ALimit, | |||
| $ | AOffset, | |||
| $ | AParams = array(), |
|||
| $ | ALayout = array() | |||
| ) |
Linkbar Diese Funktion erzeugt einen typischen Navigationsbalken mit "Previous"- und "Next"-Links und den entsprechenden Seitenzahlen.
die komplette LinkBar wird zur?ckgegeben der Variablenname f?r den offset ist "offset"
public
| integer | Name der Skriptdatei (z.B. test.php) | |
| integer | Anzahl der Elemente insgesamt | |
| integer | Anzahl der Elemente pro Seite | |
| integer | Das aktuelle erste Element in der Liste | |
| array | Die zu ?bergebenen Parameter in der Form $AParams["Varname"] = "Varwert" (optional) | |
| array | layout options (all optional) link => css name for -tag prev => value for 'previous page' (default: '<<') next => value for 'next page' (default: '>>') |
Definition at line 590 of file class.ilUtil.php.
References $params.
Referenced by ilTableGUI::render(), and ilObjForumGUI::showThreadsObject().
{
$LinkBar = "";
$layout_link = "";
$layout_prev = "<<";
$layout_next = ">>";
// layout options
if (count($ALayout > 0))
{
if ($ALayout["link"])
{
$layout_link = " class=\"".$ALayout["link"]."\"";
}
if ($ALayout["prev"])
{
$layout_prev = $ALayout["prev"];
}
if ($ALayout["next"])
{
$layout_next = $ALayout["next"];
}
}
// Wenn Hits gr?sser Limit, zeige Links an
if ($AHits > $ALimit)
{
if (!empty($AParams))
{
foreach ($AParams as $key => $value)
{
$params.= $key."=".$value."&";
}
}
// if ($params) $params = substr($params,0,-1);
$link = $AScript."?".$params."offset=";
// ?bergehe "zurck"-link, wenn offset 0 ist.
if ($AOffset >= 1)
{
$prevoffset = $AOffset - $ALimit;
$LinkBar .= "<a".$layout_link." href=\"".$link.$prevoffset."\">".$layout_prev." </a>";
}
// Ben?tigte Seitenzahl kalkulieren
$pages=intval($AHits/$ALimit);
// Wenn ein Rest bleibt, addiere eine Seite
if (($AHits % $ALimit))
$pages++;
// Bei Offset = 0 keine Seitenzahlen anzeigen : DEAKTIVIERT
// if ($AOffset != 0) {
// ansonsten zeige Links zu den anderen Seiten an
for ($i = 1 ;$i <= $pages ; $i++)
{
$newoffset=$ALimit*($i-1);
if ($newoffset == $AOffset)
{
$LinkBar .= "<font color='Gray'>[<b>".$i."</b>]</font> ";
}
else
{
$LinkBar .= "[<a".$layout_link." href=\"".$link.$newoffset."\">$i</a>] ";
}
}
// }
// Checken, ob letze Seite erreicht ist
// Wenn nicht, gebe einen "Weiter"-Link aus
if (! ( ($AOffset/$ALimit)==($pages-1) ) && ($pages!=1) )
{
$newoffset=$AOffset+$ALimit;
$LinkBar .= "<a".$layout_link." href=\"".$link.$newoffset."\"> ".$layout_next."</a>";
}
return $LinkBar;
}
else
{
return false;
}
}
Here is the caller graph for this function:| ilUtil::makeClickable | ( | $ | a_text | ) |
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
public
| string | $text: Der Text |
Definition at line 687 of file class.ilUtil.php.
{
// URL mit ://-Angabe
$ret = eregi_replace("([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=-])",
"<a href=\"\\1://\\2\\3\" target=\"_blank\">\\1://\\2\\3</a>", $a_text);
// www-URL ohne ://-Angabe
$ret = eregi_replace("([[:space:]]+)(www\.)([[:alnum:]#?/&=\.-]+)",
"\\1<a href=\"http://\\2\\3\" target=\"_blank\">\\2\\3</a>", $ret);
// ftp-URL ohne ://-Angabe
$ret = eregi_replace("([[:space:]]+)(ftp\.)([[:alnum:]#?/&=\.-]+)",
"\\1<a href=\"ftp://\\2\\3\" target=\"_blank\">\\2\\3</a>", $ret);
// E-Mail
$ret = eregi_replace("(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))",
"<a href=\"mailto:\\1\">\\1</a>", $ret);
return($ret);
}
| ilUtil::makeDateSelect | ( | $ | prefix, | |
| $ | year = "", |
|||
| $ | month = "", |
|||
| $ | day = "", |
|||
| $ | startyear = "" | |||
| ) |
Creates a combination of HTML selects for date inputs.
Creates a combination of HTML selects for date inputs The select names are $prefix[y] for years, $prefix[m] for months and $prefix[d] for days.
public
| string | $prefix Prefix of the select name | |
| integer | $year Default value for year select | |
| integer | $month Default value for month select | |
| integer | $day Default value for day select |
Definition at line 753 of file class.ilUtil.php.
References $lng.
Referenced by ilObjAssessmentFolderGUI::logsObject(), ilObjSurveyGUI::propertiesObject(), and ilObjTestGUI::propertiesObject().
{
global $lng;
if (!strlen("$year$month$day")) {
$now = getdate();
$year = $now["year"];
$month = $now["mon"];
$day = $now["mday"];
} else {
// delete leading zeros
$year = (int)$year;
$month = (int)$month;
$day = (int)$day;
}
// build day select
$sel_day .= "<select name=\"".$prefix."[d]\" id=\"".$prefix."_d\">\n";
for ($i = 1; $i <= 31; $i++)
{
$sel_day .= "<option value=\"$i\">" . sprintf("%02d", $i) . "</option>\n";
}
$sel_day .= "</select>\n";
$sel_day = preg_replace("/(value\=\"$day\")/", "$1 selected=\"selected\"", $sel_day);
// build month select
$sel_month .= "<select name=\"".$prefix."[m]\" id=\"".$prefix."_m\">\n";
for ($i = 1; $i <= 12; $i++)
{
$sel_month .= "<option value=\"$i\">" . $lng->txt("month_" . sprintf("%02d", $i) . "_long") . "</option>\n";
}
$sel_month .= "</select>\n";
$sel_month = preg_replace("/(value\=\"$month\")/", "$1 selected=\"selected\"", $sel_month);
// build year select
$sel_year .= "<select name=\"".$prefix."[y]\" id=\"".$prefix."_y\">\n";
if ((strlen($startyear) == 0) || ($startyear > $year))
{
$startyear = $year;
}
for ($i = $startyear; $i <= $year + 3; $i++)
{
$sel_year .= "<option value=\"$i\">" . sprintf("%04d", $i) . "</option>\n";
}
$sel_year .= "</select>\n";
$sel_year = preg_replace("/(value\=\"$year\")/", "$1 selected=\"selected\"", $sel_year);
$dateformat = $lng->text["lang_dateformat"];
$dateformat = strtolower(preg_replace("/\W/", "", $dateformat));
$dateformat = strtolower(preg_replace("/(\w)/", "%%$1", $dateformat));
$dateformat = preg_replace("/%%d/", $sel_day, $dateformat);
$dateformat = preg_replace("/%%m/", $sel_month, $dateformat);
$dateformat = preg_replace("/%%y/", $sel_year, $dateformat);
return $dateformat;
}
Here is the caller graph for this function:| ilUtil::makeDir | ( | $ | a_dir | ) |
creates a new directory and inherits all filesystem permissions of the parent directory You may pass only the name of your new directory or with the entire path or relative path information.
examples: a_dir = /tmp/test/your_dir a_dir = ../test/your_dir a_dir = your_dir (--> creates your_dir in current directory)
public
| string | [path] + directory name |
Definition at line 1659 of file class.ilUtil.php.
References $path.
Referenced by ilFileDataCourse::__checkPath(), ilFileDataChat::__createDirectory(), ilFileDataCourse::__initDirectory(), ilFileDataExercise::__initDirectory(), ilPurchaseBMFGUI::__sendBill(), ilObjTest::_createImportDirectory(), ilObjQuestionPool::_createImportDirectory(), ilFileDataImportMail::_initDirectory(), ilFileDataImportGroup::_initDirectory(), ilFileDataImportForum::_initDirectory(), ilFileDataImport::_initDirectory(), ilFileDataCourse::addDirectory(), ilGlossaryExport::buildExportFileXML(), ilContObjectExport::buildExportFileXML(), ilTestExport::buildExportFileXML(), ilQuestionpoolExport::buildExportFileXML(), ilTestExport::buildExportResultFile(), ilContObjParser::copyFileItems(), ilContObjParser::copyMobFiles(), ilClient::create(), ilObjSAHSLearningModule::createDataDirectory(), ilObjFileBasedLM::createDataDirectory(), createDirectory(), ilObjFile::createDirectory(), ilFileSystemGUI::createDirectory(), ilObjMediaObjectGUI::createDirectoryObject(), ilObjSurveyQuestionPool::createExportDirectory(), ilObjSurvey::createExportDirectory(), ilObjGlossary::createExportDirectory(), ilObjContentObject::createExportDirectory(), ilObjUserFolder::createExportDirectory(), ilObjTest::createExportDirectory(), ilObjQuestionPool::createExportDirectory(), ilObjSurveyQuestionPool::createImportDirectory(), ilObjSurvey::createImportDirectory(), ilObjGlossary::createImportDirectory(), ilObjContentObject::createImportDirectory(), ilObjTest::createImportDirectory(), ilFileDataCourse::createOnlineVersion(), ilFileDataExercise::deliverFile(), ilObjFile::export(), ilObjMediaObject::exportFiles(), ilObjGlossary::exportHTML(), ilObjContentObject::exportHTML(), ilObjGlossary::exportHTMLFile(), ilObjContentObject::exportHTMLFile(), ilObjGlossary::exportHTMLMOB(), ilObjContentObject::exportHTMLMOB(), ilObjContentObject::exportSCORM(), ilObjFile::getUploadFile(), ilObjUserFolderGUI::importUserRoleAssignmentObject(), rCopy(), and ilSetup::saveMasterSetup().
{
$a_dir = trim($a_dir);
// remove trailing slash (bugfix for php 4.2.x)
if (substr($a_dir,-1) == "/")
{
$a_dir = substr($a_dir,0,-1);
}
// check if a_dir comes with a path
if (!($path = substr($a_dir,0, strrpos($a_dir,"/") - strlen($a_dir))))
{
$path = ".";
}
// create directory with file permissions of parent directory
umask(0000);
return @mkdir($a_dir,fileperms($path));
}
Here is the caller graph for this function:| ilUtil::makeDirParents | ( | $ | a_dir | ) |
Create a new directory and all parent directories.
Creates a new directory and inherits all filesystem permissions of the parent directory If the parent directories doesn't exist, they will be created recursively. The directory name NEEDS TO BE an absolute path, because it seems that relative paths are not working with PHP's file_exists function.
| string | $a_dir The directory name to be created public |
Definition at line 1693 of file class.ilUtil.php.
Referenced by ASS_JavaApplet::duplicateApplet(), ASS_ImagemapQuestion::duplicateImage(), ASS_OrderingQuestion::duplicateImages(), ASS_MatchingQuestion::duplicateImages(), SurveyQuestion::duplicateMaterials(), ASS_OrderingQuestion::from_xml(), ASS_MatchingQuestion::from_xml(), ASS_JavaApplet::from_xml(), ASS_ImagemapQuestion::from_xml(), ilObjUserFolderGUI::getImportDir(), ilObjSurvey::getImportDirectory(), ilLMPresentationGUI::handleCodeParagraph(), ilQTIParser::handlerParseEndTag(), ASS_OrderingQuestion::set_image_file(), ASS_MatchingQuestion::set_image_file(), ASS_ImagemapQuestion::set_image_filename(), ASS_JavaApplet::setJavaAppletFilename(), and SurveyQuestion::setMaterialsfile().
{
$dirs = array($a_dir);
$a_dir = dirname($a_dir);
$last_dirname = '';
while($last_dirname != $a_dir)
{
array_unshift($dirs, $a_dir);
$last_dirname = $a_dir;
$a_dir = dirname($a_dir);
}
// find the first existing dir
$reverse_paths = array_reverse($dirs, TRUE);
$found_index = -1;
foreach ($reverse_paths as $key => $value)
{
if ($found_index == -1)
{
if (is_dir($value))
{
$found_index = $key;
}
}
}
umask(0000);
foreach ($dirs as $dirindex => $dir)
{
// starting with the longest existing path
if ($dirindex >= $found_index)
{
if (! file_exists($dir))
{
if (! mkdir($dir, $umask))
{
error_log("Can't make directory: $dir");
return false;
}
}
elseif (! is_dir($dir))
{
error_log("$dir is not a directory");
return false;
}
else
{
// get umask of the last existing parent directory
$umask = fileperms($dir);
}
}
}
return true;
}
Here is the caller graph for this function:| ilUtil::makeTimeSelect | ( | $ | prefix, | |
| $ | short = true, |
|||
| $ | hour = "", |
|||
| $ | minute = "", |
|||
| $ | second = "" | |||
| ) |
Creates a combination of HTML selects for time inputs.
Creates a combination of HTML selects for time inputs. The select names are $prefix[h] for hours, $prefix[m] for minutes and $prefix[s] for seconds.
public
| string | $prefix Prefix of the select name | |
| boolean | $short Set TRUE for a short time input (only hours and minutes). Default is TRUE | |
| integer | $hour Default hour value | |
| integer | $minute Default minute value | |
| integer | $second Default second value |
Definition at line 827 of file class.ilUtil.php.
References $lng.
Referenced by ilObjAssessmentFolderGUI::logsObject(), ASS_TextQuestionGUI::outOtherQuestionData(), ASS_OrderingQuestionGUI::outOtherQuestionData(), ASS_MultipleChoiceGUI::outOtherQuestionData(), ASS_MatchingQuestionGUI::outOtherQuestionData(), ASS_JavaAppletGUI::outOtherQuestionData(), ASS_ImagemapQuestionGUI::outOtherQuestionData(), ASS_ClozeTestGUI::outOtherQuestionData(), and ilObjTestGUI::propertiesObject().
{
global $lng;
if (!strlen("$hour$minute$second")) {
$now = localtime();
$hour = $now[2];
$minute = $now[1];
$second = $now[0];
} else {
$hour = (int)$hour;
$minute = (int)$minute;
$second = (int)$second;
}
// build hour select
$sel_hour .= "<select name=\"".$prefix."[h]\" id=\"".$prefix."_h\">\n";
for ($i = 0; $i <= 23; $i++)
{
$sel_hour .= "<option value=\"$i\">" . sprintf("%02d", $i) . "</option>\n";
}
$sel_hour .= "</select>\n";
$sel_hour = preg_replace("/(value\=\"$hour\")/", "$1 selected=\"selected\"", $sel_hour);
// build minutes select
$sel_minute .= "<select name=\"".$prefix."[m]\" id=\"".$prefix."_m\">\n";
for ($i = 0; $i <= 59; $i++)
{
$sel_minute .= "<option value=\"$i\">" . sprintf("%02d", $i) . "</option>\n";
}
$sel_minute .= "</select>\n";
$sel_minute = preg_replace("/(value\=\"$minute\")/", "$1 selected=\"selected\"", $sel_minute);
if (!$short) {
// build seconds select
$sel_second .= "<select name=\"".$prefix."[s]\" id=\"".$prefix."_s\">\n";
for ($i = 0; $i <= 59; $i++)
{
$sel_second .= "<option value=\"$i\">" . sprintf("%02d", $i) . "</option>\n";
}
$sel_second .= "</select>\n";
$sel_second = preg_replace("/(value\=\"$second\")/", "$1 selected=\"selected\"", $sel_second);
}
$timeformat = $lng->text["lang_timeformat"];
$timeformat = strtolower(preg_replace("/\W/", "", $timeformat));
$timeformat = preg_replace("/(\w)/", "%%$1", $timeformat);
$timeformat = preg_replace("/%%h/", $sel_hour, $timeformat);
$timeformat = preg_replace("/%%i/", $sel_minute, $timeformat);
if ($short) {
$timeformat = preg_replace("/%%s/", "", $timeformat);
} else {
$timeformat = preg_replace("/%%s/", $sel_second, $timeformat);
}
return $timeformat;
}
Here is the caller graph for this function:| ilUtil::moveUploadedFile | ( | $ | a_file, | |
| $ | a_name, | |||
| $ | a_target, | |||
| $ | a_raise_errors = true | |||
| ) |
move uploaded file
Definition at line 2654 of file class.ilUtil.php.
References $ilias, $lng, sendInfo(), and virusHandling().
Referenced by ilObjCategoryGUI::_importCategories(), ilPCMediaObjectGUI::create(), ilFileDataExercise::deliverFile(), ilObjFile::getUploadFile(), ilObjGlossaryGUI::importFileObject(), ilObjContentObjectGUI::importFileObject(), ilObjSurvey::importObject(), ilObjUserFolderGUI::importUserRoleAssignmentObject(), ilObjMediaObjectGUI::saveObject(), ilObjMediaObjectGUI::savePropertiesObject(), ASS_OrderingQuestion::set_image_file(), ASS_MatchingQuestion::set_image_file(), ASS_ImagemapQuestion::set_image_filename(), ASS_JavaApplet::setJavaAppletFilename(), SurveyQuestion::setMaterialsfile(), ilFileDataMail::storeUploadedFile(), ilFileDataImportMail::storeUploadedFile(), ilFileDataImportGroup::storeUploadedFile(), ilFileDataImportForum::storeUploadedFile(), ilFileDataForum::storeUploadedFile(), ilFileDataExercise::storeUploadedFile(), upload_file(), ilObjMediaObjectGUI::uploadFileObject(), ilObjSAHSLearningModuleGUI::uploadObject(), ilObjQuestionPoolGUI::uploadQplObject(), ilObjSurveyQuestionPoolGUI::uploadQuestionsObject(), ilObjSurveyQuestionPoolGUI::uploadSplObject(), and ilObjTestGUI::uploadTstObject().
{
global $lng, $ilias;
//echo "<br>ilUtli::moveuploadedFile($a_name)";
if (!is_file($a_file))
{
$lng->txt("upload_error_file_not_found");
}
// virus handling
$vir = ilUtil::virusHandling($a_file, $a_name);
if (!$vir[0])
{
unlink($a_file);
if ($a_raise_errors)
{
$ilias->raiseError($lng->txt("file_is_infected")."<br />".
$vir[1],
$ilias->error_obj->MESSAGE);
}
else
{
sendInfo($lng->txt("file_is_infected")."<br />".
$vir[1], true);
}
return false;
}
else
{
if ($vir[1] != "")
{
sendInfo($vir[1], true);
}
return move_uploaded_file($a_file, $a_target);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::prepareDBString | ( | $ | a_str | ) |
prepare a string for db writing (insert/update)
| string | $a_str string |
Definition at line 1971 of file class.ilUtil.php.
Referenced by ilForumImportParser::__addTopic(), ilAdvancedSearch::__createClassificationWhere(), ilAdvancedSearch::__createEducationalWhere(), ilAdvancedSearch::__createRequirementWhere(), ilAdvancedSearch::__createRightsWhere(), ilMDTypicalAgeRange::__getFields(), ilMDTechnical::__getFields(), ilMDTaxonPath::__getFields(), ilMDTaxon::__getFields(), ilMDRights::__getFields(), ilMDRequirement::__getFields(), ilMDRelation::__getFields(), ilMDMetaMetadata::__getFields(), ilMDLocation::__getFields(), ilMDLifecycle::__getFields(), ilMDLanguage::__getFields(), ilMDKeyword::__getFields(), ilMDIdentifier_::__getFields(), ilMDIdentifier::__getFields(), ilMDGeneral::__getFields(), ilMDFormat::__getFields(), ilMDEntity::__getFields(), ilMDEducational::__getFields(), ilMDDescription::__getFields(), ilMDContribute::__getFields(), ilMDClassification::__getFields(), ilMDAnnotation::__getFields(), ilQueryParser::__parseQuotation(), ilObject::_writeDescription(), ilObjSystemFolder::addHeaderTitleTranslation(), ilObjCategory::addTranslation(), ilObjCourseGrouping::create(), ilGlossaryTerm::create(), ilGlossaryDefinition::create(), ilObject::create(), ilPageObject::createFromXML(), db_session_write(), ilForum::generatePost(), ilForum::generateThread(), ilObjForum::ilClone(), ilLMPresentationGUI::lmAccess(), ilQueryParser::parse(), ilObjUser::saveAsNew(), ilPageObject::update(), and ilObject::update().
{
return addslashes($a_str);
}
Here is the caller graph for this function:| ilUtil::prepareFormOutput | ( | $ | a_str, | |
| $ | a_strip = false | |||
| ) |
prepares string output for html forms public
| string | ||
| boolean | true: strip slashes, if magic_quotes is enabled use this if $a_str comes from $_GET or $_POST var, use false, if $a_str comes from database |
Definition at line 1954 of file class.ilUtil.php.
References stripSlashes().
Referenced by ilObjSurveyGUI::addHeadingObject(), ilObjSystemFolderGUI::changeHeaderTitleObject(), ilObjCourseGroupingGUI::create(), ilObjSurveyQuestionPoolGUI::createObject(), ilObjSurveyGUI::createObject(), ilObjiLincCourseGUI::createObject(), ilObjiLincClassroomGUI::createObject(), ilObjGlossaryGUI::createObject(), ilObjContentObjectGUI::createObject(), ilObjUserGUI::createObject(), ilObjRoleTemplateGUI::createObject(), ilObjRoleGUI::createObject(), ilObjGroupGUI::createObject(), ilObjFolderGUI::createObject(), ilObjFileGUI::createObject(), ilObjectGUI::createObject(), ilObjCategoryGUI::createObject(), ilObjTestGUI::createObject(), ilObjQuestionPoolGUI::createObject(), ilObjSystemFolderGUI::displayBasicSettings(), ilSetupGUI::displayContactData(), displayForm(), ilObjiLincClassroomGUI::editClassroomObject(), ilObjLinkResourceGUI::editItemObject(), ilObjiLincCourseGUI::editObject(), ilObjCourseGUI::editObject(), ilObjUserGUI::editObject(), ilObjRoleTemplateGUI::editObject(), ilObjRoleGUI::editObject(), ilObjGroupGUI::editObject(), ilObjForumGUI::editObject(), ilObjFileGUI::editObject(), ilObjExerciseGUI::editObject(), ilObjectGUI::editObject(), ilObjCategoryGUI::editObject(), ilObjPaymentSettingsGUI::editVendor(), ilObjTestGUI::evalSelectedUsersObject(), ilObjTestGUI::evaluationDetailObject(), ilObjSurveyGUI::evaluationuserObject(), ilBibItemGUI::fill(), ilMetaDataGUI::fillAnnotation(), ilMetaDataGUI::fillClassification(), ilMetaDataGUI::fillEducational(), ilMetaDataGUI::fillGeneral(), ilMetaDataGUI::fillLifecycle(), ilMetaDataGUI::fillMetaMetadata(), ilMetaDataGUI::fillRelation(), ilMetaDataGUI::fillTechnical(), ilObjPaymentSettingsGUI::generalSettingsObject(), ilObjTest::getTestResult(), ilMDEditorGUI::listAnnotation(), ilMDEditorGUI::listClassification(), ilMDEditorGUI::listEducational(), ilMDEditorGUI::listGeneral(), ilMDEditorGUI::listLifecycle(), ilMDEditorGUI::listMetaMetaData(), ilMDEditorGUI::listRelation(), ilMDEditorGUI::listRights(), ilMDEditorGUI::listTechnical(), ilObjAssessmentFolderGUI::logsObject(), ilObjExerciseGUI::membersObject(), ASS_ClozeTestGUI::outWorkingForm(), ilObjSurveyGUI::propertiesObject(), ilObjTestGUI::propertiesObject(), ilObjCourseGUI::searchUserObject(), ilObjSearchSettingsGUI::settingsObject(), ilObjLinkResourceGUI::showAddItemObject(), ilPaymentBillAdminGUI::showBillData(), ilPurchaseBMFGUI::showCreditCard(), ilPurchaseBMFGUI::showDebitEntry(), ilPurchaseBMFGUI::showPersonalData(), ilAdvancedSearchGUI::showSearch(), ilSearchGUI::showSearch(), ilPaymentStatisticGUI::showStatistics(), and ilObjPaymentSettingsGUI::statisticObject().
{
if($a_strip)
{
$a_str = ilUtil::stripSlashes($a_str);
}
return htmlspecialchars($a_str);
}
Here is the call graph for this function:
Here is the caller graph for this function:| & ilUtil::processCSVRow | ( | &$ | row, | |
| $ | quoteAll = FALSE, |
|||
| $ | separator = ";", |
|||
| $ | outUTF8 = FALSE, |
|||
| $ | compatibleWithMSExcel = TRUE | |||
| ) |
Convertes an array for CSV usage.
Processes an array as a CSV row and converts the array values to correct CSV values. The "converted" array is returned
| array | $row The array containing the values for a CSV row | |
| string | $quoteAll Indicates to quote every value (=TRUE) or only values containing quotes and separators (=FALSE, default) | |
| string | $separator The value separator in the CSV row (used for quoting) (; = default) |
Definition at line 2715 of file class.ilUtil.php.
References $row, and $separator.
Referenced by ilObjUserFolder::createCSVExport().
{
$resultarray = array();
foreach ($row as $rowindex => $entry)
{
$surround = FALSE;
if ($quoteAll)
{
$surround = TRUE;
}
if (strpos($entry, "\"") !== FALSE)
{
$entry = str_replace("\"", "\"\"", $entry);
$surround = TRUE;
}
if (strpos($entry, $separator) !== FALSE)
{
$surround = TRUE;
}
if ($compatibleWithMSExcel)
{
// replace all CR LF with LF (for Excel for Windows compatibility
$entry = str_replace(chr(13).chr(10), chr(10), $entry);
}
if ($surround)
{
if ($outUTF8)
{
$resultarray[$rowindex] = "\"" . $entry . "\"";
}
else
{
$resultarray[$rowindex] = utf8_decode("\"" . $entry . "\"");
}
}
else
{
if ($outUTF8)
{
$resultarray[$rowindex] = $entry;
}
else
{
$resultarray[$rowindex] = utf8_decode($entry);
}
}
}
return $resultarray;
}
Here is the caller graph for this function:| ilUtil::rCopy | ( | $ | a_sdir, | |
| $ | a_tdir | |||
| ) |
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
| string | $a_sdir source directory | |
| string | $a_tdir target directory |
Definition at line 1018 of file class.ilUtil.php.
References $file, and makeDir().
Referenced by ilContObjParser::copyFileItems(), ilContObjParser::copyMobFiles(), ilObjDlBook::export(), ilObjFile::export(), ilObjMediaObject::exportFiles(), ilObjGlossary::exportHTMLMOB(), ilObjContentObject::exportHTMLMOB(), and ilObjFile::ilClone().
{
// check if arguments are directories
if (!@is_dir($a_sdir) or
!@is_dir($a_tdir))
{
return FALSE;
}
// read a_sdir, copy files and copy directories recursively
$dir = opendir($a_sdir);
while($file = readdir($dir))
{
if ($file != "." and
$file != "..")
{
// directories
if (@is_dir($a_sdir."/".$file))
{
if (!@is_dir($a_tdir."/".$file))
{
if (!ilUtil::makeDir($a_tdir."/".$file))
return FALSE;
//chmod($a_tdir."/".$file, 0775);
}
if (!ilUtil::rCopy($a_sdir."/".$file,$a_tdir."/".$file))
{
return FALSE;
}
}
// files
if (@is_file($a_sdir."/".$file))
{
if (!copy($a_sdir."/".$file,$a_tdir."/".$file))
{
return FALSE;
}
}
}
}
return TRUE;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::readFile | ( | $ | a_file | ) |
there are some known problems with the original readfile method, which sometimes truncates delivered files regardless of php.ini setting (see http://de.php.net/manual/en/function.readfile.php) use this method to avoid these problems.
Definition at line 1551 of file class.ilUtil.php.
Referenced by deliverFile().
{
$chunksize = 1*(1024*1024); // how many bytes per chunk
$buffer = '';
$handle = fopen($a_file, 'rb');
if ($handle === false)
{
return false;
}
while (!feof($handle))
{
$buffer = fread($handle, $chunksize);
print $buffer;
}
return fclose($handle);
}
Here is the caller graph for this function:| ilUtil::redirect | ( | $ | a_script | ) |
http redirect to other script
| string | $a_script target script |
Definition at line 2283 of file class.ilUtil.php.
Referenced by ilObjExerciseGUI::__searchMembers(), ilObjSurvey::_goto(), ilObjLinkResource::_goto(), ilStructureObject::_goto(), ilObjContentObject::_goto(), ilLMPageObject::_goto(), ilGlossaryTerm::_goto(), ilObjForum::_goto(), ilObjExercise::_goto(), ilObjTest::_goto(), ilObjCategoryGUI::_importCategories(), ilObjUserGUI::activeRoleSaveObject(), ilObjectGUI::addRoleObject(), ilObjCategoryGUI::addTranslationObject(), ilObjiLincCourseGUI::addUserObject(), ilObjGroupGUI::addUserObject(), ilObjRoleTemplateGUI::adoptPermSaveObject(), ilObjRoleGUI::adoptPermSaveObject(), ilObjRoleFolderGUI::adoptPermSaveObject(), ilObjiLincCourseGUI::agendaObject(), ilRegisterGUI::apply(), ilObjGroupGUI::assignApplicantsObject(), ilObjGroupGUI::assignMemberObject(), ilObjRoleGUI::assignUserObject(), SurveyQuestionGUI::cancel(), ilPurchaseBMFGUI::cancel(), ilCourseRegisterGUI::cancel(), ilLMPageObjectGUI::cancel(), ilRegisterGUI::cancel(), ASS_QuestionGUI::cancel(), ilObjiLincCourseGUI::cancelDeleteClassroomObject(), ilObjSysUserTrackingGUI::cancelDeleteDataObject(), ilObjSurveyGUI::cancelDeleteExportFileObject(), ilObjUserFolderGUI::cancelDeleteExportFileObject(), ilObjTestGUI::cancelDeleteExportFileObject(), ilObjectGUI::cancelDeleteObject(), ilObjTestGUI::cancelImportObject(), ilObjQuestionPoolGUI::cancelImportObject(), ilObjiLincCourseGUI::cancelMemberObject(), ilObjCourseGUI::cancelMemberObject(), ilObjGroupGUI::cancelMemberObject(), ilObjUserGUI::cancelObject(), ilObjStyleSheetGUI::cancelObject(), ilObjRoleGUI::cancelObject(), ilObjectGUI::cancelObject(), ilObjTestGUI::cancelPropertiesObject(), SurveyQuestionGUI::cancelSync(), ASS_QuestionGUI::cancelSync(), ilSetupGUI::changeAccessMode(), ilSetupGUI::changeDefaultClient(), ilSetupGUI::changeMasterPassword(), ilSetupGUI::changeMasterSettings(), OnlineTestCommandControl::checkOnlineTestAccess(), ilContainerGUI::clearObject(), ilObjSurveyGUI::cloneAllObject(), ilObjTestGUI::cloneAllObject(), ilObjectGUI::cloneObject(), ilRepositoryGUI::cmd_admin_compliance(), ilSetupGUI::cmdClient(), ilObjSurveyGUI::codesObject(), ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject(), ilObjiLincCourseGUI::confirmedDeleteClassroomObject(), ilObjUserFolderGUI::confirmedDeleteObject(), ilObjStyleSheetFolderGUI::confirmedDeleteObject(), ilObjStyleSettingsGUI::confirmedDeleteObject(), ilObjRoleFolderGUI::confirmedDeleteObject(), ilObjectGUI::confirmedDeleteObject(), ilObjiLincCourseGUI::confirmedRemoveMemberObject(), ilObjGroupGUI::confirmedRemoveMemberObject(), ilObjectGUI::copyObject(), ilBookmarkAdministrationGUI::createBookmark(), ilBookmarkAdministrationGUI::createBookmarkFolder(), ilObjSurveyQuestionPoolGUI::createExportFileObject(), ilObjSurveyGUI::createExportFileObject(), ilContainerGUI::cutObject(), ilObjRoleGUI::deassignUserObject(), ilObjSysUserTrackingGUI::deleteDataObject(), ilObjSurveyGUI::deleteExportFileObject(), ilObjUserFolderGUI::deleteExportFileObject(), ilObjTestGUI::deleteExportFileObject(), ilSetupGUI::displayDeleteConfirmation(), ilSetupGUI::displayLogin(), ilSetupGUI::displayMasterSetup(), ilObjSurveyQuestionPoolGUI::downloadExportFileObject(), ilObjExerciseGUI::downloadFileObject(), ilObjMediaObjectGUI::editImagemapForwardObject(), ilErrorHandling::errorHandler(), ilObjMediaPoolGUI::executeCommand(), ilObjTestGUI::executeCreateQuestionObject(), ilObjSurveyGUI::exportObject(), ilObjUserFolderGUI::exportObject(), ilObjTestGUI::exportObject(), ilObjTestGUI::finishTest(), DefaultTestCommandControl::handleCancelCommand(), ILIAS::ILIAS(), ilObjUserFolderGUI::importCancelledObject(), ilObjRootFolderGUI::importCancelledObject(), ilObjCategoryGUI::importCancelledObject(), ilObjSurveyQuestionPoolGUI::importFileObject(), ilObjSurveyGUI::importFileObject(), ilObjGlossaryGUI::importFileObject(), ilObjContentObjectGUI::importFileObject(), ilObjUserFolderGUI::importUsersObject(), ilObjTestGUI::importVerifiedFileObject(), ilObjQuestionPoolGUI::importVerifiedFileObject(), ilEditClipboardGUI::insert(), ilObjSurveyGUI::inviteObject(), ilObjiLincCourseGUI::joinClassroomObject(), ilObjiLincCourseGUI::joinObject(), ilObjiLincClassroomGUI::joinObject(), ilRepositoryGUI::linkChilds(), ilContainerGUI::linkObject(), ilRepositoryGUI::linkSelector(), ilSetupGUI::loginClient(), ilObjSurveyGUI::maintenanceObject(), ilObjTestGUI::maintenanceObject(), ilObjTestGUI::marksObject(), ilObjExerciseGUI::newMembersObject(), ilLMPresentationGUI::offlineexport(), ilObjTestGUI::participantsObject(), ilContainerGUI::pasteObject(), ilRepositoryGUI::performCopy(), ilObjMailGUI::performImportObject(), ilObjGroupGUI::performImportObject(), ilObjForumGUI::performImportObject(), ilObjCourseGUI::performUnsubscribeObject(), ilObjRoleTemplateGUI::permSaveObject(), ilObjRoleGUI::permSaveObject(), ilObjectGUI::permSaveObject(), ilObjTestGUI::printAnswersObject(), ilObjTestGUI::printobject(), ilObjSurveyGUI::propertiesObject(), ilObjTestGUI::propertiesObject(), ilObjSurveyGUI::questionsObject(), ilObjTestGUI::questionsObject(), ilObjGroupGUI::refuseApplicantsObject(), ilObjRecoveryFolderGUI::removeFromSystemObject(), ilObjectGUI::removeFromSystemObject(), ilObjCategoryGUI::removeTranslationObject(), ilObjSurveyGUI::runObject(), ilObjSurveyGUI::runShowIntroductionPage(), SurveyQuestionGUI::save(), ilLMPageObjectGUI::save(), ASS_QuestionGUI::save(), ilObjSystemFolderGUI::saveBenchSettingsObject(), ASS_QuestionGUI::saveEdit(), saveForm(), ilObjExternalToolsSettingsGUI::saveiLincObject(), ilObjAuthSettingsGUI::saveLDAPObject(), ilObjSurveyQuestionPoolGUI::saveObject(), ilObjSurveyGUI::saveObject(), ilObjLinkResourceGUI::saveObject(), ilObjiLincCourseGUI::saveObject(), ilObjiLincClassroomGUI::saveObject(), ilObjCourseGUI::saveObject(), ilObjSAHSLearningModuleGUI::saveObject(), ilObjMediaPoolGUI::saveObject(), ilObjGlossaryGUI::saveObject(), ilObjFileBasedLMGUI::saveObject(), ilObjContentObjectGUI::saveObject(), GUI::saveObject(), ilObjUserGUI::saveObject(), ilObjStyleSheetGUI::saveObject(), ilObjStyleSheetFolderGUI::saveObject(), ilObjStyleSettingsGUI::saveObject(), ilObjRoleTemplateGUI::saveObject(), ilObjRoleGUI::saveObject(), ilObjRoleFolderGUI::saveObject(), ilObjGroupGUI::saveObject(), ilObjFolderGUI::saveObject(), ilObjFileGUI::saveObject(), ilObjExerciseGUI::saveObject(), ilObjCategoryGUI::saveObject(), ilObjChatGUI::saveObject(), ilObjTestGUI::saveObject(), ilObjQuestionPoolGUI::saveObject(), ilObjAuthSettingsGUI::saveRADIUSObject(), ilObjAuthSettingsGUI::saveScriptObject(), ilObjSysUserTrackingGUI::saveSettingsObject(), ilObjAuthSettingsGUI::saveSHIBObject(), ilObjStyleSettingsGUI::saveStyleSettingsObject(), ilObjGlossaryGUI::saveTerm(), ilObjGroupGUI::searchCancelledObject(), ilObjAuthSettingsGUI::setAuthModeObject(), ilObjFileBasedLMGUI::showLearningModule(), ilObjForumGUI::showThreadsObject(), ilCourseRegisterGUI::subscribe(), ilObjSystemFolderGUI::switchBenchModuleObject(), SurveyQuestionGUI::sync(), ASS_QuestionGUI::sync(), ilSetupGUI::toggleClientList(), ilObjStyleSheetFolderGUI::toggleGlobalDefaultObject(), ilObjStyleSettingsGUI::toggleGlobalDefaultObject(), ilObjStyleSheetFolderGUI::toggleGlobalFixedObject(), ilObjStyleSettingsGUI::toggleGlobalFixedObject(), ilObjectGUI::undeleteObject(), ilObjAuthSettingsGUI::updateAuthRolesObject(), ilObjiLincClassroomGUI::updateClassroomObject(), ilObjExerciseGUI::updateMembersObject(), ilObjiLincCourseGUI::updateMemberStatusObject(), ilObjGroupGUI::updateMemberStatusObject(), ilObjSurveyGUI::updateObject(), ilObjiLincCourseGUI::updateObject(), ilObjUserGUI::updateObject(), ilObjStyleSheetGUI::updateObject(), ilObjRoleTemplateGUI::updateObject(), ilObjRoleGUI::updateObject(), ilObjGroupGUI::updateObject(), ilObjFileGUI::updateObject(), ilObjectGUI::updateObject(), ilObjCategoryGUI::updateObject(), upload_file(), ilObjSurveyGUI::uploadObject(), ilObjMailGUI::uploadObject(), and ilObjSurveyQuestionPoolGUI::uploadSplObject().
{
global $log, $PHP_SELF;
//$log->write("redirect FROM:".$PHP_SELF." to ".$a_script);
header("Location: ".$a_script);
exit();
}
Here is the caller graph for this function:| ilUtil::removeItemFromDesktops | ( | $ | a_id | ) |
removes object from all user's desktops public
| integer | ref_id |
Definition at line 1983 of file class.ilUtil.php.
References $ilias, $q, $row, and $users.
Referenced by ilObjectGUI::confirmedDeleteObject(), and ilContainerGUI::pasteObject().
{
global $ilias;
$q = "SELECT user_id FROM desktop_item WHERE item_id = '".$a_id."'";
$r = $ilias->db->query($q);
$users = array();
while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
{
$users[] = $row->user_id;
} // while
if (count($users) > 0)
{
$q = "DELETE FROM desktop_item WHERE item_id = '".$a_id."'";
$ilias->db->query($q);
}
return $users;
}
Here is the caller graph for this function:| ilUtil::removeTrailingPathSeparators | ( | $ | path | ) |
Definition at line 2573 of file class.ilUtil.php.
References $path.
Referenced by SurveyQuestion::_getInternalLinkHref(), ASS_Question::_getInternalLinkHref(), SurveyQuestion::getImagePathWeb(), ilObjTest::getImagePathWeb(), ASS_Question::getImagePathWeb(), ASS_Question::getJavaPathWeb(), SurveyQuestion::getMaterialsPathWeb(), ilObjSurveyGUI::inviteObject(), ilObjTestGUI::participantsObject(), ilObjSurveyGUI::propertiesObject(), ilObjSurveyGUI::runObject(), ilObjSurveyQuestionPoolGUI::setLocator(), ilObjSurveyGUI::setLocator(), ilObjTestGUI::setLocator(), ilObjQuestionPoolGUI::setLocator(), and ASS_JavaApplet::to_xml().
Here is the caller graph for this function:| ilUtil::renameExecutables | ( | $ | a_dir | ) |
rename uploaded executables for security reasons
Definition at line 2453 of file class.ilUtil.php.
References rRenameSuffix().
Referenced by ilPCMediaObjectGUI::create(), ilFileSystemGUI::renameFile(), ilObjMediaObjectGUI::saveObject(), ilFileSystemGUI::unzipFile(), ilFileSystemGUI::uploadFile(), ilObjMediaObjectGUI::uploadFileObject(), and ilObjSAHSLearningModuleGUI::uploadObject().
{
ilUtil::rRenameSuffix($a_dir, "php", "sec");
ilUtil::rRenameSuffix($a_dir, "php3", "sec");
ilUtil::rRenameSuffix($a_dir, "php4", "sec");
ilUtil::rRenameSuffix($a_dir, "inc", "sec");
ilUtil::rRenameSuffix($a_dir, "lang", "sec");
ilUtil::rRenameSuffix($a_dir, "phtml", "sec");
ilUtil::rRenameSuffix($a_dir, "htaccess", "sec");
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::replaceUrlParameterString | ( | $ | url, | |
| $ | parametersArray | |||
| ) |
Definition at line 2529 of file class.ilUtil.php.
References KT_replaceParam().
{
foreach ($parametersArray as $paramName => $paramValue ) {
$url = ilUtil::KT_replaceParam($url, $paramName, $paramValue);
}
return $url;
}
Here is the call graph for this function:| ilUtil::resizeImage | ( | $ | a_from, | |
| $ | a_to, | |||
| $ | a_width, | |||
| $ | a_height | |||
| ) |
resize image
| string | $a_from source file | |
| string | $a_to target file | |
| string | $a_width target width | |
| string | $a_height target height |
Definition at line 1395 of file class.ilUtil.php.
References $size, escapeShellArg(), and getConvertCmd().
Referenced by ilObjMediaObject::_resizeImage().
{
$size = " -resize ".$a_width."x".$a_height."! ";
$convert_cmd = ilUtil::getConvertCmd()." ".
ilUtil::escapeShellArg($a_from)." ".$size.ilUtil::escapeShellArg($a_to);
system($convert_cmd);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::rRenameSuffix | ( | $ | a_dir, | |
| $ | a_old_suffix, | |||
| $ | a_new_suffix | |||
| ) |
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
| string | $a_sdir source directory | |
| string | $a_tdir target directory |
Definition at line 2472 of file class.ilUtil.php.
Referenced by renameExecutables().
{
if ($a_dir == "/" || $a_dir == "" || is_int(strpos($a_dir, "..")))
{
return false;
}
// check if argument is directory
if (!@is_dir($a_dir))
{
return false;
}
// read a_dir
$dir = opendir($a_dir);
while($file = readdir($dir))
{
if ($file != "." and
$file != "..")
{
// directories
if (@is_dir($a_dir."/".$file))
{
ilUtil::rRenameSuffix($a_dir."/".$file, $a_old_suffix, $a_new_suffix);
}
// files
if (@is_file($a_dir."/".$file))
{
$path_info = pathinfo($a_dir."/".$file);
if (strtolower($path_info["extension"]) ==
strtolower($a_old_suffix))
{
$pos = strrpos($a_dir."/".$file, ".");
$new_name = substr($a_dir."/".$file, 0, $pos).".".$a_new_suffix;
rename($a_dir."/".$file, $new_name);
}
}
}
}
return true;
}
Here is the caller graph for this function:| ilUtil::searchGroups | ( | $ | a_search_str | ) |
Definition at line 2348 of file class.ilUtil.php.
References $q, $res, and $row.
Referenced by ilMail::getEmailsOfRecipients(), and ilMail::getUserIds().
{
global $ilDB;
$q = "SELECT * ".
"FROM object_data ,object_reference ".
"WHERE (object_data.title LIKE '%".$a_search_str."%' ".
"OR object_data.description LIKE '%".$a_search_str."%') ".
"AND object_data.type = 'grp' ".
"AND object_data.obj_id = object_reference.obj_id";
$res = $ilDB->query($q);
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
// STORE DATA IN ARRAY WITH KEY obj_id
// SO DUPLICATE ENTRIES ( LINKED OBJECTS ) ARE UNIQUE
$ids[$row->obj_id] = array(
"ref_id" => $row->ref_id,
"title" => $row->title,
"description" => $row->description);
}
return $ids ? $ids : array();
}
Here is the caller graph for this function:| ilUtil::setPathStr | ( | $ | a_path | ) |
??? public
| string |
Definition at line 352 of file class.ilUtil.php.
{
if ("" != $a_path && "/" != substr($a_path, -1))
{
$a_path .= "/";
//$a_path = substr($a_path,1);
}
//return getcwd().$a_path;
return $a_path;
}
| ilUtil::shortenText | ( | $ | a_str, | |
| $ | a_len, | |||
| $ | a_dots = "false" | |||
| ) |
shorten a string to given length.
Adds 3 dots at the end of string (optional) TODO: do not cut within words (->wordwrap function) public
| string | string to be shortened | |
| integer | string length in chars | |
| boolean | adding 3 dots (true) or not (false, default) |
Definition at line 964 of file class.ilUtil.php.
Referenced by ilObjSystemFolder::_getHeaderTitleDescription(), ilObject::_writeDescription(), ilObject::create(), ilObjectGUI::displayList(), ilTree::fetchNodeData(), ilPublicSectionSelector::formatHeader(), ilMediaPoolExplorer::formatHeader(), ilLMExplorer::formatHeader(), ilLMEditorExplorer::formatHeader(), ilSCORMExplorer::formatObject(), ilHACPExplorer::formatObject(), ilPublicSectionSelector::formatObject(), ilAICCExplorer::formatObject(), ilExplorer::formatObject(), ilObjSystemFolder::getHeaderTitleTranslations(), ilLMPresentationGUI::ilLMNavigation(), ilLMPresentationGUI::ilLocator(), ilObject::setDescription(), ilObject::setTitle(), updateObject(), and ilGlossaryDefinition::updateShortText().
{
if (strlen($a_str) > $a_len)
{
$a_str = substr($a_str,0,$a_len);
if ($a_dots)
{
$a_str .= "...";
}
}
return $a_str;
}
Here is the caller graph for this function:| ilUtil::showTabs | ( | $ | a_hl, | |
| $ | a_o | |||
| ) |
show the tabs in admin section
public
| integer | column to highlight | |
| array | array with templatereplacements |
Definition at line 393 of file class.ilUtil.php.
{
global $lng;
$tpltab = new ilTemplate("tpl.tabs.html", true, true);
for ($i=1; $i<=4; $i++)
{
$tpltab->setCurrentBlock("tab");
if ($a_hl == $i)
{
$tabtype = "tabactive";
$tab = $tabtype;
}
else
{
$tabtype = "tabinactive";
$tab = "tab";
}
switch ($i)
{
case 1:
$txt = $lng->txt("view_content");
break;
case 2:
$txt = $lng->txt("edit_properties");
break;
case 3:
$txt = $lng->txt("perm_settings");
break;
case 4:
$txt = $lng->txt("show_owner");
break;
} // switch
$tpltab->setVariable("CONTENT", $txt);
$tpltab->setVariable("TABTYPE", $tabtype);
$tpltab->setVariable("TAB", $tab);
$tpltab->setVariable("LINK", $a_o["LINK".$i]);
$tpltab->parseCurrentBlock();
}
return $tpltab->get();
}
| ilUtil::sort_func | ( | $ | a, | |
| $ | b | |||
| ) |
sub-function to sort an array
| array | $a | |
| array | $b |
Definition at line 2117 of file class.ilUtil.php.
{
global $array_sortby,$array_sortorder;
if ($array_sortorder == "asc")
{
return strcasecmp($a[$array_sortby], $b[$array_sortby]);
}
if ($array_sortorder == "desc")
{
return strcasecmp($b[$array_sortby], $a[$array_sortby]);
}
}
| ilUtil::sort_func_numeric | ( | $ | a, | |
| $ | b | |||
| ) |
sub-function to sort an array
| array | $a | |
| array | $b |
Definition at line 2140 of file class.ilUtil.php.
{
global $array_sortby,$array_sortorder;
if ($array_sortorder == "asc")
{
return $a["$array_sortby"] > $b["$array_sortby"];
}
if ($array_sortorder == "desc")
{
return $a["$array_sortby"] < $b["$array_sortby"];
}
}
| ilUtil::sortArray | ( | $ | array, | |
| $ | a_array_sortby, | |||
| $ | a_array_sortorder = 0, |
|||
| $ | a_numeric = false | |||
| ) |
sortArray
| array | array to sort | |
| string | sort_column | |
| string | sort_order (ASC or DESC) | |
| bool | sort numeric? |
Definition at line 2164 of file class.ilUtil.php.
Referenced by ilCourseItems::__sort(), ilCourseObjectivesGUI::__sortQuestions(), ilObjiLincCourseGUI::changeMemberObject(), ilObjGroupGUI::changeMemberObject(), ilSetupGUI::displayClientList(), ilLOListGUI::displayList(), ilObjLinkResourceGUI::editItemsObject(), ilObjTypeDefinitionGUI::editObject(), ilObjLinkResourceGUI::listItemsObject(), ilObjRoleTemplateGUI::permObject(), ilObjRoleGUI::permObject(), ilObjUserFolderGUI::searchUserObject(), ilObjGroupGUI::showNewRegistrationsObject(), ilTableGUI::sortData(), ilExplorer::sortNodes(), ilEditClipboardGUI::view(), ilObjUserFolderGUI::viewObject(), ilObjTypeDefinitionGUI::viewObject(), ilObjSystemFolderGUI::viewObject(), ilObjObjectFolderGUI::viewObject(), ilObjLanguageFolderGUI::viewObject(), and ilObjectGUI::viewObject().
{
global $array_sortby,$array_sortorder;
$array_sortby = $a_array_sortby;
if ($a_array_sortorder == "desc")
{
$array_sortorder = "desc";
}
else
{
$array_sortorder = "asc";
}
if($a_numeric)
{
usort($array, array("ilUtil", "sort_func_numeric"));
}
else
{
usort($array, array("ilUtil", "sort_func"));
}
//usort($array,"ilUtil::sort_func");
return $array;
}
Here is the caller graph for this function:| ilUtil::StopWatch | ( | $ | begin = -1 |
) |
StopWatch benchmark scriptcode.
Usage: $t1 = StopWatch(); // starts the StopWatch // your code you want to benchmark $diff = StopWatch($t1); // stops the StopWatch
$diff contains the time elapsed so far from the point where you set the marker $t1 in microseconds
public
| float | starttime in microseconds |
Definition at line 724 of file class.ilUtil.php.
{
$m = explode(" ",microtime());
$m = $m[0] + $m[1];
if ($begin != -1)
{
$m = $m - $begin;
}
return($m);
}
| ilUtil::stripScriptHTML | ( | $ | a_str, | |
| $ | a_allow = "", |
|||
| $ | a_rm_js = true | |||
| ) |
strip only html tags (4.0) from text $allowed contains tags to be allowed, in format tags a and b are allowed todo: needs to be optimized-> not very efficient
| string | $a_str input string | |
| string | $a_allow allowed tags, if an empty string is passed a default set of tags is allowed | |
| boolean | $a_rm_js remove javascript attributes (onclick...) |
Definition at line 1880 of file class.ilUtil.php.
References $pos.
Referenced by stripSlashes().
{
//$a_str = strip_tags($a_str, $a_allow);
$negativestr = "a,abbr,acronym,address,applet,area,b,base,basefont,".
"bdo,big,blockquote,body,br,button,caption,center,cite,code,col,".
"colgroup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,form,frame,".
"frameset,h1,h2,h3,h4,h5,h6,head,hr,html,i,iframe,img,input,ins,isindex,kbd,".
"label,legend,li,link,map,menu,meta,noframes,noscript,object,ol,".
"optgroup,option,p,param,q,s,samp,script,select,small,span,".
"strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,".
"title,tr,tt,u,ul,var";
$a_allow = strtolower ($a_allow);
$negatives = split (",",$negativestr);
foreach ($negatives as $item)
{
$pos = strpos($a_allow, "<$item>");
// remove complete tag, if not allowed
if ($pos === false)
{
$old_str = "";
while($old_str != $a_str)
{
$old_str = $a_str;
$a_str = preg_replace("/<\/?\s*$item(\/?)\s*>/i", "", $a_str);
$a_str = preg_replace("/<\/?\s*$item(\/?)\s+([^>]*)>/i", "", $a_str);
}
}
}
if ($a_rm_js)
{
// remove all attributes if an "on..." attribute is given
$a_str = preg_replace("/<\s*\w*(\/?)(\s+[^>]*)?(\s+on[^>]*)>/i", "", $a_str);
// remove all attributes if a "javascript" is within tag
$a_str = preg_replace("/<\s*\w*(\/?)\s+[^>]*javascript[^>]*>/i", "", $a_str);
// remove all attributes if an "expression" is within tag
// (IE allows something like <b style='width:expression(alert(1))'>test</b>)
$a_str = preg_replace("/<\s*\w*(\/?)\s+[^>]*expression[^>]*>/i", "", $a_str);
}
return $a_str;
}
Here is the caller graph for this function:| ilUtil::stripSlashes | ( | $ | a_str, | |
| $ | a_strip_html = true, |
|||
| $ | a_allow = "" | |||
| ) |
strip slashes if magic qoutes is enabled
| boolean | strip also html tags |
Definition at line 1847 of file class.ilUtil.php.
References stripScriptHTML().
Referenced by ilSearchGUI::__parseQueryString(), ilAdvancedSearchGUI::__performContentSearch(), ilAdvancedSearchGUI::__performEntitySearch(), ilAdvancedSearchGUI::__performGeneralSearch(), ilAdvancedSearchGUI::__performKeywordSearch(), ilAdvancedSearchGUI::__performLifecycleSearch(), ilAdvancedSearchGUI::__performTaxonSearch(), ilAdvancedSearchGUI::__performTitleSearch(), ilObjExerciseGUI::__saveStatus(), ilPaymentTrusteeGUI::__search(), ilObjPaymentSettingsGUI::__search(), ilObjiLincCourseGUI::__search(), ilObjRoleGUI::__search(), ilObjGroupGUI::__search(), ilObjExerciseGUI::__searchMembers(), ilObjFile::_lookupFileName(), ilObjFile::_lookupVersion(), ilObjCourseGroupingGUI::add(), ilPageEditorGUI::addChangeComment(), ilObjGlossaryGUI::addDefinition(), ilObjLinkResourceGUI::addItemObject(), ilObjectGUI::addRoleObject(), ilObjChatGUI::addRoom(), ilObjChatGUI::addRoomObject(), ASS_ClozeTestGUI::addSelectGap(), ilObjGlossaryGUI::addTerm(), ASS_ClozeTestGUI::addTextGap(), ilObjPaymentSettingsGUI::addVendorObject(), ilObjRole::assignData(), ilObjSystemFolderGUI::changeHeaderTitleObject(), ilSetup::checkDataDirSetup(), ilSetup::checkLogSetup(), ilSetup::checkToolsSetup(), ilObjCourseGroupingGUI::create(), ilPCMediaObjectGUI::create(), ilPCFileListGUI::create(), ilBibItemGUI::create(), ilMetaDataGUI::create(), ilFileSystemGUI::createDirectory(), ilObjiLincCourseGUI::createObject(), ilObjiLincClassroomGUI::createObject(), ilObjGlossaryGUI::createObject(), ilObjContentObjectGUI::createObject(), ilObjRoleTemplateGUI::createObject(), ilObjRoleGUI::createObject(), ilObjGroupGUI::createObject(), ilObjFolderGUI::createObject(), ilObjFileGUI::createObject(), ilObjectGUI::createObject(), ilObjCategoryGUI::createObject(), ilObjTestGUI::createObject(), ilObjRoleFolder::createRole(), ilFileSystemGUI::deleteFile(), ilSetupGUI::displayContactData(), ilFileSystemGUI::downloadFile(), ilObjCourseGroupingGUI::edit(), ilObjiLincClassroomGUI::editClassroomObject(), ilObjiLincCourseGUI::editObject(), ilObjRoleTemplateGUI::editObject(), ilObjRoleGUI::editObject(), ilObjGroupGUI::editObject(), ilObjForumGUI::editObject(), ilObjFileGUI::editObject(), ilObjectGUI::editObject(), ilObjCategoryGUI::editObject(), ilFileSystemGUI::extCommand(), ilMetaDataGUI::fillAnnotation(), ilMetaDataGUI::fillClassification(), ilMetaDataGUI::fillEducational(), ilMetaDataGUI::fillGeneral(), ilMetaDataGUI::fillMetaMetadata(), ilMetaDataGUI::fillRelation(), ilMetaDataGUI::fillRights(), ilObjUser::getFullname(), ilPCTable::importHtml(), SurveyQuestionGUI::insertAfterCategory(), SurveyQuestionGUI::insertBeforeCategory(), ilMDEditorGUI::listAnnotation(), ilMDEditorGUI::listEducational(), ilFileSystemGUI::listFiles(), ilMDEditorGUI::listGeneral(), loginPage(), ilObjExerciseGUI::newMembersObject(), ilPaymentTrusteeGUI::performSearch(), prepareFormOutput(), ilObjSurveyGUI::questionsObject(), ilMDTypicalAgeRange::read(), ilMDTechnical::read(), ilMDTaxonPath::read(), ilMDTaxon::read(), ilMDRights::read(), ilMDRequirement::read(), ilMDRelation::read(), ilMDMetaMetadata::read(), ilMDLocation::read(), ilMDLifecycle::read(), ilMDKeyword::read(), ilMDIdentifier_::read(), ilMDIdentifier::read(), ilMDGeneral::read(), ilMDFormat::read(), ilMDEntity::read(), ilMDEducational::read(), ilMDDescription::read(), ilMDContribute::read(), ilMDClassification::read(), ilMDAnnotation::read(), ilFileSystemGUI::renameFile(), ilFileSystemGUI::renameFileForm(), ilObjChatGUI::renameRoomObject(), ilObjSurveyGUI::runObject(), ilStructureObjectGUI::save(), ilLMPageObjectGUI::save(), ilMetaDataGUI::save(), ilPCMediaObjectGUI::saveAliasProperties(), ilGlossaryTermGUI::saveDefinition(), saveForm(), ilObjSystemFolderGUI::saveHeaderTitleObject(), ilObjTestGUI::saveMarksObject(), ilSetup::saveMasterSetup(), ilObjiLincCourseGUI::saveObject(), ilObjMediaObjectGUI::saveObject(), ilObjRoleTemplateGUI::saveObject(), ilObjRoleGUI::saveObject(), ilObjFolderGUI::saveObject(), ilObjFileGUI::saveObject(), ilObjExerciseGUI::saveObject(), ilObjectGUI::saveObject(), ilObjCategoryGUI::saveObject(), ilCourseObjectivesGUI::saveObjective(), ilPCFileListGUI::saveProperties(), ilObjMediaObjectGUI::savePropertiesObject(), ilObjTestGUI::savePropertiesObject(), ilGlossaryTermGUI::saveTerm(), ASS_TextQuestion::saveWorkingData(), ASS_ClozeTest::saveWorkingData(), ilObjPaymentSettingsGUI::searchObject(), ilObjiLincCourseGUI::searchObject(), ilObjRoleGUI::searchObject(), ilObjGroupGUI::searchObject(), ilObjSurveyGUI::searchQuestionsForm(), ASS_ClozeTestGUI::setGapValues(), ilFileSystemGUI::unzipFile(), ilPaymentBillAdminGUI::update(), ilObjCourseGroupingGUI::update(), ilMetaData::update(), ilMDEditorGUI::updateAnnotation(), ilObjMediaObjectGUI::updateAreasObject(), ilMDEditorGUI::updateClassification(), ilObjiLincClassroomGUI::updateClassroomObject(), ilNestedSetXML::updateDomNode(), ilMDEditorGUI::updateEducational(), ilMDEditorGUI::updateGeneral(), ilObjLinkResourceGUI::updateItemObject(), ilMDEditorGUI::updateLifecycle(), ilSetup::updateMasterSettings(), ilMDEditorGUI::updateMetaMetaData(), ilObjiLincCourseGUI::updateObject(), ilObjCourseGUI::updateObject(), ilObjUserGUI::updateObject(), ilObjRoleTemplateGUI::updateObject(), ilObjRoleGUI::updateObject(), ilObjGroupGUI::updateObject(), ilObjForumGUI::updateObject(), ilObjFileGUI::updateObject(), ilObjExerciseGUI::updateObject(), ilObjectGUI::updateObject(), ilObjCategoryGUI::updateObject(), ilCourseObjectivesGUI::updateObjective(), ilMDEditorGUI::updateRelation(), ilMDEditorGUI::updateRights(), ilMDEditorGUI::updateTechnical(), ilObjGlossaryGUI::updateTerm(), ilGlossaryTermGUI::updateTerm(), ilFileSystemGUI::uploadFile(), ASS_QuestionGUI::writeOtherPostData(), SurveyTextQuestionGUI::writePostData(), SurveyOrdinalQuestionGUI::writePostData(), SurveyNominalQuestionGUI::writePostData(), SurveyMetricQuestionGUI::writePostData(), ASS_TextQuestionGUI::writePostData(), ASS_OrderingQuestionGUI::writePostData(), ASS_MultipleChoiceGUI::writePostData(), ASS_MatchingQuestionGUI::writePostData(), ASS_JavaAppletGUI::writePostData(), ASS_ImagemapQuestionGUI::writePostData(), ASS_ClozeTestGUI::writePostData(), and ilObjSurveyGUI::writePropertiesFormData().
{
if (ini_get("magic_quotes_gpc"))
{
$a_str = stripslashes($a_str);
}
// set default allowed tags
if ($a_allow == "")
{
$a_allow = "<b><i><strong><em><code><cite><gap><sub><sup><pre><strike>";
}
if ($a_strip_html)
{
$a_str = ilUtil::stripScriptHTML($a_str, $a_allow);
}
return $a_str;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::switchColor | ( | $ | a_num, | |
| $ | a_css1, | |||
| $ | a_css2 | |||
| ) |
switches style sheets for each even $a_num (used for changing colors of different result rows)
public
| integer | $a_num the counter | |
| string | $a_css1 name of stylesheet 1 | |
| string | $a_css2 name of stylesheet 2 |
Definition at line 374 of file class.ilUtil.php.
Referenced by ilObjExerciseGUI::__showMembersTableContent(), ilCourseObjectivesGUI::askDeassignQuestion(), ilObjRoleGUI::askDeleteDesktopItemObject(), ilObjCourseGUI::askDeleteGroupingObject(), ilObjLinkResourceGUI::askDeleteItemsObject(), ilCourseObjectivesGUI::askDeleteLM(), ilCourseObjectivesGUI::askDeleteObjective(), ilObjChatGUI::askDeleteRecordingsObject(), ilCourseObjectivesGUI::assignChapterSelect(), ilCourseObjectivesGUI::assignLMSelect(), ilCourseObjectivesGUI::assignQuestionSelect(), ilCourseObjectivesGUI::assignTestSelect(), ilObjSystemFolderGUI::benchmarkObject(), ilCourseContentInterface::cci_view(), ilObjContentObjectGUI::chapters(), ilObjiLincCourseGUI::confirmationObject(), ilObjGroupGUI::confirmationObject(), ilObjGlossaryGUI::confirmDeleteExportFile(), ilObjContentObjectGUI::confirmDeleteExportFile(), ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject(), ilObjSurveyGUI::confirmDeleteExportFileObject(), ilObjUserFolderGUI::confirmDeleteExportFileObject(), ilObjTestGUI::confirmDeleteExportFileObject(), ilObjQuestionPoolGUI::confirmDeleteExportFileObject(), ilObjMediaPoolGUI::confirmRemove(), ilObjGlossaryGUI::confirmTermDeletion(), ilObjContentObjectGUI::delete(), ilBookmarkAdministrationGUI::delete(), ilObjUserFolderGUI::deleteObject(), ilObjStyleSheetGUI::deleteObject(), ilObjRoleFolderGUI::deleteObject(), ilObjectGUI::deleteObject(), ilObjStyleSheetFolderGUI::deleteStyleObject(), ilObjStyleSettingsGUI::deleteStyleObject(), ilSetupGUI::displayClientList(), ilObjUserFolderGUI::displayList(), ilObjTypeDefinitionGUI::displayList(), ilObjSystemFolderGUI::displayList(), ilObjObjectFolderGUI::displayList(), ilObjLanguageFolderGUI::displayList(), ilObjectGUI::displayList(), ilLOListGUI::displayList(), ilPersonalDesktopGUI::displayUsersOnline(), ilObjMediaObjectGUI::editFilesObject(), ilObjLinkResourceGUI::editItemsObject(), ilObjMediaObjectGUI::editMapAreasObject(), ilObjUserGUI::editObject(), ilObjTypeDefinitionGUI::editObject(), ilPaymentObjectGUI::editPrices(), ilObjGlossaryGUI::exportList(), ilObjContentObjectGUI::exportList(), ilObjSurveyQuestionPoolGUI::exportObject(), ilObjSurveyGUI::exportObject(), ilObjUserFolderGUI::exportObject(), ilObjTestGUI::exportObject(), ilObjQuestionPoolGUI::exportObject(), ilObjContentObjectGUI::linkChecker(), ilObjLinkResourceGUI::linkCheckerObject(), ilCourseObjectivesGUI::listAssignedLM(), ilCourseObjectivesGUI::listAssignedQuestions(), ilConditionHandlerInterface::listConditions(), ilObjRoleGUI::listDesktopItemsObject(), ilFileSystemGUI::listFiles(), ilObjCourseGUI::listGroupingsObject(), ilObjLinkResourceGUI::listItemsObject(), ilObjMediaPoolGUI::listMedia(), ilCourseObjectivesGUI::listObjectives(), ilObjCourseGUI::listStructureObject(), ilGlossaryPresentationGUI::listTermByGiven(), ilObjGlossaryGUI::listTerms(), ilObjCourseGroupingGUI::otherSelectAssign(), ilObjContentObjectGUI::pages(), ilObjRoleTemplateGUI::permObject(), ilObjRoleGUI::permObject(), ilObjectGUI::permObject(), ilObjChatGUI::recordingsObject(), ilObjiLincClassroomGUI::removeClassroomObject(), ilTableGUI::render(), ilObjUserFolderGUI::searchUserObject(), ilObjCourseGroupingGUI::selectCourse(), ilObjCourseGUI::selectStarterObject(), ilLMPresentationGUI::showDownloadList(), ilGlossaryPresentationGUI::showDownloadList(), ilObjForumGUI::showThreadsObject(), ilObjSCORMLearningModuleGUI::showTrackingItem(), ilObjSCORMLearningModuleGUI::showTrackingItemPerUser(), ilObjSCORMLearningModuleGUI::showTrackingItems(), ilObjAICCLearningModuleGUI::showTrackingItems(), ilObjMediaObjectGUI::showUsagesObject(), ilStructureObjectGUI::subchap(), ilObjectGUI::trashObject(), ilStructureObjectGUI::view(), ilEditClipboardGUI::view(), and ilBookmarkAdministrationGUI::view().
{
if (!($a_num % 2))
{
return $a_css1;
}
else
{
return $a_css2;
}
}
Here is the caller graph for this function:| ilUtil::tf2yn | ( | $ | a_tf | ) |
convert true/false to "y"/"n"
Definition at line 2097 of file class.ilUtil.php.
Referenced by ilObjContentObject::exportXMLProperties(), ilObjiLincCourseGUI::saveObject(), ilObjSAHSLearningModule::update(), and ilObjiLincCourseGUI::updateObject().
{
if($a_tf)
{
return "y";
}
else
{
return "n";
}
}
Here is the caller graph for this function:| ilUtil::unique_multi_array | ( | $ | array, | |
| $ | sub_key | |||
| ) |
Make a multi-dimensional array to have only DISTINCT values for a certain "column".
It's like using the DISTINCT parameter on a SELECT sql statement.
| array | your multi-dimensional array | |
| string | 'column' to filter |
Definition at line 2200 of file class.ilUtil.php.
{
$target = array();
$existing_sub_key_values = array();
foreach ($array as $key=>$sub_array)
{
if (!in_array($sub_array[$sub_key], $existing_sub_key_values))
{
$existing_sub_key_values[] = $sub_array[$sub_key];
$target[$key] = $sub_array;
}
}
return $target;
}
| ilUtil::unzip | ( | $ | a_file, | |
| $ | overwrite = false | |||
| ) |
unzip file
| string | $a_file full path/filename | |
| boolean | $overwrite pass true to overwrite existing files |
Definition at line 1256 of file class.ilUtil.php.
References $file, createDirectory(), and escapeShellArg().
Referenced by ilObjCategoryGUI::_importCategories(), ilObjGlossaryGUI::importFileObject(), ilObjContentObjectGUI::importFileObject(), ilObjUserFolderGUI::importUserRoleAssignmentObject(), ilFileSystemGUI::unzipFile(), ilObjSAHSLearningModuleGUI::uploadObject(), ilObjQuestionPoolGUI::uploadQplObject(), and ilObjTestGUI::uploadTstObject().
{
//global $ilias;
$pathinfo = pathinfo($a_file);
$dir = $pathinfo["dirname"];
$file = $pathinfo["basename"];
// unzip
$cdir = getcwd();
chdir($dir);
$unzip = PATH_TO_UNZIP;
//$unzip = $ilias->getSetting("unzip_path");
// workaround for unzip problem (unzip of subdirectories fails, so
// we create the subdirectories ourselves first)
// get list
$unzipcmd = $unzip." -Z -1 ".ilUtil::escapeShellArg($file);
exec($unzipcmd, $arr);
$zdirs = array();
foreach($arr as $line)
{
if(is_int(strpos($line, "/")))
{
$zdir = substr($line, 0, strrpos($line, "/"));
$nr = substr_count($zdir, "/");
//echo $zdir." ".$nr."<br>";
while ($zdir != "")
{
$nr = substr_count($zdir, "/");
$zdirs[$zdir] = $nr; // collect directories
//echo $dir." ".$nr."<br>";
$zdir = substr($zdir, 0, strrpos($zdir, "/"));
}
}
}
asort($zdirs);
foreach($zdirs as $zdir => $nr) // create directories
{
ilUtil::createDirectory($zdir);
}
// real unzip
if ($overvwrite)
{
$unzipcmd = $unzip." ".ilUtil::escapeShellArg($file);
}
else
{
$unzipcmd = $unzip." -o ".ilUtil::escapeShellArg($file);
}
exec($unzipcmd);
chdir($cdir);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::virusHandling | ( | $ | a_file, | |
| $ | a_orig_name = "", |
|||
| $ | a_clean = true | |||
| ) |
scan file for viruses and clean files if possible
Definition at line 2608 of file class.ilUtil.php.
References $lng, and ilVirusScannerFactory::_getInstance().
Referenced by moveUploadedFile().
{
global $lng;
if (IL_VIRUS_SCANNER != "None")
{
require_once("classes/class.ilVirusScannerFactory.php");
$vs = ilVirusScannerFactory::_getInstance();
if (($vs_txt = $vs->scanFile($a_file, $a_orig_name)) != "")
{
if ($a_clean && (IL_VIRUS_CLEAN_COMMAND != ""))
{
$clean_txt = $vs->cleanFile($a_file, $a_orig_name);
if ($vs->fileCleaned())
{
$vs_txt.= "<br />".$lng->txt("cleaned_file").
"<br />".$clean_txt;
$vs_txt.= "<br />".$lng->txt("repeat_scan");
if (($vs2_txt = $vs->scanFile($a_file, $a_orig_name)) != "")
{
return array(false, nl2br($vs_txt)."<br />".$lng->txt("repeat_scan_failed").
"<br />".nl2br($vs2_txt));
}
else
{
return array(true, nl2br($vs_txt)."<br />".$lng->txt("repeat_scan_succeded"));
}
}
else
{
return array(false, nl2br($vs_txt)."<br />".$lng->txt("cleaning_failed"));
}
}
else
{
return array(false, nl2br($vs_txt));
}
}
}
return array(true,"");
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUtil::yn2tf | ( | $ | a_yn | ) |
convert "y"/"n" to true/false
Definition at line 2082 of file class.ilUtil.php.
Referenced by ilObjiLincCourse::_isActivated(), ilLMObject::_isPagePublic(), ilObjSAHSLearningModuleAccess::_lookupOnline(), ilObjSAHSLearningModule::_lookupOnline(), ilObjGlossaryAccess::_lookupOnline(), ilObjGlossary::_lookupOnline(), ilObjFileBasedLMAccess::_lookupOnline(), ilObjFileBasedLM::_lookupOnline(), ilObjContentObjectAccess::_lookupOnline(), ilObjContentObject::_lookupOnline(), ilContObjParser::handlerBeginTag(), ilObjContentObjectGUI::properties(), ilObjiLincCourse::read(), ilObjSAHSLearningModule::read(), ilObjGlossary::read(), ilObjFileBasedLM::read(), ilObjContentObject::readProperties(), ilObjSCORMLearningModuleGUI::saveProperties(), ilObjGlossaryGUI::saveProperties(), ilObjFileBasedLMGUI::saveProperties(), and ilObjContentObjectGUI::saveProperties().
{
if(strtolower($a_yn) == "y")
{
return true;
}
else
{
return false;
}
}
Here is the caller graph for this function:| ilUtil::zip | ( | $ | a_dir, | |
| $ | a_file | |||
| ) |
zips given directory/file into given zip.file
Definition at line 1318 of file class.ilUtil.php.
References $file, and escapeShellArg().
Referenced by ilGlossaryExport::buildExportFileXML(), ilContObjectExport::buildExportFileXML(), ilTestExport::buildExportFileXML(), ilQuestionpoolExport::buildExportFileXML(), ilObjDlBook::export(), ilObjGlossary::exportHTML(), ilObjContentObject::exportHTML(), ilObjContentObject::exportSCORM(), ilLMPresentationGUI::offlineexport(), and ilFileDataCourse::zipFile().
{
//global $ilias;
$cdir = getcwd();
$pathinfo = pathinfo($a_file);
$dir = $pathinfo["dirname"];
$file = $pathinfo["basename"];
// unzip
$cdir = getcwd();
chdir($dir);
$zip = PATH_TO_ZIP;
//$zip = $ilias->getSetting("zip_path");
if (is_array($a_dir))
{
$source = "";
foreach($a_dir as $dir)
{
$name = basename($dir);
$source.= " ".ilUtil::escapeShellArg($name);
}
}
else
{
$name = basename($a_dir);
$source = ilUtil::escapeShellArg($name);
}
$zipcmd = $zip." -r ".ilUtil::escapeShellArg($a_file)." ".$source;
exec($zipcmd);
//echo htmlentities($zipcmd);
chdir($cdir);
}
Here is the call graph for this function:
Here is the caller graph for this function:
1.7.1