本文整理汇总了PHP中ilFormat类的典型用法代码示例。如果您正苦于以下问题:PHP ilFormat类的具体用法?PHP ilFormat怎么用?PHP ilFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ilFormat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fillRow
/**
* @param array $data
*/
public function fillRow(array $data)
{
$this->tpl->setVariable("LOGIN", $data['login']);
$this->tpl->setVariable("NAME", $data['name']);
$this->tpl->setVariable("STARTED", $data['started']);
$this->tpl->setVariable("EXTRATIME", ilFormat::_secondsToString($data['extratime'] * 60));
}
示例2: send
public function send()
{
switch ($this->getType()) {
case self::TYPE_NOTIFICATION_ACTIVATION:
$additional_information = $this->getAdditionalInformation();
/**
* @var $user ilObjUser
*/
$user = $additional_information['usr'];
foreach ($this->getRecipients() as $rcp) {
try {
$this->handleCurrentRecipient($rcp);
} catch (ilMailException $e) {
continue;
}
$this->initMimeMail();
$this->setSubject($this->getLanguage()->txt('reg_mail_subject_confirmation'));
$this->setBody($this->getLanguage()->txt('reg_mail_body_salutation') . ' ' . $user->getFullname() . ',');
$this->appendBody("\n\n");
$this->appendBody($this->getLanguage()->txt('reg_mail_body_confirmation'));
$this->appendBody("\n");
$this->appendBody(ILIAS_HTTP_PATH . '/confirmReg.php?client_id=' . CLIENT_ID . '&rh=' . ilObjUser::_generateRegistrationHash($user->getId()));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguage()->txt('reg_mail_body_2_confirmation'), ilFormat::_secondsToString($additional_information['hash_lifetime'])));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguage()->txt('reg_mail_body_3_confirmation'));
$this->appendBody(ilMail::_getInstallationSignature());
$this->sendMimeMail($this->getCurrentRecipient());
}
break;
}
}
示例3: fillRowExcel
protected function fillRowExcel($a_worksheet, &$a_row, $a_set)
{
$a_worksheet->write($a_row, 0, $a_set["login"]);
$a_worksheet->write($a_row, 1, $a_set["firstname"]);
$a_worksheet->write($a_row, 2, $a_set["lastname"]);
$a_worksheet->write($a_row, 3, ilFormat::_secondsToShortString($a_set["online_time"]));
$a_worksheet->write($a_row, 4, ilDatePresentation::formatDate(new ilDateTime($a_set["last_login"], IL_CAL_DATETIME)));
}
示例4: fillRow
/**
* Fill row
*
* @access public
* @param
*
*/
public function fillRow($a_set)
{
$this->tpl->setVariable('VAL_ID', $a_set['id']);
$this->tpl->setVariable('VAL_TITLE', $a_set['title']);
$this->tpl->setVariable('VAL_DATE', ilFormat::formatDate(date('Y-m-d H:i:s', $a_set['date']), 'datetime', true));
$this->tpl->setVariable('VAL_SORTING_TEXTINPUT', ilUtil::formInput('sorting[' . $a_set['id'] . ']', $a_set['sorting']));
$this->ctrl->setParameter($this->parent_obj, 'topic_id', $a_set['id']);
$this->tpl->setVariable('EDIT_LINK', $this->ctrl->getLinkTarget($this->parent_obj, 'showTopicForm'));
$this->tpl->setVariable('TXT_EDIT_RECORD', $this->lng->txt('edit'));
}
示例5: formatValue
/**
* @param string $column
* @param string $value
* @return string
*/
protected function formatValue($column, $value)
{
switch ($column) {
case 'filecreatedate':
return ilDatePresentation::formatDate(new ilDateTime($value, IL_CAL_UNIX));
case 'filesize':
return ilFormat::formatSize($value);
default:
return $value;
}
}
示例6: send
/**
*
* Send notifications
*
* @access public
*
*/
public function send()
{
global $ilDB;
// parent::send();
if (count($this->getRecipients())) {
$res = $ilDB->queryf("SELECT u.usr_id,u.gender,u.firstname,u.lastname,u.login,u.email,u.last_login,u.active," . "u.time_limit_unlimited, " . $ilDB->fromUnixtime("u.time_limit_from") . ", " . $ilDB->fromUnixtime("u.time_limit_until") . "," . "CASE WHEN u.active = 0 THEN '0001-01-01' ELSE CASE WHEN u.time_limit_unlimited=1 THEN '9999-12-31' ELSE " . $ilDB->fromUnixtime("u.time_limit_until") . " END END access_until," . " CASE WHEN " . $ilDB->unixTimestamp() . " BETWEEN u.time_limit_from AND u.time_limit_until THEN 0 ELSE 1 END expired," . "rq.role_disk_quota, system_role.rol_id role_id, " . "p1.value+0 user_disk_quota," . "p2.value+0 disk_usage, " . "p3.value last_update, " . "p5.value language, " . "CASE WHEN rq.role_disk_quota>p1.value+0 OR p1.value IS NULL THEN rq.role_disk_quota ELSE p1.value+0 END disk_quota\t" . "FROM usr_data u " . "JOIN (SELECT u.usr_id usr_id,MAX(rd.disk_quota) role_disk_quota " . "FROM usr_data u " . "JOIN rbac_ua ua ON ua.usr_id=u.usr_id " . "JOIN rbac_fa fa ON fa.rol_id=ua.rol_id AND fa.parent=%s " . "JOIN role_data rd ON rd.role_id=ua.rol_id WHERE u.usr_id=ua.usr_id GROUP BY u.usr_id) rq ON rq.usr_id=u.usr_id " . "LEFT JOIN rbac_ua system_role ON system_role.usr_id=u.usr_id AND system_role.rol_id = %s " . "LEFT JOIN usr_pref p1 ON p1.usr_id=u.usr_id AND p1.keyword = 'disk_quota' " . "LEFT JOIN usr_pref p2 ON p2.usr_id=u.usr_id AND p2.keyword = 'disk_usage' " . "LEFT JOIN usr_pref p3 ON p3.usr_id=u.usr_id AND p3.keyword = 'disk_usage.last_update' " . "LEFT JOIN usr_pref p5 ON p5.usr_id=u.usr_id AND p5.keyword = 'language' " . 'WHERE (((p1.value+0 > rq.role_disk_quota OR rq.role_disk_quota IS NULL) AND p2.value+0 > p1.value+0) OR
((rq.role_disk_quota > p1.value+0 OR p1.value IS NULL) AND p2.value+0 > rq.role_disk_quota)) ' . 'AND (u.active=1 AND (u.time_limit_unlimited = 1 OR ' . $ilDB->unixTimestamp() . ' BETWEEN u.time_limit_from AND u.time_limit_until)) ', array('integer', 'integer'), array(ROLE_FOLDER_ID, SYSTEM_ROLE_ID));
$users = array();
$counter = 0;
while ($row = $ilDB->fetchAssoc($res)) {
$details = ilDiskQuotaChecker::_lookupDiskUsage($row['usr_id']);
$users[$counter]['disk_quota'] = $row['disk_quota'];
$users[$counter]['disk_usage'] = $details['disk_usage'];
$users[$counter]['email'] = $row['email'];
$users[$counter]['firstname'] = $row['firstname'];
$users[$counter]['lastname'] = $row['lastname'];
++$counter;
}
if (count($users)) {
foreach ($this->getRecipients() as $rcp) {
$usrId = ilObjUser::_lookupId($rcp);
$this->initLanguage($usrId);
$this->initMail();
$this->setSubject($this->getLanguage()->txt('disk_quota_summary_subject'));
$this->setBody(ilMail::getSalutation($usrId, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguage()->txt('disk_quota_exceeded_headline'));
$this->appendBody("\n\n");
$first = true;
$counter = 0;
$numUsers = count($users);
foreach ($users as $user) {
if (!$first) {
$this->appendBody("\n---------------------------------------------------\n\n");
}
$this->appendBody($this->getLanguage()->txt('fullname') . ': ' . $user['lastname'] . ', ' . $user['firstname'] . "\n");
$this->appendBody($this->getLanguage()->txt('email') . ': ' . $user['email'] . "\n");
$this->appendBody($this->getLanguage()->txt('disk_quota') . ': ' . ilFormat::formatSize($user['disk_quota'], 'short', $this->getLanguage()) . "\n");
$this->appendBody($this->getLanguage()->txt('currently_used_disk_space') . ': ' . ilFormat::formatSize($user['disk_usage'], 'short', $this->getLanguage()) . "\n");
$this->appendBody($this->getLanguage()->txt('usrf_profile_link') . ': ' . ilUtil::_getHttpPath() . '/goto.php?target=usrf&client_id=' . CLIENT_ID);
if ($counter < $numUsers - 1) {
$this->appendBody("\n");
}
++$counter;
$first = false;
}
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'), false);
}
}
}
}
示例7: getFiles
function getFiles()
{
$files = array();
$dp = opendir($this->exercise_path);
while ($file = readdir($dp)) {
if (is_dir($file)) {
continue;
}
list($obj_id, $rest) = split('_', $file, 2);
if ($obj_id == $this->obj_id) {
if (!is_dir($this->exercise_path . '/' . $file)) {
$files[] = array('name' => $rest, 'size' => filesize($this->exercise_path . '/' . $file), 'ctime' => ilFormat::formatDate(date('Y-m-d H:i:s', filectime($this->exercise_path . '/' . $file))), 'fullpath' => $this->exercise_path . '/' . $file);
}
}
}
closedir($dp);
return $files;
}
示例8: exportToCSV
//.........这里部分代码省略.........
foreach ($additionalFields as $fieldname) {
if (strcmp($fieldname, "gender") == 0) {
array_push($datarow2, $this->lng->txt("gender_" . $userfields[$fieldname]));
} else {
array_push($datarow2, $userfields[$fieldname]);
}
}
}
array_push($datarow2, $data->getParticipant($active_id)->getReached());
array_push($datarow2, $data->getParticipant($active_id)->getMaxpoints());
array_push($datarow2, $data->getParticipant($active_id)->getMark());
if ($this->test_obj->getECTSOutput()) {
array_push($datarow2, $data->getParticipant($active_id)->getECTSMark());
}
array_push($datarow2, $data->getParticipant($active_id)->getQuestionsWorkedThrough());
array_push($datarow2, $data->getParticipant($active_id)->getNumberOfQuestions());
array_push($datarow2, $data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent() / 100.0);
$time = $data->getParticipant($active_id)->getTimeOfWork();
$time_seconds = $time;
$time_hours = floor($time_seconds / 3600);
$time_seconds -= $time_hours * 3600;
$time_minutes = floor($time_seconds / 60);
$time_seconds -= $time_minutes * 60;
array_push($datarow2, sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
$time = $data->getParticipant($active_id)->getQuestionsWorkedThrough() ? $data->getParticipant($active_id)->getTimeOfWork() / $data->getParticipant($active_id)->getQuestionsWorkedThrough() : 0;
$time_seconds = $time;
$time_hours = floor($time_seconds / 3600);
$time_seconds -= $time_hours * 3600;
$time_minutes = floor($time_seconds / 60);
$time_seconds -= $time_minutes * 60;
array_push($datarow2, sprintf("%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
$fv = $data->getParticipant($active_id)->getFirstVisit();
$lv = $data->getParticipant($active_id)->getLastVisit();
foreach (array($fv, $lv) as $ts) {
if ($ts) {
$visit = ilFormat::formatDate(date('Y-m-d H:i:s', $ts), "datetime", false, false);
array_push($datarow2, $visit);
} else {
array_push($datarow2, "");
}
}
$median = $data->getStatistics()->getStatistics()->median();
$pct = $data->getParticipant($active_id)->getMaxpoints() ? $median / $data->getParticipant($active_id)->getMaxpoints() * 100.0 : 0;
$mark = $this->test_obj->mark_schema->getMatchingMark($pct);
$mark_short_name = "";
if (is_object($mark)) {
$mark_short_name = $mark->getShortName();
}
array_push($datarow2, $mark_short_name);
array_push($datarow2, $data->getStatistics()->getStatistics()->rank($data->getParticipant($active_id)->getReached()));
array_push($datarow2, $data->getStatistics()->getStatistics()->rank_median());
array_push($datarow2, $data->getStatistics()->getStatistics()->count());
array_push($datarow2, $median);
if ($this->test_obj->getPassScoring() == SCORE_BEST_PASS) {
array_push($datarow2, $data->getParticipant($active_id)->getBestPass() + 1);
} else {
array_push($datarow2, $data->getParticipant($active_id)->getLastPass() + 1);
}
for ($pass = 0; $pass <= $data->getParticipant($active_id)->getLastPass(); $pass++) {
$finishdate = $this->test_obj->getPassFinishDate($active_id, $pass);
if ($finishdate > 0) {
if ($pass > 0) {
for ($i = 1; $i < $col - 1; $i++) {
array_push($datarow2, "");
array_push($datarow, "");
}
array_push($datarow, "");
}
array_push($datarow2, $pass + 1);
if (is_object($data->getParticipant($active_id)) && is_array($data->getParticipant($active_id)->getQuestions($pass))) {
foreach ($data->getParticipant($active_id)->getQuestions($pass) as $question) {
$question_data = $data->getParticipant($active_id)->getPass($pass)->getAnsweredQuestionByQuestionId($question["id"]);
array_push($datarow2, $question_data["reached"]);
array_push($datarow, preg_replace("/<.*?>/", "", $data->getQuestionTitle($question["id"])));
}
}
if ($this->test_obj->isRandomTest() || $this->test_obj->getShuffleQuestions() || $counter == 1 && $pass == 0) {
array_push($rows, $datarow);
}
$datarow = array();
array_push($rows, $datarow2);
$datarow2 = array();
}
}
$counter++;
}
}
$csv = "";
$separator = ";";
foreach ($rows as $evalrow) {
$csvrow =& $this->test_obj->processCSVRow($evalrow, TRUE, $separator);
$csv .= join($csvrow, $separator) . "\n";
}
if ($deliver) {
ilUtil::deliverData($csv, ilUtil::getASCIIFilename($this->test_obj->getTitle() . "_results.csv"));
exit;
} else {
return $csv;
}
}
示例9: isExecutable
/**
* Checks if the test is executable by the given user
*
* @param ilTestSession|ilTestSessionDynamicQuestionSet
* @param integer $user_id The user id
* @return array Result array
* @access public
*/
function isExecutable($testSession, $user_id, $allowPassIncrease = FALSE)
{
$result = array("executable" => true, "errormessage" => "");
if (!$this->startingTimeReached()) {
$result["executable"] = false;
$result["errormessage"] = sprintf($this->lng->txt("detail_starting_time_not_reached"), ilFormat::ftimestamp2datetimeDB($this->getStartingTime()));
return $result;
}
if ($this->endingTimeReached()) {
$result["executable"] = false;
$result["errormessage"] = sprintf($this->lng->txt("detail_ending_time_reached"), ilFormat::ftimestamp2datetimeDB($this->getEndingTime()));
return $result;
}
$active_id = $this->getActiveIdOfUser($user_id);
if ($this->getEnableProcessingTime()) {
if ($active_id > 0) {
$starting_time = $this->getStartingTimeOfUser($active_id);
if ($starting_time !== FALSE) {
if ($this->isMaxProcessingTimeReached($starting_time, $active_id)) {
if ($allowPassIncrease && $this->getResetProcessingTime() && ($this->getNrOfTries() == 0 || $this->getNrOfTries() > $this->_getPass($active_id) + 1)) {
// a test pass was quitted because the maximum processing time was reached, but the time
// will be resetted for future passes, so if there are more passes allowed, the participant may
// start the test again.
// This code block is only called when $allowPassIncrease is TRUE which only happens when
// the test info page is opened. Otherwise this will lead to unexpected results!
$testSession->increasePass();
$testSession->setLastSequence(0);
$testSession->saveToDb();
} else {
$result["executable"] = false;
$result["errormessage"] = $this->lng->txt("detail_max_processing_time_reached");
}
return $result;
}
}
}
}
if ($this->hasNrOfTriesRestriction() && $active_id > 0) {
require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
$testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this);
$testPassesSelector->setActiveId($active_id);
$testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
$closedPasses = $testPassesSelector->getReportablePasses();
if (count($closedPasses) >= $this->getNrOfTries()) {
$result["executable"] = false;
$result["errormessage"] = $this->lng->txt("maximum_nr_of_tries_reached");
return $result;
}
}
return $result;
}
示例10: viewDiskQuotaReport
/**
* The disk quota report list shows user accounts, their disk quota and their
* disk usage, as well as the last time a reminder was sent.
*/
public function viewDiskQuotaReport()
{
global $rbacsystem, $ilErr, $ilSetting, $lng;
if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
$ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING);
}
$this->tabs_gui->setTabActive('disk_quota');
$this->addDiskQuotaSubtabs('disk_quota_report');
// nothing to do if disk quota is not active
require_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
if (!ilDiskQuotaActivationChecker::_isActive()) {
return;
}
// get the form
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.disk_quota_report.html', "Services/WebDAV");
// get the date of the last update
require_once "./Services/WebDAV/classes/class.ilDiskQuotaChecker.php";
$last_update = ilDiskQuotaChecker::_lookupDiskUsageReportLastUpdate();
if ($last_update == null) {
// nothing to do if disk usage report has not been run
$this->tpl->setVariable('LAST_UPDATE_TEXT', $lng->txt('disk_quota_report_not_run_yet'));
return;
} else {
$this->tpl->setVariable('LAST_UPDATE_TEXT', $lng->txt('last_update') . ': ' . ilFormat::formatDate($last_update, 'datetime', true));
}
// Filter
$_SESSION['quota_usage_filter'] = isset($_POST['usage_filter']) ? $_POST['usage_filter'] : $_SESSION['quota_usage_filter'];
if ($_SESSION['quota_usage_filter'] == 0) {
$_SESSION['quota_usage_filter'] = 4;
}
$_SESSION['quota_access_filter'] = isset($_POST['access_filter']) ? $_POST['access_filter'] : $_SESSION['quota_access_filter'];
if ($_SESSION['quota_access_filter'] == 0) {
$_SESSION['quota_access_filter'] = 1;
}
$usage_action[1] = $lng->txt('all_users');
$usage_action[2] = $lng->txt('filter_users_without_disk_usage');
$usage_action[3] = $lng->txt('filter_users_with_disk_usage');
$usage_action[4] = $lng->txt('filter_users_with_exceeded_disk_quota');
$access_action[1] = $lng->txt('all_users');
$access_action[2] = $lng->txt('filter_users_with_access');
$access_action[3] = $lng->txt('filter_users_without_access');
$select_usage_filter = ilUtil::formSelect($_SESSION['quota_usage_filter'], "usage_filter", $usage_action, false, true);
$select_access_filter = ilUtil::formSelect($_SESSION['quota_access_filter'], "access_filter", $access_action, false, true);
$this->tpl->setCurrentBlock("filter");
$this->tpl->setVariable("FILTER_TXT_FILTER", $lng->txt('filter'));
$this->tpl->setVariable("SELECT_USAGE_FILTER", $select_usage_filter);
$this->tpl->setVariable("SELECT_ACCESS_FILTER", $select_access_filter);
$this->tpl->setVariable("FILTER_ACTION", $this->ctrl->getLinkTarget($this, 'viewDiskQuotaReport'));
$this->tpl->setVariable("FILTER_NAME", 'view');
$this->tpl->setVariable("FILTER_VALUE", $lng->txt('apply_filter'));
$this->tpl->parseCurrentBlock();
// load templates for table
$a_tpl = new ilTemplate('tpl.table.html', true, true);
$a_tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
// create table
require_once './Services/Table/classes/class.ilTableGUI.php';
$tbl = new ilTableGUI(0, false);
// title & header columns
$header_vars = array('login', 'firstname', 'lastname', 'email', 'access_until', 'last_login', 'disk_quota', 'disk_usage', 'last_reminder');
$tbl->setHeaderNames(array($lng->txt('login'), $lng->txt('firstname'), $lng->txt('lastname'), $lng->txt('email'), $lng->txt('access_until'), $lng->txt('last_login'), $lng->txt('disk_quota'), $lng->txt('disk_usage'), $lng->txt('last_reminder')));
$tbl->setHeaderVars($header_vars, $this->ctrl->getParameterArray($this, 'viewDiskQuotaReport', false));
$tbl->enable("numinfo_header");
$tbl->setFormName("cmd");
$tbl->setSelectAllCheckbox("id");
// sorting
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
// fetch the data
$data = ilDiskQuotaChecker::_fetchDiskQuotaReport($_SESSION['quota_usage_filter'], $_SESSION['quota_access_filter'], $header_vars[$tbl->getOrderColumn()], $tbl->getOrderDirection());
// paging
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
$tbl->setMaxCount(count($data));
// footer
$tbl->setFooter("tblfooter", $lng->txt("previous"), $lng->txt("next"));
// render table
$tbl->setTemplate($a_tpl);
// render rows
$count = 0;
for ($i = $tbl->getOffset(); $i < count($data) && $i < $tbl->getOffset() + $tbl->getLimit(); $i++) {
$row = $data[$i];
// build columns
foreach ($header_vars as $key) {
switch ($key) {
case 'login':
//build link
$this->ctrl->setParameterByClass("ilobjusergui", "ref_id", "7");
$this->ctrl->setParameterByClass("ilobjusergui", "obj_id", $row["usr_id"]);
$link = $this->ctrl->getLinkTargetByClass("ilobjusergui", "view");
$tbl_content_cell = '<a href="' . $link . '">' . htmlspecialchars($row[$key]) . '</a>';
break;
case 'disk_quota':
if ($row['role_id'] == SYSTEM_ROLE_ID) {
$tbl_content_cell = "<span class=\"smallgreen\">" . $lng->txt('access_unlimited') . '</span>';
} else {
$tbl_content_cell = ilFormat::formatSize($row[$key], 'short');
//.........这里部分代码省略.........
示例11: fillRow
/**
* Fill table row
*/
protected function fillRow($data)
{
global $ilCtrl, $lng;
if (!$this->isPercentageAvailable($data["obj_id"])) {
$data["percentage"] = NULL;
}
foreach ($this->getSelectedColumns() as $c) {
$val = trim($data[$c]) == "" ? " " : $data[$c];
if ($data[$c] != "" || $c == "status") {
switch ($c) {
case "first_access":
$val = ilDatePresentation::formatDate(new ilDateTime($data[$c], IL_CAL_DATETIME));
break;
case "last_access":
$val = ilDatePresentation::formatDate(new ilDateTime($data[$c], IL_CAL_UNIX));
break;
case "status":
include_once "./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php";
$path = ilLearningProgressBaseGUI::_getImagePathForStatus($data[$c]);
$text = ilLearningProgressBaseGUI::_getStatusText($data[$c]);
$val = ilUtil::img($path, $text);
if ($data["type"] != "lobj" && $data["type"] != "sco") {
$timing = $this->showTimingsWarning($data["ref_id"], $this->user_id);
if ($timing) {
if ($timing !== true) {
$timing = ": " . ilDatePresentation::formatDate(new ilDate($timing, IL_CAL_UNIX));
} else {
$timing = "";
}
$this->tpl->setCurrentBlock('warning_img');
$this->tpl->setVariable('WARNING_IMG', ilUtil::getImagePath('time_warn.png'));
$this->tpl->setVariable('WARNING_ALT', $this->lng->txt('trac_time_passed') . $timing);
$this->tpl->parseCurrentBlock();
}
}
break;
case "spent_seconds":
include_once "./Services/Utilities/classes/class.ilFormat.php";
$val = ilFormat::_secondsToString($data[$c]);
break;
case "percentage":
$val = $data[$c] . "%";
break;
}
}
if ($c == "mark" && in_array($this->type, array("lm", "dbk"))) {
$val = "-";
}
if ($c == "spent_seconds" && in_array($this->type, array("exc"))) {
$val = "-";
}
if ($c == "percentage" && (in_array(strtolower($this->status_class), array("illpstatusmanual", "illpstatusscormpackage", "illpstatustestfinished")) || $this->type == "exc")) {
$val = "-";
}
$this->tpl->setCurrentBlock("user_field");
$this->tpl->setVariable("VAL_UF", $val);
$this->tpl->parseCurrentBlock();
}
if ($data["title"] == "") {
$data["title"] = "--" . $lng->txt("none") . "--";
}
$this->tpl->setVariable("ICON", ilObject::_getIcon("", "tiny", $data["type"]));
$this->tpl->setVariable("ICON_ALT", $lng->txt($data["type"]));
if (in_array($data['type'], array('fold', 'grp')) && $data['obj_id'] != $this->obj_id) {
if ($data['type'] == 'fold') {
$object_gui = 'ilobjfoldergui';
} else {
$object_gui = 'ilobjgroupgui';
}
$this->tpl->setCurrentBlock('title_linked');
// link structure gets too complicated
if ($_GET["baseClass"] != "ilPersonalDesktopGUI" && $_GET["baseClass"] != "ilAdministrationGUI") {
$old = $ilCtrl->getParameterArrayByClass('illplistofobjectsgui');
$ilCtrl->setParameterByClass('illplistofobjectsgui', 'ref_id', $data["ref_id"]);
$ilCtrl->setParameterByClass('illplistofobjectsgui', 'details_id', $data["ref_id"]);
$ilCtrl->setParameterByClass('illplistofobjectsgui', 'user_id', $this->user_id);
$url = $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', $object_gui, 'illearningprogressgui', 'illplistofobjectsgui'), 'userdetails');
$ilCtrl->setParameterByClass('illplistofobjectsgui', 'ref_id', $old["ref_id"]);
$ilCtrl->setParameterByClass('illplistofobjectsgui', 'details_id', $old["details_id"]);
$ilCtrl->setParameterByClass('illplistofobjectsgui', 'user_id', $old["user_id"]);
} else {
$url = "#";
}
$this->tpl->setVariable("URL_TITLE", $url);
$this->tpl->setVariable("VAL_TITLE", $data["title"]);
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock('title_plain');
$this->tpl->setVariable("VAL_TITLE", $data["title"]);
$this->tpl->parseCurrentBlock();
}
if (!in_array($data["type"], array("sco", "lobj")) && !$this->getPrintMode()) {
$this->tpl->setCurrentBlock("item_command");
$ilCtrl->setParameterByClass("illplistofobjectsgui", "userdetails_id", $data["ref_id"]);
$this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTargetByClass("illplistofobjectsgui", 'edituser'));
$this->tpl->setVariable("TXT_COMMAND", $lng->txt('edit'));
$ilCtrl->setParameterByClass("illplistofobjectsgui", "userdetails_id", "");
//.........这里部分代码省略.........
示例12: outMobImageParams
function outMobImageParams()
{
global $arr_tinyMCE_image_files;
global $tpl;
for ($k = 0; $k < count($arr_tinyMCE_image_files); $k++) {
$tpl->setCurrentBlock('imageparams');
$entry = $arr_tinyMCE_image_files[$k]['file_name'];
$size = getimagesize($arr_tinyMCE_image_files[$k]['file_dir'] . $entry);
$fsize = filesize($arr_tinyMCE_image_files[$k]['file_dir'] . $entry);
$tpl->setVariable('IMG_WIDTH', $size[0]);
$tpl->setVariable('IMG_HEIGHT', $size[1]);
$tpl->setVariable('IMG_PATH', $arr_tinyMCE_image_files[$k]['http_dir']);
$tpl->setVariable('F_SIZE', ilFormat::formatSize($fsize));
$tpl->parseCurrentBlock();
}
}
示例13: showForm
//.........这里部分代码省略.........
$mailData[$key] = ilUtil::securePlainString($value);
}
}
break;
}
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form_gui = new ilPropertyFormGUI();
$form_gui->setTitle($this->lng->txt('compose'));
$form_gui->setOpenTag(false);
$this->tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, 'sendMessage'));
$this->tpl->setVariable('BUTTON_TO', $lng->txt("search_recipients"));
$this->tpl->setVariable('BUTTON_COURSES_TO', $lng->txt("mail_my_courses"));
$this->tpl->setVariable('BUTTON_GROUPS_TO', $lng->txt("mail_my_groups"));
$this->tpl->setVariable('BUTTON_MAILING_LISTS_TO', $lng->txt("mail_my_mailing_lists"));
$dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupRecipientAsync', '', true);
// RECIPIENT
$inp = new ilTextInputGUI($this->lng->txt('mail_to'), 'rcp_to');
$inp->setRequired(true);
$inp->setSize(50);
$inp->setValue($mailData["rcp_to"]);
$inp->setDataSource($dsDataLink, ",");
$inp->setMaxLength(null);
$form_gui->addItem($inp);
// CC
$inp = new ilTextInputGUI($this->lng->txt('cc'), 'rcp_cc');
$inp->setSize(50);
$inp->setValue($mailData["rcp_cc"]);
$inp->setDataSource($dsDataLink, ",");
$inp->setMaxLength(null);
$form_gui->addItem($inp);
// BCC
$inp = new ilTextInputGUI($this->lng->txt('bc'), 'rcp_bcc');
$inp->setSize(50);
$inp->setValue($mailData["rcp_bcc"]);
$inp->setDataSource($dsDataLink, ",");
$inp->setMaxLength(null);
$form_gui->addItem($inp);
// SUBJECT
$inp = new ilTextInputGUI($this->lng->txt('subject'), 'm_subject');
$inp->setSize(50);
$inp->setRequired(true);
$inp->setValue($mailData["m_subject"]);
$form_gui->addItem($inp);
// Attachments
include_once 'Services/Mail/classes/class.ilMailFormAttachmentFormPropertyGUI.php';
$att = new ilMailFormAttachmentPropertyGUI($this->lng->txt($mailData["attachments"] ? 'edit' : 'add'));
if (is_array($mailData["attachments"]) && count($mailData["attachments"])) {
foreach ($mailData["attachments"] as $data) {
if (is_file($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data)) {
$hidden = new ilHiddenInputGUI('attachments[]');
$form_gui->addItem($hidden);
$size = filesize($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data);
$label = $data . " [" . ilFormat::formatSize($size) . "]";
$att->addItem($label);
$hidden->setValue(urlencode($data));
}
}
}
$form_gui->addItem($att);
// ONLY IF SYSTEM MAILS ARE ALLOWED
if ($rbacsystem->checkAccess("system_message", $this->umail->getMailObjectReferenceId())) {
$chb = new ilCheckboxInputGUI($this->lng->txt('type'), 'm_type[]');
$chb->setOptionTitle($this->lng->txt('system_message'));
$chb->setValue('system');
$chb->setChecked(false);
if (is_array($mailData["m_type"]) and in_array('system', $mailData["m_type"])) {
$chb->setChecked(true);
}
$form_gui->addItem($chb);
}
// MESSAGE
$inp = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
//$inp->setValue(htmlspecialchars($mailData["m_message"], false));
$inp->setValue($mailData["m_message"]);
$inp->setRequired(false);
$inp->setCols(60);
$inp->setRows(10);
// PLACEHOLDERS
$chb = new ilCheckboxInputGUI($this->lng->txt('activate_serial_letter_placeholders'), 'use_placeholders');
$chb->setOptionTitle($this->lng->txt('activate_serial_letter_placeholders'));
$chb->setValue(1);
$chb->setChecked(false);
$form_gui->addItem($inp);
include_once 'Services/Mail/classes/class.ilMailFormPlaceholdersPropertyGUI.php';
$prop = new ilMailFormPlaceholdersPropertyGUI();
$chb->addSubItem($prop);
if ($mailData['use_placeholders']) {
$chb->setChecked(true);
}
$form_gui->addItem($chb);
$form_gui->addCommandButton('sendMessage', $this->lng->txt('send_mail'));
$form_gui->addCommandButton('saveDraft', $this->lng->txt('save_message'));
if (ilMailFormCall::isRefererStored()) {
$form_gui->addCommandButton('cancelMail', $this->lng->txt('cancel'));
}
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable('FORM', $form_gui->getHTML());
$this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
$this->tpl->show();
}
示例14: endingTimeReached
/**
* handle endingTimeReached
* @private
*/
function endingTimeReached()
{
ilUtil::sendInfo(sprintf($this->lng->txt("detail_ending_time_reached"), ilFormat::ftimestamp2datetimeDB($this->object->getEndingTime())));
$this->testSession->increasePass();
$this->testSession->setLastSequence(0);
$this->testSession->saveToDb();
if (!$this->object->canViewResults()) {
$this->outIntroductionPage();
} else {
$this->ctrl->redirectByClass("ilTestEvaluationGUI", "outUserResultsOverview");
}
}
示例15: getTrackingDataAgg
function getTrackingDataAgg($a_user_id, $raw = false)
{
global $ilDB;
$scos = array();
$data = array();
//get all SCO's of this object
$val_set = $ilDB->queryF('SELECT cp_node_id FROM cp_node
WHERE nodename = %s
AND cp_node.slm_id = %s', array('text', 'integer'), array('item', $this->getId()));
while ($val_rec = $ilDB->fetchAssoc($val_set)) {
array_push($scos, $val_rec['cp_node_id']);
}
foreach ($scos as $sco) {
$data_set = $ilDB->queryF('
SELECT c_timestamp last_access, total_time, success_status, completion_status,
c_raw, scaled, cp_node_id
FROM cmi_node
WHERE cp_node_id = %s
AND user_id = %s', array('integer', 'integer'), array($sco, $a_user_id));
while ($data_rec = $ilDB->fetchAssoc($data_set)) {
if ($data_rec["success_status"] != "" && $data_rec["success_status"] != "unknown") {
$status = $data_rec["success_status"];
} else {
if ($data_rec["completion_status"] == "") {
$status = "unknown";
} else {
$status = $data_rec["completion_status"];
}
}
if (!$raw) {
$time = ilFormat::_secondsToString(self::_ISODurationToCentisec($data_rec["total_time"]) / 100);
$score = "";
if ($data_rec["c_raw"] != null) {
$score = $data_rec["c_raw"];
if ($data_rec["scaled"] != null) {
$score .= " = ";
}
}
if ($data_rec["scaled"] != null) {
$score .= $data_rec["scaled"] * 100 . "%";
}
$title = self::_lookupItemTitle($data_rec["cp_node_id"]);
$last_access = ilDatePresentation::formatDate(new ilDateTime($data_rec['last_access'], IL_CAL_UNIX));
$data[] = array("user_id" => $data_rec["user_id"], "sco_id" => $data_rec["cp_node_id"], "score" => $score, "time" => $time, "status" => $status, "last_access" => $last_access, "title" => $title);
} else {
$data_rec["session_time"] = self::_ISODurationToCentisec($data_rec["session_time"]) / 100;
$data[$data_rec["cp_node_id"]] = $data_rec;
}
}
}
return $data;
}