misc->form; $content .= sprintf('%s', $action, PHP_EOL); $content .= sprintf('%s', $table, PHP_EOL); $content .= sprintf('%s', $add, PHP_EOL); $content .= sprintf('', $cancel); return $content; } /** * Prints inputs for action, table and submit/cancel buttons. * * @param array $inputs array of inputs with their name, type and value * @param array $buttons array of buttons with their name, type and value * @param array $cheboxes array of cheboxes with their name, id, checked state, type and text for label */ public function getFormInputsAndButtons($inputs, $buttons, $cheboxes = []) { $content = $this->misc->form; foreach ($cheboxes as $checkbox) { $content .= sprintf('
%s', PHP_EOL); $content .= sprintf('', $checkbox['type'], $checkbox['name'], $checkbox['id'], $checkbox['checked'] ? 'checked="checked"' : ''); $content .= sprintf('', $checkbox['id'], $checkbox['labeltext']); $content .= sprintf('
%s', PHP_EOL); } foreach ($inputs as $input) { $content .= sprintf('%s', $input['type'], $input['name'], $input['value'], PHP_EOL); } $content .= sprintf('%s', PHP_EOL); foreach ($buttons as $button) { $content .= sprintf('%s', $button['type'], $button['name'], $button['value'], PHP_EOL); } $content .= sprintf('
%s', PHP_EOL); return $content; } }