"; foreach ($images as $image) { $select .= "\n"; } $select .= ""; $html = " ".make_form(make_link("tips/save"))."
Enable:
Post: {$select}
Message:
"; $page->set_title("Tips List"); $page->set_heading("Tips List"); $page->add_block(new NavBlock()); $page->add_block(new Block("Add Tip", $html, "main", 10)); } /** * @param Tip $tip */ public function showTip(string $url, array $tip): void { global $page; $img = ""; if (!empty($tip['image'])) { $img = " "; } $html = "
".$img.html_escape($tip['text'])."
"; $page->add_block(new Block(null, $html, "subheading", 10)); } /** * @param Tip[] $tips */ public function showAll(string $url, array $tips): void { global $user, $page; $html = "". "". "". "". "". ""; if ($user->can(Permissions::TIPS_ADMIN)) { $html .= ""; } $html .= ""; foreach ($tips as $tip) { $tip_enable = bool_escape($tip['enable']) ? "Yes" : "No"; $set_link = "".$tip_enable.""; $html .= "". "". "". ( empty($tip['image']) ? "" : "" ). ""; $del_link = "Delete"; if ($user->can(Permissions::TIPS_ADMIN)) { $html .= ""; } $html .= ""; } $html .= "
IDEnabledPostTextAction
".$tip['id']."".$set_link."".$tip['text']."".$del_link."
"; $page->add_block(new Block("All Tips", $html, "main", 20)); } }