<?php

include_once 'includes/users/userRights/MemberRight.inc.php';

/**
 * This class allows for an easy formatting of users rights.
 *
 * @author Thomas Schwery <thomas.schwery@epfl.ch>
 */
class MemberRightFormatter {

    /**
     * Maps rights to a string describing in a human format the rights.
     *
     * @param Right $right
     * @return string
     */
    public static function format(MemberRight $right) {
        return $right->getName();
    }

    public static function getSummaryBox(MemberRight $right) {

        $name = $right->getName();
        $id = $right->getIdentifier();

        $content = "<div style='border: 1px dotted black;'>";
        $content.= Localization::memberRightName . ": $name";
        $content.= "<br>\n";
        $content.= Localization::memberRightId . ": $id";
        $content.= "</div>";

        return $content;
    }
}
?>
