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


PHP ilTable2GUI::setExternalSegmentation方法代码示例

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


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

示例1: showCreationForm

 private function showCreationForm(ilPropertyFormGUI $form)
 {
     global $tpl;
     require_once dirname(__FILE__) . '/class.ilObjAdobeConnect.php';
     require_once dirname(__FILE__) . '/class.ilAdobeConnectServer.php';
     $num_max_ac_obj = ilAdobeConnectServer::getSetting('ac_interface_objects');
     if ((int) $num_max_ac_obj <= 0) {
         $tpl->setContent($form->getHtml());
         return 0;
     }
     $fromtime = strtotime(date('Y-m-d H:00', time()));
     $totime = strtotime(date('Y-m-d', time() + 60 * 60 * 24 * 15)) - 1;
     $meetings = ilObjAdobeConnect::getMeetingsInRange($fromtime, $totime);
     $meetingsByDay = $this->getFreeMeetingSlotTable($meetings);
     $ranges = array();
     $t0 = $fromtime;
     $t1 = $fromtime;
     /*
      * 2 * 30 minutes for starting and ending buffer
      * 10 minutes as minimum meeting length
      */
     $bufferingTime = 30 * 60 * 2 + 10 * 60;
     $prev_dayinmonth = date('d', $t1);
     for (; $t1 < $totime; $t1 += 60 * 15) {
         $day = date('Y-m-d', $t1);
         $hour = date('H', $t1) * 60 + floor(date('i', $t1) / 15) * 15;
         $dayinmonth = date('d', $t1);
         if ($meetingsByDay[$day] && $meetingsByDay[$day][$hour] && $meetingsByDay[$day][$hour] >= $num_max_ac_obj || $dayinmonth != $prev_dayinmonth) {
             if ($t0 != $t1 && $t1 - $t0 > $bufferingTime) {
                 $ranges[] = array($t0, $t1 - 1, $t1 - $t0);
             }
             if ($dayinmonth != $prev_dayinmonth) {
                 $prev_dayinmonth = $dayinmonth;
                 $t0 = $t1;
             } else {
                 $t0 = $t1 + 60 * 15;
             }
         }
     }
     if ($t0 != $t1) {
         $ranges[] = array($t0, $t1 - 1, $t1 - $t0);
     }
     $data = array();
     foreach ($ranges as $r) {
         $size_hours = floor($r[2] / 60 / 60);
         $size_minutes = ($r[2] - $size_hours * 60 * 60) / 60;
         $data[] = array('sched_from' => ilDatePresentation::formatDate(new ilDateTime($r[0], IL_CAL_UNIX)), 'sched_to' => ilDatePresentation::formatDate(new ilDateTime($r[1], IL_CAL_UNIX)), 'sched_size' => str_pad($size_hours, 2, '0', STR_PAD_LEFT) . ':' . str_pad($size_minutes, 2, '0', STR_PAD_LEFT));
     }
     require_once 'Services/Table/classes/class.ilTable2GUI.php';
     $tgui = new ilTable2GUI($this);
     $tgui->addColumn($this->txt('sched_from'));
     $tgui->addColumn($this->txt('sched_to'));
     $tgui->addColumn($this->txt('sched_size'));
     $tgui->setExternalSegmentation(true);
     $tgui->enabled['footer'] = false;
     //		$tgui->setRowTemplate('tpl.schedule_row.html', 'Customizing/global/plugins/Services/Repository/RepositoryObject/AdobeConnect');
     $tgui->setRowTemplate('tpl.schedule_row.html', $this->pluginObj->getDirectory());
     $tgui->setData($data);
     $tgui->setTitle(sprintf($this->txt('schedule_free_slots'), date('z', $totime - $fromtime)));
     $tpl->setContent($form->getHtml() . '<br />' . $tgui->getHTML());
 }
开发者ID:KamuiXenom,项目名称:ILIAS_AdobeConnectPlugin,代码行数:61,代码来源:class.ilObjAdobeConnectGUI.php


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