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.
- data/.gitignore +2 -0
- data/MIT-LICENSE +20 -0
- data/README +40 -0
- data/Rakefile +18 -0
- data/VERSION +1 -0
- data/codeigniter_vender.gemspec +389 -0
- data/generators/ci_app/USAGE +8 -0
- data/generators/ci_app/ci_app_generator.rb +12 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/index.php +118 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/license.txt +52 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/autoload.php +116 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/config.php +329 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/constants.php +41 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/database.php +55 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/doctypes.php +15 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/hooks.php +16 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/mimes.php +105 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/routes.php +48 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/smileys.php +66 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/user_agents.php +175 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/welcome.php +17 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_404.php +34 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_db.php +34 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_general.php +34 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_php.php +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/helpers/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/hooks/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/language/english/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/libraries/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/models/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/welcome_message.php +62 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/cache/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base4.php +69 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base5.php +56 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/CodeIgniter.php +280 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Common.php +421 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Compat.php +93 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB.php +146 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_active_rec.php +1820 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_cache.php +195 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_driver.php +1366 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_forge.php +375 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_result.php +342 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_utility.php +389 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_driver.php +667 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_forge.php +248 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_result.php +169 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_utility.php +123 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_driver.php +670 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_forge.php +254 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_result.php +169 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_utility.php +245 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_driver.php +671 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_forge.php +254 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_result.php +169 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_utility.php +123 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_driver.php +780 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_forge.php +248 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_result.php +249 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_utility.php +122 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_driver.php +639 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_forge.php +266 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_result.php +228 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_utility.php +148 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_driver.php +684 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_forge.php +248 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_result.php +169 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_utility.php +124 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_driver.php +657 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_forge.php +265 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_result.php +179 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_utility.php +141 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/texb.ttf +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/array_helper.php +78 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/compatibility_helper.php +498 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/cookie_helper.php +144 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/date_helper.php +611 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/directory_helper.php +84 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/download_helper.php +100 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/email_helper.php +62 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/file_helper.php +464 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/form_helper.php +1025 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/html_helper.php +416 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/inflector_helper.php +171 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/language_helper.php +58 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/number_helper.php +75 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/path_helper.php +72 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/security_helper.php +126 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/smiley_helper.php +273 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/string_helper.php +273 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/text_helper.php +462 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/typography_helper.php +71 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/url_helper.php +593 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/xml_helper.php +62 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/calendar_lang.php +51 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/date_lang.php +60 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/db_lang.php +28 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/email_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/form_validation_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/ftp_lang.php +17 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/imglib_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/number_lang.php +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/profiler_lang.php +19 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/scaffolding_lang.php +17 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/unit_test_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/upload_lang.php +22 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/validation_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Benchmark.php +113 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Calendar.php +477 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Cart.php +550 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Config.php +244 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Controller.php +127 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Email.php +2041 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Encrypt.php +484 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Exceptions.php +174 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Form_validation.php +1278 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Ftp.php +618 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Hooks.php +226 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Image_lib.php +1544 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Input.php +1067 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Language.php +123 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Loader.php +1085 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Log.php +117 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Model.php +83 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Output.php +409 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Pagination.php +244 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Parser.php +173 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Profiler.php +392 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Router.php +389 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Session.php +758 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Sha1.php +251 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Table.php +440 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Trackback.php +547 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Typography.php +406 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/URI.php +586 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Unit_test.php +347 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Upload.php +970 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/User_agent.php +502 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Validation.php +875 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpc.php +1421 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpcs.php +536 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Zip.php +359 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/logs/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/captcha_pi.php +356 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/js_calendar_pi.php +629 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/Scaffolding.php +291 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/background.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/logo.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/add.php +32 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/delete.php +9 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/edit.php +33 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/footer.php +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/header.php +29 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/no_data.php +8 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/stylesheet.css +143 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/view.php +27 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/changelog.html +1080 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/active_record.html +757 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/caching.html +220 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/call_function.html +118 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/configuration.html +157 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/connecting.html +186 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/examples.html +217 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/fields.html +163 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/forge.html +234 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/helpers.html +151 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/index.html +99 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/queries.html +153 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/results.html +238 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/table_data.html +113 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/transactions.html +200 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/utilities.html +295 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/index.html +86 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/template.html +128 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/alternative_php.html +147 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/ancillary_classes.html +117 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/autoloader.html +101 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/caching.html +115 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/common_functions.html +119 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/controllers.html +385 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/core_classes.html +185 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/creating_libraries.html +298 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/credits.html +86 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/errors.html +138 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/helpers.html +185 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/hooks.html +167 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/libraries.html +94 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/managing_apps.html +133 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/models.html +251 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/plugins.html +127 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/profiling.html +104 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/quick_reference.html +77 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/requirements.html +82 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/reserved_names.html +156 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/routing.html +176 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/scaffolding.html +147 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/security.html +153 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/styleguide.html +687 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/urls.html +151 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/views.html +274 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/array_helper.html +119 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/compatibility_helper.html +118 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/cookie_helper.html +147 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/date_helper.html +408 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/directory_helper.html +143 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/download_helper.html +112 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/email_helper.html +102 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/file_helper.html +178 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/form_helper.html +484 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/html_helper.html +385 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/inflector_helper.html +151 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/language_helper.html +98 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/number_helper.html +107 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/path_helper.html +106 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/security_helper.html +125 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/smiley_helper.html +215 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/string_helper.html +176 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/text_helper.html +192 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/typography_helper.html +112 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/url_helper.html +289 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/xml_helper.html +105 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/appflowchart.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/arrow.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo_flame.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_quick_ref.png +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.pdf +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.png +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.pdf +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.png +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/file.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/folder.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_bg_darker.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_separator_darker.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_toggle_darker.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/smile.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/transparent.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/index.html +99 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/downloads.html +105 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/index.html +97 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/troubleshooting.html +90 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_120.html +92 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_130.html +203 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_131.html +102 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_132.html +100 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_133.html +112 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_140.html +145 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_141.html +148 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_150.html +178 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_152.html +111 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_153.html +100 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_154.html +116 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_160.html +125 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_161.html +98 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_162.html +106 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_163.html +99 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_170.html +121 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_171.html +98 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_172.html +105 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_b11.html +144 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrading.html +101 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/benchmark.html +198 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/calendar.html +249 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/cart.html +346 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/config.html +181 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/email.html +307 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/encryption.html +182 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/file_uploading.html +451 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/form_validation.html +1221 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/ftp.html +303 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/image_lib.html +666 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/input.html +231 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/language.html +137 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/loader.html +214 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/output.html +145 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/pagination.html +218 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/parser.html +208 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/sessions.html +311 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/table.html +292 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/trackback.html +246 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/typography.html +160 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/unit_testing.html +205 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/uri.html +252 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/user_agent.html +201 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/validation.html +740 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/xmlrpc.html +517 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/zip.html +278 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/license.html +107 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/hacks.txt +9 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.js +119 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.pack.js +241 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/nav.js +139 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/prototype.lite.js +127 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/user_guide_menu.js +4 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/appflow.html +95 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/at_a_glance.html +172 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/cheatsheets.html +83 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/features.html +120 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/getting_started.html +92 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/goals.html +98 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/index.html +84 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/mvc.html +100 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/toc.html +209 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/userguide.css +406 -0
- data/generators/ci_app/templates/README +1 -0
- data/generators/ci_controller/USAGE +2 -0
- data/generators/ci_controller/ci_controller_generator.rb +11 -0
- data/generators/ci_controller/templates/ci_controller.php.erb +15 -0
- data/generators/ci_controller/templates/ci_view.php.erb +8 -0
- data/generators/ci_layout/USAGE +2 -0
- data/generators/ci_layout/ci_layout_generator.rb +24 -0
- data/generators/ci_layout/templates/application_layout.php.erb +19 -0
- data/generators/ci_model/USAGE +2 -0
- data/generators/ci_model/ci_model_generator.rb +42 -0
- data/generators/ci_model/templates/ci_model.php.erb +15 -0
- data/generators/ci_model/templates/model.rb +5 -0
- data/generators/ci_model/templates/model_migration.rb.erb +16 -0
- data/init.rb +1 -0
- data/install.rb +1 -0
- data/lib/codeigniter_vender.rb +1 -0
- data/lib/tasks/app.rake +8 -0
- data/test/codeigniter_vender_test.rb +8 -0
- data/test/test_helper.rb +3 -0
- data/uninstall.rb +1 -0
- metadata +411 -0
|
@@ -0,0 +1,406 @@
|
|
|
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
|
+
* Typography Class
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
* @access private
|
|
23
|
+
* @category Helpers
|
|
24
|
+
* @author ExpressionEngine Dev Team
|
|
25
|
+
* @link http://codeigniter.com/user_guide/helpers/
|
|
26
|
+
*/
|
|
27
|
+
class CI_Typography {
|
|
28
|
+
|
|
29
|
+
// Block level elements that should not be wrapped inside <p> tags
|
|
30
|
+
var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul';
|
|
31
|
+
|
|
32
|
+
// Elements that should not have <p> and <br /> tags within them.
|
|
33
|
+
var $skip_elements = 'p|pre|ol|ul|dl|object|table|h\d';
|
|
34
|
+
|
|
35
|
+
// Tags we want the parser to completely ignore when splitting the string.
|
|
36
|
+
var $inline_elements = 'a|abbr|acronym|b|bdo|big|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|q|samp|select|small|span|strong|sub|sup|textarea|tt|var';
|
|
37
|
+
|
|
38
|
+
// array of block level elements that require inner content to be within another block level element
|
|
39
|
+
var $inner_block_required = array('blockquote');
|
|
40
|
+
|
|
41
|
+
// the last block element parsed
|
|
42
|
+
var $last_block_element = '';
|
|
43
|
+
|
|
44
|
+
// whether or not to protect quotes within { curly braces }
|
|
45
|
+
var $protect_braced_quotes = FALSE;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Nothing to do here...
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
function CI_Typography()
|
|
52
|
+
{
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Auto Typography
|
|
57
|
+
*
|
|
58
|
+
* This function converts text, making it typographically correct:
|
|
59
|
+
* - Converts double spaces into paragraphs.
|
|
60
|
+
* - Converts single line breaks into <br /> tags
|
|
61
|
+
* - Converts single and double quotes into correctly facing curly quote entities.
|
|
62
|
+
* - Converts three dots into ellipsis.
|
|
63
|
+
* - Converts double dashes into em-dashes.
|
|
64
|
+
* - Converts two spaces into entities
|
|
65
|
+
*
|
|
66
|
+
* @access public
|
|
67
|
+
* @param string
|
|
68
|
+
* @param bool whether to reduce more then two consecutive newlines to two
|
|
69
|
+
* @return string
|
|
70
|
+
*/
|
|
71
|
+
function auto_typography($str, $reduce_linebreaks = FALSE)
|
|
72
|
+
{
|
|
73
|
+
if ($str == '')
|
|
74
|
+
{
|
|
75
|
+
return '';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Standardize Newlines to make matching easier
|
|
79
|
+
if (strpos($str, "\r") !== FALSE)
|
|
80
|
+
{
|
|
81
|
+
$str = str_replace(array("\r\n", "\r"), "\n", $str);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Reduce line breaks. If there are more than two consecutive linebreaks
|
|
85
|
+
// we'll compress them down to a maximum of two since there's no benefit to more.
|
|
86
|
+
if ($reduce_linebreaks === TRUE)
|
|
87
|
+
{
|
|
88
|
+
$str = preg_replace("/\n\n+/", "\n\n", $str);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// HTML comment tags don't conform to patterns of normal tags, so pull them out separately, only if needed
|
|
92
|
+
$html_comments = array();
|
|
93
|
+
if (strpos($str, '<!--') !== FALSE)
|
|
94
|
+
{
|
|
95
|
+
if (preg_match_all("#(<!\-\-.*?\-\->)#s", $str, $matches))
|
|
96
|
+
{
|
|
97
|
+
for ($i = 0, $total = count($matches[0]); $i < $total; $i++)
|
|
98
|
+
{
|
|
99
|
+
$html_comments[] = $matches[0][$i];
|
|
100
|
+
$str = str_replace($matches[0][$i], '{@HC'.$i.'}', $str);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// match and yank <pre> tags if they exist. It's cheaper to do this separately since most content will
|
|
106
|
+
// not contain <pre> tags, and it keeps the PCRE patterns below simpler and faster
|
|
107
|
+
if (strpos($str, '<pre') !== FALSE)
|
|
108
|
+
{
|
|
109
|
+
$str = preg_replace_callback("#<pre.*?>.*?</pre>#si", array($this, '_protect_characters'), $str);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Convert quotes within tags to temporary markers.
|
|
113
|
+
$str = preg_replace_callback("#<.+?>#si", array($this, '_protect_characters'), $str);
|
|
114
|
+
|
|
115
|
+
// Do the same with braces if necessary
|
|
116
|
+
if ($this->protect_braced_quotes === TRUE)
|
|
117
|
+
{
|
|
118
|
+
$str = preg_replace_callback("#\{.+?\}#si", array($this, '_protect_characters'), $str);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Convert "ignore" tags to temporary marker. The parser splits out the string at every tag
|
|
122
|
+
// it encounters. Certain inline tags, like image tags, links, span tags, etc. will be
|
|
123
|
+
// adversely affected if they are split out so we'll convert the opening bracket < temporarily to: {@TAG}
|
|
124
|
+
$str = preg_replace("#<(/*)(".$this->inline_elements.")([ >])#i", "{@TAG}\\1\\2\\3", $str);
|
|
125
|
+
|
|
126
|
+
// Split the string at every tag. This expression creates an array with this prototype:
|
|
127
|
+
//
|
|
128
|
+
// [array]
|
|
129
|
+
// {
|
|
130
|
+
// [0] = <opening tag>
|
|
131
|
+
// [1] = Content...
|
|
132
|
+
// [2] = <closing tag>
|
|
133
|
+
// Etc...
|
|
134
|
+
// }
|
|
135
|
+
$chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
|
|
136
|
+
|
|
137
|
+
// Build our finalized string. We cycle through the array, skipping tags, and processing the contained text
|
|
138
|
+
$str = '';
|
|
139
|
+
$process = TRUE;
|
|
140
|
+
$paragraph = FALSE;
|
|
141
|
+
$current_chunk = 0;
|
|
142
|
+
$total_chunks = count($chunks);
|
|
143
|
+
|
|
144
|
+
foreach ($chunks as $chunk)
|
|
145
|
+
{
|
|
146
|
+
$current_chunk++;
|
|
147
|
+
|
|
148
|
+
// Are we dealing with a tag? If so, we'll skip the processing for this cycle.
|
|
149
|
+
// Well also set the "process" flag which allows us to skip <pre> tags and a few other things.
|
|
150
|
+
if (preg_match("#<(/*)(".$this->block_elements.").*?>#", $chunk, $match))
|
|
151
|
+
{
|
|
152
|
+
if (preg_match("#".$this->skip_elements."#", $match[2]))
|
|
153
|
+
{
|
|
154
|
+
$process = ($match[1] == '/') ? TRUE : FALSE;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if ($match[1] == '')
|
|
158
|
+
{
|
|
159
|
+
$this->last_block_element = $match[2];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
$str .= $chunk;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if ($process == FALSE)
|
|
167
|
+
{
|
|
168
|
+
$str .= $chunk;
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Force a newline to make sure end tags get processed by _format_newlines()
|
|
173
|
+
if ($current_chunk == $total_chunks)
|
|
174
|
+
{
|
|
175
|
+
$chunk .= "\n";
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Convert Newlines into <p> and <br /> tags
|
|
179
|
+
$str .= $this->_format_newlines($chunk);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// No opening block level tag? Add it if needed.
|
|
183
|
+
if ( ! preg_match("/^\s*<(?:".$this->block_elements.")/i", $str))
|
|
184
|
+
{
|
|
185
|
+
$str = preg_replace("/^(.*?)<(".$this->block_elements.")/i", '<p>$1</p><$2', $str);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Convert quotes, elipsis, em-dashes, non-breaking spaces, and ampersands
|
|
189
|
+
$str = $this->format_characters($str);
|
|
190
|
+
|
|
191
|
+
// restore HTML comments
|
|
192
|
+
for ($i = 0, $total = count($html_comments); $i < $total; $i++)
|
|
193
|
+
{
|
|
194
|
+
// remove surrounding paragraph tags, but only if there's an opening paragraph tag
|
|
195
|
+
// otherwise HTML comments at the ends of paragraphs will have the closing tag removed
|
|
196
|
+
// if '<p>{@HC1}' then replace <p>{@HC1}</p> with the comment, else replace only {@HC1} with the comment
|
|
197
|
+
$str = preg_replace('#(?(?=<p>\{@HC'.$i.'\})<p>\{@HC'.$i.'\}(\s*</p>)|\{@HC'.$i.'\})#s', $html_comments[$i], $str);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Final clean up
|
|
201
|
+
$table = array(
|
|
202
|
+
|
|
203
|
+
// If the user submitted their own paragraph tags within the text
|
|
204
|
+
// we will retain them instead of using our tags.
|
|
205
|
+
'/(<p[^>*?]>)<p>/' => '$1', // <?php BBEdit syntax coloring bug fix
|
|
206
|
+
|
|
207
|
+
// Reduce multiple instances of opening/closing paragraph tags to a single one
|
|
208
|
+
'#(</p>)+#' => '</p>',
|
|
209
|
+
'/(<p>\W*<p>)+/' => '<p>',
|
|
210
|
+
|
|
211
|
+
// Clean up stray paragraph tags that appear before block level elements
|
|
212
|
+
'#<p></p><('.$this->block_elements.')#' => '<$1',
|
|
213
|
+
|
|
214
|
+
// Clean up stray non-breaking spaces preceeding block elements
|
|
215
|
+
'#( \s*)+<('.$this->block_elements.')#' => ' <$2',
|
|
216
|
+
|
|
217
|
+
// Replace the temporary markers we added earlier
|
|
218
|
+
'/\{@TAG\}/' => '<',
|
|
219
|
+
'/\{@DQ\}/' => '"',
|
|
220
|
+
'/\{@SQ\}/' => "'",
|
|
221
|
+
'/\{@DD\}/' => '--',
|
|
222
|
+
'/\{@NBS\}/' => ' '
|
|
223
|
+
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
// Do we need to reduce empty lines?
|
|
227
|
+
if ($reduce_linebreaks === TRUE)
|
|
228
|
+
{
|
|
229
|
+
$table['#<p>\n*</p>#'] = '';
|
|
230
|
+
}
|
|
231
|
+
else
|
|
232
|
+
{
|
|
233
|
+
// If we have empty paragraph tags we add a non-breaking space
|
|
234
|
+
// otherwise most browsers won't treat them as true paragraphs
|
|
235
|
+
$table['#<p></p>#'] = '<p> </p>';
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return preg_replace(array_keys($table), $table, $str);
|
|
239
|
+
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// --------------------------------------------------------------------
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Format Characters
|
|
246
|
+
*
|
|
247
|
+
* This function mainly converts double and single quotes
|
|
248
|
+
* to curly entities, but it also converts em-dashes,
|
|
249
|
+
* double spaces, and ampersands
|
|
250
|
+
*
|
|
251
|
+
* @access public
|
|
252
|
+
* @param string
|
|
253
|
+
* @return string
|
|
254
|
+
*/
|
|
255
|
+
function format_characters($str)
|
|
256
|
+
{
|
|
257
|
+
static $table;
|
|
258
|
+
|
|
259
|
+
if ( ! isset($table))
|
|
260
|
+
{
|
|
261
|
+
$table = array(
|
|
262
|
+
// nested smart quotes, opening and closing
|
|
263
|
+
// note that rules for grammar (English) allow only for two levels deep
|
|
264
|
+
// and that single quotes are _supposed_ to always be on the outside
|
|
265
|
+
// but we'll accommodate both
|
|
266
|
+
// Note that in all cases, whitespace is the primary determining factor
|
|
267
|
+
// on which direction to curl, with non-word characters like punctuation
|
|
268
|
+
// being a secondary factor only after whitespace is addressed.
|
|
269
|
+
'/\'"(\s|$)/' => '’”$1',
|
|
270
|
+
'/(^|\s|<p>)\'"/' => '$1‘“',
|
|
271
|
+
'/\'"(\W)/' => '’”$1',
|
|
272
|
+
'/(\W)\'"/' => '$1‘“',
|
|
273
|
+
'/"\'(\s|$)/' => '”’$1',
|
|
274
|
+
'/(^|\s|<p>)"\'/' => '$1“‘',
|
|
275
|
+
'/"\'(\W)/' => '”’$1',
|
|
276
|
+
'/(\W)"\'/' => '$1“‘',
|
|
277
|
+
|
|
278
|
+
// single quote smart quotes
|
|
279
|
+
'/\'(\s|$)/' => '’$1',
|
|
280
|
+
'/(^|\s|<p>)\'/' => '$1‘',
|
|
281
|
+
'/\'(\W)/' => '’$1',
|
|
282
|
+
'/(\W)\'/' => '$1‘',
|
|
283
|
+
|
|
284
|
+
// double quote smart quotes
|
|
285
|
+
'/"(\s|$)/' => '”$1',
|
|
286
|
+
'/(^|\s|<p>)"/' => '$1“',
|
|
287
|
+
'/"(\W)/' => '”$1',
|
|
288
|
+
'/(\W)"/' => '$1“',
|
|
289
|
+
|
|
290
|
+
// apostrophes
|
|
291
|
+
"/(\w)'(\w)/" => '$1’$2',
|
|
292
|
+
|
|
293
|
+
// Em dash and ellipses dots
|
|
294
|
+
'/\s?\-\-\s?/' => '—',
|
|
295
|
+
'/(\w)\.{3}/' => '$1…',
|
|
296
|
+
|
|
297
|
+
// double space after sentences
|
|
298
|
+
'/(\W) /' => '$1 ',
|
|
299
|
+
|
|
300
|
+
// ampersands, if not a character entity
|
|
301
|
+
'/&(?!#?[a-zA-Z0-9]{2,};)/' => '&'
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return preg_replace(array_keys($table), $table, $str);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// --------------------------------------------------------------------
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Format Newlines
|
|
312
|
+
*
|
|
313
|
+
* Converts newline characters into either <p> tags or <br />
|
|
314
|
+
*
|
|
315
|
+
* @access public
|
|
316
|
+
* @param string
|
|
317
|
+
* @return string
|
|
318
|
+
*/
|
|
319
|
+
function _format_newlines($str)
|
|
320
|
+
{
|
|
321
|
+
if ($str == '')
|
|
322
|
+
{
|
|
323
|
+
return $str;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (strpos($str, "\n") === FALSE && ! in_array($this->last_block_element, $this->inner_block_required))
|
|
327
|
+
{
|
|
328
|
+
return $str;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Convert two consecutive newlines to paragraphs
|
|
332
|
+
$str = str_replace("\n\n", "</p>\n\n<p>", $str);
|
|
333
|
+
|
|
334
|
+
// Convert single spaces to <br /> tags
|
|
335
|
+
$str = preg_replace("/([^\n])(\n)([^\n])/", "\\1<br />\\2\\3", $str);
|
|
336
|
+
|
|
337
|
+
// Wrap the whole enchilada in enclosing paragraphs
|
|
338
|
+
if ($str != "\n")
|
|
339
|
+
{
|
|
340
|
+
$str = '<p>'.$str.'</p>';
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Remove empty paragraphs if they are on the first line, as this
|
|
344
|
+
// is a potential unintended consequence of the previous code
|
|
345
|
+
$str = preg_replace("/<p><\/p>(.*)/", "\\1", $str, 1);
|
|
346
|
+
|
|
347
|
+
return $str;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// ------------------------------------------------------------------------
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Protect Characters
|
|
354
|
+
*
|
|
355
|
+
* Protects special characters from being formatted later
|
|
356
|
+
* We don't want quotes converted within tags so we'll temporarily convert them to {@DQ} and {@SQ}
|
|
357
|
+
* and we don't want double dashes converted to emdash entities, so they are marked with {@DD}
|
|
358
|
+
* likewise double spaces are converted to {@NBS} to prevent entity conversion
|
|
359
|
+
*
|
|
360
|
+
* @access public
|
|
361
|
+
* @param array
|
|
362
|
+
* @return string
|
|
363
|
+
*/
|
|
364
|
+
function _protect_characters($match)
|
|
365
|
+
{
|
|
366
|
+
return str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $match[0]);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// --------------------------------------------------------------------
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Convert newlines to HTML line breaks except within PRE tags
|
|
373
|
+
*
|
|
374
|
+
* @access public
|
|
375
|
+
* @param string
|
|
376
|
+
* @return string
|
|
377
|
+
*/
|
|
378
|
+
function nl2br_except_pre($str)
|
|
379
|
+
{
|
|
380
|
+
$ex = explode("pre>",$str);
|
|
381
|
+
$ct = count($ex);
|
|
382
|
+
|
|
383
|
+
$newstr = "";
|
|
384
|
+
for ($i = 0; $i < $ct; $i++)
|
|
385
|
+
{
|
|
386
|
+
if (($i % 2) == 0)
|
|
387
|
+
{
|
|
388
|
+
$newstr .= nl2br($ex[$i]);
|
|
389
|
+
}
|
|
390
|
+
else
|
|
391
|
+
{
|
|
392
|
+
$newstr .= $ex[$i];
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
if ($ct - 1 != $i)
|
|
396
|
+
$newstr .= "pre>";
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return $newstr;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
}
|
|
403
|
+
// END Typography Class
|
|
404
|
+
|
|
405
|
+
/* End of file Typography.php */
|
|
406
|
+
/* Location: ./system/libraries/Typography.php */
|