function showResults(Dto_FormResult $result, array $data = null) { /* * First make sure the user actually tried * to submit this form, if so, return our * JSON output and nothing else. */ if ($result->isSubmitted()) { /* * Determine what type of renderer for the form submission * result we should use? * * We render either as HTML, if not default to render * as JSON */ if (isset($data['renderhtml'])) { renderResultMessagesHtml($result); } else { echo $result->toJSON(); } # else return true; } # if /* * If there was no submit of the form, just show placeholders * for the errors and information */ echo "<ul class='formerrors'></ul><ul class='forminformation'></ul>"; return false; }
<?php require "includes/form-messages.inc.php"; renderResultMessagesHtml(new Dto_FormResult()); # is form voor het toevoegen van een groep ipv wijzigen van een $isNew = isset($data['isnew']); # vraag de opgegeven securitygroup op if (!$isNew) { $securitygroup = $tplHelper->getSecGroup($data['groupid']); } else { $securitygroup = array('name' => ''); } # if ?> <!-- Naam van security group wijzigen of nieuwe security groep toevoegen --> <fieldset> <form class="editsecgroupform" name="editsecgroupform" action="<?php echo $tplHelper->makeEditSecGroupAction(); ?> " method="post"> <input type="hidden" name="editsecgroupform[xsrfid]" value="<?php echo $tplHelper->generateXsrfCookie('editsecgroupform'); ?> "> <?php if (!$isNew) { ?> <input type="hidden" name="groupid" value="<?php echo $securitygroup['id'];