Profile::showLegend PHP Method

showLegend() public method

public showLegend ( )
    function showLegend()
    {
        echo "<div class='spaced'>";
        echo "<table class='tab_cadre_fixe'>";
        echo "<tr class='tab_bg_2'><td width='70' style='text-decoration:underline' class='b'>";
        echo __('Caption') . "</td>";
        echo "<td class='tab_bg_4' width='15' style='border:1px solid black'></td>";
        echo "<td class='b'>" . __('Global right') . "</td></tr>\n";
        echo "<tr class='tab_bg_2'><td></td>";
        echo "<td class='tab_bg_2' width='15' style='border:1px solid black'></td>";
        echo "<td class='b'>" . __('Entity right') . "</td></tr>";
        echo "</table></div>\n";
    }

Usage Example

Exemplo n.º 1
0
 function showForm($profiles_id, $options = array())
 {
     if (!Session::haveRight("profile", READ)) {
         return false;
     }
     $canedit = Session::haveRight("profile", UPDATE);
     //if ($id) {
     //   $this->getProfilesFromDB($id);
     //}
     //Ensure rights are defined in database
     self::installRights();
     $profile = new Profile();
     $profile->getFromDB($profiles_id);
     echo "<form action='" . Profile::getFormUrl() . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     $general_rights = self::getGeneralRights();
     $profile->displayRightsChoiceMatrix($general_rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General', 'genericobject')));
     $types_rights = self::getTypesRights();
     $title = __('Objects', 'genericobject');
     if (count($types_rights) == 0) {
         $title .= __(" (No types defined yet)", "genericobject");
     }
     $profile->displayRightsChoiceMatrix($types_rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => $title));
     $profile->showLegend();
     if ($canedit) {
         echo "<div class='center'>";
         echo Html::hidden('id', array('value' => $profiles_id));
         echo Html::submit(_sx('button', 'Save'), array('name' => 'update'));
         echo "</div>\n";
         Html::closeForm();
     }
     echo "</div>";
 }