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


PHP ilDatePresentation::formatPeriod方法代码示例

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


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

示例1: availabilityToString

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

示例2: parse

 /**
  * Parse bookings
  * @param int $a_groupid
  * @param ilDate $start
  * @param ilDate $end
  *
  * throws ilViteroConnectionException
  */
 public function parse($a_groupid, ilDateTime $start, ilDateTime $end)
 {
     $booking_list = array();
     try {
         $con = new ilViteroBookingSoapConnector();
         $bookings = $con->getByGroupAndDate($a_groupid, $start, $end);
     } catch (Exception $e) {
         throw $e;
     }
     $booking_arr = array();
     if (is_object($bookings->booking)) {
         $booking_arr = array($bookings->booking);
     } elseif (is_array($bookings->booking)) {
         $booking_arr = $bookings->booking;
     }
     $counter = 0;
     foreach ($booking_arr as $booking) {
         $fstart = ilViteroUtils::parseSoapDate($booking->start);
         $fend = ilViteroUtils::parseSoapDate($booking->end);
         $duration = $fend->get(IL_CAL_UNIX) - $fstart->get(IL_CAL_UNIX);
         foreach (ilViteroUtils::calculateBookingAppointments($start, $end, $booking) as $dl) {
             $booking_list[$counter]['rec'] = $booking->repetitionpattern;
             $booking_list[$counter]['id'] = $booking->bookingid;
             $booking_list[$counter]['start'] = $dl;
             $booking_list[$counter]['startt'] = $dl->get(IL_CAL_UNIX);
             $bend = clone $dl;
             $bend->setDate($dl->get(IL_CAL_UNIX) + $duration, IL_CAL_UNIX);
             $booking_list[$counter]['end'] = $bend;
             if ($booking->cafe) {
                 $booking_list[$counter]['start'] = new ilDate($booking_list[$counter]['startt'], IL_CAL_UNIX);
                 $booking_list[$counter]['time'] = ilDatePresentation::formatDate($booking_list[$counter]['start']);
             } else {
                 $booking_list[$counter]['time'] = ilDatePresentation::formatPeriod($booking_list[$counter]['start'], $booking_list[$counter]['end']);
             }
             $booking_list[$counter]['duration'] = ilFormat::_secondsToString($booking_list[$counter]['end']->get(IL_CAL_UNIX) - $booking_list[$counter]['start']->get(IL_CAL_UNIX), false);
             if ($booking->repetitionpattern) {
                 $repend = ilViteroUtils::parseSoapDate($booking->repetitionenddate);
                 $booking_list[$counter]['ends'] = ilDatePresentation::formatDate(new ilDate($repend->get(IL_CAL_UNIX), IL_CAL_UNIX));
             }
             $counter++;
         }
     }
     $this->setMaxCount(count($booking_list));
     $this->setData($booking_list);
 }
开发者ID:leifos-gmbh,项目名称:Vitero,代码行数:53,代码来源:class.ilViteroBookingTableGUI.php

示例3: showMessages


