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


PHP ilTable2GUI::setEnableHeader方法代码示例

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


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

示例1: 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());
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:59,代码来源:class.ilShopNewsGUI.php


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