コード例 #1
0
 /**
  * @param ilTable2GUI $table_gui
  */
 private function prepareTable(ilTable2GUI $table_gui)
 {
     global $lng;
     $table_gui->addColumn($lng->txt('toplist_col_rank'));
     $table_gui->addColumn($lng->txt('toplist_col_participant'));
     if ($this->object->getHighscoreAchievedTS()) {
         $table_gui->addColumn($lng->txt('toplist_col_achieved'));
     }
     if ($this->object->getHighscoreScore()) {
         $table_gui->addColumn($lng->txt('toplist_col_score'));
     }
     if ($this->object->getHighscorePercentage()) {
         $table_gui->addColumn($lng->txt('toplist_col_percentage'));
     }
     if ($this->object->getHighscoreHints()) {
         $table_gui->addColumn($lng->txt('toplist_col_hints'));
     }
     if ($this->object->getHighscoreWTime()) {
         $table_gui->addColumn($lng->txt('toplist_col_wtime'));
     }
     $table_gui->setEnableNumInfo(false);
     $table_gui->setLimit(10);
 }
コード例 #2
0
 /**
  * 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());
 }