//.........这里部分代码省略.........
     // should be able to grep templates
     if ($export) {
         $roomTpl = new ilTemplate('tpl.history_export.html', true, true, 'Modules/Chatroom');
     } else {
         $roomTpl = new ilTemplate('tpl.history.html', true, true, 'Modules/Chatroom');
     }
     $scopes = array();
     if ($export) {
         ilDatePresentation::setUseRelativeDates(false);
     }
     global $ilUser;
     $time_format = $ilUser->getTimeFormat();
     $prevDate = '';
     $messagesShown = 0;
     $lastDateTime = null;
     foreach ($messages as $message) {
         $message['message']->message = json_decode($message['message']->message);
         switch ($message['message']->type) {
             case 'message':
                 if ($_REQUEST['scope'] && $message['message']->sub == $_REQUEST['scope'] || !$_REQUEST['scope'] && !$message['message']->sub) {
                     $date = new ilDate($message['timestamp'], IL_CAL_UNIX);
                     $dateTime = new ilDateTime($message['timestamp'], IL_CAL_UNIX);
                     $currentDate = ilDatePresentation::formatDate($dateTime);
                     $roomTpl->setCurrentBlock('MESSAGELINE');
                     $roomTpl->setVariable('MESSAGECONTENT', $message['message']->message->content);
                     // oops... it is a message? ^^
                     $roomTpl->setVariable('MESSAGESENDER', $message['message']->user->username);
                     if (null == $lastDateTime || date('d', $lastDateTime->get(IL_CAL_UNIX)) != date('d', $dateTime->get(IL_CAL_UNIX)) || date('m', $lastDateTime->get(IL_CAL_UNIX)) != date('m', $dateTime->get(IL_CAL_UNIX)) || date('Y', $lastDateTime->get(IL_CAL_UNIX)) != date('Y', $dateTime->get(IL_CAL_UNIX))) {
                         $roomTpl->setVariable('MESSAGEDATE', ilDatePresentation::formatDate($date));
                     }
                     if ($prevDate != $currentDate) {
                         switch ($time_format) {
                             case ilCalendarSettings::TIME_FORMAT_24:
                                 $date_string = $dateTime->get(IL_CAL_FKT_DATE, 'H:i', $ilUser->getTimeZone());
                                 break;
                             case ilCalendarSettings::TIME_FORMAT_12:
                                 $date_string = $dateTime->get(IL_CAL_FKT_DATE, 'g:ia', $ilUser->getTimeZone());
                                 break;
                         }
                         $roomTpl->setVariable('MESSAGETIME', $date_string);
                         $prevDate = $currentDate;
                     }
                     $roomTpl->parseCurrentBlock();
                     $lastDateTime = $dateTime;
                     ++$messagesShown;
                 }
                 break;
         }
     }
     foreach ($psessions as $session) {
         $scopes[$session['proom_id']] = $session['title'];
     }
     if (isset($scopes[''])) {
         unset($scopes['']);
     }
     if (!$messagesShown) {
         //$roomTpl->touchBlock('NO_MESSAGES');
         $roomTpl->setVariable('LBL_NO_MESSAGES', $lng->txt('no_messages'));
     }
     asort($scopes, SORT_STRING);
     $scopes = array($lng->txt('main')) + $scopes;
     if (count($scopes) > 1) {
         $select = new ilSelectInputGUI($lng->txt('scope'), 'scope');
         $select->setOptions($scopes);
         if (isset($_REQUEST['scope'])) {
             $select->setValue($_REQUEST['scope']);
         }
         $durationForm->addItem($select);
     }
     $room = ilChatroom::byObjectId($this->gui->object->getId());
     //if ($room->getSetting('private_rooms_enabled')) {
     $prevUseRelDates = ilDatePresentation::useRelativeDates();
     ilDatePresentation::setUseRelativeDates(false);
     $unixFrom = $from->getUnixTime();
     $unixTo = $to->getUnixTime();
     if ($unixFrom == $unixTo) {
         $date = new ilDate($unixFrom, IL_CAL_UNIX);
         $date_sub = ilDatePresentation::formatDate($date);
     } else {
         $date1 = new ilDate($unixFrom, IL_CAL_UNIX);
         $date2 = new ilDate($unixTo, IL_CAL_UNIX);
         $date_sub = ilDatePresentation::formatPeriod($date1, $date2);
     }
     ilDatePresentation::setUseRelativeDates($prevUseRelDates);
     $isPrivateRoom = (bool) (int) $_REQUEST['scope'];
     if ($isPrivateRoom) {
         $roomTpl->setVariable('ROOM_TITLE', sprintf($lng->txt('history_title_private_room'), $scopes[(int) $_REQUEST['scope']]) . ' (' . $date_sub . ')');
     } else {
         $roomTpl->setVariable('ROOM_TITLE', sprintf($lng->txt('history_title_general'), $this->gui->object->getTitle()) . ' (' . $date_sub . ')');
     }
     //}
     if ($export) {
         header("Content-Type: text/html");
         header("Content-Disposition: attachment; filename=\"" . urlencode($scopes[(int) $_REQUEST['scope']] . '.html') . "\"");
         echo $roomTpl->get();
         exit;
     }
     $roomTpl->setVariable('PERIOD_FORM', $durationForm->getHTML());
     $tpl->setVariable('ADM_CONTENT', $roomTpl->get());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilChatroomHistoryTask.php

示例4: fillRow

 /**
  * fill row
  *
  * @access protected
  * @param array set of data
  * @return
  */
 protected function fillRow($a_set)
 {
     global $ilUser, $lng;
     if ($a_set["milestone"]) {
         $this->tpl->setCurrentBlock("img_ms");
         $this->tpl->setVariable("IMG_MS", ilUtil::getImagePath("icon_ms_s.png"));
         $this->tpl->setVariable("ALT_MS", $lng->txt("cal_milestone"));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable('VAL_DESCRIPTION', $a_set['description']);
     $this->tpl->setVariable('VAL_TITLE_LINK', $a_set['title']);
     $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $a_set['id']);
     $this->tpl->setVariable('VAL_LINK', $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'edit'));
     switch ($a_set['frequence']) {
         case IL_CAL_FREQ_DAILY:
             $this->tpl->setVariable('VAL_FREQUENCE', $this->lng->txt('cal_daily'));
             break;
         case IL_CAL_FREQ_WEEKLY:
             $this->tpl->setVariable('VAL_FREQUENCE', $this->lng->txt('cal_weekly'));
             break;
         case IL_CAL_FREQ_MONTHLY:
             $this->tpl->setVariable('VAL_FREQUENCE', $this->lng->txt('cal_monthly'));
             break;
         case IL_CAL_FREQ_YEARLY:
             $this->tpl->setVariable('VAL_FREQUENCE', $this->lng->txt('cal_yearly'));
             break;
         default:
             #$this->tpl->setVariable('VAL_FREQUENCE',$this->lng->txt('cal_no_recurrence'));
             break;
     }
     if ($a_set['fullday']) {
         $date = ilDatePresentation::formatPeriod(new ilDate($a_set['begin'], IL_CAL_UNIX), new ilDate($a_set['end'], IL_CAL_UNIX));
     } else {
         $date = ilDatePresentation::formatPeriod(new ilDateTime($a_set['begin'], IL_CAL_UNIX), new ilDateTime($a_set['end'], IL_CAL_UNIX));
     }
     $this->tpl->setVariable('VAL_BEGIN', $date);
     /*
     if($a_set['duration'])
     {
     	if($a_set['milestone'])
     	{
     		$this->tpl->setVariable('VAL_DURATION','-');
     	}
     	else
     	{
     		$this->tpl->setVariable('VAL_DURATION',ilFormat::_secondsToString($a_set['duration']));
     	}
     }
     else
     {
     	$this->tpl->setVariable('VAL_DURATION','');
     }
     */
     $update = new ilDateTime($a_set['last_update'], IL_CAL_UNIX, $ilUser->getTimeZone());
     $this->tpl->setVariable('VAL_LAST_UPDATE', ilDatePresentation::formatDate($update));
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:63,代码来源:class.ilCalendarChangedAppointmentsTableGUI.php

