codeigniter_vender 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. data/.gitignore +2 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README +40 -0
  4. data/Rakefile +18 -0
  5. data/VERSION +1 -0
  6. data/codeigniter_vender.gemspec +389 -0
  7. data/generators/ci_app/USAGE +8 -0
  8. data/generators/ci_app/ci_app_generator.rb +12 -0
  9. data/generators/ci_app/templates/CodeIgniter_1.7.2/index.php +118 -0
  10. data/generators/ci_app/templates/CodeIgniter_1.7.2/license.txt +52 -0
  11. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/autoload.php +116 -0
  12. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/config.php +329 -0
  13. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/constants.php +41 -0
  14. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/database.php +55 -0
  15. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/doctypes.php +15 -0
  16. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/hooks.php +16 -0
  17. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/index.html +10 -0
  18. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/mimes.php +105 -0
  19. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/routes.php +48 -0
  20. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/smileys.php +66 -0
  21. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/user_agents.php +175 -0
  22. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/index.html +10 -0
  23. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/welcome.php +17 -0
  24. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_404.php +34 -0
  25. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_db.php +34 -0
  26. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_general.php +34 -0
  27. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_php.php +10 -0
  28. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/index.html +10 -0
  29. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/helpers/index.html +10 -0
  30. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/hooks/index.html +10 -0
  31. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/index.html +10 -0
  32. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/language/english/index.html +10 -0
  33. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/libraries/index.html +10 -0
  34. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/models/index.html +10 -0
  35. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/index.html +10 -0
  36. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/welcome_message.php +62 -0
  37. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/cache/index.html +10 -0
  38. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base4.php +69 -0
  39. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base5.php +56 -0
  40. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/CodeIgniter.php +280 -0
  41. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Common.php +421 -0
  42. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Compat.php +93 -0
  43. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/index.html +10 -0
  44. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB.php +146 -0
  45. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_active_rec.php +1820 -0
  46. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_cache.php +195 -0
  47. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_driver.php +1366 -0
  48. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_forge.php +375 -0
  49. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_result.php +342 -0
  50. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_utility.php +389 -0
  51. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/index.html +10 -0
  52. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/index.html +10 -0
  53. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_driver.php +667 -0
  54. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_forge.php +248 -0
  55. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_result.php +169 -0
  56. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_utility.php +123 -0
  57. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/index.html +10 -0
  58. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_driver.php +670 -0
  59. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_forge.php +254 -0
  60. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_result.php +169 -0
  61. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_utility.php +245 -0
  62. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/index.html +10 -0
  63. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_driver.php +671 -0
  64. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_forge.php +254 -0
  65. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_result.php +169 -0
  66. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_utility.php +123 -0
  67. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/index.html +10 -0
  68. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_driver.php +780 -0
  69. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_forge.php +248 -0
  70. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_result.php +249 -0
  71. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_utility.php +122 -0
  72. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/index.html +10 -0
  73. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_driver.php +639 -0
  74. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_forge.php +266 -0
  75. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_result.php +228 -0
  76. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_utility.php +148 -0
  77. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/index.html +10 -0
  78. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_driver.php +684 -0
  79. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_forge.php +248 -0
  80. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_result.php +169 -0
  81. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_utility.php +124 -0
  82. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/index.html +10 -0
  83. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_driver.php +657 -0
  84. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_forge.php +265 -0
  85. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_result.php +179 -0
  86. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_utility.php +141 -0
  87. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/index.html +10 -0
  88. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/index.html +10 -0
  89. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/texb.ttf +0 -0
  90. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/array_helper.php +78 -0
  91. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/compatibility_helper.php +498 -0
  92. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/cookie_helper.php +144 -0
  93. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/date_helper.php +611 -0
  94. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/directory_helper.php +84 -0
  95. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/download_helper.php +100 -0
  96. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/email_helper.php +62 -0
  97. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/file_helper.php +464 -0
  98. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/form_helper.php +1025 -0
  99. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/html_helper.php +416 -0
  100. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/index.html +10 -0
  101. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/inflector_helper.php +171 -0
  102. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/language_helper.php +58 -0
  103. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/number_helper.php +75 -0
  104. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/path_helper.php +72 -0
  105. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/security_helper.php +126 -0
  106. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/smiley_helper.php +273 -0
  107. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/string_helper.php +273 -0
  108. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/text_helper.php +462 -0
  109. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/typography_helper.php +71 -0
  110. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/url_helper.php +593 -0
  111. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/xml_helper.php +62 -0
  112. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/index.html +10 -0
  113. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/calendar_lang.php +51 -0
  114. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/date_lang.php +60 -0
  115. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/db_lang.php +28 -0
  116. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/email_lang.php +24 -0
  117. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/form_validation_lang.php +24 -0
  118. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/ftp_lang.php +17 -0
  119. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/imglib_lang.php +24 -0
  120. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/index.html +10 -0
  121. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/number_lang.php +10 -0
  122. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/profiler_lang.php +19 -0
  123. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/scaffolding_lang.php +17 -0
  124. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/unit_test_lang.php +24 -0
  125. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/upload_lang.php +22 -0
  126. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/validation_lang.php +24 -0
  127. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/index.html +10 -0
  128. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Benchmark.php +113 -0
  129. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Calendar.php +477 -0
  130. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Cart.php +550 -0
  131. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Config.php +244 -0
  132. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Controller.php +127 -0
  133. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Email.php +2041 -0
  134. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Encrypt.php +484 -0
  135. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Exceptions.php +174 -0
  136. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Form_validation.php +1278 -0
  137. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Ftp.php +618 -0
  138. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Hooks.php +226 -0
  139. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Image_lib.php +1544 -0
  140. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Input.php +1067 -0
  141. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Language.php +123 -0
  142. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Loader.php +1085 -0
  143. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Log.php +117 -0
  144. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Model.php +83 -0
  145. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Output.php +409 -0
  146. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Pagination.php +244 -0
  147. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Parser.php +173 -0
  148. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Profiler.php +392 -0
  149. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Router.php +389 -0
  150. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Session.php +758 -0
  151. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Sha1.php +251 -0
  152. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Table.php +440 -0
  153. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Trackback.php +547 -0
  154. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Typography.php +406 -0
  155. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/URI.php +586 -0
  156. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Unit_test.php +347 -0
  157. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Upload.php +970 -0
  158. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/User_agent.php +502 -0
  159. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Validation.php +875 -0
  160. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpc.php +1421 -0
  161. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpcs.php +536 -0
  162. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Zip.php +359 -0
  163. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/index.html +10 -0
  164. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/logs/index.html +10 -0
  165. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/captcha_pi.php +356 -0
  166. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/index.html +10 -0
  167. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/js_calendar_pi.php +629 -0
  168. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/Scaffolding.php +291 -0
  169. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/background.jpg +0 -0
  170. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/index.html +10 -0
  171. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/logo.jpg +0 -0
  172. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/index.html +10 -0
  173. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/add.php +32 -0
  174. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/delete.php +9 -0
  175. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/edit.php +33 -0
  176. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/footer.php +10 -0
  177. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/header.php +29 -0
  178. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/index.html +10 -0
  179. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/no_data.php +8 -0
  180. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/stylesheet.css +143 -0
  181. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/view.php +27 -0
  182. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/changelog.html +1080 -0
  183. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/active_record.html +757 -0
  184. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/caching.html +220 -0
  185. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/call_function.html +118 -0
  186. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/configuration.html +157 -0
  187. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/connecting.html +186 -0
  188. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/examples.html +217 -0
  189. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/fields.html +163 -0
  190. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/forge.html +234 -0
  191. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/helpers.html +151 -0
  192. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/index.html +99 -0
  193. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/queries.html +153 -0
  194. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/results.html +238 -0
  195. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/table_data.html +113 -0
  196. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/transactions.html +200 -0
  197. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/utilities.html +295 -0
  198. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/index.html +86 -0
  199. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/template.html +128 -0
  200. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/alternative_php.html +147 -0
  201. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/ancillary_classes.html +117 -0
  202. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/autoloader.html +101 -0
  203. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/caching.html +115 -0
  204. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/common_functions.html +119 -0
  205. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/controllers.html +385 -0
  206. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/core_classes.html +185 -0
  207. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/creating_libraries.html +298 -0
  208. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/credits.html +86 -0
  209. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/errors.html +138 -0
  210. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/helpers.html +185 -0
  211. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/hooks.html +167 -0
  212. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/libraries.html +94 -0
  213. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/managing_apps.html +133 -0
  214. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/models.html +251 -0
  215. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/plugins.html +127 -0
  216. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/profiling.html +104 -0
  217. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/quick_reference.html +77 -0
  218. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/requirements.html +82 -0
  219. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/reserved_names.html +156 -0
  220. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/routing.html +176 -0
  221. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/scaffolding.html +147 -0
  222. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/security.html +153 -0
  223. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/styleguide.html +687 -0
  224. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/urls.html +151 -0
  225. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/views.html +274 -0
  226. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/array_helper.html +119 -0
  227. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/compatibility_helper.html +118 -0
  228. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/cookie_helper.html +147 -0
  229. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/date_helper.html +408 -0
  230. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/directory_helper.html +143 -0
  231. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/download_helper.html +112 -0
  232. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/email_helper.html +102 -0
  233. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/file_helper.html +178 -0
  234. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/form_helper.html +484 -0
  235. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/html_helper.html +385 -0
  236. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/inflector_helper.html +151 -0
  237. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/language_helper.html +98 -0
  238. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/number_helper.html +107 -0
  239. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/path_helper.html +106 -0
  240. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/security_helper.html +125 -0
  241. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/smiley_helper.html +215 -0
  242. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/string_helper.html +176 -0
  243. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/text_helper.html +192 -0
  244. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/typography_helper.html +112 -0
  245. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/url_helper.html +289 -0
  246. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/xml_helper.html +105 -0
  247. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/appflowchart.gif +0 -0
  248. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/arrow.gif +0 -0
  249. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo.jpg +0 -0
  250. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo_flame.jpg +0 -0
  251. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_quick_ref.png +0 -0
  252. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.pdf +0 -0
  253. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.png +0 -0
  254. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.pdf +0 -0
  255. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.png +0 -0
  256. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/file.gif +0 -0
  257. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/folder.gif +0 -0
  258. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_bg_darker.jpg +0 -0
  259. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_separator_darker.jpg +0 -0
  260. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_toggle_darker.jpg +0 -0
  261. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/smile.gif +0 -0
  262. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/transparent.gif +0 -0
  263. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/index.html +99 -0
  264. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/downloads.html +105 -0
  265. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/index.html +97 -0
  266. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/troubleshooting.html +90 -0
  267. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_120.html +92 -0
  268. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_130.html +203 -0
  269. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_131.html +102 -0
  270. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_132.html +100 -0
  271. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_133.html +112 -0
  272. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_140.html +145 -0
  273. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_141.html +148 -0
  274. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_150.html +178 -0
  275. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_152.html +111 -0
  276. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_153.html +100 -0
  277. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_154.html +116 -0
  278. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_160.html +125 -0
  279. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_161.html +98 -0
  280. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_162.html +106 -0
  281. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_163.html +99 -0
  282. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_170.html +121 -0
  283. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_171.html +98 -0
  284. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_172.html +105 -0
  285. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_b11.html +144 -0
  286. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrading.html +101 -0
  287. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/benchmark.html +198 -0
  288. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/calendar.html +249 -0
  289. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/cart.html +346 -0
  290. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/config.html +181 -0
  291. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/email.html +307 -0
  292. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/encryption.html +182 -0
  293. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/file_uploading.html +451 -0
  294. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/form_validation.html +1221 -0
  295. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/ftp.html +303 -0
  296. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/image_lib.html +666 -0
  297. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/input.html +231 -0
  298. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/language.html +137 -0
  299. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/loader.html +214 -0
  300. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/output.html +145 -0
  301. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/pagination.html +218 -0
  302. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/parser.html +208 -0
  303. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/sessions.html +311 -0
  304. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/table.html +292 -0
  305. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/trackback.html +246 -0
  306. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/typography.html +160 -0
  307. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/unit_testing.html +205 -0
  308. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/uri.html +252 -0
  309. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/user_agent.html +201 -0
  310. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/validation.html +740 -0
  311. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/xmlrpc.html +517 -0
  312. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/zip.html +278 -0
  313. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/license.html +107 -0
  314. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/hacks.txt +9 -0
  315. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.js +119 -0
  316. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.pack.js +241 -0
  317. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/nav.js +139 -0
  318. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/prototype.lite.js +127 -0
  319. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/user_guide_menu.js +4 -0
  320. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/appflow.html +95 -0
  321. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/at_a_glance.html +172 -0
  322. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/cheatsheets.html +83 -0
  323. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/features.html +120 -0
  324. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/getting_started.html +92 -0
  325. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/goals.html +98 -0
  326. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/index.html +84 -0
  327. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/mvc.html +100 -0
  328. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/toc.html +209 -0
  329. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/userguide.css +406 -0
  330. data/generators/ci_app/templates/README +1 -0
  331. data/generators/ci_controller/USAGE +2 -0
  332. data/generators/ci_controller/ci_controller_generator.rb +11 -0
  333. data/generators/ci_controller/templates/ci_controller.php.erb +15 -0
  334. data/generators/ci_controller/templates/ci_view.php.erb +8 -0
  335. data/generators/ci_layout/USAGE +2 -0
  336. data/generators/ci_layout/ci_layout_generator.rb +24 -0
  337. data/generators/ci_layout/templates/application_layout.php.erb +19 -0
  338. data/generators/ci_model/USAGE +2 -0
  339. data/generators/ci_model/ci_model_generator.rb +42 -0
  340. data/generators/ci_model/templates/ci_model.php.erb +15 -0
  341. data/generators/ci_model/templates/model.rb +5 -0
  342. data/generators/ci_model/templates/model_migration.rb.erb +16 -0
  343. data/init.rb +1 -0
  344. data/install.rb +1 -0
  345. data/lib/codeigniter_vender.rb +1 -0
  346. data/lib/tasks/app.rake +8 -0
  347. data/test/codeigniter_vender_test.rb +8 -0
  348. data/test/test_helper.rb +3 -0
  349. data/uninstall.rb +1 -0
  350. metadata +411 -0
