get_html_for_blotter_editor($entries); $page->set_title("Blotter Editor"); $page->set_heading("Blotter Editor"); $page->add_block(new Block("Welcome to the Blotter Editor!", $html, "main", 10)); $page->add_block(new Block("Navigation", "Index", "left", 0)); } public function display_blotter_page($entries) { global $page; $html = $this->get_html_for_blotter_page($entries); $page->set_title("Blotter"); $page->set_heading("Blotter"); $page->add_block(new Block("Blotter Entries", $html, "main", 10)); } public function display_blotter(array $entries): void { global $page, $config; $html = $this->get_html_for_blotter($entries); $position = $config->get_string("blotter_position", "subheading"); $page->add_block(new Block(null, $html, $position, 20)); } private function get_html_for_blotter_editor(array $entries): string { global $user; /** * Long function name, but at least I won't confuse it with something else ^_^ */ // Add_new stuff goes here. $table_header = "
Add entries to the blotter, and they will be displayed."; return $html; } private function get_html_for_blotter_page(array $entries): string { /** * This one displays a list of all blotter entries. */ global $config; $i_color = $config->get_string("blotter_color", "#FF0000"); $html = "
"; $num_entries = count($entries); for ($i = 0 ; $i < $num_entries ; $i++) { /** * Blotter entries */ // Reset variables: $i_open = ""; $i_close = ""; //$id = $entries[$i]['id']; $messy_date = $entries[$i]['entry_date']; $clean_date = date("y/m/d", strtotime($messy_date)); $entry_text = $entries[$i]['entry_text']; if ($entries[$i]['important'] == 'Y') { $i_open = ""; $i_close=""; } $html .= "{$i_open}{$clean_date} - {$entry_text}{$i_close}"; return $html; } private function get_html_for_blotter(array $entries): string { global $config; $i_color = $config->get_string("blotter_color", "#FF0000"); $position = $config->get_string("blotter_position", "subheading"); $entries_list = ""; $num_entries = count($entries); for ($i = 0 ; $i < $num_entries ; $i++) { /** * Blotter entries */ // Reset variables: $i_open = ""; $i_close = ""; //$id = $entries[$i]['id']; $messy_date = $entries[$i]['entry_date']; $clean_date = date("m/d/y", strtotime($messy_date)); $entry_text = $entries[$i]['entry_text']; if ($entries[$i]['important'] == 'Y') { $i_open = ""; $i_close=""; } $entries_list .= "
"; } $html .= "