本文整理汇总了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());
}