month = $_REQUEST['rec_month']; } else { $this->month = date('Y-m'); } $log = new helper_plugin_recommend_log($this->month); $this->entries = $log->getEntries(); $this->logs = $log->getLogs(); } public function getTOC() { return array_map([$this, 'recommend_make_toc'], $this->logs); } public function html() { if (!$this->logs) { echo 'No recommendations.'; return; } if (!$this->entries) { echo 'No recommendations were made in ' . $this->month . '.'; return; } echo '

In ' . $this->month . ', your users made the following ' . count($this->entries) . ' recommendations:

'; echo ''; } public function recommend_make_toc($month) { global $ID; return html_mktocitem('?do=admin&page=recommend&id=' . $ID . '&rec_month=' . $month, $month, 1, ''); } }