本文整理汇总了PHP中ilTable2GUI::setExportFormats方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTable2GUI::setExportFormats方法的具体用法?PHP ilTable2GUI::setExportFormats怎么用?PHP ilTable2GUI::setExportFormats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTable2GUI
的用法示例。
在下文中一共展示了ilTable2GUI::setExportFormats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
示例2: setExportFormats
public function setExportFormats()
{
parent::setExportFormats(array(self::EXPORT_EXCEL, self::EXPORT_CSV));
}