/** * @static * @param $value string * @return string */ protected static function formatDateTimeField($value) { if (!strlen($value)) { return $value; } return ilDatePresentation::formatDate(new ilDateTime($value, IL_CAL_DATETIME)); }
/** * Fill table row */ protected function fillRow($d) { global $lng, $ilCtrl; $this->tpl->setVariable("ID", $d["id"]); if ($d["deadline"] > 0) { $this->tpl->setVariable("TXT_DEADLINE", ilDatePresentation::formatDate(new ilDateTime($d["deadline"], IL_CAL_UNIX))); } if ($d["start_time"] > 0) { $this->tpl->setVariable("TXT_START_TIME", ilDatePresentation::formatDate(new ilDateTime($d["start_time"], IL_CAL_UNIX))); } $this->tpl->setVariable("TXT_INSTRUCTIONS", ilUtil::shortenText($d["instruction"], 200, true)); if ($d["mandatory"]) { $this->tpl->setVariable("TXT_MANDATORY", $lng->txt("yes")); } else { $this->tpl->setVariable("TXT_MANDATORY", $lng->txt("no")); } if ($d["peer"]) { $this->tpl->setVariable("TXT_PEER", $lng->txt("yes") . " (" . $d["peer_min"] . ")"); } else { $this->tpl->setVariable("TXT_PEER", $lng->txt("no")); } $this->tpl->setVariable("TXT_TITLE", $d["title"]); $this->tpl->setVariable("TXT_TYPE", $d["type"]); $this->tpl->setVariable("ORDER_VAL", $d["order_val"]); $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit")); $ilCtrl->setParameter($this->parent_obj, "ass_id", $d["id"]); $this->tpl->setVariable("CMD_EDIT", $ilCtrl->getLinkTarget($this->parent_obj, "editAssignment")); }
function ilEphorusReportHeaderTableGUI($a_parent_obj, $a_parent_cmd, $document) { global $ilCtrl, $lng; parent::__construct($a_parent_obj, $a_parent_cmd); $this->setTopCommands(false); $this->addColumn($lng->txt("rep_robj_xeph_document_info")); $this->addColumn(""); $this->setEnableHeader(true); $this->setRowTemplate("tpl.eph_report_header.html", "Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus"); $this->disable("footer"); $member = ilObjUser::_lookupName($document->user_id); $a_data = array(); $student = array(); $student["key"] = "student"; $student["value"] = $member["firstname"] . " " . $member["lastname"]; array_push($a_data, $student); $ilCtrl->setParameter($this->parent_obj, "filename", $document->filename); $ilCtrl->setParameter($this->parent_obj, "filetitle", $document->filetitle); $ilCtrl->setParameter($this->parent_obj, "part_id", $document->user_id); $doc = array(); $doc["key"] = "document"; $doc["value"] = "<a href=\"" . $ilCtrl->getLinkTarget($this->parent_obj, "downloadSubmittedFile") . "\">" . $document->filetitle . "</a>"; array_push($a_data, $doc); $ilCtrl->setParameter($this->parent_obj, "filename", ""); $ilCtrl->setParameter($this->parent_obj, "filetitle", ""); $submission_date = array(); $submission_date["key"] = "submission_date"; $submission_date["value"] = ilDatePresentation::formatDate(new ilDateTime($document->date_created, IL_CAL_DATETIME)); array_push($a_data, $submission_date); $this->setData($a_data); }
public function send() { global $lng; $additional_information = $this->getAdditionalInformation(); $old_val = ilDatePresentation::useRelativeDates(); ilDatePresentation::setUseRelativeDates(false); foreach ($this->getRecipients() as $rcp) { try { $this->handleCurrentRecipient($rcp); } catch (ilMailException $e) { continue; } $this->initMimeMail(); $this->initLanguageByIso2Code(); ilDatePresentation::setLanguage($this->getLanguage()); $date_for_deletion = ilDatePresentation::formatDate(new ilDate($additional_information["date"], IL_CAL_UNIX)); $this->setSubject($this->getLanguage()->txt('del_mail_subject')); $body = sprintf($this->getLanguage()->txt("del_mail_body"), $rcp->fullname, "\n\n", $additional_information["www"], $date_for_deletion); $this->appendBody($body); $this->appendBody(ilMail::_getInstallationSignature()); $this->sendMimeMail($this->getCurrentRecipient()); } ilDatePresentation::setUseRelativeDates($old_val); ilDatePresentation::setLanguage($lng); }
/** * send an advanced notification to the owner of the test * @param int $owner_id * @param string $title * @param sting $usr_data * @param array $file_names */ public function sendAdvancedNotification($owner_id, $title, $usr_data, $file_names) { $this->initLanguage($owner_id); $this->language->loadLanguageModule('assessment'); $this->initMail(); $this->setSubject(sprintf($this->language->txt('tst_user_finished_test'), $title)); $this->setBody(ilMail::getSalutation($owner_id, $this->getLanguage())); $this->appendBody("\n\n"); $this->appendBody($this->language->txt('user_has_finished_a_test')); $this->appendBody("\n\n"); $this->appendBody($this->language->txt('title') . ': ' . $title); $this->appendBody("\n"); $this->appendBody($this->language->txt('username') . ': ' . $usr_data); $this->appendBody("\n"); ilDatePresentation::setUseRelativeDates(false); $this->appendBody($this->language->txt('tst_finished') . ': ' . ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX))); $this->appendBody("\n\n"); $this->appendBody($this->language->txt('tst_attached_xls_file')); $this->appendBody("\n\n"); $this->appendBody($this->language->txt('tst_notification_explanation_admin')); $this->appendBody("\n"); $this->setAttachments($file_names); $this->getMail()->appendInstallationSignature(true); $this->sendMail(array($owner_id), array('system')); }
/** * Fill template row * * @param array $a_set */ protected function fillRow($a_set) { $date = ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX)); $this->tpl->setVariable("TSTAMP", $date); $this->tpl->setVariable("TXT_USER", $a_set["user"]); $this->tpl->setVariable("TXT_DETAILS", $a_set["details"]); }
/** * @param array $row */ public function fillRow(array $row) { $old_value = ilDatePresentation::useRelativeDates(); ilDatePresentation::setUseRelativeDates(false); $row['date'] = ilDatePresentation::formatDate(new ilDateTime($row['date'], IL_CAL_UNIX)); ilDatePresentation::setUseRelativeDates($old_value); if (array_key_exists('percentage', $row)) { $row['percentage'] = sprintf('%.2f', $row['percentage']) . '%'; } // fill columns if (!$this->isObjectiveOrientedPresentationEnabled()) { $this->tpl->setVariable('VAL_SCORED', $row['scored']); $this->tpl->setVariable('VAL_PASS', $row['pass']); } $this->tpl->setVariable('VAL_DATE', $row['date']); if ($this->isObjectiveOrientedPresentationEnabled()) { $this->tpl->setVariable('VAL_LO_OBJECTIVES', $row['objectives']); $this->tpl->setVariable('VAL_LO_TRY', sprintf($this->lng->txt('tst_res_lo_try_n'), $row['pass'])); } $this->tpl->setVariable('VAL_ANSWERED', $row['answered']); if (isset($row['hints'])) { $this->tpl->setVariable('VAL_HINTS', $row['hints']); } $this->tpl->setVariable('VAL_REACHED', $row['reached']); $this->tpl->setVariable('VAL_PERCENTAGE', $row['percentage']); if (!$this->pdf_view) { $this->tpl->setVariable('VAL_PASS_DETAILS', $row['pass_details']); } }
public function getHTML() { if (!$this->getADT()->isNull()) { // :TODO: relative dates? return ilDatePresentation::formatDate($this->getADT()->getDate()); } }
protected function fillRow($a_set) { $this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDateTime($a_set["created"], IL_CAL_UNIX))); $name = ilObjUser::_lookupName($a_set["user_id"]); $this->tpl->setVariable("LASTNAME", $name["lastname"]); $this->tpl->setVariable("FIRSTNAME", $name["firstname"]); $this->tpl->setVariable("LOGIN", $name["login"]); $this->tpl->setVariable("ACTION", $this->action_map[$a_set["action"]]); if ($a_set["action"] == ilRbacLog::CHANGE_OWNER) { $user = ilObjUser::_lookupFullname($a_set["data"][0]); $changes = array(array("action" => $this->lng->txt("rbac_log_changed_owner"), "operation" => $user)); } else { if ($a_set["action"] == ilRbacLog::EDIT_TEMPLATE) { $changes = $this->parseChangesTemplate($a_set["data"]); } else { $changes = $this->parseChangesFaPa($a_set["data"]); } } $this->tpl->setCurrentBlock("changes"); foreach ($changes as $change) { $this->tpl->setVariable("CHANGE_ACTION", $change["action"]); $this->tpl->setVariable("CHANGE_OPERATION", $change["operation"]); $this->tpl->parseCurrentBlock(); } }
/** * Returns an array containing all variables and values which can be exchanged in the certificate * The values should be calculated from real data. The $params parameter array should contain all * necessary information to calculate the values. * * @param array $params An array of parameters to calculate the certificate parameter values * @return array The certificate variables */ public function getCertificateVariablesForPresentation($params = array()) { global $lng; $lng->loadLanguageModule('certificate'); $user_data = $params["user_data"]; $vars = $this->getBaseVariablesForPresentation($user_data, $params["last_access"], null); $vars["SKILL_TITLE"] = ilUtil::prepareFormOutput($this->skill->getTitleForCertificate()); $vars["SKILL_LEVEL_TITLE"] = ilUtil::prepareFormOutput($this->skill->getLevelTitleForCertificate($this->skill_level_id)); $vars["SKILL_TRIGGER_TITLE"] = ilUtil::prepareFormOutput($this->skill->getTriggerTitleForCertificate($this->skill_level_id)); // custom completion date $achievement_date = ilBasicSkill::lookupLevelAchievementDate($user_data["usr_id"], $this->skill_level_id); if ($achievement_date !== false) { $old = ilDatePresentation::useRelativeDates(); ilDatePresentation::setUseRelativeDates(false); $vars["DATE_COMPLETED"] = ilDatePresentation::formatDate(new ilDate($achievement_date, IL_CAL_DATETIME)); $vars["DATETIME_COMPLETED"] = ilDatePresentation::formatDate(new ilDateTime($achievement_date, IL_CAL_DATETIME)); ilDatePresentation::setUseRelativeDates($old); } else { $vars["DATE_COMPLETED"] = ""; $vars["DATETIME_COMPLETED"] = ""; } foreach ($vars as $id => $caption) { $insert_tags["[" . $id . "]"] = $caption; } return $insert_tags; }
/** * Fill a single data row. */ protected function fillRow($a_set) { global $lng, $ilCtrl; // box title if ($a_set["box"] == 0) { $this->tpl->setVariable("BOX", $this->plugin->txt("leitner_box_0_title")); } else { $this->tpl->setVariable("BOX", sprintf($this->plugin->txt("leitner_box_x_title"), $a_set["box"])); } // box data $this->tpl->setVariable("CAPACITY", $a_set["capacity"]); $this->tpl->setVariable("COUNT", $a_set["count"]); $this->tpl->setVariable("LAST_TRAINED", ilDatePresentation::formatDate($a_set["last_trained"])); // actions if ($a_set["count"]) { $ilCtrl->setParameter($this->parent, "box", $a_set["box"]); $this->tpl->setVariable("LINK_TRAINING", $ilCtrl->getLinkTarget($this->parent, "startTraining")); $this->tpl->setVariable("TXT_TRAINING", $this->plugin->txt("start_training")); } // training alert if ($a_set["count"] >= $a_set["capacity"]) { $this->tpl->setVariable("SRC_TRAINING_ALERT", $this->plugin->getImagePath("clock.png")); $this->tpl->setVariable("TXT_TRAINING_ALERT", $this->plugin->txt("training_needed")); } }
/** * Fill table row */ protected function fillRow($file) { global $lng; $this->tpl->setVariable("FILE_ID", $file["id"]); $this->tpl->setVariable("DELIVERED_FILE", $file["filetitle"]); $date = new ilDateTime($file['timestamp14'], IL_CAL_TIMESTAMP); $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date)); }
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))); }
/** * Fill table row */ protected function fillRow($file) { global $lng; $this->tpl->setVariable("FILE_ID", $file["returned_id"]); $this->tpl->setVariable("DELIVERED_FILE", $file["filetitle"]); $date = new ilDateTime($file['timestamp14'], IL_CAL_TIMESTAMP); $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date)); if ($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) { $this->tpl->setVariable("DELIVERED_OWNER", ilUserUtil::getNamePresentation($file["owner_id"])); } }
/** * @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; } }
/** * Fill row template * @param array $a_set */ protected function fillRow($a_set) { global $ilCtrl; $this->tpl->setVariable('CHECKBOX_ID', $a_set['user']); $this->tpl->setVariable('VAL_USERNAME', $a_set['name']); // $ilCtrl->setParameter($this->getParentObject(),'user_id',$a_set['user']); // $this->tpl->setVariable('LINK_ITEM', $ilCtrl->getLinkTarget($this->getParentObject(),'showTrackingItem')); $this->tpl->setVariable('VAL_LAST', ilDatePresentation::formatDate(new ilDateTime($a_set['last_access'], IL_CAL_UNIX))); $this->tpl->setVariable('VAL_ATTEMPT', (int) $a_set['attempts']); $this->tpl->setVariable('VAL_VERSION', (string) $a_set['version']); }
/** * Fill row * * @access public * @param * */ public function fillRow($a_set) { $this->tpl->setVariable('VAL_ID', $a_set['id']); $this->tpl->setVariable('VAL_SIZE', sprintf("%.1f KB", $a_set['file_size'] / 1024)); $this->tpl->setVariable('VAL_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set['date'], IL_CAL_UNIX))); foreach ($a_set['record_arr'] as $title) { $this->tpl->setCurrentBlock('record_title'); $this->tpl->setVariable('REC_TITLE', $title); $this->tpl->parseCurrentBlock(); } }
/** * Standard Version of Fill Row. Most likely to * be overwritten by derived class. */ protected function fillRow($a_set) { global $lng, $ilCtrl, $ilAccess; $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); // user if ($a_set["user_id"] > 0) { $this->tpl->setCurrentBlock("user_info"); $user_obj = new ilObjUser($a_set["user_id"]); $this->tpl->setVariable("VAL_AUTHOR", $user_obj->getLogin()); $this->tpl->setVariable("TXT_AUTHOR", $lng->txt("author")); $this->tpl->parseCurrentBlock(); } // access if ($enable_internal_rss) { $this->tpl->setCurrentBlock("access"); $this->tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility")); if ($a_set["visibility"] == NEWS_PUBLIC || $a_set["priority"] == 0 && ilBlockSetting::_lookup("news", "public_notifications", 0, $a_set["context_obj_id"])) { $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public")); } else { $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users")); } $this->tpl->parseCurrentBlock(); } // last update if ($a_set["creation_date"] != $a_set["update_date"]) { $this->tpl->setCurrentBlock("ni_update"); $this->tpl->setVariable("TXT_LAST_UPDATE", $lng->txt("last_update")); $this->tpl->setVariable("VAL_LAST_UPDATE", ilDatePresentation::formatDate(new ilDateTime($a_set["update_date"], IL_CAL_DATETIME))); $this->tpl->parseCurrentBlock(); } // creation date $this->tpl->setVariable("VAL_CREATION_DATE", ilDatePresentation::formatDate(new ilDateTime($a_set["creation_date"], IL_CAL_DATETIME))); $this->tpl->setVariable("TXT_CREATED", $lng->txt("created")); // title $this->tpl->setVariable("VAL_TITLE", $a_set["title"]); // content if ($a_set["content"] != "") { $this->tpl->setCurrentBlock("content"); $this->tpl->setVariable("VAL_CONTENT", ilUtil::shortenText($a_set["content"], 80, true, true), true); $this->tpl->parseCurrentBlock(); } $perm_ref_id = $this->perm_ref_id > 0 ? $this->perm_ref_id : $a_set["ref_id"]; if ($ilAccess->checkAccess("write", "", $perm_ref_id)) { $this->tpl->setCurrentBlock("edit"); $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit")); $ilCtrl->setParameterByClass("ilnewsitemgui", "news_item_id", $a_set["id"]); $this->tpl->setVariable("CMD_EDIT", $ilCtrl->getLinkTargetByClass("ilnewsitemgui", "editNewsItem")); $this->tpl->parseCurrentBlock(); } // context $this->tpl->setVariable("CONTEXT", $lng->txt("obj_" . $a_set["context_obj_type"]) . ":<br />" . ilObject::_lookupTitle($a_set["context_obj_id"])); $this->tpl->setVariable("VAL_ID", $a_set["id"]); }
/** * Fill row * @staticvar int $counter * @param array $set */ public function fillRow($set) { global $ilCtrl; $ilCtrl->setParameter($this->getParentObject(), 'server_id', $set['server_id']); $ilCtrl->setParameterByClass('ilecsmappingsettingsgui', 'server_id', $set['server_id']); if ($set['active']) { $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_ok.svg')); $this->tpl->setVariable('TXT_OK', $this->lng->txt('ecs_activated')); } else { $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_not_ok.svg')); $this->tpl->setVariable('TXT_OK', $this->lng->txt('ecs_inactivated')); } $this->tpl->setVariable('VAL_TITLE', ilECSSetting::getInstanceByServerId($set['server_id'])->getTitle()); $this->tpl->setVariable('LINK_EDIT', $ilCtrl->getLinkTarget($this->getParentObject(), 'edit')); $this->tpl->setVariable('TXT_SRV_ADDR', $this->lng->txt('ecs_server_addr')); if (ilECSSetting::getInstanceByServerId($set['server_id'])->getServer()) { $this->tpl->setVariable('VAL_DESC', ilECSSetting::getInstanceByServerId($set['server_id'])->getServer()); } else { $this->tpl->setVariable('VAL_DESC', $this->lng->txt('ecs_not_configured')); } $dt = ilECSSetting::getInstanceByServerId($set['server_id'])->fetchCertificateExpiration(); if ($dt != NULL) { $this->tpl->setVariable('TXT_CERT_VALID', $this->lng->txt('ecs_cert_valid_until')); $now = new ilDateTime(time(), IL_CAL_UNIX); $now->increment(IL_CAL_MONTH, 2); if (ilDateTime::_before($dt, $now)) { $this->tpl->setCurrentBlock('invalid'); $this->tpl->setVariable('VAL_ICERT', ilDatePresentation::formatDate($dt)); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('valid'); $this->tpl->setVariable('VAL_VCERT', ilDatePresentation::formatDate($dt)); $this->tpl->parseCurrentBlock(); } } // Actions include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $list = new ilAdvancedSelectionListGUI(); $list->setSelectionHeaderClass('small'); $list->setItemLinkClass('small'); $list->setId('actl_' . $set['server_id']); $list->setListTitle($this->lng->txt('actions')); if (ilECSSetting::getInstanceByServerId($set['server_id'])->isEnabled()) { $list->addItem($this->lng->txt('ecs_deactivate'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'deactivate')); } else { $list->addItem($this->lng->txt('ecs_activate'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'activate')); } $list->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'edit')); $list->addItem($this->lng->txt('copy'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'cp')); $list->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'delete')); $this->tpl->setVariable('ACTIONS', $list->getHTML()); $ilCtrl->clearParameters($this->getParentObject()); }
protected function availabilityToString() { switch ($this->object->getAvailabilityType()) { case ilObjRemoteTest::ACTIVATION_OFFLINE: return $this->lng->txt('offline'); case ilObjRemoteTest::ACTIVATION_UNLIMITED: return $this->lng->txt('grp_unlimited'); case ilObjRemoteTest::ACTIVATION_LIMITED: return ilDatePresentation::formatPeriod(new ilDateTime($this->object->getStartingTime(), IL_CAL_UNIX), new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX)); } return ''; }
/** * fill row * * @access public * @param * @return */ public function fillRow($a_set) { global $ilUser, $ilAccess; $this->tpl->setVariable('VAL_ID', $a_set['solution_id']); if (strlen($a_set['webpath'])) { $this->tpl->setVariable('VAL_FILE', '<a href="' . $a_set['webpath'] . $a_set['value1'] . '" target=\\"_blank\\">' . ilUtil::prepareFormOutput($a_set['value2']) . '</a>'); } else { $this->tpl->setVariable('VAL_FILE', ilUtil::prepareFormOutput($a_set['value2'])); } ilDatePresentation::setUseRelativeDates(false); $this->tpl->setVariable('VAL_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX))); }
/** * fill row * * @access public * @param * @return */ public function fillRow($data) { global $ilUser, $ilAccess; $username = $this->tstObject->userLookupFullName($data["user_fi"], TRUE); $this->tpl->setVariable("DATETIME", ilDatePresentation::formatDate(new ilDateTime($data["tstamp"], IL_CAL_UNIX))); $this->tpl->setVariable("USER", $username); $this->tpl->setVariable("LOG", trim(ilUtil::prepareFormOutput($data["logtext"]))); $location = ''; if (strlen($data["ref_id"]) && strlen($data["href"])) { $location = '<a href="' . $data['href'] . '">' . $this->lng->txt("perma_link") . '</a>'; } $this->tpl->setVariable("LOCATION", $location); }
function render() { global $tpl, $ilSetting, $lng; if ($ilSetting->get('last_cronjob_start_ts')) { $tstamp = ilDatePresentation::formatDate(new ilDateTime($ilSetting->get('last_cronjob_start_ts'), IL_CAL_UNIX)); } else { $tstamp = $lng->txt('cronjob_last_start_unknown'); } ilUtil::sendInfo($lng->txt('cronjob_last_start') . ": " . $tstamp); include_once "Services/Cron/classes/class.ilCronManagerTableGUI.php"; $tbl = new ilCronManagerTableGUI($this, "render"); $tpl->setContent($tbl->getHTML()); }
/** * Standard Version of Fill Row. Most likely to * be overwritten by derived class. */ protected function fillRow($a_set) { global $lng, $ilCtrl; include_once "./Modules/Wiki/classes/class.ilWikiPage.php"; $title = ilWikiPage::lookupTitle($a_set["id"]); $this->tpl->setVariable("TXT_PAGE_TITLE", $title); $this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDateTime($a_set["date"], IL_CAL_DATETIME))); $ilCtrl->setParameterByClass("ilwikipagegui", "page", rawurlencode($title)); $ilCtrl->setParameterByClass("ilwikipagegui", "old_nr", $a_set["nr"]); $this->tpl->setVariable("HREF_PAGE", $ilCtrl->getLinkTargetByClass("ilwikipagegui", "preview")); // user name include_once "./Services/User/classes/class.ilUserUtil.php"; $this->tpl->setVariable("TXT_USER", ilUserUtil::getNamePresentation($a_set["user"], true, true, $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd()))); }
/** * @param array $row */ public function fillRow(array $row) { $old_value = ilDatePresentation::useRelativeDates(); ilDatePresentation::setUseRelativeDates(false); $row['date'] = ilDatePresentation::formatDate(new ilDateTime($row['date'], IL_CAL_UNIX)); ilDatePresentation::setUseRelativeDates($old_value); if (array_key_exists('percentage', $row)) { $row['percentage'] = sprintf('%.2f', $row['percentage']) . '%'; } if ($this->pdf_view && array_key_exists('pass_details', $row)) { unset($row['pass_details']); } parent::fillRow($row); }
/** * fill row * * @access public * @param * @return */ public function fillRow($data) { $this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDate($data['tstamp'], IL_CAL_UNIX))); $user = ilObjUser::_lookupName($data["user_fi"]); $this->tpl->setVariable("USER", ilUtil::prepareFormOutput(trim($user["title"] . " " . $user["firstname"] . " " . $user["lastname"]))); $title = ""; if ($data["question_fi"] || $data["original_fi"]) { include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php"; $title = assQuestion::_getQuestionTitle($data["question_fi"]); if (strlen($title) == 0) { $title = assQuestion::_getQuestionTitle($data["original_fi"]); } $title = $this->lng->txt("assessment_log_question") . ": " . $title; } $this->tpl->setVariable("MESSAGE", ilUtil::prepareFormOutput($data['logtext']) . (strlen($title) ? " (" . $title . ")" : '')); }
/** * Standard Version of Fill Row. Most likely to * be overwritten by derived class. */ protected function fillRow($a_set) { global $lng, $ilCtrl, $ilAccess; // rollback command if ($a_set["nr"] > 0) { $ilCtrl->setParameter($this->getParentObject(), "old_nr", $a_set["nr"]); $this->tpl->setCurrentBlock("command"); $this->tpl->setVariable("TXT_COMMAND", $lng->txt("cont_rollback")); $this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTarget($this->getParentObject(), "rollbackConfirmation")); $this->tpl->parseCurrentBlock(); $ilCtrl->setParameter($this->getParentObject(), "old_nr", ""); } if (!$this->rselect) { $this->tpl->setVariable("RSELECT", 'checked="checked"'); $this->rselect = true; } else { if (!$this->lselect) { $this->tpl->setVariable("LSELECT", 'checked="checked"'); $this->lselect = true; } } $this->tpl->setVariable("NR", $a_set["nr"]); $this->tpl->setVariable("TXT_HDATE", ilDatePresentation::formatDate(new ilDateTime($a_set["hdate"], IL_CAL_DATETIME))); $ilCtrl->setParameter($this->getParentObject(), "old_nr", $a_set["nr"]); $ilCtrl->setParameter($this->getParentObject(), "history_mode", "1"); $this->tpl->setVariable("HREF_OLD_PAGE", $ilCtrl->getLinkTarget($this->getParentObject(), "preview")); $ilCtrl->setParameter($this->getParentObject(), "history_mode", ""); if (ilObject::_exists($a_set["user"])) { // user name $user = ilObjUser::_lookupName($a_set["user"]); $login = ilObjUser::_lookupLogin($a_set["user"]); //$this->tpl->setVariable("TXT_LINKED_USER", // $user["lastname"].", ".$user["firstname"]." [".$login."]"); // profile link include_once "./Services/User/classes/class.ilUserUtil.php"; $name_pres = ilUserUtil::getNamePresentation($a_set["user"], true, true, $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd())); //$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "user", $a_set["user"]); //$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "back_url", // rawurlencode($ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd()))); //$this->tpl->setVariable("USER_LINK", // $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML")); //$img = ilObjUser::_getPersonalPicturePath($a_set["user"], "xxsmall"); //$this->tpl->setVariable("IMG_USER", $img); $this->tpl->setVariable("TXT_USER", $name_pres); } $ilCtrl->setParameter($this->getParentObject(), "old_nr", ""); }
/** * Fill a single data row. */ protected function fillRow($a_set) { $this->tpl->setVariable("TXT_USER", ilUserUtil::getNamePresentation($a_set["user_id"], false, false)); $this->tpl->setVariable('TXT_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set["date"], IL_CAL_DATETIME))); $this->tpl->setVariable("TXT_ACTION", $this->createInfoText($a_set)); if ($this->getObjType() == "lm" || $this->getObjType() == "dbk") { $obj_arr = explode(":", $a_set["obj_type"]); switch ($obj_arr[1]) { case "st": $img_type = "st"; $class = "ilstructureobjectgui"; $cmd = "view"; break; case "pg": $img_type = "pg"; $class = "illmpageobjectgui"; $cmd = "edit"; break; default: $img_type = $obj_arr[0]; $class = ""; $cmd = "view"; break; } $this->tpl->setCurrentBlock("item_icon"); $this->tpl->setVariable("SRC_ICON", ilUtil::getImagePath("icon_" . $img_type . ".svg")); $this->tpl->parseCurrentBlock(); if ($class != "") { $this->tpl->setCurrentBlock("item_link"); $this->ilCtrl->setParameterByClass($class, "obj_id", $a_set["obj_id"]); $this->tpl->setVariable("HREF_LINK", $this->ilCtrl->getLinkTargetByClass($class, $cmd)); $this->tpl->setVariable("TXT_LINK", $a_set["title"]); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock("item_title"); $this->tpl->setVariable("TXT_TITLE", ilObject::_lookupTitle($a_set["obj_id"])); $this->tpl->parseCurrentBlock(); } } if ($this->isCommentVisible() && $a_set["user_comment"] != "") { $this->tpl->setCurrentBlock("user_comment"); $this->tpl->setVariable("TXT_COMMENT", $this->lng->txt("comment")); $this->tpl->setVariable("TXT_USER_COMMENT", $a_set["user_comment"]); $this->tpl->parseCurrentBlock(); } }
/** * * * @access public * @param array row data * @return */ public function fillRow($a_set) { $this->tpl->setVariable('VAL_ID', $a_set['cal_id']); $this->tpl->setVariable('CALENDAR_NAME', $a_set['name']); $this->tpl->setVariable('TXT_FROM', $this->lng->txt('owner')); $name = ilObjUser::_lookupName($a_set['owner']); $this->tpl->setVariable('LASTNAME', $name['lastname']); $this->tpl->setVariable('FIRSTNAME', $name['firstname']); $this->tpl->setVariable('APPS_COUNT', $a_set['apps']); $this->tpl->setVariable('CREATE_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set['create_date'], IL_CAL_DATETIME))); if ($a_set['accepted']) { $this->tpl->setVariable('ACC_IMG', ilUtil::getImagePath('icon_ok.svg')); $this->tpl->setVariable('ALT_ACC', $this->lng->txt('cal_accepted')); } if ($a_set['declined']) { $this->tpl->setVariable('DEC_IMG', ilUtil::getImagePath('icon_ok.svg')); $this->tpl->setVariable('ALT_DEC', $this->lng->txt('cal_declined')); } }
/** * @global ilCtrl $ilCtrl * @global ilLanguage $lng * @param array $row */ public function fillRow($row) { //vd($row); global $ilCtrl, $lng; $ilCtrl->setParameter($this->parent_obj, 'active_id', $row['active_id']); $ilCtrl->setParameter($this->parent_obj, 'pass', $row['pass']); if ($row['is_scored_pass']) { $this->tpl->setCurrentBlock('selected_pass'); $this->tpl->touchBlock('selected_pass'); $this->tpl->parseCurrentBlock(); $this->tpl->setVariable('CSS_ROW', 'tblrowmarked'); } $this->tpl->setVariable("PASS_NR", $row['pass'] + 1); $this->tpl->setVariable("PASS_DATE", ilDatePresentation::formatDate(new ilDate($row['finishdate'], IL_CAL_UNIX))); $this->tpl->setVariable("PASS_ANSWERED_QUESTIONS", $row['answered_questions'] . " " . strtolower($this->lng->txt("of")) . " " . $row['total_questions']); $this->tpl->setVariable("PASS_REACHED_POINTS", $row['reached_points'] . " " . strtolower($this->lng->txt("of")) . " " . $row['max_points']); $this->tpl->setVariable("PASS_REACHED_PERCENTAGE", sprintf("%.2f%%", $row['percentage'])); $this->tpl->setVariable("TXT_SHOW_PASS", $lng->txt('tst_edit_scoring')); $this->tpl->setVariable("HREF_SHOW_PASS", $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)); }