当前位置: 首页>>代码示例>>PHP>>正文


PHP ilDatePresentation::formatDate方法代码示例

本文整理汇总了PHP中ilDatePresentation::formatDate方法的典型用法代码示例。如果您正苦于以下问题:PHP ilDatePresentation::formatDate方法的具体用法?PHP ilDatePresentation::formatDate怎么用?PHP ilDatePresentation::formatDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilDatePresentation的用法示例。


在下文中一共展示了ilDatePresentation::formatDate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: formatDateTimeField

 /**
  * @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));
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:class.ilShopCouponsTableGUI.php

示例2: fillRow

 /**
  * 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"));
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:31,代码来源:class.ilAssignmentsTableGUI.php

示例3: ilEphorusReportHeaderTableGUI

 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);
 }
开发者ID:jmcgettrick,项目名称:ilias-ephorus,代码行数:31,代码来源:class.ilEphorusReportTableGUI.php

示例4: send

 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);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:25,代码来源:class.ilCronDeleteInactiveUserReminderMailNotification.php

示例5: getHTML

 public function getHTML()
 {
     if (!$this->getADT()->isNull()) {
         // :TODO: relative dates?
         return ilDatePresentation::formatDate($this->getADT()->getDate());
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:7,代码来源:class.ilADTDatePresentationBridge.php

示例6: fillRow

 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();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:25,代码来源:class.ilRbacLogTableGUI.php

示例7: fillRow

 /**
  * 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"]);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:class.ilExAssignmentTeamLogTableGUI.php

示例8: getCertificateVariablesForPresentation

 /**
  * 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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:34,代码来源:class.ilSkillCertificateAdapter.php

示例9: fillRow

 /**
  * @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']);
     }
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:32,代码来源:class.ilTestPassOverviewTableGUI.php

示例10: sendAdvancedNotification

 /**
  * 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'));
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:32,代码来源:class.ilTestMailNotification.php

示例11: fillRow

 /**
  * 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"));
     }
 }
开发者ID:ilifau,项目名称:Flashcards,代码行数:28,代码来源:class.ilLeitnerTableGUI.php

示例12: fillRow

 /**
  * 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));
 }
开发者ID:jmcgettrick,项目名称:ilias-ephorus,代码行数:11,代码来源:class.ilEphDeliveredFilesTableGUI.php

示例13: 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)));
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:8,代码来源:class.ilUserLPTableGUI.php

示例14: fillRow

 /**
  * 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']);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:15,代码来源:class.ilSCORMTrackingUsersTableGUI.php

示例15: fillRow

 /**
  * 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();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:18,代码来源:class.ilAdvancedMDRecordExportFilesTableGUI.php


注:本文中的ilDatePresentation::formatDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。