This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
accm-website/includes/menu/MenuEntryFormatter.inc.php
2010-08-14 22:32:09 +02:00

46 lines
1.3 KiB
PHP

<?php
include_once './includes/menu/MenuEntry.inc.php';
/**
* This class allows for easy formatting of menu entries.
*
* @author Thomas Schwery <thomas.schwery@epfl.ch>
*/
class MenuEntryFormatter {
public static function getEntry(MenuEntry $entry) {
$name = $entry->getName();
$hint = $entry->getHint();
$url = $entry->getUrl();
$hint = str_replace("'", "&#39;", $hint);
return "<a href='./?page=$url' title='$hint'>$name</a>";
}
public static function getSummaryBox(MenuEntry $entry) {
$name = $entry->getName();
$hint = $entry->getHint();
$url = $entry->getUrl();
$menuId = $entry->getMenuId();
$weight = $entry->getWeight();
$content = "<div style='border: 1px dotted black;'>";
$content.= Localization::menuEntryName . ": $name";
$content.= "<br>\n";
$content.= Localization::menuEntryHint . ": $hint";
$content.= "<br>\n";
$content.= Localization::menuEntryURL . ": $url";
$content.= "<br>\n";
$content.= Localization::menuEntryMenuId . ": $menuId";
$content.= "<br>\n";
$content.= Localization::menuEntryWeight . ": $weight";
$content.= "</div>";
return $content;
}
}
?>