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>"; }