forms.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. $ipsum = elgg_view('developers/ipsum');
  3. ?><form action="#">
  4. <fieldset>
  5. <legend>Fieldset Legend</legend>
  6. <div>
  7. <label for="f1">Text input (.elgg-input-text):</label>
  8. <?php echo elgg_view('input/text', array(
  9. 'name' => 'f1',
  10. 'id' => 'f1',
  11. 'value' => 'input text',
  12. ));
  13. ?>
  14. </div>
  15. <div>
  16. <label for="f2">Password input (.elgg-input-password):</label>
  17. <?php echo elgg_view('input/password', array(
  18. 'name' => 'f2',
  19. 'id' => 'f2',
  20. 'value' => 'password',
  21. ));
  22. ?>
  23. </div>
  24. <div>
  25. <label for="f3">Radio input (.elgg-input-radios):</label><br />
  26. <?php echo elgg_view('input/radio', array(
  27. 'name' => 'f3',
  28. 'id' => 'f3',
  29. 'options' => array('a (.elgg-input-radio)' => 1, 'b (.elgg-input-radio)' => 2),
  30. ));
  31. ?>
  32. </div>
  33. <div>
  34. <label for="f4">Checkboxes input (.elgg-input-checkboxes):</label><br />
  35. <?php echo elgg_view('input/checkboxes', array(
  36. 'name' => 'f4',
  37. 'id' => 'f4',
  38. 'options' => array('a (.elgg-input-checkbox)' => 1, 'b (.elgg-input-checkbox)' => 2),
  39. ));
  40. ?>
  41. </div>
  42. <div>
  43. <label for="f5">Select input (dropdown) (.elgg-input-dropdown):</label><br />
  44. <?php echo elgg_view('input/select', array(
  45. 'name' => 'f5',
  46. 'id' => 'f5',
  47. 'options' => array('option 1', 'option 2'),
  48. ));
  49. ?>
  50. </div>
  51. <div>
  52. <label for="f51">Select input (multiselect) (.elgg-input-dropdown):</label><br />
  53. <?php echo elgg_view('input/select', array(
  54. 'name' => 'f51[]',
  55. 'id' => 'f51',
  56. 'options_values' => array('value 1' => 'option 1', 'value 2' => 'option 2', 'value 3' => 'option 3'),
  57. 'multiple' => true,
  58. ));
  59. ?>
  60. </div>
  61. <div>
  62. <label for="f6">Access input (.elgg-input-access):</label><br />
  63. <?php echo elgg_view('input/access', array(
  64. 'name' => 'f6',
  65. 'id' => 'f6',
  66. 'value' => ACCESS_PUBLIC,
  67. ));
  68. ?>
  69. </div>
  70. <div>
  71. <label for="f7">File input (.elgg-input-file):</label>
  72. <?php echo elgg_view('input/file', array(
  73. 'name' => 'f7',
  74. 'id' => 'f7',
  75. ));
  76. ?>
  77. </div>
  78. <div>
  79. <label for="f8">URL input (.elgg-input-url):</label>
  80. <?php echo elgg_view('input/url', array(
  81. 'name' => 'f8',
  82. 'id' => 'f8',
  83. 'value' => 'http://elgg.org/',
  84. ));
  85. ?>
  86. </div>
  87. <div>
  88. <label for="f9">Tags input (.elgg-input-tags):</label>
  89. <?php echo elgg_view('input/tags', array(
  90. 'name' => 'f9',
  91. 'id' => 'f9',
  92. 'value' => 'one, two, three',
  93. ));
  94. ?>
  95. </div>
  96. <div>
  97. <label for="f10">Email input (.elgg-input-email):</label>
  98. <?php echo elgg_view('input/email', array(
  99. 'name' => 'f10',
  100. 'id' => 'f10',
  101. 'value' => 'noone@elgg.org',
  102. ));
  103. ?>
  104. </div>
  105. <div>
  106. <label for="f11">Autocomplete input (.elgg-input-autocomplete):</label>
  107. <?php echo elgg_view('input/autocomplete', array(
  108. 'name' => 'f11',
  109. 'id' => 'f11',
  110. 'match_on' => array('groups', 'friends'),
  111. ));
  112. ?>
  113. </div>
  114. <div>
  115. <label for="f12">Date input (.elgg-input-date):</label>
  116. <?php echo elgg_view('input/date', array(
  117. 'name' => 'f12',
  118. 'id' => 'f12',
  119. 'value' => '2012-12-31',
  120. ));
  121. ?>
  122. </div>
  123. <div>
  124. <label for="f13">User picker input (.elgg-user-picker):</label>
  125. <?php echo elgg_view('input/userpicker', array(
  126. 'name' => 'f13',
  127. 'id' => 'f13',
  128. ));
  129. ?>
  130. </div>
  131. <div>
  132. <label for="f16">User picker input (with max 1 results) (.elgg-user-picker):</label>
  133. <?php echo elgg_view('input/userpicker', array(
  134. 'name' => 'f16',
  135. 'id' => 'f16',
  136. 'limit' => 1
  137. ));
  138. ?>
  139. </div>
  140. <div>
  141. <label for="f15">Plain textarea input (.elgg-input-plaintext):</label>
  142. <?php echo elgg_view('input/plaintext', array(
  143. 'name' => 'f15',
  144. 'id' => 'f15',
  145. 'value' => $ipsum,
  146. ));
  147. ?>
  148. </div>
  149. <div>
  150. <label for="f14">Long textarea input (.elgg-input-longtext):</label>
  151. <?php echo elgg_view('input/longtext', array(
  152. 'name' => 'f14',
  153. 'id' => 'f14',
  154. 'value' => $ipsum,
  155. ));
  156. ?>
  157. </div>
  158. </fieldset>
  159. </form>