示例5: getProperties

 /**
  * Get item properties
  *
  * @return	array		array of property arrays:
  *						'alert' (boolean) => display as an alert property (usually in red)
  *						'property' (string) => property name
  *						'value' (string) => property value
  */
 public function getProperties()
 {
     $props = array();
     $this->plugin->includeClass('class.ilObjAdobeConnect.php');
     $objectData = ilObjAdobeConnect::getObjectData($this->obj_id);
     if ($objectData->permanent_room == 1) {
         $props[] = array('alert' => false, 'value' => $this->plugin->txt('permanent_room'));
     } else {
         if ((int) $objectData->start_date > time() || (int) $objectData->end_date < time()) {
             $props[] = array('alert' => false, 'value' => $this->plugin->txt('meeting_not_available'));
         } else {
             $props[] = array('alert' => false, 'property' => $this->txt('start_date'), 'value' => ilDatePresentation::formatDate(new ilDateTime($objectData->start_date, IL_CAL_UNIX)));
             $props[] = array('alert' => false, 'property' => $this->txt('duration'), 'value' => ilDatePresentation::formatPeriod(new ilDateTime($objectData->start_date, IL_CAL_UNIX), new ilDateTime($objectData->end_date, IL_CAL_UNIX)));
         }
     }
     return $props;
 }
开发者ID:HochschuleLuzern,项目名称:ILIAS_AdobeConnectPlugin,代码行数:25,代码来源:class.ilObjAdobeConnectListGUI.php

