本文整理汇总了PHP中ilTable2GUI::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTable2GUI::setData方法的具体用法?PHP ilTable2GUI::setData怎么用?PHP ilTable2GUI::setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTable2GUI
的用法示例。
在下文中一共展示了ilTable2GUI::setData方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vatsObject
public function vatsObject()
{
global $ilAccess;
if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) {
$this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
}
include_once 'Services/Table/classes/class.ilTable2GUI.php';
$tbl = new ilTable2GUI($this, 'vats');
$tbl->setId('pay_vats_tbl');
$tbl->setFormAction($this->ctrl->getFormAction($this), 'createVat');
$tbl->setTitle($this->lng->txt('payment_tax_rates'));
$tbl->setRowTemplate('tpl.shop_vats_list_row.html', 'Services/Payment');
$tbl->setDefaultOrderField('title');
$tbl->addColumn('', 'check', '1%');
$tbl->addColumn($this->lng->txt('vat_title'), 'vat_title', '33%');
$tbl->addColumn($this->lng->txt('vat_rate'), 'vat_rate', '33%');
$tbl->addColumn('', 'commands', '33%');
$oShopVatsList = new ilShopVatsList();
$oShopVatsList->read();
$result = array();
$_SESSION['count_vats'] = $oShopVatsList->getNumItems();
if ($oShopVatsList->hasItems()) {
$tbl->enable('select_all');
$tbl->setSelectAllCheckbox('vat_id');
$counter = 0;
foreach ($oShopVatsList as $oVAT) {
$result[$counter]['check'] = ilUtil::formCheckbox(0, 'vat_id[]', $oVAT->getId());
$result[$counter]['vat_title'] = $oVAT->getTitle();
$result[$counter]['vat_rate'] = ilShopUtils::_formatVAT((double) $oVAT->getRate());
$this->ctrl->setParameter($this, 'vat_id', $oVAT->getId());
$result[$counter]['edit_text'] = $this->lng->txt('edit');
$result[$counter]['edit_url'] = $this->ctrl->getLinkTarget($this, 'editVat');
$result[$counter]['delete_text'] = $this->lng->txt('delete');
$result[$counter]['delete_url'] = $this->ctrl->getLinkTarget($this, 'confirmDeleteVat');
$this->ctrl->clearParameters($this);
++$counter;
}
$tbl->addMultiCommand('confirmDeleteVat', $this->lng->txt('delete'));
} else {
$tbl->disable('header');
$tbl->disable('footer');
$tbl->setNoEntriesText($this->lng->txt('paya_no_vats_assigned'));
}
$tbl->setData($result);
$tbl->addCommandButton('createVat', $this->lng->txt('paya_insert_vats'));
$this->tpl->setContent($tbl->getHTML());
return true;
}
示例2: statisticsObject
/**
* Print out statistics about the language
*/
function statisticsObject()
{
$modules = ilObjLanguageExt::_getModules($this->object->key);
$data = array();
$total = array("module" => '', "all" => 0, "changed" => 0, "unchanged" => 0);
foreach ($modules as $module) {
$row = array();
$row['module'] = $module;
$row['all'] = count($this->object->getAllValues(array($module)));
$row['changed'] = count($this->object->getChangedValues(array($module)));
$row['unchanged'] = $row['all'] - $row['changed'];
$total['all'] += $row['all'];
$total['changed'] += $row['changed'];
$total['unchanged'] += $row['unchanged'];
$data[] = $row;
}
$total['module'] = "<b>" . $this->lng->txt("language_all_modules") . "</b>";
$total['all'] = "<b>" . $total['all'] . "</b>";
$total['changed'] = "<b>" . $total['changed'] . "</b>";
$total['unchanged'] = "<b>" . $total['unchanged'] . "</b>";
$data[] = $total;
// create and configure the table object
include_once 'Services/Table/classes/class.ilTable2GUI.php';
$table_gui = new ilTable2GUI($this, "statistics");
$table_gui->setRowTemplate("tpl.lang_statistics_row.html", "Services/Language");
$table_gui->setEnableTitle(false);
$table_gui->setEnableNumInfo(false);
$table_gui->setLimit(count($data));
$table_gui->setExportFormats(array(ilTable2GUI::EXPORT_EXCEL));
$table_gui->addColumn(ucfirst($this->lng->txt("module")), "", "25%");
$table_gui->addColumn($this->lng->txt("language_scope_global"), "", "25%");
$table_gui->addColumn($this->lng->txt("language_scope_local"), "", "25%");
$table_gui->addColumn($this->lng->txt("language_scope_unchanged"), "", "25%");
$table_gui->setData($data);
$this->tpl->setContent($table_gui->getHTML());
}
示例3: showResults
public function showResults()
{
global $lng, $ilUser, $rbacreview, $ilObjDataCache;
$form = $this->initSearchForm();
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_search.html", "Services/Contact");
$this->tpl->setVariable("ACTION", $this->ctrl->getFormAction($this));
$this->tpl->setTitle($this->lng->txt("mail"));
$this->tpl->setVariable('SEARCHFORM', $form->getHtml());
// #14109
if (strlen($_SESSION['mail_search_search']) < 3) {
if ($_GET["ref"] != "wsp") {
$this->tpl->show();
}
return;
}
$abook = new ilAddressbook($ilUser->getId());
$entries = $abook->searchUsers(addslashes(urldecode($_SESSION['mail_search_search'])));
// remove all contacts who are not registered users for personal workspace
if ($_GET["ref"] == "wsp") {
foreach ($entries as $idx => $entry) {
if (!$entry["login"]) {
unset($entries[$idx]);
}
}
}
if (count($entries)) {
$tbl_addr = new ilTable2GUI($this);
$tbl_addr->setTitle($lng->txt('mail_addressbook'));
$tbl_addr->setRowTemplate('tpl.mail_search_addr_row.html', 'Services/Contact');
$result = array();
$counter = 0;
foreach ($entries as $entry) {
if ($_GET["ref"] != "wsp") {
$result[$counter]['check'] = ilUtil::formCheckbox(0, 'search_name_to_addr[]', $entry['login'] ? $entry['login'] : $entry['email']) . ilUtil::formCheckbox(0, 'search_name_cc[]', $entry['login'] ? $entry['login'] : $entry['email']) . ilUtil::formCheckbox(0, 'search_name_bcc[]', $entry['login'] ? $entry['login'] : $entry['email']);
} else {
$user_id = ilObjUser::_loginExists($entry["login"]);
$result[$counter]['check'] = ilUtil::formCheckbox(0, 'search_name_to_addr[]', $user_id);
}
$result[$counter]['login'] = $entry['login'];
$result[$counter]['firstname'] = $entry['firstname'];
$result[$counter]['lastname'] = $entry['lastname'];
$id = ilObjUser::_lookupId($entry['login']);
if (ilObjUser::_lookupPref($id, 'public_email') == 'y' || !$entry['login']) {
$has_mail_addr = true;
$result[$counter]['email'] = $entry['email'];
}
++$counter;
}
if ($_GET["ref"] != "wsp") {
$tbl_addr->addColumn($this->lng->txt('mail_to') . '/' . $this->lng->txt('cc') . '/' . $this->lng->txt('bc'), 'check', '10%');
} else {
$tbl_addr->addColumn("", "", "1%");
}
$tbl_addr->addColumn($this->lng->txt('login'), 'login', "15%");
$tbl_addr->addColumn($this->lng->txt('firstname'), 'firstname', "15%");
$tbl_addr->addColumn($this->lng->txt('lastname'), 'lastname', "15%");
if ($has_mail_addr) {
foreach ($result as $key => $val) {
if ($val['email'] == '') {
$result[$key]['email'] = ' ';
}
}
$tbl_addr->addColumn($this->lng->txt('email'), 'email', "15%");
}
$tbl_addr->setData($result);
$tbl_addr->setDefaultOrderField('login');
$tbl_addr->setPrefix('addr_');
$tbl_addr->enable('select_all');
$tbl_addr->setSelectAllCheckbox('search_name_to_addr');
$tbl_addr->setFormName('recipients');
$this->tpl->setVariable('TABLE_ADDR', $tbl_addr->getHTML());
}
include_once 'Services/Search/classes/class.ilQueryParser.php';
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
include_once 'Services/Search/classes/class.ilSearchResult.php';
$all_results = new ilSearchResult();
$query_parser = new ilQueryParser(addcslashes($_SESSION['mail_search_search'], '%_'));
$query_parser->setCombination(QP_COMBINATION_AND);
$query_parser->setMinWordLength(3);
$query_parser->parse();
$user_search =& ilObjectSearchFactory::_getUserSearchInstance($query_parser);
$user_search->enableActiveCheck(true);
$user_search->setFields(array('login'));
$result_obj = $user_search->performSearch();
$all_results->mergeEntries($result_obj);
$user_search->setFields(array('firstname'));
$result_obj = $user_search->performSearch();
$all_results->mergeEntries($result_obj);
$user_search->setFields(array('lastname'));
$result_obj = $user_search->performSearch();
$all_results->mergeEntries($result_obj);
$all_results->setMaxHits(100000);
$all_results->preventOverwritingMaxhits(true);
$all_results->filter(ROOT_FOLDER_ID, true);
// Filter users (depends on setting in user accounts)
include_once 'Services/User/classes/class.ilUserFilter.php';
$users = ilUserFilter::getInstance()->filter($all_results->getResultIds());
if (count($users)) {
$tbl_users = new ilTable2GUI($this);
$tbl_users->setTitle($lng->txt('system') . ': ' . $lng->txt('persons'));
//.........这里部分代码省略.........
示例4: editSocialBookmarksObject
/**
* Configure social bookmark settings
*
* @access public
*/
function editSocialBookmarksObject()
{
global $ilAccess, $rbacreview, $lng, $ilCtrl;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
$this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
}
$this->__initSubTabs("editSocialBookmarks");
include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
$rset = ilSocialBookmarks::_getEntry();
$counter = 0;
foreach ($rset as $row) {
$current_selection_list = new ilAdvancedSelectionListGUI();
$current_selection_list->setListTitle($lng->txt("actions"));
$current_selection_list->setId("act_" . $counter++);
$ilCtrl->setParameter($this, 'sbm_id', $row->sbm_id);
$current_selection_list->addItem($lng->txt("edit"), '', $ilCtrl->getLinkTarget($this, "editSocialBookmark"));
$current_selection_list->addItem($lng->txt("delete"), '', $ilCtrl->getLinkTarget($this, "deleteSocialBookmarks"));
$toggle_action = '';
if ($row->sbm_active) {
$current_selection_list->addItem($lng->txt("socialbm_disable"), '', $toggle_action = $ilCtrl->getLinkTarget($this, "disableSocialBookmarks"));
} else {
$current_selection_list->addItem($lng->txt("socialbm_enable"), '', $toggle_action = $ilCtrl->getLinkTarget($this, "enableSocialBookmarks"));
}
$dset[] = array('CHECK' => ilUtil::formCheckbox(0, 'sbm_id[]', $row->sbm_id), 'ID' => $row->sbm_id, 'TITLE' => $row->sbm_title, 'LINK' => str_replace('{', '{', $row->sbm_link), 'ICON' => $row->sbm_icon, 'ACTIVE' => $row->sbm_active ? $lng->txt('enabled') : $lng->txt('disabled'), 'ACTIONS' => $current_selection_list->getHTML(), 'TOGGLE_LINK' => $toggle_action);
$ilCtrl->clearParameters($this);
}
require_once 'Services/Table/classes/class.ilTable2GUI.php';
$table = new ilTable2GUI($this, 'editSocialBookmarks');
$table->setFormName('smtable');
$table->setId('smtable');
$table->setPrefix('sm');
$table->setFormAction($ilCtrl->getFormAction($this, 'saveSocialBookmarks'));
$table->addColumn('', 'check', '', true);
$table->addColumn($lng->txt('icon'), '');
$table->addColumn($lng->txt('title'), 'TITLE');
$table->addColumn($lng->txt('link'), 'LINK');
$table->addColumn($lng->txt('active'), 'ACTIVE');
$table->addColumn($lng->txt('actions'), '');
$table->setTitle($lng->txt('bm_manage_social_bm'));
$table->setData($dset);
$table->setRowTemplate('tpl.social_bookmarking_row.html', 'Services/Administration');
$table->setSelectAllCheckbox('sbm_id');
$table->setDefaultOrderField("title");
$table->setDefaultOrderDirection("asc");
$table->addMultiCommand('enableSocialBookmarks', $lng->txt('socialbm_enable'));
$table->addMultiCommand('disableSocialBookmarks', $lng->txt('socialbm_disable'));
$table->addMultiCommand('deleteSocialBookmarks', $lng->txt('delete'));
$table->addCommandButton('addSocialBookmark', $lng->txt('create'));
$this->tpl->setVariable('ADM_CONTENT', $table->getHTML());
}
示例5: showMembersList
public function showMembersList()
{
if (!$this->mlists->getCurrentMailingList()->getId()) {
$this->showMailingLists();
return true;
}
$this->ctrl->setParameter($this, 'cmd', 'post');
$this->ctrl->setParameter($this, 'ml_id', $this->mlists->getCurrentMailingList()->getId());
$this->tpl->setTitle($this->lng->txt('mail_addressbook'));
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_mailing_lists_members.html', 'Services/Contact');
$tbl = new ilTable2GUI($this);
$tbl->setId('show_mlng_mmbrs_list_tbl');
$tbl->setFormAction($this->ctrl->getFormAction($this), 'showMemberForm');
$tbl->setTitle($this->lng->txt('mail_members_of_mailing_list') . ' ' . $this->mlists->getCurrentMailingList()->getTitle());
$tbl->setRowTemplate('tpl.mail_mailing_lists_membersrow.html', 'Services/Contact');
$this->ctrl->setParameter($this, 'cmd', 'showMembersList');
$tbl->setDefaultOrderField('title');
$result = array();
$tbl->addColumn('', 'check', '10%');
$tbl->addColumn($this->lng->txt('title'), 'title', '90%');
$assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
if (count($assigned_entries)) {
$tbl->enable('select_all');
$tbl->setSelectAllCheckbox('a_id');
$counter = 0;
foreach ($assigned_entries as $entry) {
$result[$counter]['check'] = ilUtil::formCheckbox(0, 'a_id[]', $entry['a_id']);
$result[$counter]['title'] = $entry['login'] != '' ? $entry['login'] : $entry['email'];
++$counter;
}
$tbl->addMultiCommand('confirmDeleteMembers', $this->lng->txt('delete'));
} else {
$tbl->disable('header');
$tbl->disable('footer');
$tbl->setNoEntriesText($this->lng->txt('mail_search_no'));
}
$tbl->setData($result);
$tbl->addCommandButton('showAssignmentForm', $this->lng->txt('add'));
$tbl->addCommandButton('showMailingLists', $this->lng->txt('back'));
$this->tpl->setVariable('MEMBERS_LIST', $tbl->getHTML());
$this->tpl->show();
return true;
}
示例6: showArchive
public function showArchive($confirmation_gui = '')
{
global $ilUser, $tpl, $ilTabs, $ilSetting, $rbacreview;
$ilTabs->setSubTabActive('archive');
include_once 'Services/Payment/classes/class.ilShopNewsItemList.php';
include_once 'Services/Table/classes/class.ilTable2GUI.php';
$news_tpl = new ilTemplate('tpl.main_view.html', true, true, 'Services/Payment');
if ((int) strlen($confirmation_gui)) {
$news_tpl->setVariable('CONFIRMATION', $confirmation_gui);
}
$tbl = new ilTable2GUI($this);
$tbl->setId('shop_news_archive_tbl');
$tbl->setTitle($this->lng->txt('archive'), 'icon_news.png', $this->lng->txt('news'));
$tbl->setRowTemplate('tpl.shop_news_row.html', 'Services/Payment');
$tbl->setFormAction($this->ctrl->getFormAction($this), 'showArchive');
$tbl->addColumn($this->lng->txt('archive'), 'title', '100%');
$oNewsList = ilShopNewsItemList::_getInstance();
$oNewsList->setMode(ilShopNewsItemList::TYPE_ARCHIVE)->setPublicSection($ilUser->getId() == ANONYMOUS_USER_ID)->setArchiveDate(time() - $ilSetting->get('payment_news_archive_period') * 24 * 60 * 60)->read();
$result = array();
if ($oNewsList->hasItems()) {
$tbl->setEnableTitle(true);
$tbl->setEnableHeader(true);
$counter = 0;
foreach ($oNewsList as $entry) {
if ($entry->getVisibility() != 'public' && $ilUser->getId() == ANONYMOUS_USER_ID) {
continue;
}
if (strtotime($entry->getCreationDate()) > time() - $ilSetting->get('payment_news_archive_period') * 24 * 60 * 60) {
continue;
}
if ($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) == true) {
$this->ctrl->setParameter($this, 'news_id', $entry->getId());
$result[$counter]['news_id'] = $entry->getId();
$result[$counter]['edit_src'] = $this->ctrl->getLinkTarget($this, 'editArchiveNews');
$result[$counter]['edit_txt'] = $this->lng->txt('edit');
$result[$counter]['delete_src'] = $this->ctrl->getLinkTarget($this, 'confirmDeleteArchiveNews');
$result[$counter]['delete_txt'] = $this->lng->txt('delete');
$this->ctrl->clearParameters($this);
}
$result[$counter]['creation_date'] = ilDatePresentation::formatDate(new ilDateTime($entry->getCreationDate(), IL_CAL_DATETIME));
$result[$counter]['title'] = $entry->getTitle();
$result[$counter]['content'] = $entry->getContent();
$result[$counter]['user_id'] = $entry->getUserId();
$result[$counter]['author'] = $ilUser->getLogin();
$result[$counter]['creation_date'] = ilDatePresentation::formatDate(new ilDateTime($entry->getCreationDate(), IL_CAL_DATETIME));
$result[$counter]['update_date'] = ilDatePresentation::formatDate(new ilDateTime($entry->getCreationDate(), IL_CAL_DATETIME));
$result[$counter]['txt_author'] = $this->lng->txt('author');
$result[$counter]['txt_creation_date'] = $this->lng->txt('create_date');
$result[$counter]['txt_update_date'] = $this->lng->txt('last_update');
$this->ctrl->clearParameters($this);
++$counter;
}
} else {
$tbl->setNoEntriesText($this->lng->txt('payment_news_no_news_items'));
}
$tbl->setData($result);
$news_tpl->setVariable('TABLE', $tbl->getHTML());
$tpl->setContent($news_tpl->get());
}
示例7: __showMembersTable
private function __showMembersTable($moderators, $admins, $members, $tutors)
{
/**
* @var $lng ilLanguage
* @var $tpl ilTemplate
* @var $ilCtrl ilCtrl
*/
global $lng, $tpl, $ilCtrl;
if ($moderators) {
$tbl_mod = new ilTable2GUI($this);
$tbl_mod->setId('tbl_id_mod');
$tbl_mod->setFormAction($ilCtrl->getFormAction($this, 'showMembers'));
$tbl_mod->setTitle($lng->txt('moderators'));
$tbl_mod->addColumn('', '', '1%', true);
$tbl_mod->addColumn($lng->txt('login'), '', '10%');
$tbl_mod->addColumn($lng->txt('firstname'), '', '10%');
$tbl_mod->addColumn($lng->txt('lastname'), '', '10%');
$tbl_mod->addColumn($lng->txt('allow_user_toggle_noti'), '', '10%');
$tbl_mod->setSelectAllCheckbox('user_id');
$tbl_mod->setRowTemplate('tpl.forums_members_row.html', 'Modules/Forum');
$tbl_mod->setData($moderators);
$tbl_mod->addMultiCommand('enableHideUserToggleNoti', $lng->txt('enable_hide_user_toggle'));
$tbl_mod->addMultiCommand('disableHideUserToggleNoti', $lng->txt('disable_hide_user_toggle'));
$tpl->setCurrentBlock('moderators_table');
$tpl->setVariable('MODERATORS', $tbl_mod->getHTML());
}
if ($admins) {
$tbl_adm = new ilTable2GUI($this);
$tbl_adm->setId('tbl_id_adm');
$tbl_adm->setFormAction($ilCtrl->getFormAction($this, 'showMembers'));
$tbl_adm->setTitle($lng->txt('administrator'));
$tbl_adm->addColumn('', '', '1%', true);
$tbl_adm->addColumn($lng->txt('login'), '', '10%');
$tbl_adm->addColumn($lng->txt('firstname'), '', '10%');
$tbl_adm->addColumn($lng->txt('lastname'), '', '10%');
$tbl_adm->addColumn($lng->txt('allow_user_toggle_noti'), '', '10%');
$tbl_adm->setSelectAllCheckbox('user_id');
$tbl_adm->setRowTemplate('tpl.forums_members_row.html', 'Modules/Forum');
$tbl_adm->setData($admins);
$tbl_adm->addMultiCommand('enableHideUserToggleNoti', $lng->txt('enable_hide_user_toggle'));
$tbl_adm->addMultiCommand('disableHideUserToggleNoti', $lng->txt('disable_hide_user_toggle'));
$tpl->setCurrentBlock('admins_table');
$tpl->setVariable('ADMINS', $tbl_adm->getHTML());
}
if ($members) {
$tbl_mem = new ilTable2GUI($this);
$tbl_mem->setId('tbl_id_mem');
$tbl_mem->setFormAction($ilCtrl->getFormAction($this, 'showMembers'));
$tbl_mem->setTitle($lng->txt('members'));
$tbl_mem->addColumn('', '', '1%', true);
$tbl_mem->addColumn($lng->txt('login'), '', '10%');
$tbl_mem->addColumn($lng->txt('firstname'), '', '10%');
$tbl_mem->addColumn($lng->txt('lastname'), '', '10%');
$tbl_mem->addColumn($lng->txt('allow_user_toggle_noti'), '', '10%');
$tbl_mem->setSelectAllCheckbox('user_id');
$tbl_mem->setRowTemplate('tpl.forums_members_row.html', 'Modules/Forum');
$tbl_mem->setData($members);
$tbl_mem->addMultiCommand('enableHideUserToggleNoti', $lng->txt('enable_hide_user_toggle'));
$tbl_mem->addMultiCommand('disableHideUserToggleNoti', $lng->txt('disable_hide_user_toggle'));
$tpl->setCurrentBlock('members_table');
$tpl->setVariable('MEMBERS', $tbl_mem->getHTML());
}
if ($tutors) {
$tbl_tut = new ilTable2GUI($this);
$tbl_tut->setId('tbl_id_tut');
$tbl_tut->setFormAction($ilCtrl->getFormAction($this, 'showMembers'));
$tbl_tut->setTitle($lng->txt('tutors'));
$tbl_tut->addColumn('', '', '1%', true);
$tbl_tut->addColumn($lng->txt('login'), '', '10%');
$tbl_tut->addColumn($lng->txt('firstname'), '', '10%');
$tbl_tut->addColumn($lng->txt('lastname'), '', '10%');
$tbl_tut->addColumn($lng->txt('allow_user_toggle_noti'), '', '10%');
$tbl_tut->setSelectAllCheckbox('user_id');
$tbl_tut->setRowTemplate('tpl.forums_members_row.html', 'Modules/Forum');
$tbl_tut->setData($tutors);
$tbl_tut->addMultiCommand('enableHideUserToggleNoti', $lng->txt('enable_hide_user_toggle'));
$tbl_tut->addMultiCommand('disableHideUserToggleNoti', $lng->txt('disable_hide_user_toggle'));
$tpl->setCurrentBlock('tutors_table');
$tpl->setVariable('TUTORS', $tbl_tut->getHTML());
}
}
示例8: 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());
}
示例9: showModerators
/**
*
*/
public function showModerators()
{
/**
* @var $ilToolbar ilToolbarGUI
* @var $lng ilLanguage
*/
global $ilToolbar, $lng;
include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
ilRepositorySearchGUI::fillAutoCompleteToolbar($this, $ilToolbar, array('auto_complete_name' => $lng->txt('user'), 'submit_name' => $lng->txt('add'), 'add_search' => true, 'add_from_container' => $this->oForumModerators->getRefId()));
$tbl = new ilTable2GUI($this);
$tbl->setId('frm_show_mods_tbl_' . (int) $_GET['ref_id']);
$tbl->setFormAction($this->ctrl->getFormAction($this, 'detachModeratorRole'));
$tbl->setTitle($this->lng->txt('frm_moderators'));
$tbl->setRowTemplate('tpl.forum_moderators_table_row.html', 'Modules/Forum');
$tbl->setDefaultOrderField('login');
$entries = $this->oForumModerators->getCurrentModerators();
$num = count($entries);
if ($num > 1) {
$tbl->addColumn('', 'check', '1%', true);
$tbl->setSelectAllCheckbox('usr_id');
$tbl->addMultiCommand('detachModeratorRole', $this->lng->txt('frm_detach_moderator_role'));
} else {
if (!$entries) {
$tbl->setNoEntriesText($this->lng->txt('frm_moderators_not_exist_yet'));
}
}
$tbl->addColumn($this->lng->txt('login'), 'login', '30%');
$tbl->addColumn($this->lng->txt('firstname'), 'firstname', '30%');
$tbl->addColumn($this->lng->txt('lastname'), 'lastname', '30%');
$result = array();
$i = 0;
foreach ($entries as $usr_id) {
/**
* @var $user ilObjUser
*/
$user = ilObjectFactory::getInstanceByObjId($usr_id);
if ($num > 1) {
$result[$i]['check'] = ilUtil::formCheckbox(false, 'usr_id[]', $user->getId());
}
$result[$i]['login'] = $user->getLogin();
$result[$i]['firstname'] = $user->getFirstname();
$result[$i]['lastname'] = $user->getLastname();
++$i;
}
$tbl->setData($result);
$this->tpl->setContent($tbl->getHTML());
}
示例10: showModerators
public function showModerators()
{
/**
* @var $ilToolbar ilToolbarGUI */
global $ilToolbar;
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.forum_moderators.html', 'Modules/Forum');
// search button
$ilToolbar->addButton($this->lng->txt("search_users"), $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start'));
$tbl = new ilTable2GUI($this);
$tbl->setId('frm_show_mods_tbl_' . $_GET['ref_id']);
$tbl->setFormAction($this->ctrl->getFormAction($this, 'detachModeratorRole'));
$tbl->setTitle($this->lng->txt('frm_moderators'));
$tbl->setRowTemplate('tpl.forum_moderators_table_row.html', 'Modules/Forum');
$tbl->addColumn('', 'check', '1%');
$tbl->addColumn($this->lng->txt('login'), 'login', '30%');
$tbl->addColumn($this->lng->txt('firstname'), 'firstname', '30%');
$tbl->addColumn($this->lng->txt('lastname'), 'lastname', '30%');
$tbl->setDefaultOrderField('login');
$entries = $this->oForumModerators->getCurrentModerators();
$result = array();
if (count($entries)) {
$counter = 0;
foreach ($entries as $usr_id) {
$oUser = ilObjectFactory::getInstanceByObjId($usr_id, false);
if (is_object($oUser)) {
if (count($entries) > 1) {
$result[$counter]['check'] = ilUtil::formCheckbox(0, 'usr_id[]', $oUser->getId());
}
$result[$counter]['login'] = $oUser->getLogin();
$result[$counter]['firstname'] = $oUser->getFirstname();
$result[$counter]['lastname'] = $oUser->getLastname();
++$counter;
}
}
if (count($entries) > 1) {
$tbl->enable('select_all');
$tbl->setSelectAllCheckbox('usr_id');
$tbl->addMultiCommand('detachModeratorRole', $this->lng->txt('frm_detach_moderator_role'));
}
} else {
$tbl->disable('header');
$tbl->disable('footer');
$tbl->setNoEntriesText($this->lng->txt('frm_moderators_not_exist_yet'));
}
$tbl->setData($result);
$this->tpl->setVariable('TXT_FORUM_MODERATORS', $tbl->getHTML());
}