bsformrenderer.class.inc.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. // Copyright (C) 2010-2016 Combodo SARL
  3. //
  4. // This file is part of iTop.
  5. //
  6. // iTop is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Affero General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // iTop is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU Affero General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Affero General Public License
  17. // along with iTop. If not, see <http://www.gnu.org/licenses/>
  18. namespace Combodo\iTop\Renderer\Bootstrap;
  19. use \Silex\Application;
  20. use \Combodo\iTop\Renderer\FormRenderer;
  21. use \Combodo\iTop\Form\Form;
  22. /**
  23. * Description of formrenderer
  24. *
  25. * @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
  26. */
  27. class BsFormRenderer extends FormRenderer
  28. {
  29. const DEFAULT_RENDERER_NAMESPACE = 'Combodo\\iTop\\Renderer\\Bootstrap\\FieldRenderer\\';
  30. /**
  31. * Default constructor
  32. *
  33. * @param \Combodo\iTop\Form\Form $oForm
  34. */
  35. public function __construct(Form $oForm = null)
  36. {
  37. parent::__construct($oForm);
  38. $this->AddSupportedField('HiddenField', 'BsSimpleFieldRenderer');
  39. $this->AddSupportedField('LabelField', 'BsSimpleFieldRenderer');
  40. $this->AddSupportedField('PasswordField', 'BsSimpleFieldRenderer');
  41. $this->AddSupportedField('StringField', 'BsSimpleFieldRenderer');
  42. $this->AddSupportedField('TextAreaField', 'BsSimpleFieldRenderer');
  43. $this->AddSupportedField('CaseLogField', 'BsSimpleFieldRenderer');
  44. $this->AddSupportedField('SelectField', 'BsSimpleFieldRenderer');
  45. $this->AddSupportedField('MultipleSelectField', 'BsSimpleFieldRenderer');
  46. $this->AddSupportedField('RadioField', 'BsSimpleFieldRenderer');
  47. $this->AddSupportedField('CheckboxField', 'BsSimpleFieldRenderer');
  48. $this->AddSupportedField('SubFormField', 'BsSubFormFieldRenderer');
  49. $this->AddSupportedField('SelectObjectField', 'BsSelectObjectFieldRenderer');
  50. $this->AddSupportedField('LinkedSetField', 'BsLinkedSetFieldRenderer');
  51. $this->AddSupportedField('DateTimeField', 'BsSimpleFieldRenderer');
  52. $this->AddSupportedField('DurationField', 'BsSimpleFieldRenderer');
  53. $this->AddSupportedField('FileUploadField', 'BsFileUploadFieldRenderer');
  54. $this->AddSupportedField('BlobField', 'BsSimpleFieldRenderer');
  55. }
  56. }