";
foreach ($images as $image) {
$select .= "\n";
}
$select .= "";
$html = "
".make_form(make_link("tips/save"))."
";
$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));
}
public function showTip($url, $tip)
{
global $page;
$img = "";
if (!empty($tip['image'])) {
$img = " ";
}
$html = "".$img.html_escape($tip['text'])."
";
$page->add_block(new Block(null, $html, "subheading", 10));
}
public function showAll($url, $tips)
{
global $user, $page;
$html = "".
"".
"ID | ".
"Enabled | ".
"Image | ".
"Text | ";
if ($user->can(Permissions::TIPS_ADMIN)) {
$html .= "Action | ";
}
$html .= "
";
foreach ($tips as $tip) {
$tip_enable = ($tip['enable'] == "Y") ? "Yes" : "No";
$set_link = "".$tip_enable."";
$html .= "".
"".$tip['id']." | ".
"".$set_link." | ".
(
empty($tip['image']) ?
" | " :
" | "
).
"".$tip['text']." | ";
$del_link = "Delete";
if ($user->can(Permissions::TIPS_ADMIN)) {
$html .= "".$del_link." | ";
}
$html .= "
";
}
$html .= "
";
$page->add_block(new Block("All Tips", $html, "main", 20));
}
}