@@ -0,0 +1,1025 @@
1
+ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+ /**
3
+ * CodeIgniter
4
+ *
5
+ * An open source application development framework for PHP 4.3.2 or newer
6
+ *
7
+ * @package CodeIgniter
8
+ * @author ExpressionEngine Dev Team
9
+ * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc.
10
+ * @license http://codeigniter.com/user_guide/license.html
11
+ * @link http://codeigniter.com
12
+ * @since Version 1.0
13
+ * @filesource
14
+ */
15
+
16
+ // ------------------------------------------------------------------------
17
+
18
+ /**
19
+ * CodeIgniter Form Helpers
20
+ *
21
+ * @package CodeIgniter
22
+ * @subpackage Helpers
23
+ * @category Helpers
24
+ * @author ExpressionEngine Dev Team
25
+ * @link http://codeigniter.com/user_guide/helpers/form_helper.html
26
+ */
27
+
28
+ // ------------------------------------------------------------------------
29
+
30
+ /**
31
+ * Form Declaration
32
+ *
33
+ * Creates the opening portion of the form.
34
+ *
35
+ * @access public
36
+ * @param string the URI segments of the form destination
37
+ * @param array a key/value pair of attributes
38
+ * @param array a key/value pair hidden data
39
+ * @return string
40
+ */
41
+ if ( ! function_exists('form_open'))
42
+ {
43
+ function form_open($action = '', $attributes = '', $hidden = array())
44
+ {
45
+ $CI =& get_instance();
46
+
47
+ if ($attributes == '')
48
+ {
49
+ $attributes = 'method="post"';
50
+ }
51
+
52
+ $action = ( strpos($action, '://') === FALSE) ? $CI->config->site_url($action) : $action;
53
+
54
+ $form = '<form action="'.$action.'"';
55
+
56
+ $form .= _attributes_to_string($attributes, TRUE);
57
+
58
+ $form .= '>';
59
+
60
+ if (is_array($hidden) AND count($hidden) > 0)
61
+ {
62
+ $form .= form_hidden($hidden);
63
+ }
64
+
65
+ return $form;
66
+ }
67
+ }
68
+
69
+ // ------------------------------------------------------------------------
70
+
71
+ /**
72
+ * Form Declaration - Multipart type
73
+ *
74
+ * Creates the opening portion of the form, but with "multipart/form-data".
75
+ *
76
+ * @access public
77
+ * @param string the URI segments of the form destination
78
+ * @param array a key/value pair of attributes
79
+ * @param array a key/value pair hidden data
80
+ * @return string
81
+ */
82
+ if ( ! function_exists('form_open_multipart'))
83
+ {
84
+ function form_open_multipart($action, $attributes = array(), $hidden = array())
85
+ {
86
+ $attributes['enctype'] = 'multipart/form-data';
87
+ return form_open($action, $attributes, $hidden);
88
+ }
89
+ }
90
+
91
+ // ------------------------------------------------------------------------
92
+
93
+ /**
94
+ * Hidden Input Field
95
+ *
96
+ * Generates hidden fields. You can pass a simple key/value string or an associative
97
+ * array with multiple values.
98
+ *
99
+ * @access public
100
+ * @param mixed
101
+ * @param string
102
+ * @return string
103
+ */
104
+ if ( ! function_exists('form_hidden'))
105
+ {
106
+ function form_hidden($name, $value = '', $recursing = FALSE)
107
+ {
108
+ static $form;
109
+
110
+ if ($recursing === FALSE)
111
+ {
112
+ $form = "\n";
113
+ }
114
+
115
+ if (is_array($name))
116
+ {
117
+ foreach ($name as $key => $val)
118
+ {
119
+ form_hidden($key, $val, TRUE);
120
+ }
121
+ return $form;
122
+ }
123
+
124
+ if ( ! is_array($value))
125
+ {
126
+ $form .= '<input type="hidden" name="'.$name.'" value="'.form_prep($value, $name).'" />'."\n";
127
+ }
128
+ else
129
+ {
130
+ foreach ($value as $k => $v)
131
+ {
132
+ $k = (is_int($k)) ? '' : $k;
133
+ form_hidden($name.'['.$k.']', $v, TRUE);
134
+ }
135
+ }
136
+
137
+ return $form;
138
+ }
139
+ }
140
+
141
+ // ------------------------------------------------------------------------
142
+
143
+ /**
144
+ * Text Input Field
145
+ *
146
+ * @access public
147
+ * @param mixed
148
+ * @param string
149
+ * @param string
150
+ * @return string
151
+ */
152
+ if ( ! function_exists('form_input'))
153
+ {
154
+ function form_input($data = '', $value = '', $extra = '')
155
+ {
156
+ $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
157
+
158
+ return "<input "._parse_form_attributes($data, $defaults).$extra." />";
159
+ }
160
+ }
161
+
162
+ // ------------------------------------------------------------------------
163
+
164
+ /**
165
+ * Password Field
166
+ *
167
+ * Identical to the input function but adds the "password" type
168
+ *
169
+ * @access public
170
+ * @param mixed
171
+ * @param string
172
+ * @param string
173
+ * @return string
174
+ */
175
+ if ( ! function_exists('form_password'))
176
+ {
177
+ function form_password($data = '', $value = '', $extra = '')
178
+ {
179
+ if ( ! is_array($data))
180
+ {
181
+ $data = array('name' => $data);
182
+ }
183
+
184
+ $data['type'] = 'password';
185
+ return form_input($data, $value, $extra);
186
+ }
187
+ }
188
+
189
+ // ------------------------------------------------------------------------
190
+
191
+ /**
192
+ * Upload Field
193
+ *
194
+ * Identical to the input function but adds the "file" type
195
+ *
196
+ * @access public
197
+ * @param mixed
198
+ * @param string
199
+ * @param string
200
+ * @return string
201
+ */
202
+ if ( ! function_exists('form_upload'))
203
+ {
204
+ function form_upload($data = '', $value = '', $extra = '')
205
+ {
206
+ if ( ! is_array($data))
207
+ {
208
+ $data = array('name' => $data);
209
+ }
210
+
211
+ $data['type'] = 'file';
212
+ return form_input($data, $value, $extra);
213
+ }
214
+ }
215
+
216
+ // ------------------------------------------------------------------------
217
+
218
+ /**
219
+ * Textarea field
220
+ *
221
+ * @access public
222
+ * @param mixed
223
+ * @param string
224
+ * @param string
225
+ * @return string
226
+ */
227
+ if ( ! function_exists('form_textarea'))
228
+ {
229
+ function form_textarea($data = '', $value = '', $extra = '')
230
+ {
231
+ $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12');
232
+
233
+ if ( ! is_array($data) OR ! isset($data['value']))
234
+ {
235
+ $val = $value;
236
+ }
237
+ else
238
+ {
239
+ $val = $data['value'];
240
+ unset($data['value']); // textareas don't use the value attribute
241
+ }
242
+
243
+ $name = (is_array($data)) ? $data['name'] : $data;
244
+ return "<textarea "._parse_form_attributes($data, $defaults).$extra.">".form_prep($val, $name)."</textarea>";
245
+ }
246
+ }
247
+
248
+ // ------------------------------------------------------------------------
249
+
250
+ /**
251
+ * Multi-select menu
252
+ *
253
+ * @access public
254
+ * @param string
255
+ * @param array
256
+ * @param mixed
257
+ * @param string
258
+ * @return type
259
+ */
260
+ if (! function_exists('form_multiselect'))
261
+ {
262
+ function form_multiselect($name = '', $options = array(), $selected = array(), $extra = '')
263
+ {
264
+ if ( ! strpos($extra, 'multiple'))
265
+ {
266
+ $extra .= ' multiple="multiple"';
267
+ }
268
+
269
+ return form_dropdown($name, $options, $selected, $extra);
270
+ }
271
+ }
272
+
273
+ // --------------------------------------------------------------------
274
+
275
+ /**
276
+ * Drop-down Menu
277
+ *
278
+ * @access public
279
+ * @param string
280
+ * @param array
281
+ * @param string
282
+ * @param string
283
+ * @return string
284
+ */
285
+ if ( ! function_exists('form_dropdown'))
286
+ {
287
+ function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '')
288
+ {
289
+ if ( ! is_array($selected))
290
+ {
291
+ $selected = array($selected);
292
+ }
293
+
294
+ // If no selected state was submitted we will attempt to set it automatically
295
+ if (count($selected) === 0)
296
+ {
297
+ // If the form name appears in the $_POST array we have a winner!
298
+ if (isset($_POST[$name]))
299
+ {
300
+ $selected = array($_POST[$name]);
301
+ }
302
+ }
303
+
304
+ if ($extra != '') $extra = ' '.$extra;
305
+
306
+ $multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : '';
307
+
308
+ $form = '<select name="'.$name.'"'.$extra.$multiple.">\n";
309
+
310
+ foreach ($options as $key => $val)
311
+ {
312
+ $key = (string) $key;
313
+
314
+ if (is_array($val))
315
+ {
316
+ $form .= '<optgroup label="'.$key.'">'."\n";
317
+
318
+ foreach ($val as $optgroup_key => $optgroup_val)
319
+ {
320
+ $sel = (in_array($optgroup_key, $selected)) ? ' selected="selected"' : '';
321
+
322
+ $form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string) $optgroup_val."</option>\n";
323
+ }
324
+
325
+ $form .= '</optgroup>'."\n";
326
+ }
327
+ else
328
+ {
329
+ $sel = (in_array($key, $selected)) ? ' selected="selected"' : '';
330
+
331
+ $form .= '<option value="'.$key.'"'.$sel.'>'.(string) $val."</option>\n";
332
+ }
333
+ }
334
+
335
+ $form .= '</select>';
336
+
337
+ return $form;
338
+ }
339
+ }
340
+
341
+ // ------------------------------------------------------------------------
342
+
343
+ /**
344
+ * Checkbox Field
345
+ *
346
+ * @access public
347
+ * @param mixed
348
+ * @param string
349
+ * @param bool
350
+ * @param string
351
+ * @return string
352
+ */
353
+ if ( ! function_exists('form_checkbox'))
354
+ {
355
+ function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '')
356
+ {
357
+ $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
358
+
359
+ if (is_array($data) AND array_key_exists('checked', $data))
360
+ {
361
+ $checked = $data['checked'];
362
+
363
+ if ($checked == FALSE)
364
+ {
365
+ unset($data['checked']);
366
+ }
367
+ else
368
+ {
369
+ $data['checked'] = 'checked';
370
+ }
371
+ }
372
+
373
+ if ($checked == TRUE)
374
+ {
375
+ $defaults['checked'] = 'checked';
376
+ }
377
+ else
378
+ {
379
+ unset($defaults['checked']);
380
+ }
381
+
382
+ return "<input "._parse_form_attributes($data, $defaults).$extra." />";
383
+ }
384
+ }
385
+
386
+ // ------------------------------------------------------------------------
387
+
388
+ /**
389
+ * Radio Button
390
+ *
391
+ * @access public
392
+ * @param mixed
393
+ * @param string
394
+ * @param bool
395
+ * @param string
396
+ * @return string
397
+ */
398
+ if ( ! function_exists('form_radio'))
399
+ {
400
+ function form_radio($data = '', $value = '', $checked = FALSE, $extra = '')
401
+ {
402
+ if ( ! is_array($data))
403
+ {
404
+ $data = array('name' => $data);
405
+ }
406
+
407
+ $data['type'] = 'radio';
408
+ return form_checkbox($data, $value, $checked, $extra);
409
+ }
410
+ }
411
+
412
+ // ------------------------------------------------------------------------
413
+
414
+ /**
415
+ * Submit Button
416
+ *
417
+ * @access public
418
+ * @param mixed
419
+ * @param string
420
+ * @param string
421
+ * @return string
422
+ */
423
+ if ( ! function_exists('form_submit'))
424
+ {
425
+ function form_submit($data = '', $value = '', $extra = '')
426
+ {
427
+ $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
428
+
429
+ return "<input "._parse_form_attributes($data, $defaults).$extra." />";
430
+ }
431
+ }
432
+
433
+ // ------------------------------------------------------------------------
434
+
435
+ /**
436
+ * Reset Button
437
+ *
438
+ * @access public
439
+ * @param mixed
440
+ * @param string
441
+ * @param string
442
+ * @return string
443
+ */
444
+ if ( ! function_exists('form_reset'))
445
+ {
446
+ function form_reset($data = '', $value = '', $extra = '')
447
+ {
448
+ $defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
449
+
450
+ return "<input "._parse_form_attributes($data, $defaults).$extra." />";
451
+ }
452
+ }
453
+
454
+ // ------------------------------------------------------------------------
455
+
456
+ /**
457
+ * Form Button
458
+ *
459
+ * @access public
460
+ * @param mixed
461
+ * @param string
462
+ * @param string
463
+ * @return string
464
+ */
465
+ if ( ! function_exists('form_button'))
466
+ {
467
+ function form_button($data = '', $content = '', $extra = '')
468
+ {
469
+ $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'button');
470
+
471
+ if ( is_array($data) AND isset($data['content']))
472
+ {
473
+ $content = $data['content'];
474
+ unset($data['content']); // content is not an attribute
475
+ }
476
+
477
+ return "<button "._parse_form_attributes($data, $defaults).$extra.">".$content."</button>";
478
+ }
479
+ }
480
+
481
+ // ------------------------------------------------------------------------
482
+
483
+ /**
484
+ * Form Label Tag
485
+ *
486
+ * @access public
487
+ * @param string The text to appear onscreen
488
+ * @param string The id the label applies to
489
+ * @param string Additional attributes
490
+ * @return string
491
+ */
492
+ if ( ! function_exists('form_label'))
493
+ {
494
+ function form_label($label_text = '', $id = '', $attributes = array())
495
+ {
496
+
497
+ $label = '<label';
498
+
499
+ if ($id != '')
500
+ {
501
+ $label .= " for=\"$id\"";
502
+ }
503
+
504
+ if (is_array($attributes) AND count($attributes) > 0)
505
+ {
506
+ foreach ($attributes as $key => $val)
507
+ {
508
+ $label .= ' '.$key.'="'.$val.'"';
509
+ }
510
+ }
511
+
512
+ $label .= ">$label_text</label>";
513
+
514
+ return $label;
515
+ }
516
+ }
517
+
518
+ // ------------------------------------------------------------------------
519
+ /**
520
+ * Fieldset Tag
521
+ *
522
+ * Used to produce <fieldset><legend>text</legend>. To close fieldset
523
+ * use form_fieldset_close()
524
+ *
525
+ * @access public
526
+ * @param string The legend text
527
+ * @param string Additional attributes
528
+ * @return string
529
+ */
530
+ if ( ! function_exists('form_fieldset'))
531
+ {
532
+ function form_fieldset($legend_text = '', $attributes = array())
533
+ {
534
+ $fieldset = "<fieldset";
535
+
536
+ $fieldset .= _attributes_to_string($attributes, FALSE);
537
+
538
+ $fieldset .= ">\n";
539
+
540
+ if ($legend_text != '')
541
+ {
542
+ $fieldset .= "<legend>$legend_text</legend>\n";
543
+ }
544
+
545
+ return $fieldset;
546
+ }
547
+ }
548
+
549
+ // ------------------------------------------------------------------------
550
+
551
+ /**
552
+ * Fieldset Close Tag
553
+ *
554
+ * @access public
555
+ * @param string
556
+ * @return string
557
+ */
558
+ if ( ! function_exists('form_fieldset_close'))
559
+ {
560
+ function form_fieldset_close($extra = '')
561
+ {
562
+ return "</fieldset>".$extra;
563
+ }
564
+ }
565
+
566
+ // ------------------------------------------------------------------------
567
+
568
+ /**
569
+ * Form Close Tag
570
+ *
571
+ * @access public
572
+ * @param string
573
+ * @return string
574
+ */
575
+ if ( ! function_exists('form_close'))
576
+ {
577
+ function form_close($extra = '')
578
+ {
579
+ return "</form>".$extra;
580
+ }
581
+ }
582
+
583
+ // ------------------------------------------------------------------------
584
+
585
+ /**
586
+ * Form Prep
587
+ *
588
+ * Formats text so that it can be safely placed in a form field in the event it has HTML tags.
589
+ *
590
+ * @access public
591
+ * @param string
592
+ * @return string
593
+ */
594
+ if ( ! function_exists('form_prep'))
595
+ {
596
+ function form_prep($str = '', $field_name = '')
597
+ {
598
+ static $prepped_fields = array();
599
+
600
+ // if the field name is an array we do this recursively
601
+ if (is_array($str))
602
+ {
603
+ foreach ($str as $key => $val)
604
+ {
605
+ $str[$key] = form_prep($val);
606
+ }
607
+
608
+ return $str;
609
+ }
610
+
611
+ if ($str === '')
612
+ {
613
+ return '';
614
+ }
615
+
616
+ // we've already prepped a field with this name
617
+ // @todo need to figure out a way to namespace this so
618
+ // that we know the *exact* field and not just one with
619
+ // the same name
620
+ if (isset($prepped_fields[$field_name]))
621
+ {
622
+ return $str;
623
+ }
624
+
625
+ $str = htmlspecialchars($str);
626
+
627
+ // In case htmlspecialchars misses these.
628
+ $str = str_replace(array("'", '"'), array("&#39;", "&quot;"), $str);
629
+
630
+ if ($field_name != '')
631
+ {
632
+ $prepped_fields[$field_name] = $str;
633
+ }
634
+
635
+ return $str;
636
+ }
637
+ }
638
+
639
+ // ------------------------------------------------------------------------
640
+
641
+ /**
642
+ * Form Value
643
+ *
644
+ * Grabs a value from the POST array for the specified field so you can
645
+ * re-populate an input field or textarea. If Form Validation
646
+ * is active it retrieves the info from the validation class
647
+ *
648
+ * @access public
649
+ * @param string
650
+ * @return mixed
651
+ */
652
+ if ( ! function_exists('set_value'))
653
+ {
654
+ function set_value($field = '', $default = '')
655
+ {
656
+ if (FALSE === ($OBJ =& _get_validation_object()))
657
+ {
658
+ if ( ! isset($_POST[$field]))
659
+ {
660
+ return $default;
661
+ }
662
+
663
+ return form_prep($_POST[$field], $field);
664
+ }
665
+
666
+ return form_prep($OBJ->set_value($field, $default), $field);
667
+ }
668
+ }
669
+
670
+ // ------------------------------------------------------------------------
671
+
672
+ /**
673
+ * Set Select
674
+ *
675
+ * Let's you set the selected value of a <select> menu via data in the POST array.
676
+ * If Form Validation is active it retrieves the info from the validation class
677
+ *
678
+ * @access public
679
+ * @param string
680
+ * @param string
681
+ * @param bool
682
+ * @return string
683
+ */
684
+ if ( ! function_exists('set_select'))
685
+ {
686
+ function set_select($field = '', $value = '', $default = FALSE)
687
+ {
688
+ $OBJ =& _get_validation_object();
689
+
690
+ if ($OBJ === FALSE)
691
+ {
692
+ if ( ! isset($_POST[$field]))
693
+ {
694
+ if (count($_POST) === 0 AND $default == TRUE)
695
+ {
696
+ return ' selected="selected"';
697
+ }
698
+ return '';
699
+ }
700
+
701
+ $field = $_POST[$field];
702
+
703
+ if (is_array($field))
704
+ {
705
+ if ( ! in_array($value, $field))
706
+ {
707
+ return '';
708
+ }
709
+ }
710
+ else
711
+ {
712
+ if (($field == '' OR $value == '') OR ($field != $value))
713
+ {
714
+ return '';
715
+ }
716
+ }
717
+
718
+ return ' selected="selected"';
719
+ }
720
+
721
+ return $OBJ->set_select($field, $value, $default);
722
+ }
723
+ }
724
+
725
+ // ------------------------------------------------------------------------
726
+
727
+ /**
728
+ * Set Checkbox
729
+ *
730
+ * Let's you set the selected value of a checkbox via the value in the POST array.
731
+ * If Form Validation is active it retrieves the info from the validation class
732
+ *
733
+ * @access public
734
+ * @param string
735
+ * @param string
736
+ * @param bool
737
+ * @return string
738
+ */
739
+ if ( ! function_exists('set_checkbox'))
740
+ {
741
+ function set_checkbox($field = '', $value = '', $default = FALSE)
742
+ {
743
+ $OBJ =& _get_validation_object();
744
+
745
+ if ($OBJ === FALSE)
746
+ {
747
+ if ( ! isset($_POST[$field]))
748
+ {
749
+ if (count($_POST) === 0 AND $default == TRUE)
750
+ {
751
+ return ' checked="checked"';
752
+ }
753
+ return '';
754
+ }
755
+
756
+ $field = $_POST[$field];
757
+
758
+ if (is_array($field))
759
+ {
760
+ if ( ! in_array($value, $field))
761
+ {
762
+ return '';
763
+ }
764
+ }
765
+ else
766
+ {
767
+ if (($field == '' OR $value == '') OR ($field != $value))
768
+ {
769
+ return '';
770
+ }
771
+ }
772
+
773
+ return ' checked="checked"';
774
+ }
775
+
776
+ return $OBJ->set_checkbox($field, $value, $default);
777
+ }
778
+ }
779
+
780
+ // ------------------------------------------------------------------------
781
+
782
+ /**
783
+ * Set Radio
784
+ *
785
+ * Let's you set the selected value of a radio field via info in the POST array.
786
+ * If Form Validation is active it retrieves the info from the validation class
787
+ *
788
+ * @access public
789
+ * @param string
790
+ * @param string
791
+ * @param bool
792
+ * @return string
793
+ */
794
+ if ( ! function_exists('set_radio'))
795
+ {
796
+ function set_radio($field = '', $value = '', $default = FALSE)
797
+ {
798
+ $OBJ =& _get_validation_object();
799
+
800
+ if ($OBJ === FALSE)
801
+ {
802
+ if ( ! isset($_POST[$field]))
803
+ {
804
+ if (count($_POST) === 0 AND $default == TRUE)
805
+ {
806
+ return ' checked="checked"';
807
+ }
808
+ return '';
809
+ }
810
+
811
+ $field = $_POST[$field];
812
+
813
+ if (is_array($field))
814
+ {
815
+ if ( ! in_array($value, $field))
816
+ {
817
+ return '';
818
+ }
819
+ }
820
+ else
821
+ {
822
+ if (($field == '' OR $value == '') OR ($field != $value))
823
+ {
824
+ return '';
825
+ }
826
+ }
827
+
828
+ return ' checked="checked"';
829
+ }
830
+
831
+ return $OBJ->set_radio($field, $value, $default);
832
+ }
833
+ }
834
+
835
+ // ------------------------------------------------------------------------
836
+
837
+ /**
838
+ * Form Error
839
+ *
840
+ * Returns the error for a specific form field. This is a helper for the
841
+ * form validation class.
842
+ *
843
+ * @access public
844
+ * @param string
845
+ * @param string
846
+ * @param string
847
+ * @return string
848
+ */
849
+ if ( ! function_exists('form_error'))
850
+ {
851
+ function form_error($field = '', $prefix = '', $suffix = '')
852
+ {
853
+ if (FALSE === ($OBJ =& _get_validation_object()))
854
+ {
855
+ return '';
856
+ }
857
+
858
+ return $OBJ->error($field, $prefix, $suffix);
859
+ }
860
+ }
861
+
862
+ // ------------------------------------------------------------------------
863
+
864
+ /**
865
+ * Validation Error String
866
+ *
867
+ * Returns all the errors associated with a form submission. This is a helper
868
+ * function for the form validation class.
869
+ *
870
+ * @access public
871
+ * @param string
872
+ * @param string
873
+ * @return string
874
+ */
875
+ if ( ! function_exists('validation_errors'))
876
+ {
877
+ function validation_errors($prefix = '', $suffix = '')
878
+ {
879
+ if (FALSE === ($OBJ =& _get_validation_object()))
880
+ {
881
+ return '';
882
+ }
883
+
884
+ return $OBJ->error_string($prefix, $suffix);
885
+ }
886
+ }
887
+
888
+ // ------------------------------------------------------------------------
889
+
890
+ /**
891
+ * Parse the form attributes
892
+ *
893
+ * Helper function used by some of the form helpers
894
+ *
895
+ * @access private
896
+ * @param array
897
+ * @param array
898
+ * @return string
899
+ */
900
+ if ( ! function_exists('_parse_form_attributes'))
901
+ {
902
+ function _parse_form_attributes($attributes, $default)
903
+ {
904
+ if (is_array($attributes))
905
+ {
906
+ foreach ($default as $key => $val)
907
+ {
908
+ if (isset($attributes[$key]))
909
+ {
910
+ $default[$key] = $attributes[$key];
911
+ unset($attributes[$key]);
912
+ }
913
+ }
914
+
915
+ if (count($attributes) > 0)
916
+ {
917
+ $default = array_merge($default, $attributes);
918
+ }
919
+ }
920
+
921
+ $att = '';
922
+
923
+ foreach ($default as $key => $val)
924
+ {
925
+ if ($key == 'value')
926
+ {
927
+ $val = form_prep($val, $default['name']);
928
+ }
929
+
930
+ $att .= $key . '="' . $val . '" ';
931
+ }
932
+
933
+ return $att;
934
+ }
935
+ }
936
+
937
+ // ------------------------------------------------------------------------
938
+
939
+ /**
940
+ * Attributes To String
941
+ *
942
+ * Helper function used by some of the form helpers
943
+ *
944
+ * @access private
945
+ * @param mixed
946
+ * @param bool
947
+ * @return string
948
+ */
949
+ if ( ! function_exists('_attributes_to_string'))
950
+ {
951
+ function _attributes_to_string($attributes, $formtag = FALSE)
952
+ {
953
+ if (is_string($attributes) AND strlen($attributes) > 0)
954
+ {
955
+ if ($formtag == TRUE AND strpos($attributes, 'method=') === FALSE)
956
+ {
957
+ $attributes .= ' method="post"';
958
+ }
959
+
960
+ return ' '.$attributes;
961
+ }
962
+
963
+ if (is_object($attributes) AND count($attributes) > 0)
964
+ {
965
+ $attributes = (array)$attributes;
966
+ }
967
+
968
+ if (is_array($attributes) AND count($attributes) > 0)
969
+ {
970
+ $atts = '';
971
+
972
+ if ( ! isset($attributes['method']) AND $formtag === TRUE)
973
+ {
974
+ $atts .= ' method="post"';
975
+ }
976
+
977
+ foreach ($attributes as $key => $val)
978
+ {
979
+ $atts .= ' '.$key.'="'.$val.'"';
980
+ }
981
+
982
+ return $atts;
983
+ }
984
+ }
985
+ }
986
+
987
+ // ------------------------------------------------------------------------
988
+
989
+ /**
990
+ * Validation Object
991
+ *
992
+ * Determines what the form validation class was instantiated as, fetches
993
+ * the object and returns it.
994
+ *
995
+ * @access private
996
+ * @return mixed
997
+ */
998
+ if ( ! function_exists('_get_validation_object'))
999
+ {
1000
+ function &_get_validation_object()
1001
+ {
1002
+ $CI =& get_instance();
1003
+
1004
+ // We set this as a variable since we're returning by reference
1005
+ $return = FALSE;
1006
+
1007
+ if ( ! isset($CI->load->_ci_classes) OR ! isset($CI->load->_ci_classes['form_validation']))
1008
+ {
1009
+ return $return;
1010
+ }
1011
+
1012
+ $object = $CI->load->_ci_classes['form_validation'];
1013
+
1014
+ if ( ! isset($CI->$object) OR ! is_object($CI->$object))
1015
+ {
1016
+ return $return;
1017
+ }
1018
+
1019
+ return $CI->$object;
1020
+ }
1021
+ }
1022
+
1023
+
1024
+ /* End of file form_helper.php */
1025
+ /* Location: ./system/helpers/form_helper.php */