示例6: initAttendanceList

 /**
  * Init attendance list object
  * 
  * @return ilAttendanceList 
  */
 protected function initAttendanceList()
 {
     $members_obj = $this->initContainer(true);
     include_once 'Services/Membership/classes/class.ilAttendanceList.php';
     $list = new ilAttendanceList($this, $members_obj);
     $list->setId('sessattlst');
     $event_app = $this->object->getFirstAppointment();
     ilDatePresentation::setUseRelativeDates(false);
     $desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
     ilDatePresentation::setUseRelativeDates(true);
     $desc .= " " . $this->object->getTitle();
     $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
     $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
     $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
     if ($this->object->enabledRegistration()) {
         $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
     }
     $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
     $list->addBlank($this->lng->txt('sess_signature'));
     $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
     return $list;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:27,代码来源:class.ilObjSessionGUI.php

示例7: fillRow

 /**
  * fill row 
  *
  * @access public
  * @param
  * @return
  */
 public function fillRow($a_set)
 {
     global $ilAccess;
     $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
     $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']);
     if (!$ilAccess->checkAccessOfUser($a_set['usr_id'], 'read', '', $this->getParentObject()->object->getRefId()) and is_array($info = $ilAccess->getInfo())) {
         $this->tpl->setCurrentBlock('access_warning');
         $this->tpl->setVariable('PARENT_ACCESS', $info[0]['text']);
         $this->tpl->parseCurrentBlock();
     }
     if (!ilObjUser::_lookupActive($a_set['usr_id'])) {
         $this->tpl->setCurrentBlock('access_warning');
         $this->tpl->setVariable('PARENT_ACCESS', $this->lng->txt('usr_account_inactive'));
         $this->tpl->parseCurrentBlock();
     }
     foreach ($this->getSelectedColumns() as $field) {
         switch ($field) {
             case 'gender':
                 $a_set['gender'] = $a_set['gender'] ? $this->lng->txt('gender_' . $a_set['gender']) : '';
                 $this->tpl->setCurrentBlock('custom_fields');
                 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
                 $this->tpl->parseCurrentBlock();
                 break;
             case 'birthday':
                 $a_set['birthday'] = $a_set['birthday'] ? ilDatePresentation::formatDate(new ilDate($a_set['birthday'], IL_CAL_DATE)) : $this->lng->txt('no_date');
                 $this->tpl->setCurrentBlock('custom_fields');
                 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
                 $this->tpl->parseCurrentBlock();
                 break;
             case 'consultation_hour':
                 $this->tpl->setCurrentBlock('custom_fields');
                 $dts = array();
                 foreach ((array) $a_set['consultation_hours'] as $ch) {
                     $tmp = ilDatePresentation::formatPeriod(new ilDateTime($ch['dt'], IL_CAL_UNIX), new ilDateTime($ch['dtend'], IL_CAL_UNIX));
                     if ($ch['explanation']) {
                         $tmp .= ' ' . $ch['explanation'];
                     }
                     $dts[] = $tmp;
                 }
                 $dt_string = implode('<br />', $dts);
                 $this->tpl->setVariable('VAL_CUST', $dt_string);
                 $this->tpl->parseCurrentBlock();
                 break;
             case 'prtf':
                 $tmp = array();
                 if (is_array($a_set['prtf'])) {
                     foreach ($a_set['prtf'] as $prtf_url => $prtf_txt) {
                         $tmp[] = '<a href="' . $prtf_url . '">' . $prtf_txt . '</a>';
                     }
                 }
                 $this->tpl->setVariable('VAL_CUST', implode('<br />', $tmp));
                 break;
             case 'odf_last_update':
                 $this->tpl->setVariable('VAL_EDIT_INFO', (string) $a_set['odf_info_txt']);
                 break;
             default:
                 $this->tpl->setCurrentBlock('custom_fields');
                 $this->tpl->setVariable('VAL_CUST', isset($a_set[$field]) ? (string) $a_set[$field] : '');
                 $this->tpl->parseCurrentBlock();
                 break;
         }
     }
     if ($this->privacy->enabledCourseAccessTimes()) {
         $this->tpl->setVariable('VAL_ACCESS', $a_set['access_time']);
     }
     if ($this->show_learning_progress) {
         $this->tpl->setCurrentBlock('lp');
         switch ($a_set['progress']) {
             case ilLPStatus::LP_STATUS_COMPLETED:
                 $this->tpl->setVariable('LP_STATUS_ALT', $this->lng->txt($a_set['progress']));
                 $this->tpl->setVariable('LP_STATUS_PATH', ilUtil::getImagePath('scorm/complete.svg'));
                 break;
             case ilLPStatus::LP_STATUS_IN_PROGRESS:
                 $this->tpl->setVariable('LP_STATUS_ALT', $this->lng->txt($a_set['progress']));
                 $this->tpl->setVariable('LP_STATUS_PATH', ilUtil::getImagePath('scorm/incomplete.svg'));
                 break;
             case ilLPStatus::LP_STATUS_NOT_ATTEMPTED:
                 $this->tpl->setVariable('LP_STATUS_ALT', $this->lng->txt($a_set['progress']));
                 $this->tpl->setVariable('LP_STATUS_PATH', ilUtil::getImagePath('scorm/not_attempted.svg'));
                 break;
             case ilLPStatus::LP_STATUS_FAILED:
                 $this->tpl->setVariable('LP_STATUS_ALT', $this->lng->txt($a_set['progress']));
                 $this->tpl->setVariable('LP_STATUS_PATH', ilUtil::getImagePath('scorm/failed.svg'));
                 break;
         }
         $this->tpl->parseCurrentBlock();
     }
     if ($this->type == 'admin') {
         $this->tpl->setVariable('VAL_POSTNAME', 'admins');
         $this->tpl->setVariable('VAL_NOTIFICATION_ID', $a_set['usr_id']);
         $this->tpl->setVariable('VAL_NOTIFICATION_CHECKED', $a_set['notification'] ? 'checked="checked"' : '');
     } elseif ($this->type == 'tutor') {
         $this->tpl->setVariable('VAL_POSTNAME', 'tutors');
//.........这里部分代码省略.........
开发者ID:bheyser,项目名称:qplskl,代码行数:101,代码来源:class.ilCourseParticipantsTableGUI.php

示例8: infoScreen

 /**
  * show information screen
  */
 function infoScreen()
 {
     global $ilErr, $ilAccess, $ilUser, $ilSetting;
     $this->checkPermission('visible');
     // Fill meta header tags
     include_once 'Services/MetaData/classes/class.ilMDUtils.php';
     ilMDUtils::_fillHTMLMetaTags($this->object->getId(), $this->object->getId(), 'crs');
     $this->tabs_gui->setTabActive('info_short');
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     include_once 'Modules/Course/classes/class.ilCourseFile.php';
     $files =& ilCourseFile::_readFilesByCourse($this->object->getId());
     $info = new ilInfoScreenGUI($this);
     $info->enablePrivateNotes();
     $info->enableFeedback();
     $info->enableNews();
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         $info->enableNewsEditing();
     }
     if (strlen($this->object->getImportantInformation()) or strlen($this->object->getSyllabus()) or count($files)) {
         $info->addSection($this->lng->txt('crs_general_informations'));
     }
     if (strlen($this->object->getImportantInformation())) {
         $info->addProperty($this->lng->txt('crs_important_info'), "<strong>" . nl2br(ilUtil::makeClickable($this->object->getImportantInformation(), true) . "</strong>"));
     }
     if (strlen($this->object->getSyllabus())) {
         $info->addProperty($this->lng->txt('crs_syllabus'), nl2br(ilUtil::makeClickable($this->object->getSyllabus(), true)));
     }
     // files
     if (count($files)) {
         $tpl = new ilTemplate('tpl.event_info_file.html', true, true, 'Modules/Course');
         foreach ($files as $file) {
             $tpl->setCurrentBlock("files");
             $this->ctrl->setParameter($this, 'file_id', $file->getFileId());
             $tpl->setVariable("DOWN_LINK", $this->ctrl->getLinkTarget($this, 'sendfile'));
             $tpl->setVariable("DOWN_NAME", $file->getFileName());
             $tpl->setVariable("DOWN_INFO_TXT", $this->lng->txt('crs_file_size_info'));
             $tpl->setVariable("DOWN_SIZE", $file->getFileSize());
             $tpl->setVariable("TXT_BYTES", $this->lng->txt('bytes'));
             $tpl->parseCurrentBlock();
         }
         $info->addProperty($this->lng->txt('crs_file_download'), $tpl->get());
     }
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'crs', $this->object->getId());
     $record_gui->setInfoObject($info);
     $record_gui->parse();
     // meta data
     $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
     // contact
     if ($this->object->hasContactData()) {
         $info->addSection($this->lng->txt("crs_contact"));
     }
     if (strlen($this->object->getContactName())) {
         $info->addProperty($this->lng->txt("crs_contact_name"), $this->object->getContactName());
     }
     if (strlen($this->object->getContactResponsibility())) {
         $info->addProperty($this->lng->txt("crs_contact_responsibility"), $this->object->getContactResponsibility());
     }
     if (strlen($this->object->getContactPhone())) {
         $info->addProperty($this->lng->txt("crs_contact_phone"), $this->object->getContactPhone());
     }
     if ($this->object->getContactEmail()) {
         require_once 'Services/Mail/classes/class.ilMailFormCall.php';
         $emails = split(",", $this->object->getContactEmail());
         foreach ($emails as $email) {
             $email = trim($email);
             $etpl = new ilTemplate("tpl.crs_contact_email.html", true, true, 'Modules/Course');
             $etpl->setVariable("EMAIL_LINK", ilMailFormCall::getLinkTarget($info, 'showSummary', array(), array('type' => 'new', 'rcp_to' => $email, 'sig' => $this->createMailSignature())));
             $etpl->setVariable("CONTACT_EMAIL", $email);
             $mailString .= $etpl->get() . "<br />";
         }
         $info->addProperty($this->lng->txt("crs_contact_email"), $mailString);
     }
     if (strlen($this->object->getContactConsultation())) {
         $info->addProperty($this->lng->txt("crs_contact_consultation"), nl2br($this->object->getContactConsultation()));
     }
     //
     // access
     //
     // #10360
     $this->lng->loadLanguageModule("rep");
     $info->addSection($this->lng->txt("rep_activation_availability"));
     $info->showLDAPRoleGroupMappingInfo();
     // activation
     if ($this->object->getActivationUnlimitedStatus()) {
         $info->addProperty($this->lng->txt("rep_activation_access"), $this->lng->txt('crs_visibility_limitless'));
     } else {
         $info->addProperty($this->lng->txt('rep_activation_access'), ilDatePresentation::formatPeriod(new ilDateTime($this->object->getActivationStart(), IL_CAL_UNIX), new ilDateTime($this->object->getActivationEnd(), IL_CAL_UNIX)));
     }
     switch ($this->object->getSubscriptionLimitationType()) {
         case IL_CRS_SUBSCRIPTION_DEACTIVATED:
             $txt = $this->lng->txt("crs_info_reg_deactivated");
             break;
         default:
             switch ($this->object->getSubscriptionType()) {
                 case IL_CRS_SUBSCRIPTION_CONFIRMATION:
                     $txt = $this->lng->txt("crs_info_reg_confirmation");
//.........这里部分代码省略.........
开发者ID:bheyser,项目名称:qplskl,代码行数:101,代码来源:class.ilObjCourseGUI.php

示例9: infoScreen

 public function infoScreen()
 {
     global $tpl;
     $this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php');
     $this->pluginObj->includeClass('class.ilAdobeConnectServer.php');
     $this->pluginObj->includeClass('class.ilAdobeConnectQuota.php');
     $this->pluginObj->includeClass("class.ilObjAdobeConnectAccess.php");
     $settings = ilAdobeConnectServer::_getInstance();
     $this->tabs->setTabActive('info_short');
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     $info->removeFormAction();
     $info->addSection($this->pluginObj->txt('general'));
     if ($this->object->getPermanentRoom() == 1 && ilAdobeConnectServer::getSetting('enable_perm_room', '1')) {
         $duration_text = $this->pluginObj->txt('permanent_room');
     } else {
         $duration_text = ilDatePresentation::formatPeriod(new ilDateTime($this->object->getStartDate()->getUnixTime(), IL_CAL_UNIX), new ilDateTime($this->object->getEndDate()->getUnixTime(), IL_CAL_UNIX));
     }
     $presentation_url = $settings->getPresentationUrl();
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->pluginObj->txt('access_meeting_title'));
     $this->object->doRead();
     if ($this->object->getStartDate() != NULL) {
         $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId());
         $ilAdobeConnectUser->ensureAccountExistance();
         $xavc_login = $ilAdobeConnectUser->getXAVCLogin();
         $quota = new ilAdobeConnectQuota();
     }
     // show link
     if (($this->object->getPermanentRoom() == 1 || $this->doProvideAccessLink()) && $this->object->isParticipant($xavc_login)) {
         if (!$quota->mayStartScheduledMeeting($this->object->getScoId())) {
             $href = $this->txt("meeting_not_available_no_slots");
         } else {
             $href = '<a href="' . $this->ctrl->getLinkTarget($this, 'performSso') . '" target="_blank" >' . $presentation_url . $this->object->getURL() . '</a>';
         }
     } else {
         $href = $this->txt("meeting_not_available");
     }
     $info->addProperty($this->pluginObj->txt('duration'), $duration_text);
     $info->addProperty($this->pluginObj->txt('meeting_url'), $href);
     $tpl->setContent($info->getHTML() . $this->getPerformTriggerHtml());
 }
开发者ID:KamuiXenom,项目名称:ILIAS_AdobeConnectPlugin,代码行数:42,代码来源:class.ilObjAdobeConnectGUI.php

示例10: replacePlaceholders

 function replacePlaceholders($a_string, &$a_user, $a_amail, $a_lang)
 {
     global $ilSetting, $tree;
     // determine salutation
     switch ($a_user->getGender()) {
         case "f":
             $gender_salut = $a_amail["sal_f"];
             break;
         case "m":
             $gender_salut = $a_amail["sal_m"];
             break;
         default:
             $gender_salut = $a_amail["sal_g"];
     }
     $gender_salut = trim($gender_salut);
     $a_string = str_replace("[MAIL_SALUTATION]", $gender_salut, $a_string);
     $a_string = str_replace("[LOGIN]", $a_user->getLogin(), $a_string);
     $a_string = str_replace("[FIRST_NAME]", $a_user->getFirstname(), $a_string);
     $a_string = str_replace("[LAST_NAME]", $a_user->getLastname(), $a_string);
     // BEGIN Mail Include E-Mail Address in account mail
     $a_string = str_replace("[EMAIL]", $a_user->getEmail(), $a_string);
     // END Mail Include E-Mail Address in account mail
     $a_string = str_replace("[PASSWORD]", $this->getUserPassword(), $a_string);
     $a_string = str_replace("[ILIAS_URL]", ILIAS_HTTP_PATH . "/login.php?client_id=" . CLIENT_ID, $a_string);
     $a_string = str_replace("[CLIENT_NAME]", CLIENT_NAME, $a_string);
     $a_string = str_replace("[ADMIN_MAIL]", $ilSetting->get("admin_email"), $a_string);
     // (no) password sections
     if ($this->getUserPassword() == "") {
         // #12232
         $a_string = preg_replace("/\\[IF_PASSWORD\\].*\\[\\/IF_PASSWORD\\]/imsU", "", $a_string);
         $a_string = preg_replace("/\\[IF_NO_PASSWORD\\](.*)\\[\\/IF_NO_PASSWORD\\]/imsU", "\$1", $a_string);
     } else {
         $a_string = preg_replace("/\\[IF_NO_PASSWORD\\].*\\[\\/IF_NO_PASSWORD\\]/imsU", "", $a_string);
         $a_string = preg_replace("/\\[IF_PASSWORD\\](.*)\\[\\/IF_PASSWORD\\]/imsU", "\$1", $a_string);
     }
     // #13346
     if (!$a_user->getTimeLimitUnlimited()) {
         // #6098
         $a_string = preg_replace("/\\[IF_TIMELIMIT\\](.*)\\[\\/IF_TIMELIMIT\\]/imsU", "\$1", $a_string);
         $timelimit_from = new ilDateTime($a_user->getTimeLimitFrom(), IL_CAL_UNIX);
         $timelimit_until = new ilDateTime($a_user->getTimeLimitUntil(), IL_CAL_UNIX);
         $timelimit = ilDatePresentation::formatPeriod($timelimit_from, $timelimit_until);
         $a_string = str_replace("[TIMELIMIT]", $timelimit, $a_string);
     } else {
         $a_string = preg_replace("/\\[IF_TIMELIMIT\\](.*)\\[\\/IF_TIMELIMIT\\]/imsU", "", $a_string);
     }
     // target
     $tar = false;
     if ($_GET["target"] != "") {
         $tarr = explode("_", $_GET["target"]);
         if ($tree->isInTree($tarr[1])) {
             $obj_id = ilObject::_lookupObjId($tarr[1]);
             $type = ilObject::_lookupType($obj_id);
             if ($type == $tarr[0]) {
                 $a_string = str_replace("[TARGET_TITLE]", ilObject::_lookupTitle($obj_id), $a_string);
                 $a_string = str_replace("[TARGET]", ILIAS_HTTP_PATH . "/goto.php?client_id=" . CLIENT_ID . "&target=" . $_GET["target"], $a_string);
                 // this looks complicated, but we may have no initilised $lng object here
                 // if mail is send during user creation in authentication
                 include_once "./Services/Language/classes/class.ilLanguage.php";
                 $a_string = str_replace("[TARGET_TYPE]", ilLanguage::_lookupEntry($a_lang, "common", "obj_" . $tarr[0]), $a_string);
                 $tar = true;
             }
         }
     }
     // (no) target section
     if (!$tar) {
         $a_string = preg_replace("/\\[IF_TARGET\\].*\\[\\/IF_TARGET\\]/imsU", "", $a_string);
     } else {
         $a_string = preg_replace("/\\[IF_TARGET\\](.*)\\[\\/IF_TARGET\\]/imsU", "\$1", $a_string);
     }
     return $a_string;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:72,代码来源:class.ilAccountMail.php

示例11: initBookingNumbersForm

 protected function initBookingNumbersForm(array $a_objects_counter, $a_group_id)
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "confirmedBooking"));
     $form->setTitle($this->lng->txt("book_confirm_booking_schedule_number_of_objects"));
     $form->setDescription($this->lng->txt("book_confirm_booking_schedule_number_of_objects_info"));
     include_once 'Modules/BookingManager/classes/class.ilBookingObject.php';
     $section = false;
     foreach ($a_objects_counter as $id => $counter) {
         $id = explode("_", $id);
         $book_id = $id[0] . "_" . $id[1] . "_" . $id[2] . "_" . $counter;
         $obj = new ilBookingObject($id[0]);
         if (!$section) {
             $section = new ilFormSectionHeaderGUI();
             $section->setTitle($obj->getTitle());
             $form->addItem($section);
             $section = true;
         }
         $period = ilDatePresentation::formatPeriod(new ilDateTime($id[1], IL_CAL_UNIX), new ilDateTime($id[2], IL_CAL_UNIX));
         $nr_field = new ilNumberInputGUI($period, "conf_nr__" . $book_id);
         $nr_field->setValue(1);
         $nr_field->setSize(3);
         $nr_field->setMaxValue($counter);
         $nr_field->setMinValue(1);
         $nr_field->setRequired(true);
         $form->addItem($nr_field);
     }
     if ($a_group_id) {
         $grp = new ilHiddenInputGUI("grp_id");
         $grp->setValue($a_group_id);
         $form->addItem($grp);
     }
     $form->addCommandButton("confirmedBookingNumbers", $this->lng->txt("confirm"));
     $form->addCommandButton("render", $this->lng->txt("cancel"));
     return $form;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:37,代码来源:class.ilObjBookingPoolGUI.php

示例12: displayPostInfo

 public function displayPostInfo()
 {
     global $tpl, $ilUser, $lng, $ilCtrl;
     $id = (int) $_GET["object_id"];
     if (!$id) {
         return;
     }
     // placeholder
     include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
     $book_ids = ilBookingReservation::getObjectReservationForUser($id, $ilUser->getId(), true);
     $tmp = array();
     $rsv_ids = explode(";", $_GET["rsv_ids"]);
     foreach ($book_ids as $book_id) {
         if (in_array($book_id, $rsv_ids)) {
             $obj = new ilBookingReservation($book_id);
             $from = $obj->getFrom();
             $to = $obj->getTo();
             if ($from > time()) {
                 $tmp[$from . "-" . $to]++;
             }
         }
     }
     $olddt = ilDatePresentation::useRelativeDates();
     ilDatePresentation::setUseRelativeDates(false);
     $period = array();
     ksort($tmp);
     foreach ($tmp as $time => $counter) {
         $time = explode("-", $time);
         $time = ilDatePresentation::formatPeriod(new ilDateTime($time[0], IL_CAL_UNIX), new ilDateTime($time[1], IL_CAL_UNIX));
         if ($counter > 1) {
             $time .= " (" . $counter . ")";
         }
         $period[] = $time;
     }
     $book_id = array_shift($book_ids);
     ilDatePresentation::setUseRelativeDates($olddt);
     $obj = new ilBookingReservation($book_id);
     if ($obj->getUserId() != $ilUser->getId()) {
         return;
     }
     include_once 'Modules/BookingManager/classes/class.ilBookingObject.php';
     $obj = new ilBookingObject($id);
     $pfile = $obj->getPostFile();
     $ptext = $obj->getPostText();
     $mytpl = new ilTemplate('tpl.booking_reservation_post.html', true, true, 'Modules/BookingManager');
     $mytpl->setVariable("TITLE", $lng->txt('book_post_booking_information'));
     if ($ptext) {
         // placeholder
         $ptext = str_replace("[OBJECT]", $obj->getTitle(), $ptext);
         $ptext = str_replace("[PERIOD]", implode("<br />", $period), $ptext);
         $mytpl->setVariable("POST_TEXT", nl2br($ptext));
     }
     if ($pfile) {
         $ilCtrl->setParameter($this, "object_id", $obj->getId());
         $url = $ilCtrl->getLinkTarget($this, 'deliverPostFile');
         $ilCtrl->setParameter($this, "object_id", "");
         $mytpl->setVariable("DOWNLOAD", $lng->txt('download'));
         $mytpl->setVariable("URL_FILE", $url);
         $mytpl->setVariable("TXT_FILE", $pfile);
     }
     $mytpl->setVariable("TXT_SUBMIT", $lng->txt('ok'));
     $mytpl->setVariable("URL_SUBMIT", $ilCtrl->getLinkTargetByClass('ilobjbookingpoolgui', 'render'));
     $tpl->setContent($mytpl->get());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:64,代码来源:class.ilBookingObjectGUI.php

示例13: setAppointments

 /**
  * set appointments
  *
  * @access public
  * @return
  */
 public function setAppointments($a_apps)
 {
     include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
     include_once './Services/Calendar/classes/class.ilCalendarRecurrences.php';
     include_once './Services/Calendar/classes/class.ilCalendarCategory.php';
     $cat = new ilCalendarCategory($this->cat_id);
     foreach ($a_apps as $cal_entry_id) {
         $entry = new ilCalendarEntry($cal_entry_id);
         $rec = ilCalendarRecurrences::_getFirstRecurrence($entry->getEntryId());
         // booking
         if ($cat->getType() == ilCalendarCategory::TYPE_CH) {
             include_once 'Services/Booking/classes/class.ilBookingEntry.php';
             $book = new ilBookingEntry($entry->getContextId());
             if ($book) {
                 $title = $entry->getTitle();
                 if ($book->isOwner()) {
                     $max = (int) $book->getNumberOfBookings();
                     $current = (int) $book->getCurrentNumberOfBookings($entry->getEntryId());
                     if ($max > 1) {
                         $title .= ' (' . $current . '/' . $max . ')';
                     } else {
                         if ($current == $max) {
                             $title .= ' (' . $this->lng->txt('cal_booked_out') . ')';
                         } else {
                             $title .= ' (' . $this->lng->txt('cal_book_free') . ')';
                         }
                     }
                 } else {
                     if ($book->hasBooked($entry->getEntryId())) {
                         $title .= ' (' . $this->lng->txt('cal_date_booked') . ')';
                     }
                 }
             }
         } else {
             $title = $entry->getPresentationTitle();
         }
         $tmp_arr['id'] = $entry->getEntryId();
         $tmp_arr['title'] = $title;
         $tmp_arr['description'] = $entry->getDescription();
         $tmp_arr['fullday'] = $entry->isFullday();
         $tmp_arr['begin'] = $entry->getStart()->get(IL_CAL_UNIX);
         $tmp_arr['end'] = $entry->getEnd()->get(IL_CAL_UNIX);
         $tmp_arr['dt_sort'] = $entry->getStart()->get(IL_CAL_UNIX);
         $tmp_arr['dt'] = ilDatePresentation::formatPeriod($entry->getStart(), $entry->getEnd());
         #$tmp_arr['duration'] = ($dur = $tmp_arr['end'] - $tmp_arr['begin']) ? $dur : 60 * 60 * 24;
         $tmp_arr['duration'] = $tmp_arr['end'] - $tmp_arr['begin'];
         if ($tmp_arr['fullday']) {
             $tmp_arr['duration'] += 60 * 60 * 24;
         }
         if (!$tmp_arr['fullday'] and $tmp_arr['end'] == $tmp_arr['begin']) {
             $tmp_arr['duration'] = '';
         }
         $tmp_arr['frequence'] = $rec->getFrequenceType();
         $tmp_arr['deletable'] = (!$entry->isAutoGenerated() and $this->is_editable);
         $appointments[] = $tmp_arr;
     }
     $this->setData($appointments ? $appointments : array());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:64,代码来源:class.ilCalendarAppointmentsTableGUI.php

示例14: rsvConfirmCancelAggregationForm

 function rsvConfirmCancelAggregationForm($a_ids)
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "rsvCancel"));
     $form->setTitle($this->lng->txt("book_confirm_cancel_aggregation"));
     include_once 'Modules/BookingManager/classes/class.ilBookingObject.php';
     include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
     ilDatePresentation::setUseRelativeDates(false);
     foreach ($a_ids as $idx => $ids) {
         if (is_array($ids)) {
             $first = $ids;
             $first = array_shift($first);
         } else {
             $first = $ids;
         }
         $rsv = new ilBookingReservation($first);
         $obj = new ilBookingObject($rsv->getObjectId());
         $caption = $obj->getTitle() . ", " . ilDatePresentation::formatPeriod(new ilDateTime($rsv->getFrom(), IL_CAL_UNIX), new ilDateTime($rsv->getTo() + 1, IL_CAL_UNIX));
         $item = new ilNumberInputGUI($caption, "rsv_id_" . $idx);
         $item->setRequired(true);
         $item->setMinValue(0);
         $item->setSize(4);
         $form->addItem($item);
         if (is_array($ids)) {
             $item->setMaxValue(sizeof($ids));
             foreach ($ids as $id) {
                 $hidden = new ilHiddenInputGUI("rsv_aggr[" . $idx . "][]");
                 $hidden->setValue($id);
                 $form->addItem($hidden);
             }
         } else {
             $item->setMaxValue(1);
             $hidden = new ilHiddenInputGUI("rsv_aggr[" . $idx . "]");
             $hidden->setValue($ids);
             $form->addItem($hidden);
         }
         if ($_POST["rsv_id_" . $idx]) {
             $item->setValue((int) $_POST["rsv_id_" . $idx]);
         }
     }
     $form->addCommandButton("rsvCancel", $this->lng->txt("confirm"));
     $form->addCommandButton("log", $this->lng->txt("cancel"));
     return $form;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:45,代码来源:class.ilObjBookingPoolGUI.php

示例15: addListGUIActivationProperty

 /**
  * Get timing details for list gui
  *
  * @param ilObjectListGUI $a_list_gui
  * @param array &$a_item
  * @return array caption, value
  */
 public static function addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
 {
     global $lng;
     self::addAdditionalSubItemInformation($a_item);
     if (isset($a_item['timing_type'])) {
         if (!isset($a_item['masked_start'])) {
             $start = $a_item['start'];
             $end = $a_item['end'];
         } else {
             $start = $a_item['masked_start'];
             $end = $a_item['masked_end'];
         }
         $activation = '';
         switch ($a_item['timing_type']) {
             case ilObjectActivation::TIMINGS_ACTIVATION:
                 $activation = ilDatePresentation::formatPeriod(new ilDateTime($start, IL_CAL_UNIX), new ilDateTime($end, IL_CAL_UNIX));
                 break;
             case ilObjectActivation::TIMINGS_PRESETTING:
                 $activation = ilDatePresentation::formatPeriod(new ilDate($start, IL_CAL_UNIX), new ilDate($end, IL_CAL_UNIX));
                 break;
         }
         if ($activation != "") {
             global $lng;
             $lng->loadLanguageModule('crs');
             $a_list_gui->addCustomProperty($lng->txt($a_item['activation_info']), $activation, false, true);
         }
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:35,代码来源:class.ilObjectActivation.php


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