From ad42fe278ccda114856c4f636b665efcf3cf3e76 Mon Sep 17 00:00:00 2001 From: Mark Bryk Date: Thu, 6 Sep 2012 00:46:18 -0400 Subject: [PATCH] not really sure what ive done --- .htaccess | 16 + nbproject/configs/my_site.properties | 0 nbproject/private/config.properties | 1 + nbproject/private/configs/my_site.properties | 4 + protected/config/main.php | 16 +- protected/extensions/bootstrap/LICENSE.txt | 24 + .../bootstrap/components/Bootstrap.php | 338 + .../bootstrap/gii/bootstrap/BootstrapCode.php | 32 + .../gii/bootstrap/BootstrapGenerator.php | 14 + .../gii/bootstrap/templates/default/_form.php | 35 + .../bootstrap/templates/default/_search.php | 28 + .../gii/bootstrap/templates/default/_view.php | 26 + .../gii/bootstrap/templates/default/admin.php | 70 + .../templates/default/controller.php | 183 + .../bootstrap/templates/default/create.php | 24 + .../gii/bootstrap/templates/default/index.php | 26 + .../bootstrap/templates/default/update.php | 28 + .../gii/bootstrap/templates/default/view.php | 36 + .../bootstrap/gii/bootstrap/views/index.php | 64 + .../bootstrap/lib/bootstrap/.gitignore | 33 + .../bootstrap/lib/bootstrap/LICENSE | 176 + .../bootstrap/lib/bootstrap/Makefile | 59 + .../bootstrap/lib/bootstrap/README.md | 100 + .../img/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes .../bootstrap/img/glyphicons-halflings.png | Bin 0 -> 13826 bytes .../bootstrap/lib/bootstrap/js/.jshintrc | 10 + .../bootstrap/lib/bootstrap/js/README.md | 112 + .../lib/bootstrap/js/bootstrap-alert.js | 90 + .../lib/bootstrap/js/bootstrap-button.js | 96 + .../lib/bootstrap/js/bootstrap-carousel.js | 169 + .../lib/bootstrap/js/bootstrap-collapse.js | 157 + .../lib/bootstrap/js/bootstrap-dropdown.js | 100 + .../lib/bootstrap/js/bootstrap-modal.js | 218 + .../lib/bootstrap/js/bootstrap-popover.js | 98 + .../lib/bootstrap/js/bootstrap-scrollspy.js | 151 + .../lib/bootstrap/js/bootstrap-tab.js | 135 + .../lib/bootstrap/js/bootstrap-tooltip.js | 275 + .../lib/bootstrap/js/bootstrap-transition.js | 61 + .../lib/bootstrap/js/bootstrap-typeahead.js | 285 + .../lib/bootstrap/js/tests/index.html | 54 + .../lib/bootstrap/js/tests/phantom.js | 63 + .../lib/bootstrap/js/tests/server.js | 14 + .../js/tests/unit/bootstrap-alert.js | 56 + .../js/tests/unit/bootstrap-button.js | 77 + .../js/tests/unit/bootstrap-carousel.js | 28 + .../js/tests/unit/bootstrap-collapse.js | 54 + .../js/tests/unit/bootstrap-dropdown.js | 87 + .../js/tests/unit/bootstrap-modal.js | 114 + .../js/tests/unit/bootstrap-phantom.js | 21 + .../js/tests/unit/bootstrap-popover.js | 93 + .../js/tests/unit/bootstrap-scrollspy.js | 31 + .../bootstrap/js/tests/unit/bootstrap-tab.js | 61 + .../js/tests/unit/bootstrap-tooltip.js | 136 + .../js/tests/unit/bootstrap-transition.js | 13 + .../js/tests/unit/bootstrap-typeahead.js | 148 + .../lib/bootstrap/js/tests/vendor/jquery.js | 9252 +++++++++++++++++ .../lib/bootstrap/js/tests/vendor/qunit.css | 232 + .../lib/bootstrap/js/tests/vendor/qunit.js | 1510 +++ .../lib/bootstrap/less/accordion.less | 33 + .../bootstrap/lib/bootstrap/less/alerts.less | 58 + .../bootstrap/lib/bootstrap/less/badges.less | 36 + .../lib/bootstrap/less/bootstrap.less | 62 + .../lib/bootstrap/less/breadcrumbs.less | 24 + .../lib/bootstrap/less/button-groups.less | 191 + .../bootstrap/lib/bootstrap/less/buttons.less | 191 + .../lib/bootstrap/less/carousel.less | 121 + .../bootstrap/lib/bootstrap/less/close.less | 29 + .../bootstrap/lib/bootstrap/less/code.less | 57 + .../bootstrap/less/component-animations.less | 20 + .../lib/bootstrap/less/dropdowns.less | 143 + .../bootstrap/lib/bootstrap/less/forms.less | 584 ++ .../bootstrap/lib/bootstrap/less/grid.less | 5 + .../lib/bootstrap/less/hero-unit.less | 22 + .../lib/bootstrap/less/labels-badges.less | 55 + .../bootstrap/lib/bootstrap/less/labels.less | 38 + .../bootstrap/lib/bootstrap/less/layouts.less | 17 + .../bootstrap/lib/bootstrap/less/mixins.less | 631 ++ .../bootstrap/lib/bootstrap/less/modals.less | 90 + .../bootstrap/lib/bootstrap/less/navbar.less | 364 + .../bootstrap/lib/bootstrap/less/navs.less | 363 + .../bootstrap/lib/bootstrap/less/pager.less | 36 + .../lib/bootstrap/less/pagination.less | 56 + .../lib/bootstrap/less/popovers.less | 49 + .../lib/bootstrap/less/progress-bars.less | 117 + .../bootstrap/lib/bootstrap/less/reset.less | 126 + .../bootstrap/less/responsive-1200px-min.less | 26 + .../bootstrap/less/responsive-767px-max.less | 149 + .../less/responsive-768px-979px.less | 17 + .../lib/bootstrap/less/responsive-navbar.less | 146 + .../bootstrap/less/responsive-utilities.less | 41 + .../lib/bootstrap/less/responsive.less | 48 + .../lib/bootstrap/less/scaffolding.less | 29 + .../bootstrap/lib/bootstrap/less/sprites.less | 191 + .../bootstrap/lib/bootstrap/less/tables.less | 176 + .../lib/bootstrap/less/tests/css-tests.css | 51 + .../lib/bootstrap/less/tests/css-tests.html | 827 ++ .../lib/bootstrap/less/thumbnails.less | 47 + .../bootstrap/lib/bootstrap/less/tooltip.less | 35 + .../bootstrap/lib/bootstrap/less/type.less | 235 + .../lib/bootstrap/less/utilities.less | 23 + .../lib/bootstrap/less/variables.less | 205 + .../bootstrap/lib/bootstrap/less/wells.less | 27 + .../bootstrap/widgets/BootActiveForm.php | 524 + .../bootstrap/widgets/BootAlert.php | 88 + .../bootstrap/widgets/BootBadge.php | 70 + .../bootstrap/widgets/BootBaseMenu.php | 96 + .../bootstrap/widgets/BootBreadcrumbs.php | 88 + .../bootstrap/widgets/BootButton.php | 244 + .../bootstrap/widgets/BootButtonColumn.php | 81 + .../bootstrap/widgets/BootButtonGroup.php | 97 + .../bootstrap/widgets/BootCarousel.php | 155 + .../bootstrap/widgets/BootDataColumn.php | 56 + .../bootstrap/widgets/BootDetailView.php | 59 + .../bootstrap/widgets/BootDropdown.php | 119 + .../bootstrap/widgets/BootGridView.php | 102 + .../extensions/bootstrap/widgets/BootHero.php | 62 + .../bootstrap/widgets/BootLabel.php | 71 + .../bootstrap/widgets/BootListView.php | 31 + .../extensions/bootstrap/widgets/BootMenu.php | 224 + .../bootstrap/widgets/BootModal.php | 100 + .../bootstrap/widgets/BootNavbar.php | 142 + .../bootstrap/widgets/BootPager.php | 111 + .../bootstrap/widgets/BootProgress.php | 82 + .../bootstrap/widgets/BootTabbable.php | 186 + .../bootstrap/widgets/BootThumbnails.php | 45 + .../bootstrap/widgets/BootTypeahead.php | 49 + .../bootstrap/widgets/input/BootInput.php | 358 + .../widgets/input/BootInputHorizontal.php | 215 + .../widgets/input/BootInputInline.php | 57 + .../widgets/input/BootInputSearch.php | 34 + .../widgets/input/BootInputVertical.php | 170 + protected/extensions/mailer/EMailer.php | 219 + .../extensions/mailer/phpmailer/ChangeLog.txt | 373 + protected/extensions/mailer/phpmailer/LICENSE | 504 + protected/extensions/mailer/phpmailer/README | 218 + .../extensions/mailer/phpmailer/aboutus.html | 169 + .../mailer/phpmailer/class.phpmailer.php | 2068 ++++ .../mailer/phpmailer/class.pop3.php | 407 + .../mailer/phpmailer/class.smtp.php | 814 ++ .../phpmailer/language/phpmailer.lang-ar.php | 27 + .../phpmailer/language/phpmailer.lang-br.php | 26 + .../phpmailer/language/phpmailer.lang-ca.php | 26 + .../phpmailer/language/phpmailer.lang-ch.php | 26 + .../phpmailer/language/phpmailer.lang-cz.php | 25 + .../phpmailer/language/phpmailer.lang-de.php | 26 + .../phpmailer/language/phpmailer.lang-dk.php | 26 + .../phpmailer/language/phpmailer.lang-es.php | 26 + .../phpmailer/language/phpmailer.lang-et.php | 26 + .../phpmailer/language/phpmailer.lang-fi.php | 27 + .../phpmailer/language/phpmailer.lang-fo.php | 27 + .../phpmailer/language/phpmailer.lang-fr.php | 25 + .../phpmailer/language/phpmailer.lang-hu.php | 25 + .../phpmailer/language/phpmailer.lang-it.php | 27 + .../phpmailer/language/phpmailer.lang-ja.php | 26 + .../phpmailer/language/phpmailer.lang-nl.php | 25 + .../phpmailer/language/phpmailer.lang-no.php | 25 + .../phpmailer/language/phpmailer.lang-pl.php | 25 + .../phpmailer/language/phpmailer.lang-ro.php | 27 + .../phpmailer/language/phpmailer.lang-ru.php | 25 + .../phpmailer/language/phpmailer.lang-se.php | 26 + .../phpmailer/language/phpmailer.lang-tr.php | 27 + .../phpmailer/language/phpmailer.lang-zh.php | 26 + .../language/phpmailer.lang-zh_cn.php | 26 + protected/modules/klapper/KlapperModule.php | 28 + .../klapper/controllers/DefaultController.php | 9 + .../modules/klapper/views/default/index.php | 18 + protected/views/layouts/main.php | 2 +- robots.txt | 2 + themes/biskit/views/layouts/main.php | 23 +- themes/biskit/views/site/index.php | 2 +- 170 files changed, 30311 insertions(+), 9 deletions(-) create mode 100644 .htaccess create mode 100644 nbproject/configs/my_site.properties create mode 100644 nbproject/private/config.properties create mode 100644 nbproject/private/configs/my_site.properties create mode 100644 protected/extensions/bootstrap/LICENSE.txt create mode 100644 protected/extensions/bootstrap/components/Bootstrap.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/BootstrapCode.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/BootstrapGenerator.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/templates/default/_form.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/templates/default/_search.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/templates/default/_view.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/templates/default/admin.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/templates/default/controller.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/templates/default/create.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/templates/default/index.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/templates/default/update.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/templates/default/view.php create mode 100644 protected/extensions/bootstrap/gii/bootstrap/views/index.php create mode 100644 protected/extensions/bootstrap/lib/bootstrap/.gitignore create mode 100644 protected/extensions/bootstrap/lib/bootstrap/LICENSE create mode 100644 protected/extensions/bootstrap/lib/bootstrap/Makefile create mode 100644 protected/extensions/bootstrap/lib/bootstrap/README.md create mode 100644 protected/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings-white.png create mode 100644 protected/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings.png create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/.jshintrc create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/README.md create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-alert.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-button.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-carousel.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-collapse.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-dropdown.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-modal.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-popover.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-scrollspy.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-tab.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-tooltip.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-transition.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-typeahead.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/index.html create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/phantom.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/server.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-alert.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-button.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-carousel.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-collapse.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-dropdown.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-modal.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-phantom.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-popover.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-scrollspy.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-tab.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-tooltip.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-transition.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-typeahead.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/vendor/jquery.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/vendor/qunit.css create mode 100644 protected/extensions/bootstrap/lib/bootstrap/js/tests/vendor/qunit.js create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/accordion.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/alerts.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/badges.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/bootstrap.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/breadcrumbs.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/button-groups.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/buttons.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/carousel.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/close.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/code.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/component-animations.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/dropdowns.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/forms.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/grid.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/hero-unit.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/labels-badges.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/labels.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/layouts.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/mixins.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/modals.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/navbar.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/navs.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/pager.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/pagination.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/popovers.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/progress-bars.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/reset.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/responsive-1200px-min.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/responsive-767px-max.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/responsive-768px-979px.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/responsive-navbar.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/responsive-utilities.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/responsive.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/scaffolding.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/sprites.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/tables.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/tests/css-tests.css create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/tests/css-tests.html create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/thumbnails.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/tooltip.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/type.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/utilities.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/variables.less create mode 100644 protected/extensions/bootstrap/lib/bootstrap/less/wells.less create mode 100644 protected/extensions/bootstrap/widgets/BootActiveForm.php create mode 100644 protected/extensions/bootstrap/widgets/BootAlert.php create mode 100644 protected/extensions/bootstrap/widgets/BootBadge.php create mode 100644 protected/extensions/bootstrap/widgets/BootBaseMenu.php create mode 100644 protected/extensions/bootstrap/widgets/BootBreadcrumbs.php create mode 100644 protected/extensions/bootstrap/widgets/BootButton.php create mode 100644 protected/extensions/bootstrap/widgets/BootButtonColumn.php create mode 100644 protected/extensions/bootstrap/widgets/BootButtonGroup.php create mode 100644 protected/extensions/bootstrap/widgets/BootCarousel.php create mode 100644 protected/extensions/bootstrap/widgets/BootDataColumn.php create mode 100644 protected/extensions/bootstrap/widgets/BootDetailView.php create mode 100644 protected/extensions/bootstrap/widgets/BootDropdown.php create mode 100644 protected/extensions/bootstrap/widgets/BootGridView.php create mode 100644 protected/extensions/bootstrap/widgets/BootHero.php create mode 100644 protected/extensions/bootstrap/widgets/BootLabel.php create mode 100644 protected/extensions/bootstrap/widgets/BootListView.php create mode 100644 protected/extensions/bootstrap/widgets/BootMenu.php create mode 100644 protected/extensions/bootstrap/widgets/BootModal.php create mode 100644 protected/extensions/bootstrap/widgets/BootNavbar.php create mode 100644 protected/extensions/bootstrap/widgets/BootPager.php create mode 100644 protected/extensions/bootstrap/widgets/BootProgress.php create mode 100644 protected/extensions/bootstrap/widgets/BootTabbable.php create mode 100644 protected/extensions/bootstrap/widgets/BootThumbnails.php create mode 100644 protected/extensions/bootstrap/widgets/BootTypeahead.php create mode 100644 protected/extensions/bootstrap/widgets/input/BootInput.php create mode 100644 protected/extensions/bootstrap/widgets/input/BootInputHorizontal.php create mode 100644 protected/extensions/bootstrap/widgets/input/BootInputInline.php create mode 100644 protected/extensions/bootstrap/widgets/input/BootInputSearch.php create mode 100644 protected/extensions/bootstrap/widgets/input/BootInputVertical.php create mode 100644 protected/extensions/mailer/EMailer.php create mode 100644 protected/extensions/mailer/phpmailer/ChangeLog.txt create mode 100644 protected/extensions/mailer/phpmailer/LICENSE create mode 100644 protected/extensions/mailer/phpmailer/README create mode 100644 protected/extensions/mailer/phpmailer/aboutus.html create mode 100644 protected/extensions/mailer/phpmailer/class.phpmailer.php create mode 100644 protected/extensions/mailer/phpmailer/class.pop3.php create mode 100644 protected/extensions/mailer/phpmailer/class.smtp.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-ar.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-br.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-ca.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-ch.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-cz.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-de.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-dk.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-es.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-et.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-fi.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-fo.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-fr.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-hu.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-it.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-ja.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-nl.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-no.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-pl.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-ro.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-ru.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-se.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-tr.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-zh.php create mode 100644 protected/extensions/mailer/phpmailer/language/phpmailer.lang-zh_cn.php create mode 100644 protected/modules/klapper/KlapperModule.php create mode 100644 protected/modules/klapper/controllers/DefaultController.php create mode 100644 protected/modules/klapper/views/default/index.php create mode 100644 robots.txt diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..4d325fa --- /dev/null +++ b/.htaccess @@ -0,0 +1,16 @@ +RedirectMatch 404 /\\.git(/|$) + +RewriteEngine on + +# If you are in a sub folder of your web root you +# might have to enable something like this: +# +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d + +RewriteRule . index.php +DirectoryIndex index.php + + + + diff --git a/nbproject/configs/my_site.properties b/nbproject/configs/my_site.properties new file mode 100644 index 0000000..e69de29 diff --git a/nbproject/private/config.properties b/nbproject/private/config.properties new file mode 100644 index 0000000..734312e --- /dev/null +++ b/nbproject/private/config.properties @@ -0,0 +1 @@ +config=my_site diff --git a/nbproject/private/configs/my_site.properties b/nbproject/private/configs/my_site.properties new file mode 100644 index 0000000..d8b733e --- /dev/null +++ b/nbproject/private/configs/my_site.properties @@ -0,0 +1,4 @@ +remote.connection=webhostinghub-644854 +remote.upload=ON_RUN +run.as=REMOTE +url=http://markbryk.in/ diff --git a/protected/config/main.php b/protected/config/main.php index e775e29..7dd9c4d 100644 --- a/protected/config/main.php +++ b/protected/config/main.php @@ -15,22 +15,26 @@ 'theme'=>'biskit', // preloading 'log' component - 'preload'=>array('log'), + 'preload'=>array('log', 'bootstrap'), // autoloading model and component classes 'import'=>array( 'application.models.*', 'application.components.*', + 'application.extensions.*' ), 'modules'=>array( // uncomment the following to enable the Gii tool - + 'klapper', 'gii'=>array( 'class'=>'system.gii.GiiModule', - 'password'=>'Enter Your Password Here', + 'password'=>'admin', // If removed, Gii defaults to localhost only. Edit carefully to taste. 'ipFilters'=>array('127.0.0.1','::1'), + 'generatorPaths'=>array( + 'bootstrap.gii', // since 0.9.1 + ), ), ), @@ -50,6 +54,7 @@ '//'=>'/', '/'=>'/', ), + 'showScriptName'=>true, ), 'db'=>array( @@ -80,12 +85,15 @@ */ ), ), + 'bootstrap'=>array( + 'class'=>'application.extensions.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions + ), ), // application-level parameters that can be accessed // using Yii::app()->params['paramName'] 'params'=>array( // this is used in contact page - 'adminEmail'=>'webmaster@example.com', + 'adminEmail'=>'mark@markbryk.in', ), ); \ No newline at end of file diff --git a/protected/extensions/bootstrap/LICENSE.txt b/protected/extensions/bootstrap/LICENSE.txt new file mode 100644 index 0000000..60b0b32 --- /dev/null +++ b/protected/extensions/bootstrap/LICENSE.txt @@ -0,0 +1,24 @@ +Copyright (c) 2010, Christoffer Niska +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Christoffer Niska nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/protected/extensions/bootstrap/components/Bootstrap.php b/protected/extensions/bootstrap/components/Bootstrap.php new file mode 100644 index 0000000..4a20d1c --- /dev/null +++ b/protected/extensions/bootstrap/components/Bootstrap.php @@ -0,0 +1,338 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @version 0.9.12 + */ + +/** + * Bootstrap application component. + * Used for registering Bootstrap core functionality. + */ +class Bootstrap extends CApplicationComponent +{ + // Bootstrap plugins. + const PLUGIN_ALERT = 'alert'; + const PLUGIN_BUTTON = 'button'; + const PLUGIN_CAROUSEL = 'carousel'; + const PLUGIN_COLLAPSE = 'collapse'; + const PLUGIN_DROPDOWN = 'dropdown'; + const PLUGIN_MODAL = 'modal'; + const PLUGIN_POPOVER = 'popover'; + const PLUGIN_SCROLLSPY = 'scrollspy'; + const PLUGIN_TAB = 'tab'; + const PLUGIN_TOOLTIP = 'tooltip'; + const PLUGIN_TRANSITION = 'transition'; + const PLUGIN_TYPEAHEAD = 'typeahead'; + + /** + * @var boolean whether to register the Bootstrap core CSS (bootstrap.min.css). + * Defaults to true. + */ + public $coreCss = true; + /** + * @var boolean whether to register the Bootstrap responsive CSS (bootstrap-responsive.min.css). + * Defaults to false. + */ + public $responsiveCss = false; + /** + * @var boolean whether to register the Yii-specific CSS missing from Bootstrap. + * @since 0.9.12 + */ + public $yiiCss = true; + /** + * @var boolean whether to register jQuery and the Bootstrap JavaScript. + * @since 0.9.10 + */ + public $enableJS = true; + /** + * @var array the plugin options (name=>options). + * @since 0.9.8 + */ + public $plugins = array(); + /** + * @var boolean whether to enable debugging mode. + */ + public $debug = false; + + protected $_assetsUrl; + + /** + * Initializes the component. + */ + public function init() + { + // Register the bootstrap path alias. + if (!Yii::getPathOfAlias('bootstrap')) + Yii::setPathOfAlias('bootstrap', realpath(dirname(__FILE__).'/..')); + + // Prevents the extension from registering scripts + // and publishing assets when ran from the command line. + if (php_sapi_name() === 'cli') + return; + + if ($this->coreCss) + $this->registerCss(); + + if ($this->responsiveCss) + $this->registerResponsiveCss(); + + if ($this->yiiCss) + $this->registerYiiCss(); + + if ($this->enableJS) + $this->registerCorePlugins(); + } + + /** + * Registers the Bootstrap CSS. + */ + public function registerCss() + { + Yii::app()->clientScript->registerCssFile($this->getAssetsUrl().'/css/bootstrap.min.css'); + } + + /** + * Registers the Bootstrap responsive CSS. + * @since 0.9.8 + */ + public function registerResponsiveCss() + { + /** @var CClientScript $cs */ + $cs = Yii::app()->getClientScript(); + $cs->registerMetaTag('width=device-width, initial-scale=1.0', 'viewport'); + $cs->registerCssFile($this->getAssetsUrl().'/css/bootstrap-responsive.min.css'); + } + + /** + * Registers the Yii-specific CSS missing from Bootstrap. + * @since 0.9.11 + */ + public function registerYiiCss() + { + Yii::app()->clientScript->registerCssFile($this->getAssetsUrl().'/css/bootstrap-yii.css'); + } + + /** + * Registers the core JavaScript plugins. + * @since 0.9.8 + */ + public function registerCorePlugins() + { + /** @var CClientScript $cs */ + $cs = Yii::app()->getClientScript(); + $cs->registerCoreScript('jquery'); + $cs->registerScriptFile($this->getAssetsUrl().'/js/bootstrap.min.js'); + + $this->registerTooltip(); + $this->registerPopover(); + } + + /** + * Registers the Bootstrap alert plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#alerts + * @since 0.9.8 + */ + public function registerAlert($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_ALERT, $selector, $options); + } + + /** + * Registers the Bootstrap buttons plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#buttons + * @since 0.9.8 + */ + public function registerButton($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_BUTTON, $selector, $options); + } + + /** + * Registers the Bootstrap carousel plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#carousel + * @since 0.9.8 + */ + public function registerCarousel($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_CAROUSEL, $selector, $options); + } + + /** + * Registers the Bootstrap collapse plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#collapse + * @since 0.9.8 + */ + public function registerCollapse($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_COLLAPSE, $selector, $options, '.collapse'); + } + + /** + * Registers the Bootstrap dropdowns plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#dropdowns + * @since 0.9.8 + */ + public function registerDropdown($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_DROPDOWN, $selector, $options, '.dropdown-toggle[data-dropdown="dropdown"]'); + } + + /** + * Registers the Bootstrap modal plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#modal + * @since 0.9.8 + */ + public function registerModal($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_MODAL, $selector, $options); + } + + /** + * Registers the Bootstrap scrollspy plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#scrollspy + * @since 0.9.8 + */ + public function registerScrollSpy($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_SCROLLSPY, $selector, $options); + } + + /** + * Registers the Bootstrap popover plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#popover + * @since 0.9.8 + */ + public function registerPopover($selector = null, $options = array()) + { + $this->registerTooltip(); // Popover requires the tooltip plugin + $this->registerPlugin(self::PLUGIN_POPOVER, $selector, $options, 'a[rel="popover"]'); + } + + /** + * Registers the Bootstrap tabs plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#tabs + * @since 0.9.8 + */ + public function registerTabs($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_TAB, $selector, $options); + } + + /** + * Registers the Bootstrap tooltip plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#tooltip + * @since 0.9.8 + */ + public function registerTooltip($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_TOOLTIP, $selector, $options, 'a[rel="tooltip"]'); + } + + /** + * Registers the Bootstrap typeahead plugin. + * @param string $selector the CSS selector + * @param array $options the plugin options + * @see http://twitter.github.com/bootstrap/javascript.html#typeahead + * @since 0.9.8 + */ + public function registerTypeahead($selector = null, $options = array()) + { + $this->registerPlugin(self::PLUGIN_TYPEAHEAD, $selector, $options); + } + + /** + * Sets the target element for the scrollspy. + * @param string $selector the CSS selector + * @param string $target the target CSS selector + * @param string $offset the offset + */ + public function spyOn($selector, $target = null, $offset = null) + { + $script = "jQuery('{$selector}').attr('data-spy', 'scroll');"; + + if (isset($target)) + $script .= "jQuery('{$selector}').attr('data-target', '{$target}');"; + + if (isset($offset)) + $script .= "jQuery('{$selector}').attr('data-offset', '{$offset}');"; + + Yii::app()->clientScript->registerScript(__CLASS__.'.spyOn.'.$selector, $script, CClientScript::POS_BEGIN); + } + + /** + * Registers a Bootstrap JavaScript plugin. + * @param string $name the name of the plugin + * @param string $selector the CSS selector + * @param array $options the plugin options + * @param string $defaultSelector the default CSS selector + * @since 0.9.8 + */ + protected function registerPlugin($name, $selector = null, $options = array(), $defaultSelector = null) + { + if (!isset($selector) && empty($options)) + { + // Initialization from extension configuration. + $config = isset($this->plugins[$name]) ? $this->plugins[$name] : array(); + + if (isset($config['selector'])) + $selector = $config['selector']; + + if (isset($config['options'])) + $options = $config['options']; + + if (!isset($selector)) + $selector = $defaultSelector; + } + + if (isset($selector)) + { + $key = __CLASS__.'.'.md5($name.$selector.serialize($options).$defaultSelector); + $options = !empty($options) ? CJavaScript::encode($options) : ''; + Yii::app()->clientScript->registerScript($key, "jQuery('{$selector}').{$name}({$options});"); + } + } + + /** + * Returns the URL to the published assets folder. + * @return string the URL + */ + protected function getAssetsUrl() + { + if ($this->_assetsUrl !== null) + return $this->_assetsUrl; + else + { + $assetsPath = Yii::getPathOfAlias('bootstrap.assets'); + + if ($this->debug) + $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, true); + else + $assetsUrl = Yii::app()->assetManager->publish($assetsPath); + + return $this->_assetsUrl = $assetsUrl; + } + } +} diff --git a/protected/extensions/bootstrap/gii/bootstrap/BootstrapCode.php b/protected/extensions/bootstrap/gii/bootstrap/BootstrapCode.php new file mode 100644 index 0000000..6cd7267 --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/BootstrapCode.php @@ -0,0 +1,32 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + */ + +Yii::import('gii.generators.crud.CrudCode'); + +class BootstrapCode extendS CrudCode +{ + public function generateActiveRow($modelClass, $column) + { + if ($column->type === 'boolean') + return "\$form->checkBoxRow(\$model,'{$column->name}')"; + else if (stripos($column->dbType,'text') !== false) + return "\$form->textAreaRow(\$model,'{$column->name}',array('rows'=>6, 'cols'=>50, 'class'=>'span8'))"; + else + { + if (preg_match('/^(password|pass|passwd|passcode)$/i',$column->name)) + $inputField='passwordFieldRow'; + else + $inputField='textFieldRow'; + + if ($column->type!=='string' || $column->size===null) + return "\$form->{$inputField}(\$model,'{$column->name}',array('class'=>'span5'))"; + else + return "\$form->{$inputField}(\$model,'{$column->name}',array('class'=>'span5','maxlength'=>$column->size))"; + } + } +} diff --git a/protected/extensions/bootstrap/gii/bootstrap/BootstrapGenerator.php b/protected/extensions/bootstrap/gii/bootstrap/BootstrapGenerator.php new file mode 100644 index 0000000..26df23c --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/BootstrapGenerator.php @@ -0,0 +1,14 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + */ + +Yii::import('gii.generators.crud.CrudGenerator'); + +class BootstrapGenerator extends CrudGenerator +{ + public $codeModel = 'bootstrap.gii.bootstrap.BootstrapCode'; +} \ No newline at end of file diff --git a/protected/extensions/bootstrap/gii/bootstrap/templates/default/_form.php b/protected/extensions/bootstrap/gii/bootstrap/templates/default/_form.php new file mode 100644 index 0000000..81b660d --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/templates/default/_form.php @@ -0,0 +1,35 @@ + +beginWidget('bootstrap.widgets.BootActiveForm',array( + 'id'=>'".$this->class2id($this->modelClass)."-form', + 'enableAjaxValidation'=>false, +)); ?>\n"; ?> + +

Fields with * are required.

+ + errorSummary(\$model); ?>\n"; ?> + +tableSchema->columns as $column) +{ + if($column->autoIncrement) + continue; +?> + generateActiveRow($this->modelClass,$column)."; ?>\n"; ?> + + +
+ widget('bootstrap.widgets.BootButton', array( + 'buttonType'=>'submit', + 'type'=>'primary', + 'label'=>\$model->isNewRecord ? 'Create' : 'Save', + )); ?>\n"; ?> +
+ +endWidget(); ?>\n"; ?> diff --git a/protected/extensions/bootstrap/gii/bootstrap/templates/default/_search.php b/protected/extensions/bootstrap/gii/bootstrap/templates/default/_search.php new file mode 100644 index 0000000..fc64894 --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/templates/default/_search.php @@ -0,0 +1,28 @@ + +beginWidget('bootstrap.widgets.BootActiveForm',array( + 'action'=>Yii::app()->createUrl(\$this->route), + 'method'=>'get', +)); ?>\n"; ?> + +tableSchema->columns as $column): ?> +generateInputField($this->modelClass,$column); + if(strpos($field,'password')!==false) + continue; +?> + generateActiveRow($this->modelClass,$column)."; ?>\n"; ?> + + +
+ widget('bootstrap.widgets.BootButton', array( + 'type'=>'primary', + 'label'=>'Search', + )); ?>\n"; ?> +
+ +endWidget(); ?>\n"; ?> \ No newline at end of file diff --git a/protected/extensions/bootstrap/gii/bootstrap/templates/default/_view.php b/protected/extensions/bootstrap/gii/bootstrap/templates/default/_view.php new file mode 100644 index 0000000..5b52359 --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/templates/default/_view.php @@ -0,0 +1,26 @@ + +
+ +getAttributeLabel('{$this->tableSchema->primaryKey}')); ?>:\n"; +echo "\t{$this->tableSchema->primaryKey}),array('view','id'=>\$data->{$this->tableSchema->primaryKey})); ?>\n\t
\n\n"; +$count=0; +foreach($this->tableSchema->columns as $column) +{ + if($column->isPrimaryKey) + continue; + if(++$count==7) + echo "\tgetAttributeLabel('{$column->name}')); ?>:\n"; + echo "\t{$column->name}); ?>\n\t
\n\n"; +} +if($count>=7) + echo "\t*/ ?>\n"; +?> + +
\ No newline at end of file diff --git a/protected/extensions/bootstrap/gii/bootstrap/templates/default/admin.php b/protected/extensions/bootstrap/gii/bootstrap/templates/default/admin.php new file mode 100644 index 0000000..5f57935 --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/templates/default/admin.php @@ -0,0 +1,70 @@ + +pluralize($this->class2name($this->modelClass)); +echo "\$this->breadcrumbs=array( + '$label'=>array('index'), + 'Manage', +);\n"; +?> + +$this->menu=array( + array('label'=>'List modelClass; ?>','url'=>array('index')), + array('label'=>'Create modelClass; ?>','url'=>array('create')), +); + +Yii::app()->clientScript->registerScript('search', " +$('.search-button').click(function(){ + $('.search-form').toggle(); + return false; +}); +$('.search-form form').submit(function(){ + $.fn.yiiGridView.update('class2id($this->modelClass); ?>-grid', { + data: $(this).serialize() + }); + return false; +}); +"); +?> + +

Manage pluralize($this->class2name($this->modelClass)); ?>

+ +

+You may optionally enter a comparison operator (<, <=, >, >=, <> +or =) at the beginning of each of your search values to specify how the comparison should be done. +

+ +'search-button btn')); ?>"; ?> + + + + $this->widget('bootstrap.widgets.BootGridView',array( + 'id'=>'class2id($this->modelClass); ?>-grid', + 'dataProvider'=>$model->search(), + 'filter'=>$model, + 'columns'=>array( +tableSchema->columns as $column) +{ + if(++$count==7) + echo "\t\t/*\n"; + echo "\t\t'".$column->name."',\n"; +} +if($count>=7) + echo "\t\t*/\n"; +?> + array( + 'class'=>'bootstrap.widgets.BootButtonColumn', + ), + ), +)); ?> diff --git a/protected/extensions/bootstrap/gii/bootstrap/templates/default/controller.php b/protected/extensions/bootstrap/gii/bootstrap/templates/default/controller.php new file mode 100644 index 0000000..4361343 --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/templates/default/controller.php @@ -0,0 +1,183 @@ + + + +class controllerClass; ?> extends baseControllerClass."\n"; ?> +{ + /** + * @var string the default layout for the views. Defaults to '//layouts/column2', meaning + * using two-column layout. See 'protected/views/layouts/column2.php'. + */ + public $layout='//layouts/column2'; + + /** + * @return array action filters + */ + public function filters() + { + return array( + 'accessControl', // perform access control for CRUD operations + ); + } + + /** + * Specifies the access control rules. + * This method is used by the 'accessControl' filter. + * @return array access control rules + */ + public function accessRules() + { + return array( + array('allow', // allow all users to perform 'index' and 'view' actions + 'actions'=>array('index','view'), + 'users'=>array('*'), + ), + array('allow', // allow authenticated user to perform 'create' and 'update' actions + 'actions'=>array('create','update'), + 'users'=>array('@'), + ), + array('allow', // allow admin user to perform 'admin' and 'delete' actions + 'actions'=>array('admin','delete'), + 'users'=>array('admin'), + ), + array('deny', // deny all users + 'users'=>array('*'), + ), + ); + } + + /** + * Displays a particular model. + * @param integer $id the ID of the model to be displayed + */ + public function actionView($id) + { + $this->render('view',array( + 'model'=>$this->loadModel($id), + )); + } + + /** + * Creates a new model. + * If creation is successful, the browser will be redirected to the 'view' page. + */ + public function actionCreate() + { + $model=new modelClass; ?>; + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['modelClass; ?>'])) + { + $model->attributes=$_POST['modelClass; ?>']; + if($model->save()) + $this->redirect(array('view','id'=>$model->tableSchema->primaryKey; ?>)); + } + + $this->render('create',array( + 'model'=>$model, + )); + } + + /** + * Updates a particular model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id the ID of the model to be updated + */ + public function actionUpdate($id) + { + $model=$this->loadModel($id); + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['modelClass; ?>'])) + { + $model->attributes=$_POST['modelClass; ?>']; + if($model->save()) + $this->redirect(array('view','id'=>$model->tableSchema->primaryKey; ?>)); + } + + $this->render('update',array( + 'model'=>$model, + )); + } + + /** + * Deletes a particular model. + * If deletion is successful, the browser will be redirected to the 'admin' page. + * @param integer $id the ID of the model to be deleted + */ + public function actionDelete($id) + { + if(Yii::app()->request->isPostRequest) + { + // we only allow deletion via POST request + $this->loadModel($id)->delete(); + + // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser + if(!isset($_GET['ajax'])) + $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); + } + else + throw new CHttpException(400,'Invalid request. Please do not repeat this request again.'); + } + + /** + * Lists all models. + */ + public function actionIndex() + { + $dataProvider=new CActiveDataProvider('modelClass; ?>'); + $this->render('index',array( + 'dataProvider'=>$dataProvider, + )); + } + + /** + * Manages all models. + */ + public function actionAdmin() + { + $model=new modelClass; ?>('search'); + $model->unsetAttributes(); // clear any default values + if(isset($_GET['modelClass; ?>'])) + $model->attributes=$_GET['modelClass; ?>']; + + $this->render('admin',array( + 'model'=>$model, + )); + } + + /** + * Returns the data model based on the primary key given in the GET variable. + * If the data model is not found, an HTTP exception will be raised. + * @param integer the ID of the model to be loaded + */ + public function loadModel($id) + { + $model=modelClass; ?>::model()->findByPk($id); + if($model===null) + throw new CHttpException(404,'The requested page does not exist.'); + return $model; + } + + /** + * Performs the AJAX validation. + * @param CModel the model to be validated + */ + protected function performAjaxValidation($model) + { + if(isset($_POST['ajax']) && $_POST['ajax']==='class2id($this->modelClass); ?>-form') + { + echo CActiveForm::validate($model); + Yii::app()->end(); + } + } +} diff --git a/protected/extensions/bootstrap/gii/bootstrap/templates/default/create.php b/protected/extensions/bootstrap/gii/bootstrap/templates/default/create.php new file mode 100644 index 0000000..dc6953b --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/templates/default/create.php @@ -0,0 +1,24 @@ + +pluralize($this->class2name($this->modelClass)); +echo "\$this->breadcrumbs=array( + '$label'=>array('index'), + 'Create', +);\n"; +?> + +$this->menu=array( + array('label'=>'List modelClass; ?>','url'=>array('index')), + array('label'=>'Manage modelClass; ?>','url'=>array('admin')), +); +?> + +

Create modelClass; ?>

+ +renderPartial('_form', array('model'=>\$model)); ?>"; ?> diff --git a/protected/extensions/bootstrap/gii/bootstrap/templates/default/index.php b/protected/extensions/bootstrap/gii/bootstrap/templates/default/index.php new file mode 100644 index 0000000..545c6d4 --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/templates/default/index.php @@ -0,0 +1,26 @@ + +pluralize($this->class2name($this->modelClass)); +echo "\$this->breadcrumbs=array( + '$label', +);\n"; +?> + +$this->menu=array( + array('label'=>'Create modelClass; ?>','url'=>array('create')), + array('label'=>'Manage modelClass; ?>','url'=>array('admin')), +); +?> + +

+ + $this->widget('bootstrap.widgets.BootListView',array( + 'dataProvider'=>$dataProvider, + 'itemView'=>'_view', +)); ?> diff --git a/protected/extensions/bootstrap/gii/bootstrap/templates/default/update.php b/protected/extensions/bootstrap/gii/bootstrap/templates/default/update.php new file mode 100644 index 0000000..5039ac6 --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/templates/default/update.php @@ -0,0 +1,28 @@ + +guessNameColumn($this->tableSchema->columns); +$label=$this->pluralize($this->class2name($this->modelClass)); +echo "\$this->breadcrumbs=array( + '$label'=>array('index'), + \$model->{$nameColumn}=>array('view','id'=>\$model->{$this->tableSchema->primaryKey}), + 'Update', +);\n"; +?> + +$this->menu=array( + array('label'=>'List modelClass; ?>','url'=>array('index')), + array('label'=>'Create modelClass; ?>','url'=>array('create')), + array('label'=>'View modelClass; ?>','url'=>array('view','id'=>$model->tableSchema->primaryKey; ?>)), + array('label'=>'Manage modelClass; ?>','url'=>array('admin')), +); +?> + +

Update modelClass." {$this->tableSchema->primaryKey}; ?>"; ?>

+ +renderPartial('_form',array('model'=>\$model)); ?>"; ?> \ No newline at end of file diff --git a/protected/extensions/bootstrap/gii/bootstrap/templates/default/view.php b/protected/extensions/bootstrap/gii/bootstrap/templates/default/view.php new file mode 100644 index 0000000..88f2432 --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/templates/default/view.php @@ -0,0 +1,36 @@ + +guessNameColumn($this->tableSchema->columns); +$label=$this->pluralize($this->class2name($this->modelClass)); +echo "\$this->breadcrumbs=array( + '$label'=>array('index'), + \$model->{$nameColumn}, +);\n"; +?> + +$this->menu=array( + array('label'=>'List modelClass; ?>','url'=>array('index')), + array('label'=>'Create modelClass; ?>','url'=>array('create')), + array('label'=>'Update modelClass; ?>','url'=>array('update','id'=>$model->tableSchema->primaryKey; ?>)), + array('label'=>'Delete modelClass; ?>','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->tableSchema->primaryKey; ?>),'confirm'=>'Are you sure you want to delete this item?')), + array('label'=>'Manage modelClass; ?>','url'=>array('admin')), +); +?> + +

View modelClass." #{$this->tableSchema->primaryKey}; ?>"; ?>

+ + $this->widget('bootstrap.widgets.BootDetailView',array( + 'data'=>$model, + 'attributes'=>array( +tableSchema->columns as $column) + echo "\t\t'".$column->name."',\n"; +?> + ), +)); ?> diff --git a/protected/extensions/bootstrap/gii/bootstrap/views/index.php b/protected/extensions/bootstrap/gii/bootstrap/views/index.php new file mode 100644 index 0000000..900c7c3 --- /dev/null +++ b/protected/extensions/bootstrap/gii/bootstrap/views/index.php @@ -0,0 +1,64 @@ +clientScript->registerScript('gii.crud'," +$('#{$class}_controller').change(function(){ + $(this).data('changed',$(this).val()!=''); +}); +$('#{$class}_model').bind('keyup change', function(){ + var controller=$('#{$class}_controller'); + if(!controller.data('changed')) { + var id=new String($(this).val().match(/\\w*$/)); + if(id.length>0) + id=id.substring(0,1).toLowerCase()+id.substring(1); + controller.val(id); + } +}); +"); +?> +

Bootstrap Generator

+ +

This generator generates a controller and views that implement CRUD operations for the specified data model.

+ +beginWidget('CCodeForm', array('model'=>$model)); ?> + +
+ labelEx($model,'model'); ?> + textField($model,'model',array('size'=>65)); ?> +
+ Model class is case-sensitive. It can be either a class name (e.g. Post) + or the path alias of the class file (e.g. application.models.Post). + Note that if the former, the class must be auto-loadable. +
+ error($model,'model'); ?> +
+ +
+ labelEx($model,'controller'); ?> + textField($model,'controller',array('size'=>65)); ?> +
+ Controller ID is case-sensitive. CRUD controllers are often named after + the model class name that they are dealing with. Below are some examples: +
    +
  • post generates PostController.php
  • +
  • postTag generates PostTagController.php
  • +
  • admin/user generates admin/UserController.php. + If the application has an admin module enabled, + it will generate UserController (and other CRUD code) + within the module instead. +
  • +
+
+ error($model,'controller'); ?> +
+ +
+ labelEx($model,'baseControllerClass'); ?> + textField($model,'baseControllerClass',array('size'=>65)); ?> +
+ This is the class that the new CRUD controller class will extend from. + Please make sure the class exists and can be autoloaded. +
+ error($model,'baseControllerClass'); ?> +
+ +endWidget(); ?> diff --git a/protected/extensions/bootstrap/lib/bootstrap/.gitignore b/protected/extensions/bootstrap/lib/bootstrap/.gitignore new file mode 100644 index 0000000..19700fe --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/.gitignore @@ -0,0 +1,33 @@ +# Numerous always-ignore extensions +*.diff +*.err +*.orig +*.log +*.rej +*.swo +*.swp +*.vi +*~ +*.sass-cache + +# OS or Editor folders +.DS_Store +Thumbs.db +.cache +.project +.settings +.tmproj +*.esproj +nbproject +*.sublime-project +*.sublime-workspace + +# Komodo +*.komodoproject +.komodotools + +# Folders to ignore +.hg +.svn +.CVS +.idea \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/LICENSE b/protected/extensions/bootstrap/lib/bootstrap/LICENSE new file mode 100644 index 0000000..2bb9ad2 --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/Makefile b/protected/extensions/bootstrap/lib/bootstrap/Makefile new file mode 100644 index 0000000..923c0ce --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/Makefile @@ -0,0 +1,59 @@ +BOOTSTRAP = ./docs/assets/css/bootstrap.css +BOOTSTRAP_LESS = ./less/bootstrap.less +BOOTSTRAP_RESPONSIVE = ./docs/assets/css/bootstrap-responsive.css +BOOTSTRAP_RESPONSIVE_LESS = ./less/responsive.less +LESS_COMPRESSOR ?= `which lessc` +WATCHR ?= `which watchr` + +# +# BUILD DOCS +# + +docs: bootstrap + rm docs/assets/bootstrap.zip + zip -r docs/assets/bootstrap.zip bootstrap + rm -r bootstrap + lessc ${BOOTSTRAP_LESS} > ${BOOTSTRAP} + lessc ${BOOTSTRAP_RESPONSIVE_LESS} > ${BOOTSTRAP_RESPONSIVE} + node docs/build + cp img/* docs/assets/img/ + cp js/*.js docs/assets/js/ + cp js/tests/vendor/jquery.js docs/assets/js/ + cp js/tests/vendor/jquery.js docs/assets/js/ + +# +# BUILD SIMPLE BOOTSTRAP DIRECTORY +# lessc & uglifyjs are required +# + +bootstrap: + mkdir -p bootstrap/img + mkdir -p bootstrap/css + mkdir -p bootstrap/js + cp img/* bootstrap/img/ + lessc ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.css + lessc --compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css + lessc ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css + lessc --compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css + cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > bootstrap/js/bootstrap.js + uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.js + +# +# MAKE FOR GH-PAGES 4 FAT & MDO ONLY (O_O ) +# + +gh-pages: docs + rm -f ../bootstrap-gh-pages/assets/bootstrap.zip + node docs/build production + cp -r docs/* ../bootstrap-gh-pages + +# +# WATCH LESS FILES +# + +watch: + echo "Watching less files..."; \ + watchr -e "watch('less/.*\.less') { system 'make' }" + + +.PHONY: dist docs watch gh-pages \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/README.md b/protected/extensions/bootstrap/lib/bootstrap/README.md new file mode 100644 index 0000000..0395568 --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/README.md @@ -0,0 +1,100 @@ +TWITTER BOOTSTRAP +================= + +Bootstrap is Twitter's toolkit for kickstarting CSS for websites, apps, and more. It includes base CSS styles for typography, forms, buttons, tables, grids, navigation, alerts, and more. + +To get started -- checkout http://twitter.github.com/bootstrap! + + +Versioning +---------- + +For transparency and insight into our release cycle, and for striving to maintain backward compatibility, Bootstrap will be maintained under the Semantic Versioning guidelines as much as possible. + +Releases will be numbered with the follow format: + +`..` + +And constructed with the following guidelines: + +* Breaking backward compatibility bumps the major +* New additions without breaking backward compatibility bumps the minor +* Bug fixes and misc changes bump the patch + +For more information on SemVer, please visit http://semver.org/. + + +Bug tracker +----------- + +Have a bug? Please create an issue here on GitHub! + +https://github.com/twitter/bootstrap/issues + + +Twitter account +--------------- + +Keep up to date on announcements and more by following Bootstrap on Twitter, @TwBootstrap. + + +Mailing list +------------ + +Have a question? Ask on our mailing list! + +twitter-bootstrap@googlegroups.com + +http://groups.google.com/group/twitter-bootstrap + + +IRC +--- + +Server: irc.freenode.net + +Channel: ##twitter-bootstrap (the double ## is not a typo) + + +Developers +---------- + +We have included a makefile with convenience methods for working with the Bootstrap library. + ++ **build** - `make` +Runs the LESS compiler to rebuild the `/less` files and compiles the docs pages. Requires lessc and uglify-js. Read more in our docs » + ++ **watch** - `make watch` +This is a convenience method for watching just Less files and automatically building them whenever you save. Requires the Watchr gem. + + +Authors +------- + +**Mark Otto** + ++ http://twitter.com/mdo ++ http://github.com/markdotto + +**Jacob Thornton** + ++ http://twitter.com/fat ++ http://github.com/fat + + +Copyright and license +--------------------- + +Copyright 2012 Twitter, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this work except in compliance with the License. +You may obtain a copy of the License in the LICENSE file, or at: + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/protected/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings-white.png b/protected/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings-white.png new file mode 100644 index 0000000000000000000000000000000000000000..3bf6484a29d8da269f9bc874b25493a45fae3bae GIT binary patch literal 8777 zcmZvC1yGz#v+m*$LXcp=A$ZWB0fL7wNbp_U*$~{_gL`my3oP#L!5tQYy99Ta`+g_q zKlj|KJ2f@c)ARJx{q*bbkhN_!|Wn*Vos8{TEhUT@5e;_WJsIMMcG5%>DiS&dv_N`4@J0cnAQ-#>RjZ z00W5t&tJ^l-QC*ST1-p~00u^9XJ=AUl7oW-;2a+x2k__T=grN{+1c4XK0ZL~^z^i$ zp&>vEhr@4fZWb380S18T&!0cQ3IKpHF)?v=b_NIm0Q>vwY7D0baZ)n z31Fa5sELUQARIVaU0nqf0XzT+fB_63aA;@<$l~wse|mcA;^G1TmX?-)e)jkGPfkuA z92@|!<>h5S_4f8QP-JRq>d&7)^Yin8l7K8gED$&_FaV?gY+wLjpoW%~7NDe=nHfMG z5DO3j{R9kv5GbssrUpO)OyvVrlx>u0UKD0i;Dpm5S5dY16(DL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 0 HcmV?d00001 diff --git a/protected/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings.png b/protected/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings.png new file mode 100644 index 0000000000000000000000000000000000000000..79bc568c21395d5a5ceab62fadb04457094b2ac7 GIT binary patch literal 13826 zcma)jby!@B+o%-915yyF0YFyB4?Ne(CRg z-#O<#&wb84`D17H-t*49Gi$BAvS#fBDJx22pcA4aAt7PN%1EdpAw8RXk~3bSJRMO{ zLOPzl2q2PL5H+wV#M#IJgd}PLHU^Q&+8CLER6#~2F82K(0VJg7mlo<;5G{o-d_b@b zi_u>l7MP9Q6B-FgKp19c1hfJ{$c#Z|7Pf*EM~$r%WELiZ6q=k0YzlVbAae^DR|k-q ztD-v4)e6XKLLn?fCII7mGGGIO7?HtjtZg0nV1g9?*yVeY|6XRLAp1uJVkJoNAEdMt zl*z=w4j?j47B*%e8y7nn*Jl>?&uqM(d6~#Qv9YtUvVUS_<7Q@Os%DRy=VF;OnbPZB&l+~Sg=;$olKxc@r)Yv8{FpRTZ&JYl7zK5_7had2=;im|h^ zOS1E@^NNabNpOiuiHY)jW|#UmR@T-LVq^;h{dM{mYw=&$PyZv9Puu}y1OYp!gTdDS z?kdXWUuEt5GU<9?B8*-aqzJHUs!SW&!V4sCD=ZRit}=F za#FB9kud@CK`bEFpnvsHQESM*Bx{Smy@b!&$kyyB9n2;mQzNJ~ghI&7+QrV?0tmKs zG<38vvbHufF>%IThd>Rse#s3_OPbdF5nnAWt zL)hVIta5&^8bd;2&ytl8Rfo+Tcz~_-Bx?#ZE2<3oUBe})+zpAGX&=O$_aCJBN!CBt zv~LUxtg{dH^uI`jCU#YZa*6x&AyIg@k@bxImc$%rVne48BslqY$+TLFj(v37h7yfx z$^jmG#g_Rs?ETA?`?LMJ^OpUDIY(RQdGlgR?XG$OKf8PyqRZyid2g!3%@a^C1igpD z2NKzV@|1wiF}EtKQRH|$CJJ9)q3e}#g7m#Zl(d`W;iCBregW~kz}j^J z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aVA6Ry$0&8rtZV3pHxzf$? zzAjYXA~;b|XCc95MUR%dTT@Z>0}uY+8y=;wW1vky{pKP;cOV}6&6tV$I;>`FK z906wPfPrz9t=;&M?(Wwdm z0?&;KzLQk84srC-9#ap*I_9GregSZjm<$6oiZ>h3ACEnS7A^faq{fPmD!rT69qQG% zRVF#+RDZ(-Ue?g!$?;NT#p=8F8SV%EZ5ry{-5J)UN6Jj~-klPlw7o4w&aUp0pn@@) zM(jp3}a6rP@=sC1ZvM zV)jL-HO|elZ@x|hHXkrmGu9uS2%=Jqa zgIqpCmA+s{=XewW1!LqE)3%%mIO z(8jQbk;xApH`iS0;h7M96j^_3N=#|-xP-=*>3=obmL(W)Au>jdy3E<UjD;R zOI^Va(lW(qH`MjF&}RqCOifgKKA39SANA9=Qv4z+3Qey|4BJBzex_v%9=l5D-xJaG`?IF#?EKul!io4R+`>v>t_65&VXqROwiMr@*>SD)gNHL4^Ml5(vgCqodJjd$~XNSPzt@GziL=mgy;Y+qBZh&1qKxwm{>$kMCyH2rN?F2%^-bX#z9QBC| zNx?aIaFXEMqAKsMWDfWB@Pt3@$5LZ%DVDT70icB1BXM`F_#4rYqTkpk%wf tVgFekgZM{XhA!KlmFcR^%iaf4$rSfz)nO-hfB%&wE2$_^D)!aq{{YOB6}SKZ literal 0 HcmV?d00001 diff --git a/protected/extensions/bootstrap/lib/bootstrap/js/.jshintrc b/protected/extensions/bootstrap/lib/bootstrap/js/.jshintrc new file mode 100644 index 0000000..bbac349 --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/js/.jshintrc @@ -0,0 +1,10 @@ +{ + "validthis": true, + "laxcomma" : true, + "laxbreak" : true, + "browser" : true, + "debug" : true, + "boss" : true, + "expr" : true, + "asi" : true +} \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/js/README.md b/protected/extensions/bootstrap/lib/bootstrap/js/README.md new file mode 100644 index 0000000..c7b71e7 --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/js/README.md @@ -0,0 +1,112 @@ +## 2.0 BOOTSTRAP JS PHILOSOPHY +These are the high-level design rules which guide the development of Bootstrap's plugin apis. + +--- + +### DATA-ATTRIBUTE API + +We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript. This is bootstraps first class api. + +We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this: + + $('body').off('.data-api') + +To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this: + + $('body').off('.alert.data-api') + +--- + +### PROGRAMATIC API + +We also believe you should be able to use all plugins provided by Bootstrap purely through the JS API. + +All public APIs should be single, chainable methods, and return the collection acted upon. + + $(".btn.danger").button("toggle").addClass("fat") + +All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior: + + $("#myModal").modal() // initialized with defaults + $("#myModal").modal({ keyboard: false }) // initialized with no keyboard + $("#myModal").modal('show') // initializes and invokes show immediately + +--- + +### OPTIONS + +Options should be sparse and add universal value. We should pick the right defaults. + +All plugins should have a default object which can be modified to affect all instances' default options. The defaults object should be available via `$.fn.plugin.defaults`. + + $.fn.modal.defaults = { … } + +An options definition should take the following form: + + *noun*: *adjective* - describes or modifies a quality of an instance + +examples: + + backdrop: true + keyboard: false + placement: 'top' + +--- + +### EVENTS + +All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action. + + show | shown + hide | hidden + +All infinitive events should provide preventDefault functionality. This provides the abililty to stop the execution of an action. + + $('#myModal').on('show', function (e) { + if (!data) return e.preventDefault() // stops modal from being shown + }) + +--- + +### CONSTRUCTORS + +Each plugin should expose its raw constructor on a `Constructor` property -- accessed in the following way: + + + $.fn.popover.Constructor + +--- + +### DATA ACCESSOR + +Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this: + + $('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor + +--- + +### DATA ATTRIBUTES + +Data attributes should take the following form: + +- data-{{verb}}={{plugin}} - defines main interaction +- data-target || href^=# - defined on "control" element (if element controls an element other than self) +- data-{{noun}} - defines class instance options + +examples: + + // control other targets + data-toggle="modal" data-target="#foo" + data-toggle="collapse" data-target="#foo" data-parent="#bar" + + // defined on element they control + data-spy="scroll" + + data-dismiss="modal" + data-dismiss="alert" + + data-toggle="dropdown" + + data-toggle="button" + data-toggle="buttons-checkbox" + data-toggle="buttons-radio" \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-alert.js b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-alert.js new file mode 100644 index 0000000..fa0806e --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-alert.js @@ -0,0 +1,90 @@ +/* ========================================================== + * bootstrap-alert.js v2.0.3 + * http://twitter.github.com/bootstrap/javascript.html#alerts + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* ALERT CLASS DEFINITION + * ====================== */ + + var dismiss = '[data-dismiss="alert"]' + , Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + + e && e.preventDefault() + + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) + + $parent.trigger(e = $.Event('close')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent + .trigger('closed') + .remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent.on($.support.transition.end, removeElement) : + removeElement() + } + + + /* ALERT PLUGIN DEFINITION + * ======================= */ + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('alert') + if (!data) $this.data('alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + /* ALERT DATA-API + * ============== */ + + $(function () { + $('body').on('click.alert.data-api', dismiss, Alert.prototype.close) + }) + +}(window.jQuery); \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-button.js b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-button.js new file mode 100644 index 0000000..a9e6ba7 --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-button.js @@ -0,0 +1,96 @@ +/* ============================================================ + * bootstrap-button.js v2.0.3 + * http://twitter.github.com/bootstrap/javascript.html#buttons + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* BUTTON PUBLIC CLASS DEFINITION + * ============================== */ + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.button.defaults, options) + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + , $el = this.$element + , data = $el.data() + , val = $el.is('input') ? 'val' : 'html' + + state = state + 'Text' + data.resetText || $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + }, 0) + } + + Button.prototype.toggle = function () { + var $parent = this.$element.parent('[data-toggle="buttons-radio"]') + + $parent && $parent + .find('.active') + .removeClass('active') + + this.$element.toggleClass('active') + } + + + /* BUTTON PLUGIN DEFINITION + * ======================== */ + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('button') + , options = typeof option == 'object' && option + if (!data) $this.data('button', (data = new Button(this, options))) + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $.fn.button.Constructor = Button + + + /* BUTTON DATA-API + * =============== */ + + $(function () { + $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + }) + }) + +}(window.jQuery); \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-carousel.js b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-carousel.js new file mode 100644 index 0000000..96e5a81 --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-carousel.js @@ -0,0 +1,169 @@ +/* ========================================================== + * bootstrap-carousel.js v2.0.3 + * http://twitter.github.com/bootstrap/javascript.html#carousel + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CAROUSEL CLASS DEFINITION + * ========================= */ + + var Carousel = function (element, options) { + this.$element = $(element) + this.options = options + this.options.slide && this.slide(this.options.slide) + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.prototype = { + + cycle: function (e) { + if (!e) this.paused = false + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + return this + } + + , to: function (pos) { + var $active = this.$element.find('.active') + , children = $active.parent().children() + , activePos = children.index($active) + , that = this + + if (pos > (children.length - 1) || pos < 0) return + + if (this.sliding) { + return this.$element.one('slid', function () { + that.to(pos) + }) + } + + if (activePos == pos) { + return this.pause().cycle() + } + + return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) + } + + , pause: function (e) { + if (!e) this.paused = true + clearInterval(this.interval) + this.interval = null + return this + } + + , next: function () { + if (this.sliding) return + return this.slide('next') + } + + , prev: function () { + if (this.sliding) return + return this.slide('prev') + } + + , slide: function (type, next) { + var $active = this.$element.find('.active') + , $next = next || $active[type]() + , isCycling = this.interval + , direction = type == 'next' ? 'left' : 'right' + , fallback = type == 'next' ? 'first' : 'last' + , that = this + , e = $.Event('slide') + + this.sliding = true + + isCycling && this.pause() + + $next = $next.length ? $next : this.$element.find('.item')[fallback]() + + if ($next.hasClass('active')) return + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + this.$element.one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } + + isCycling && this.cycle() + + return this + } + + } + + + /* CAROUSEL PLUGIN DEFINITION + * ========================== */ + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('carousel') + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) + if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (typeof option == 'string' || (option = options.slide)) data[option]() + else if (options.interval) data.cycle() + }) + } + + $.fn.carousel.defaults = { + interval: 5000 + , pause: 'hover' + } + + $.fn.carousel.Constructor = Carousel + + + /* CAROUSEL DATA-API + * ================= */ + + $(function () { + $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data()) + $target.carousel(options) + e.preventDefault() + }) + }) + +}(window.jQuery); \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-collapse.js b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-collapse.js new file mode 100644 index 0000000..d02f6fd --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-collapse.js @@ -0,0 +1,157 @@ +/* ============================================================= + * bootstrap-collapse.js v2.0.3 + * http://twitter.github.com/bootstrap/javascript.html#collapse + * ============================================================= + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) + + if (this.options.parent) { + this.$parent = $(this.options.parent) + } + + this.options.toggle && this.toggle() + } + + Collapse.prototype = { + + constructor: Collapse + + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + , show: function () { + var dimension + , scroll + , actives + , hasData + + if (this.transitioning) return + + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') + + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + this.$element[dimension](this.$element[0][scroll]) + } + + , hide: function () { + var dimension + if (this.transitioning) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) + } + + , reset: function (size) { + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth + + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') + + return this + } + + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } + + this.$element.trigger(startEvent) + + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSIBLE PLUGIN DEFINITION + * ============================== */ + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = typeof option == 'object' && option + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSIBLE DATA-API + * ==================== */ + + $(function () { + $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $(target).collapse(option) + }) + }) + +}(window.jQuery); \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-dropdown.js b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-dropdown.js new file mode 100644 index 0000000..ec0588d --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-dropdown.js @@ -0,0 +1,100 @@ +/* ============================================================ + * bootstrap-dropdown.js v2.0.3 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle="dropdown"]' + , Dropdown = function (element) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function (e) { + var $this = $(this) + , $parent + , selector + , isActive + + if ($this.is('.disabled, :disabled')) return + + selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + $parent.length || ($parent = $this.parent()) + + isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) $parent.toggleClass('open') + + return false + } + + } + + function clearMenus() { + $(toggle).parent().removeClass('open') + } + + + /* DROPDOWN PLUGIN DEFINITION + * ========================== */ + + $.fn.dropdown = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('dropdown') + if (!data) $this.data('dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.dropdown.Constructor = Dropdown + + + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ + + $(function () { + $('html').on('click.dropdown.data-api', clearMenus) + $('body') + .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() }) + .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) + }) + +}(window.jQuery); \ No newline at end of file diff --git a/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-modal.js b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-modal.js new file mode 100644 index 0000000..c831de6 --- /dev/null +++ b/protected/extensions/bootstrap/lib/bootstrap/js/bootstrap-modal.js @@ -0,0 +1,218 @@ +/* ========================================================= + * bootstrap-modal.js v2.0.3 + * http://twitter.github.com/bootstrap/javascript.html#modals + * ========================================================= + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================= */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* MODAL CLASS DEFINITION + * ====================== */ + + var Modal = function (content, options) { + this.options = options + this.$element = $(content) + .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) + } + + Modal.prototype = { + + constructor: Modal + + , toggle: function () { + return this[!this.isShown ? 'show' : 'hide']() + } + + , show: function () { + var that = this + , e = $.Event('show') + + this.$element.trigger(e) + + if (this.isShown || e.isDefaultPrevented()) return + + $('body').addClass('modal-open') + + this.isShown = true + + escape.call(this) + backdrop.call(this, function () { + var transition = $.support.transition && that.$element.hasClass('fade') + + if (!that.$element.parent().length) { + that.$element.appendTo(document.body) //don't move modals dom position + } + + that.$element + .show() + + if (transition) { + that.$element[0].offsetWidth // force reflow + } + + that.$element.addClass('in') + + transition ? + that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : + that.$element.trigger('shown') + + }) + } + + , hide: function (e) { + e && e.preventDefault() + + var that = this + + e = $.Event('hide') + + this.$element.trigger(e) + + if (!this.isShown || e.isDefaultPrevented()) return + + this.isShown = false + + $('body').removeClass('modal-open') + + escape.call(this) + + this.$element.removeClass('in') + + $.support.transition && this.$element.hasClass('fade') ? + hideWithTransition.call(this) : + hideModal.call(this) + } + + } + + + /* MODAL PRIVATE METHODS + * ===================== */ + + function hideWithTransition() { + var that = this + , timeout = setTimeout(function () { + that.$element.off($.support.transition.end) + hideModal.call(that) + }, 500) + + this.$element.one($.support.transition.end, function () { + clearTimeout(timeout) + hideModal.call(that) + }) + } + + function hideModal(that) { + this.$element + .hide() + .trigger('hidden') + + backdrop.call(this) + } + + function backdrop(callback) { + var that = this + , animate = this.$element.hasClass('fade') ? 'fade' : '' + + if (this.isShown && this.options.backdrop) { + var doAnimate = $.support.transition && animate + + this.$backdrop = $(''; + } +} diff --git a/protected/extensions/bootstrap/widgets/BootPager.php b/protected/extensions/bootstrap/widgets/BootPager.php new file mode 100644 index 0000000..2dbef87 --- /dev/null +++ b/protected/extensions/bootstrap/widgets/BootPager.php @@ -0,0 +1,111 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets + */ + +/** + * Bootstrap pager widget. + */ +class BootPager extends CLinkPager +{ + /** + * @var string the text shown before page buttons. Defaults to ''. + */ + public $header = ''; + /** + * @var string the URL of the CSS file used by this pager. + * Defaults to false, meaning that no CSS will be included. + */ + public $cssFile = false; + /** + * @var boolean whether to display the first and last items. + */ + public $displayFirstAndLast = false; + + /** + * Initializes the pager by setting some default property values. + */ + public function init() + { + if ($this->nextPageLabel === null) + $this->nextPageLabel = Yii::t('bootstrap','Next').' →'; + + if ($this->prevPageLabel === null) + $this->prevPageLabel = '← '.Yii::t('bootstrap','Previous'); + + if ($this->firstPageLabel === null) + $this->firstPageLabel = Yii::t('bootstrap','First'); + + if ($this->lastPageLabel === null) + $this->lastPageLabel = Yii::t('bootstrap','Last'); + + if (!isset($this->htmlOptions['class'])) + $this->htmlOptions['class'] = ''; // would default to yiiPager + + parent::init(); + } + + /** + * Creates the page buttons. + * @return array a list of page buttons (in HTML code). + */ + protected function createPageButtons() + { + if (($pageCount = $this->getPageCount()) <= 1) + return array(); + + list ($beginPage, $endPage) = $this->getPageRange(); + + $currentPage = $this->getCurrentPage(false); // currentPage is calculated in getPageRange() + + $buttons = array(); + + // first page + if ($this->displayFirstAndLast) + $buttons[] = $this->createPageButton($this->firstPageLabel, 0, 'first', $currentPage <= 0, false); + + // prev page + if (($page = $currentPage - 1) < 0) + $page = 0; + + $buttons[] = $this->createPageButton($this->prevPageLabel, $page, 'previous', $currentPage <= 0, false); + + // internal pages + for ($i = $beginPage; $i <= $endPage; ++$i) + $buttons[] = $this->createPageButton($i + 1, $i, '', false, $i == $currentPage); + + // next page + if (($page = $currentPage+1) >= $pageCount-1) + $page = $pageCount-1; + + $buttons[] = $this->createPageButton($this->nextPageLabel, $page, 'next', $currentPage >= ($pageCount - 1), false); + + // last page + if ($this->displayFirstAndLast) + $buttons[] = $this->createPageButton($this->lastPageLabel, $pageCount - 1, 'last', $currentPage >= ($pageCount - 1), false); + + return $buttons; + } + + /** + * Creates a page button. + * You may override this method to customize the page buttons. + * @param string $label the text label for the button + * @param integer $page the page number + * @param string $class the CSS class for the page button. This could be 'page', 'first', 'last', 'next' or 'previous'. + * @param boolean $hidden whether this page button is visible + * @param boolean $selected whether this page button is selected + * @return string the generated button + */ + protected function createPageButton($label, $page, $class, $hidden, $selected) + { + if ($hidden || $selected) + $class .= ' '.($hidden ? 'disabled' : 'active'); + + return CHtml::tag('li', array('class'=>$class), CHtml::link($label, $this->createPageUrl($page))); + } +} diff --git a/protected/extensions/bootstrap/widgets/BootProgress.php b/protected/extensions/bootstrap/widgets/BootProgress.php new file mode 100644 index 0000000..3828dea --- /dev/null +++ b/protected/extensions/bootstrap/widgets/BootProgress.php @@ -0,0 +1,82 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets + * @since 0.9.10 + */ + +/** + * Bootstrap progress bar widget. + */ +class BootProgress extends CWidget +{ + // Progress bar types. + const TYPE_DEFAULT = ''; + const TYPE_INFO = 'info'; + const TYPE_SUCCESS = 'success'; + const TYPE_DANGER = 'danger'; + + /** + * @var string the bar type. + * Valid values are '', 'info', 'success', and 'danger'. + */ + public $type = self::TYPE_DEFAULT; + /** + * @var boolean whether the bar is striped. + */ + public $striped = false; + /** + * @var boolean whether the bar is animated. + */ + public $animated = false; + /** + * @var integer the progress. + */ + public $percent = 0; + /** + * @var array the HTML attributes for the widget container. + */ + public $htmlOptions = array(); + + /** + * Initializes the widget. + */ + public function init() + { + $classes = array('progress'); + + $validTypes = array(self::TYPE_DEFAULT, self::TYPE_INFO, self::TYPE_SUCCESS, self::TYPE_DANGER); + if ($this->type !== self::TYPE_DEFAULT && in_array($this->type, $validTypes)) + $classes[] = 'progress-'.$this->type; + + if ($this->striped) + $classes[] = 'progress-striped'; + + if ($this->animated) + $classes[] = 'active'; + + $classes = implode(' ', $classes); + if (isset($this->htmlOptions['class'])) + $this->htmlOptions['class'] .= ' '.$classes; + else + $this->htmlOptions['class'] = $classes; + + if ($this->percent < 0) + $this->percent = 0; + else if ($this->percent > 100) + $this->percent = 100; + } + + /** + * Runs the widget. + */ + public function run() + { + echo CHtml::openTag('div', $this->htmlOptions); + echo '
'; + echo ''; + } +} diff --git a/protected/extensions/bootstrap/widgets/BootTabbable.php b/protected/extensions/bootstrap/widgets/BootTabbable.php new file mode 100644 index 0000000..bba569e --- /dev/null +++ b/protected/extensions/bootstrap/widgets/BootTabbable.php @@ -0,0 +1,186 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets + */ + +Yii::import('bootstrap.widgets.BootMenu'); + +/** + * Bootstrap JavaScript tabs widget. + * @since 0.9.8 + */ +class BootTabbable extends CWidget +{ + // Tab placements. + const PLACEMENT_ABOVE = 'above'; + const PLACEMENT_BELOW = 'below'; + const PLACEMENT_LEFT = 'left'; + const PLACEMENT_RIGHT = 'right'; + + /** + * @var string the type of tabs to display. Defaults to 'tabs'. + * Valid values are 'tabs' and 'pills'. + * Please not that JavaScript pills are not fully supported in Bootstrap! + */ + public $type = BootMenu::TYPE_TABS; + /** + * @var string the placement of the tabs. + * Valid values are 'above', 'below', 'left' and 'right'. + */ + public $placement = self::PLACEMENT_ABOVE; + /** + * @var array the tab configuration. + */ + public $tabs = array(); + /** + * @var boolean whether to encode item labels. + */ + public $encodeLabel = true; + /** + * @var string[] the JavaScript event handlers. + */ + public $events = array(); + /** + * @var array the HTML attributes for the widget container. + */ + public $htmlOptions = array(); + + /** + * Initializes the widget. + */ + public function init() + { + if (!isset($this->htmlOptions['id'])) + $this->htmlOptions['id'] = $this->getId(); + + $validPlacements = array(self::PLACEMENT_ABOVE, self::PLACEMENT_BELOW, self::PLACEMENT_LEFT, self::PLACEMENT_RIGHT); + + if (isset($this->placement) && in_array($this->placement, $validPlacements)) + { + $classes = 'tabs-'.$this->placement; + if (isset($this->htmlOptions['class'])) + $this->htmlOptions['class'] .= ' '.$classes; + else + $this->htmlOptions['class'] = $classes; + } + } + + /** + * Run this widget. + */ + public function run() + { + $id = $this->id; + $content = array(); + $items = $this->normalizeTabs($this->tabs, $content); + + ob_start(); + $this->controller->widget('bootstrap.widgets.BootMenu', array( + 'type'=>$this->type, + 'encodeLabel'=>$this->encodeLabel, + 'items'=>$items, + )); + $tabs = ob_get_clean(); + + ob_start(); + echo '
'; + echo implode('', $content); + echo '
'; + $content = ob_get_clean(); + + echo CHtml::openTag('div', $this->htmlOptions); + echo $this->placement === self::PLACEMENT_BELOW ? $content.$tabs : $tabs.$content; + echo ''; + + /** @var CClientScript $cs */ + $cs = Yii::app()->getClientScript(); + $cs->registerScript(__CLASS__.'#'.$id, "jQuery('#{$id}').tab('show');"); + + // Register the "show" event-handler. + if (isset($this->events['show'])) + { + $fn = CJavaScript::encode($this->events['show']); + $cs->registerScript(__CLASS__.'#'.$id.'.show', "jQuery('#{$id} a[data-toggle=\"tab\"]').on('show', {$fn});"); + } + + // Register the "shown" event-handler. + if (isset($this->events['shown'])) + { + $fn = CJavaScript::encode($this->events['shown']); + $cs->registerScript(__CLASS__.'#'.$id.'.shown', "jQuery('#{$id} a[data-toggle=\"tab\"]').on('shown', {$fn});"); + } + } + + /** + * Normalizes the tab configuration. + * @param array $tabs the tab configuration + * @param array $panes a reference to the panes array + * @param integer $i the current index + * @return array the items + */ + protected function normalizeTabs($tabs, &$panes, &$i = 0) + { + $id = $this->getId(); + $items = array(); + + foreach ($tabs as $tab) + { + $item = $tab; + + if (isset($item['visible']) && !$item['visible']) + continue; + + if (!isset($item['itemOptions'])) + $item['itemOptions'] = array(); + + $item['linkOptions']['data-toggle'] = 'tab'; + + if (isset($tab['items'])) + $item['items'] = $this->normalizeTabs($item['items'], $panes, $i); + else + { + if (!isset($item['id'])) + $item['id'] = $id.'_tab_'.($i + 1); + + $item['url'] = '#'.$item['id']; + + if (!isset($item['content'])) + $item['content'] = ''; + + $content = $item['content']; + unset($item['content']); + + if (!isset($item['paneOptions'])) + $item['paneOptions'] = array(); + + $paneOptions = $item['paneOptions']; + unset($item['paneOptions']); + + $paneOptions['id'] = $item['id']; + + $classes = array('tab-pane fade'); + + if (isset($item['active']) && $item['active']) + $classes[] = 'active in'; + + $classes = implode(' ', $classes); + if (isset($paneOptions['class'])) + $paneOptions['class'] .= $classes; + else + $paneOptions['class'] = $classes; + + $panes[] = CHtml::tag('div', $paneOptions, $content); + + $i++; // increment the tab-index + } + + $items[] = $item; + } + + return $items; + } +} diff --git a/protected/extensions/bootstrap/widgets/BootThumbnails.php b/protected/extensions/bootstrap/widgets/BootThumbnails.php new file mode 100644 index 0000000..d4173f4 --- /dev/null +++ b/protected/extensions/bootstrap/widgets/BootThumbnails.php @@ -0,0 +1,45 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets + */ + +Yii::import('bootstrap.widgets.BootListView'); + +/** + * Bootstrap thumbnails widget. + */ +class BootThumbnails extends BootListView +{ + /** + * Renders the data items for the view. + * Each item is corresponding to a single data model instance. + * Child classes should override this method to provide the actual item rendering logic. + */ + public function renderItems() + { + $data = $this->dataProvider->getData(); + + if (!empty($data)) + { + echo CHtml::openTag('ul', array('class'=>'thumbnails')); + $owner = $this->getOwner(); + $render = $owner instanceof CController ? 'renderPartial' : 'render'; + foreach($data as $i=>$item) + { + $data = $this->viewData; + $data['index'] = $i; + $data['data'] = $item; + $data['widget'] = $this; + $owner->$render($this->itemView,$data); + } + + echo ''; + } + else + $this->renderEmptyText(); + } +} diff --git a/protected/extensions/bootstrap/widgets/BootTypeahead.php b/protected/extensions/bootstrap/widgets/BootTypeahead.php new file mode 100644 index 0000000..5c28ee8 --- /dev/null +++ b/protected/extensions/bootstrap/widgets/BootTypeahead.php @@ -0,0 +1,49 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets + * @since 0.9.10 + */ + +/** + * Bootstrap type-a-head widget. + */ +class BootTypeahead extends CWidget +{ + /** + * @var array the options for the Bootstrap JavaScript plugin. + */ + public $options = array(); + /** + * @var array the HTML attributes for the widget container. + */ + public $htmlOptions = array(); + + /** + * Initializes the widget. + */ + public function init() + { + if (!isset($this->htmlOptions['id'])) + $this->htmlOptions['id'] = $this->getId(); + + $this->htmlOptions['type'] = 'text'; + $this->htmlOptions['data-provide'] = 'typeahead'; + } + + /** + * Runs the widget. + */ + public function run() + { + $id = $this->id; + + echo CHtml::tag('input', $this->htmlOptions); + + $options = !empty($this->options) ? CJavaScript::encode($this->options) : ''; + Yii::app()->clientScript->registerScript(__CLASS__.'#'.$id, "jQuery('#{$id}').typeahead({$options});"); + } +} diff --git a/protected/extensions/bootstrap/widgets/input/BootInput.php b/protected/extensions/bootstrap/widgets/input/BootInput.php new file mode 100644 index 0000000..d24901f --- /dev/null +++ b/protected/extensions/bootstrap/widgets/input/BootInput.php @@ -0,0 +1,358 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets.input + */ + +/** + * Bootstrap input widget. + * Used for rendering inputs according to Bootstrap standards. + */ +abstract class BootInput extends CInputWidget +{ + // The different input types. + const TYPE_CHECKBOX = 'checkbox'; + const TYPE_CHECKBOXLIST = 'checkboxlist'; + const TYPE_CHECKBOXLIST_INLINE = 'checkboxlist_inline'; + const TYPE_DROPDOWN = 'dropdownlist'; + const TYPE_FILE = 'filefield'; + const TYPE_PASSWORD = 'password'; + const TYPE_RADIO = 'radiobutton'; + const TYPE_RADIOLIST = 'radiobuttonlist'; + const TYPE_RADIOLIST_INLINE = 'radiobuttonlist_inline'; + const TYPE_TEXTAREA = 'textarea'; + const TYPE_TEXT = 'textfield'; + const TYPE_CAPTCHA = 'captcha'; + const TYPE_UNEDITABLE = 'uneditable'; + + /** + * @var BootActiveForm the associated form widget. + */ + public $form; + /** + * @var string the input label text. + */ + public $label; + /** + * @var string the input type. + * Following types are supported: checkbox, checkboxlist, dropdownlist, filefield, password, + * radiobutton, radiobuttonlist, textarea, textfield, captcha and uneditable. + */ + public $type; + /** + * @var array the data for list inputs. + */ + public $data = array(); + + /** + * Initializes the widget. + * @throws CException if the widget could not be initialized. + */ + public function init() + { + if (!isset($this->form)) + throw new CException(__CLASS__.': Failed to initialize widget! Form is not set.'); + + if (!isset($this->model)) + throw new CException(__CLASS__.': Failed to initialize widget! Model is not set.'); + + if (!isset($this->type)) + throw new CException(__CLASS__.': Failed to initialize widget! Input type is not set.'); + + if ($this->type === self::TYPE_UNEDITABLE) + { + $classes = 'uneditable-input'; + if (isset($this->htmlOptions['class'])) + $this->htmlOptions['class'] .= ' '.$classes; + else + $this->htmlOptions['class'] = $classes; + } + } + + /** + * Runs the widget. + * @throws CException if the widget type is invalid. + */ + public function run() + { + switch ($this->type) + { + case self::TYPE_CHECKBOX: + $this->checkBox(); + break; + + case self::TYPE_CHECKBOXLIST: + $this->checkBoxList(); + break; + + case self::TYPE_CHECKBOXLIST_INLINE: + $this->checkBoxListInline(); + break; + + case self::TYPE_DROPDOWN: + $this->dropDownList(); + break; + + case self::TYPE_FILE: + $this->fileField(); + break; + + case self::TYPE_PASSWORD: + $this->passwordField(); + break; + + case self::TYPE_RADIO: + $this->radioButton(); + break; + + case self::TYPE_RADIOLIST: + $this->radioButtonList(); + break; + + case self::TYPE_RADIOLIST_INLINE: + $this->radioButtonListInline(); + break; + + case self::TYPE_TEXTAREA: + $this->textArea(); + break; + + case self::TYPE_TEXT: + $this->textField(); + break; + + case self::TYPE_CAPTCHA: + $this->captcha(); + break; + + case self::TYPE_UNEDITABLE: + $this->uneditableField(); + break; + + default: + throw new CException(__CLASS__.': Failed to run widget! Type is invalid.'); + } + } + + /** + * Returns the label for the input. + * @param array $htmlOptions additional HTML attributes + * @return string the label + */ + protected function getLabel($htmlOptions = array()) + { + if ($this->label !== false && !in_array($this->type, array('checkbox', 'radio')) && $this->hasModel()) + return $this->form->labelEx($this->model, $this->attribute, $htmlOptions); + else if ($this->label !== null) + return $this->label; + else + return ''; + } + + /** + * Returns the prepend element for the input. + * @param array $htmlOptions additional HTML attributes + * @return string the element + */ + protected function getPrepend($htmlOptions = array()) + { + if ($this->hasAddOn()) + { + $classes = 'add-on'; + if (isset($htmlOptions['class'])) + $htmlOptions['class'] .= ' '.$classes; + else + $htmlOptions['class'] = $classes; + + $classes = $this->getInputContainerCssClass(); + ob_start(); + echo '
'; + if (isset($this->htmlOptions['prepend'])) + echo CHtml::tag('span', $htmlOptions, $this->htmlOptions['prepend']); + return ob_get_clean(); + } + else + return ''; + } + + /** + * Returns the append element for the input. + * @param array $htmlOptions additional HTML attributes + * @return string the element + */ + protected function getAppend($htmlOptions = array()) + { + if ($this->hasAddOn()) + { + $classes = 'add-on'; + if (isset($htmlOptions['class'])) + $htmlOptions['class'] .= ' '.$classes; + else + $htmlOptions['class'] = $classes; + + ob_start(); + if (isset($this->htmlOptions['append'])) + echo CHtml::tag('span', $htmlOptions, $this->htmlOptions['append']); + echo '
'; + return ob_get_clean(); + } + else + return ''; + } + + /** + * Returns the input container CSS classes. + * @return string the classes + */ + protected function getInputContainerCssClass() + { + $classes = array(); + if (isset($this->htmlOptions['prepend'])) + $classes[] = 'input-prepend'; + if (isset($this->htmlOptions['append'])) + $classes[] = 'input-append'; + + return implode(' ', $classes); + } + + /** + * Returns whether the input has an add-on (prepend and/or append). + * @return boolean the result + */ + protected function hasAddOn() + { + return isset($this->htmlOptions['prepend']) || isset($this->htmlOptions['append']); + } + + /** + * Returns the error text for the input. + * @param array $htmlOptions additional HTML attributes + * @return string the error text + */ + protected function getError($htmlOptions = array()) + { + return $this->form->error($this->model, $this->attribute, $htmlOptions); + } + + /** + * Returns the hint text for the input. + * @return string the hint text + */ + protected function getHint() + { + if (isset($this->htmlOptions['hint'])) + { + $hint = $this->htmlOptions['hint']; + unset($this->htmlOptions['hint']); + return '

'.$hint.'

'; + } + else + return ''; + } + + /** + * Returns the container CSS class for the input. + * @return string the CSS class. + */ + protected function getContainerCssClass() + { + if ($this->model->hasErrors(CHtml::resolveName($this->model, $this->attribute))) + return CHtml::$errorCss; + else + return ''; + } + + /** + * Renders a checkbox. + * @return string the rendered content + * @abstract + */ + abstract protected function checkBox(); + + /** + * Renders a list of checkboxes. + * @return string the rendered content + * @abstract + */ + abstract protected function checkBoxList(); + + /** + * Renders a list of inline checkboxes. + * @return string the rendered content + * @abstract + */ + abstract protected function checkBoxListInline(); + + /** + * Renders a drop down list (select). + * @return string the rendered content + * @abstract + */ + abstract protected function dropDownList(); + + /** + * Renders a file field. + * @return string the rendered content + * @abstract + */ + abstract protected function fileField(); + + /** + * Renders a password field. + * @return string the rendered content + * @abstract + */ + abstract protected function passwordField(); + + /** + * Renders a radio button. + * @return string the rendered content + * @abstract + */ + abstract protected function radioButton(); + + /** + * Renders a list of radio buttons. + * @return string the rendered content + * @abstract + */ + abstract protected function radioButtonList(); + + /** + * Renders a list of inline radio buttons. + * @return string the rendered content + * @abstract + */ + abstract protected function radioButtonListInline(); + + /** + * Renders a textarea. + * @return string the rendered content + * @abstract + */ + abstract protected function textArea(); + + /** + * Renders a text field. + * @return string the rendered content + * @abstract + */ + abstract protected function textField(); + + /** + * Renders a CAPTCHA. + * @return string the rendered content + * @abstract + */ + abstract protected function captcha(); + + /** + * Renders an uneditable field. + * @return string the rendered content + * @abstract + */ + abstract protected function uneditableField(); +} diff --git a/protected/extensions/bootstrap/widgets/input/BootInputHorizontal.php b/protected/extensions/bootstrap/widgets/input/BootInputHorizontal.php new file mode 100644 index 0000000..7b74cc5 --- /dev/null +++ b/protected/extensions/bootstrap/widgets/input/BootInputHorizontal.php @@ -0,0 +1,215 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets.input + */ + +Yii::import('bootstrap.widgets.input.BootInput'); + +/** + * Bootstrap horizontal form input widget. + * @since 0.9.8 + */ +class BootInputHorizontal extends BootInput +{ + /** + * Runs the widget. + */ + public function run() + { + echo CHtml::openTag('div', array('class'=>'control-group '.$this->getContainerCssClass())); + parent::run(); + echo ''; + } + + /** + * Returns the label for this block. + * @param array $htmlOptions additional HTML attributes + * @return string the label + */ + protected function getLabel($htmlOptions = array()) + { + $classes = 'control-label'; + if (isset($htmlOptions['class'])) + $htmlOptions['class'] .= ' '.$classes; + else + $htmlOptions['class'] = $classes; + + return parent::getLabel($htmlOptions); + } + + /** + * Renders a checkbox. + * @return string the rendered content + */ + protected function checkBox() + { + $attribute = $this->attribute; + echo '
'; + echo '
'; + } + + /** + * Renders a list of checkboxes. + * @return string the rendered content + */ + protected function checkBoxList() + { + echo $this->getLabel(); + echo '
'; + echo $this->form->checkBoxList($this->model, $this->attribute, $this->data, $this->htmlOptions); + echo $this->getError().$this->getHint(); + echo '
'; + } + + /** + * Renders a list of inline checkboxes. + * @return string the rendered content + */ + protected function checkBoxListInline() + { + $this->htmlOptions['inline'] = true; + $this->checkBoxList(); + } + + /** + * Renders a drop down list (select). + * @return string the rendered content + */ + protected function dropDownList() + { + echo $this->getLabel(); + echo '
'; + echo $this->form->dropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions); + echo $this->getError().$this->getHint(); + echo '
'; + } + + /** + * Renders a file field. + * @return string the rendered content + */ + protected function fileField() + { + echo $this->getLabel(); + echo '
'; + echo $this->form->fileField($this->model, $this->attribute, $this->htmlOptions); + echo $this->getError().$this->getHint(); + echo '
'; + } + + /** + * Renders a password field. + * @return string the rendered content + */ + protected function passwordField() + { + echo $this->getLabel(); + echo '
'; + echo $this->getPrepend(); + echo $this->form->passwordField($this->model, $this->attribute, $this->htmlOptions); + echo $this->getAppend(); + echo $this->getError().$this->getHint(); + echo '
'; + } + + /** + * Renders a radio button. + * @return string the rendered content + */ + protected function radioButton() + { + $attribute = $this->attribute; + echo '
'; + echo '
'; + } + + /** + * Renders a list of radio buttons. + * @return string the rendered content + */ + protected function radioButtonList() + { + echo $this->getLabel(); + echo '
'; + echo $this->form->radioButtonList($this->model, $this->attribute, $this->data, $this->htmlOptions); + echo $this->getError().$this->getHint(); + echo '
'; + } + + /** + * Renders a list of inline radio buttons. + * @return string the rendered content + */ + protected function radioButtonListInline() + { + $this->htmlOptions['inline'] = true; + $this->radioButtonList(); + } + + /** + * Renders a textarea. + * @return string the rendered content + */ + protected function textArea() + { + echo $this->getLabel(); + echo '
'; + echo $this->form->textArea($this->model, $this->attribute, $this->htmlOptions); + echo $this->getError().$this->getHint(); + echo '
'; + } + + /** + * Renders a text field. + * @return string the rendered content + */ + protected function textField() + { + echo $this->getLabel(); + echo '
'; + echo $this->getPrepend(); + echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions); + echo $this->getAppend(); + echo $this->getError().$this->getHint(); + echo '
'; + } + + /** + * Renders a CAPTCHA. + * @return string the rendered content + */ + protected function captcha() + { + echo $this->getLabel(); + echo '
'; + echo '
'.$this->widget('CCaptcha', $this->data, true).'
'; + echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions); + echo $this->getError().$this->getHint(); + echo '
'; + } + + /** + * Renders an uneditable field. + * @return string the rendered content + */ + protected function uneditableField() + { + echo $this->getLabel(); + echo '
'; + echo CHtml::tag('span', $this->htmlOptions, $this->model->{$this->attribute}); + echo $this->getError().$this->getHint(); + echo '
'; + } +} diff --git a/protected/extensions/bootstrap/widgets/input/BootInputInline.php b/protected/extensions/bootstrap/widgets/input/BootInputInline.php new file mode 100644 index 0000000..8162bcd --- /dev/null +++ b/protected/extensions/bootstrap/widgets/input/BootInputInline.php @@ -0,0 +1,57 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets.input + */ + +Yii::import('bootstrap.widgets.input.BootInputVertical'); + +/** + * Bootstrap vertical form input widget. + * @since 0.9.8 + */ +class BootInputInline extends BootInputVertical +{ + /** + * Renders a drop down list (select). + * @return string the rendered content + */ + protected function dropDownList() + { + echo $this->getLabel(); + echo $this->form->dropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions); + } + + /** + * Renders a password field. + * @return string the rendered content + */ + protected function passwordField() + { + $this->htmlOptions['placeholder'] = $this->model->getAttributeLabel($this->attribute); + echo $this->form->passwordField($this->model, $this->attribute, $this->htmlOptions); + } + + /** + * Renders a textarea. + * @return string the rendered content + */ + protected function textArea() + { + $this->htmlOptions['placeholder'] = $this->model->getAttributeLabel($this->attribute); + echo $this->form->textArea($this->model, $this->attribute, $this->htmlOptions); + } + + /** + * Renders a text field. + * @return string the rendered content + */ + protected function textField() + { + $this->htmlOptions['placeholder'] = $this->model->getAttributeLabel($this->attribute); + echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions); + } +} diff --git a/protected/extensions/bootstrap/widgets/input/BootInputSearch.php b/protected/extensions/bootstrap/widgets/input/BootInputSearch.php new file mode 100644 index 0000000..03955af --- /dev/null +++ b/protected/extensions/bootstrap/widgets/input/BootInputSearch.php @@ -0,0 +1,34 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets.input + */ + +Yii::import('bootstrap.widgets.input.BootInputInline'); + +/** + * Bootstrap vertical form input widget. + * @since 0.9.8 + */ +class BootInputSearch extends BootInputInline +{ + /** + * Renders a text field. + * @return string the rendered content + */ + protected function textField() + { + $classes = 'search-query'; + if (isset($this->htmlOptions['class'])) + $this->htmlOptions['class'] .= ' '.$classes; + else + $this->htmlOptions['class'] = $classes; + + $this->htmlOptions['placeholder'] = $this->model->getAttributeLabel($this->attribute); + echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions); + echo $this->getError().$this->getHint(); + } +} diff --git a/protected/extensions/bootstrap/widgets/input/BootInputVertical.php b/protected/extensions/bootstrap/widgets/input/BootInputVertical.php new file mode 100644 index 0000000..74e150b --- /dev/null +++ b/protected/extensions/bootstrap/widgets/input/BootInputVertical.php @@ -0,0 +1,170 @@ + + * @copyright Copyright © Christoffer Niska 2011- + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @package bootstrap.widgets.input + */ + +Yii::import('bootstrap.widgets.input.BootInput'); + +/** + * Bootstrap vertical form input widget. + * @since 0.9.8 + */ +class BootInputVertical extends BootInput +{ + /** + * Renders a CAPTCHA. + * @return string the rendered content + */ + protected function captcha() + { + echo $this->getLabel().'
'; + echo '
'.$this->widget('CCaptcha', $this->data, true).'
'; + echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions); + echo $this->getError().$this->getHint(); + echo '
'; + } + + /** + * Renders a checkbox. + * @return string the rendered content + */ + protected function checkBox() + { + $attribute = $this->attribute; + echo ''; + } + + /** + * Renders a list of checkboxes. + * @return string the rendered content + */ + protected function checkBoxList() + { + echo $this->getLabel(); + echo $this->form->checkBoxList($this->model, $this->attribute, $this->data, $this->htmlOptions); + echo $this->getError().$this->getHint(); + } + + /** + * Renders a list of inline checkboxes. + * @return string the rendered content + */ + protected function checkBoxListInline() + { + $this->htmlOptions['inline'] = true; + $this->checkBoxList(); + } + + /** + * Renders a drop down list (select). + * @return string the rendered content + */ + protected function dropDownList() + { + echo $this->getLabel(); + echo $this->form->dropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions); + echo $this->getError().$this->getHint(); + } + + /** + * Renders a file field. + * @return string the rendered content + */ + protected function fileField() + { + echo $this->getLabel(); + echo $this->form->fileField($this->model, $this->attribute, $this->htmlOptions); + echo $this->getError().$this->getHint(); + } + + /** + * Renders a password field. + * @return string the rendered content + */ + protected function passwordField() + { + echo $this->getLabel(); + echo $this->getPrepend(); + echo $this->form->passwordField($this->model, $this->attribute, $this->htmlOptions); + echo $this->getAppend(); + echo $this->getError().$this->getHint(); + } + + /** + * Renders a radio button. + * @return string the rendered content + */ + protected function radioButton() + { + $attribute = $this->attribute; + echo ''; + } + + /** + * Renders a list of radio buttons. + * @return string the rendered content + */ + protected function radioButtonList() + { + echo $this->getLabel(); + echo $this->form->radioButtonList($this->model, $this->attribute, $this->data, $this->htmlOptions); + echo $this->getError().$this->getHint(); + } + + /** + * Renders a list of inline radio buttons. + * @return string the rendered content + */ + protected function radioButtonListInline() + { + $this->htmlOptions['inline'] = true; + $this->radioButtonList(); + } + + /** + * Renders a textarea. + * @return string the rendered content + */ + protected function textArea() + { + echo $this->getLabel(); + echo $this->form->textArea($this->model, $this->attribute, $this->htmlOptions); + echo $this->getError().$this->getHint(); + } + + /** + * Renders a text field. + * @return string the rendered content + */ + protected function textField() + { + echo $this->getLabel(); + echo $this->getPrepend(); + echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions); + echo $this->getAppend(); + echo $this->getError().$this->getHint(); + } + + /** + * Renders an uneditable field. + * @return string the rendered content + */ + protected function uneditableField() + { + echo $this->getLabel(); + echo CHtml::tag('span', $this->htmlOptions, $this->model->{$this->attribute}); + echo $this->getError().$this->getHint(); + } +} diff --git a/protected/extensions/mailer/EMailer.php b/protected/extensions/mailer/EMailer.php new file mode 100644 index 0000000..29c6844 --- /dev/null +++ b/protected/extensions/mailer/EMailer.php @@ -0,0 +1,219 @@ +. + * + * For third party licenses and copyrights, please see phpmailer/LICENSE + * + */ + +/** + * Include the the PHPMailer class. + */ +require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'phpmailer'.DIRECTORY_SEPARATOR.'class.phpmailer.php'); + +/** + * EMailer is a simple wrapper for the PHPMailer library. + * @see http://phpmailer.codeworxtech.com/index.php?pg=phpmailer + * + * @author MetaYii + * @package application.extensions.emailer + * @since 1.0 + */ +class EMailer +{ + //*************************************************************************** + // Configuration + //*************************************************************************** + + /** + * The path to the directory where the view for getView is stored. Must not + * have ending dot. + * + * @var string + */ + protected $pathViews = 'application.views.email'; + + /** + * The path to the directory where the layout for getView is stored. Must + * not have ending dot. + * + * @var string + */ + protected $pathLayouts = 'application.views.email.layouts'; + + //*************************************************************************** + // Private properties + //*************************************************************************** + + /** + * The internal PHPMailer object. + * + * @var object PHPMailer + */ + private $_myMailer; + + //*************************************************************************** + // Initialization + //*************************************************************************** + + /** + * Init method for the application component mode. + */ + public function init() {} + + /** + * Constructor. Here the instance of PHPMailer is created. + */ + public function __construct() + { + $this->_myMailer = new PHPMailer(); + } + + //*************************************************************************** + // Setters and getters + //*************************************************************************** + + /** + * Setter + * + * @param string $value pathLayouts + */ + public function setPathLayouts($value) + { + if (!is_string($value) && !preg_match("/[a-z0-9\.]/i")) + throw new CException(Yii::t('EMailer', 'pathLayouts must be a Yii alias path')); + $this->pathLayouts = $value; + } + + /** + * Getter + * + * @return string pathLayouts + */ + public function getPathLayouts() + { + return $this->pathLayouts; + } + + /** + * Setter + * + * @param string $value pathViews + */ + public function setPathViews($value) + { + if (!is_string($value) && !preg_match("/[a-z0-9\.]/i")) + throw new CException(Yii::t('EMailer', 'pathViews must be a Yii alias path')); + $this->pathViews = $value; + } + + /** + * Getter + * + * @return string pathViews + */ + public function getPathViews() + { + return $this->pathViews; + } + + //*************************************************************************** + // Magic + //*************************************************************************** + + /** + * Call a PHPMailer function + * + * @param string $method the method to call + * @param array $params the parameters + * @return mixed + */ + public function __call($method, $params) + { + if (is_object($this->_myMailer) && get_class($this->_myMailer)==='PHPMailer') return call_user_func_array(array($this->_myMailer, $method), $params); + else throw new CException(Yii::t('EMailer', 'Can not call a method of a non existent object')); + } + + /** + * Setter + * + * @param string $name the property name + * @param string $value the property value + */ + public function __set($name, $value) + { + if (is_object($this->_myMailer) && get_class($this->_myMailer)==='PHPMailer') $this->_myMailer->$name = $value; + else throw new CException(Yii::t('EMailer', 'Can not set a property of a non existent object')); + } + + /** + * Getter + * + * @param string $name + * @return mixed + */ + public function __get($name) + { + if (is_object($this->_myMailer) && get_class($this->_myMailer)==='PHPMailer') return $this->_myMailer->$name; + else throw new CException(Yii::t('EMailer', 'Can not access a property of a non existent object')); + } + + /** + * Cleanup work before serializing. + * This is a PHP defined magic method. + * @return array the names of instance-variables to serialize. + */ + public function __sleep() + { + } + + /** + * This method will be automatically called when unserialization happens. + * This is a PHP defined magic method. + */ + public function __wakeup() + { + } + + //*************************************************************************** + // Utilities + //*************************************************************************** + + /** + * Displays an e-mail in preview mode. + * + * @param string $view the class + * @param array $vars + * @param string $layout + */ + public function getView($view, $vars = array(), $layout = null) + { + $body = Yii::app()->controller->renderPartial($this->pathViews.'.'.$view, array_merge($vars, array('content'=>$this->_myMailer)), true); + if ($layout === null) { + $this->_myMailer->Body = $body; + } + else { + $this->_myMailer->Body = Yii::app()->controller->renderPartial($this->pathLayouts.'.'.$layout, array('content'=>$body), true); + } + } +} \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/ChangeLog.txt b/protected/extensions/mailer/phpmailer/ChangeLog.txt new file mode 100644 index 0000000..f7d81c9 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/ChangeLog.txt @@ -0,0 +1,373 @@ +ChangeLog + +NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6. + IT WILL NOT WORK WITH PHP4. + +Version 5.0.0 (April 02, 2009) + +* With the release of this version, we are initiating a new version numbering + system to differentiate from the PHP4 version of PHPMailer. +* Most notable in this release is fully object oriented code. +class.smtp.php: +* Refactored class.smtp.php to support new exception handling + code size reduced from 29.2 Kb to 25.6 Kb +* Removed unnecessary functions from class.smtp.php: + public function Expand($name) { + public function Help($keyword="") { + public function Noop() { + public function Send($from) { + public function SendOrMail($from) { + public function Verify($name) { +class.phpmailer.php: +* Refactored class.phpmailer.php with new exception handling +* Changed processing functionality of Sendmail and Qmail so they cannot be + inadvertently used +* removed getFile() function, just became a simple wrapper for + file_get_contents() +* added check for PHP version (will gracefully exit if not at least PHP 5.0) +class.phpmailer.php enhancements +* enhanced code to check if an attachment source is the same as an embedded or + inline graphic source to eliminate duplicate attachments +New /test_script +* We have written a test script you can use to test the script as part of your + installation. Once you press submit, the test script will send a multi-mime + email with either the message you type in or an HTML email with an inline + graphic. Two attachments are included in the email (one of the attachments + is also the inline graphic so you can see that only one copy of the graphic + is sent in the email). The test script will also display the functional + script that you can copy/paste to your editor to duplicate the functionality. +New examples +* All new examples in both basic and advanced modes. Advanced examples show + Exception handling. +PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0 +* all new documentation + +Please note: the website has been updated to reflect the changes in PHPMailer +version 5.0.0. http://phpmailer.codeworxtech.com/ + +Version 2.3 (November 06, 2008) + +* added Arabic language (many thanks to Bahjat Al Mostafa) +* removed English language from language files and made it a default within + class.phpmailer.php - if no language is found, it will default to use + the english language translation +* fixed public/private declarations +* corrected line 1728, $basedir to $directory +* added $sign_cert_file to avoid improper duplicate use of $sign_key_file +* corrected $this->Hello on line 612 to $this->Helo +* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user + if default is not acceptable +* removed trim() from return results in EncodeQP +* /test and three files it contained are removed from version 2.3 +* fixed phpunit.php for compliance with PHP5 +* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg); +* We have removed the /phpdoc from the downloads. All documentation is now on + the http://phpmailer.codeworxtech.com website. + +Version 2.2.1 () July 19 2008 + +* fixed line 1092 in class.smtp.php (my apologies, error on my part) + +Version 2.2 () July 15 2008 + +* Fixed redirect issue (display of UTF-8 in thank you redirect) +* fixed error in getResponse function declaration (class.pop3.php) +* PHPMailer now PHP6 compliant +* fixed line 1092 in class.smtp.php (endless loop from missing = sign) + +Version 2.1 (Wed, June 04 2008) + +** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. + IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE + APPRECIATED. + +* added S/MIME functionality (ability to digitally sign emails) + BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. + The "Signed Emails" functionality adds the Sign method to pass the private key + filename and the password to read it, and then email will be sent with + content-type multipart/signed and with the digital signature attached. +* fully compatible with E_STRICT error level + - Please note: + In about half the test environments this development version was subjected + to, an error was thrown for the date() functions used (line 1565 and 1569). + This is NOT a PHPMailer error, it is the result of an incorrectly configured + PHP5 installation. The fix is to modify your 'php.ini' file and include the + date.timezone = America/New York + directive, to your own server timezone + - If you do get this error, and are unable to access your php.ini file: + In your PHP script, add + date_default_timezone_set('America/Toronto'); + - do not try to use + $myVar = date_default_timezone_get(); + as a test, it will throw an error. +* added ability to define path (mainly for embedded images) + function MsgHTML($message,$basedir='') ... where: + $basedir is the fully qualified path +* fixed MsgHTML() function: + - Embedded Images where images are specified by :// will not be altered or embedded +* fixed the return value of SMTP exit code ( pclose ) +* addressed issue of multibyte characters in subject line and truncating +* added ability to have user specified Message ID + (default is still that PHPMailer create a unique Message ID) +* corrected unidentified message type to 'application/octet-stream' +* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al). +* added check for added attachments +* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny") + +Version 2.1.0beta2 (Sun, Dec 02 2007) +* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon) +* finished all testing, all known bugs corrected, enhancements tested +- note: will NOT work with PHP4. + +please note, this is BETA software +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS +INTENDED STRICTLY FOR TESTING + +Version 2.1.0beta1 +please note, this is BETA software +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS +INTENDED STRICTLY FOR TESTING + +Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release +* implements new property to control VERP in class.smtp.php + example (requires instantiating class.smtp.php): + $mail->do_verp = true; +* POP-before-SMTP functionality included, thanks to Richard Davey + (see class.pop3.php & pop3_before_smtp_test.php for examples) +* included example showing how to use PHPMailer with GMAIL +* fixed the missing Cc in SendMail() and Mail() + +****************** +A note on sending bulk emails: + +If the email you are sending is not personalized, consider using the +"undisclosed-recipient:;" strategy. That is, put all of your recipients +in the Bcc field and set the To field to "undisclosed-recipients:;". +It's a lot faster (only one send) and saves quite a bit on resources. +Contrary to some opinions, this will not get you listed in spam engines - +it's a legitimate way for you to send emails. + +A partial example for use with PHPMailer: + +$mail->AddAddress("undisclosed-recipients:;"); +$mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com"); + +Many email service providers restrict the number of emails that can be sent +in any given time period. Often that is between 50 - 60 emails maximum +per hour or per send session. + +If that's the case, then break up your Bcc lists into chunks that are one +less than your limit, and put a pause in your script. +******************* + +Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release +* dramatically simplified using inline graphics ... it's fully automated and requires no user input +* added automatic document type detection for attachments and pictures +* added MsgHTML() function to replace Body tag for HTML emails +* fixed the SendMail security issues (input validation vulnerability) +* enhanced the AddAddresses functionality so that the "Name" portion is used in the email address +* removed the need to use the AltBody method (set from the HTML, or default text used) +* set the PHP Mail() function as the default (still support SendMail, SMTP Mail) +* removed the need to set the IsHTML property (set automatically) +* added Estonian language file by Indrek Päri +* added header injection patch +* added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc. + example of use: + $mail->set('X-Priority', '3'); + $mail->set('X-MSMail-Priority', 'Normal'); +* fixed warning message in SMTP get_lines method +* added TLS/SSL SMTP support + example of use: + $mail = new PHPMailer(); + $mail->Mailer = "smtp"; + $mail->Host = "smtp.example.com"; + $mail->SMTPSecure = "tls"; // option + //$mail->SMTPSecure = "ssl"; // option + ... + $mail->Send(); +* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7) +* Works with PHP installed as a module or as CGI-PHP +- NOTE: will NOT work with PHP5 in E_STRICT error mode + +Version 1.73 (Sun, Jun 10 2005) +* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf +* Now has a total of 20 translations +* Fixed alt attachments bug: http://tinyurl.com/98u9k + +Version 1.72 (Wed, May 25 2004) +* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations. +* Received: Removed this method because spam filter programs like +SpamAssassin reject this header. +* Fixed error count bug. +* SetLanguage default is now "language/". +* Fixed magic_quotes_runtime bug. + +Version 1.71 (Tue, Jul 28 2003) +* Made several speed enhancements +* Added German and Italian translation files +* Fixed HELO/AUTH bugs on keep-alive connects +* Now provides an error message if language file does not load +* Fixed attachment EOL bug +* Updated some unclear documentation +* Added additional tests and improved others + +Version 1.70 (Mon, Jun 20 2003) +* Added SMTP keep-alive support +* Added IsError method for error detection +* Added error message translation support (SetLanguage) +* Refactored many methods to increase library performance +* Hello now sends the newer EHLO message before HELO as per RFC 2821 +* Removed the boundary class and replaced it with GetBoundary +* Removed queue support methods +* New $Hostname variable +* New Message-ID header +* Received header reformat +* Helo variable default changed to $Hostname +* Removed extra spaces in Content-Type definition (#667182) +* Return-Path should be set to Sender when set +* Adds Q or B encoding to headers when necessary +* quoted-encoding should now encode NULs \000 +* Fixed encoding of body/AltBody (#553370) +* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC) +* Multiple bug fixes + +Version 1.65 (Fri, Aug 09 2002) +* Fixed non-visible attachment bug (#585097) for Outlook +* SMTP connections are now closed after each transaction +* Fixed SMTP::Expand return value +* Converted SMTP class documentation to phpDocumentor format + +Version 1.62 (Wed, Jun 26 2002) +* Fixed multi-attach bug +* Set proper word wrapping +* Reduced memory use with attachments +* Added more debugging +* Changed documentation to phpDocumentor format + +Version 1.60 (Sat, Mar 30 2002) +* Sendmail pipe and address patch (Christian Holtje) +* Added embedded image and read confirmation support (A. Ognio) +* Added unit tests +* Added SMTP timeout support (*nix only) +* Added possibly temporary PluginDir variable for SMTP class +* Added LE message line ending variable +* Refactored boundary and attachment code +* Eliminated SMTP class warnings +* Added SendToQueue method for future queuing support + +Version 1.54 (Wed, Dec 19 2001) +* Add some queuing support code +* Fixed a pesky multi/alt bug +* Messages are no longer forced to have "To" addresses + +Version 1.50 (Thu, Nov 08 2001) +* Fix extra lines when not using SMTP mailer +* Set WordWrap variable to int with a zero default + +Version 1.47 (Tue, Oct 16 2001) +* Fixed Received header code format +* Fixed AltBody order error +* Fixed alternate port warning + +Version 1.45 (Tue, Sep 25 2001) +* Added enhanced SMTP debug support +* Added support for multiple ports on SMTP +* Added Received header for tracing +* Fixed AddStringAttachment encoding +* Fixed possible header name quote bug +* Fixed wordwrap() trim bug +* Couple other small bug fixes + +Version 1.41 (Wed, Aug 22 2001) +* Fixed AltBody bug w/o attachments +* Fixed rfc_date() for certain mail servers + +Version 1.40 (Sun, Aug 12 2001) +* Added multipart/alternative support (AltBody) +* Documentation update +* Fixed bug in Mercury MTA + +Version 1.29 (Fri, Aug 03 2001) +* Added AddStringAttachment() method +* Added SMTP authentication support + +Version 1.28 (Mon, Jul 30 2001) +* Fixed a typo in SMTP class +* Fixed header issue with Imail (win32) SMTP server +* Made fopen() calls for attachments use "rb" to fix win32 error + +Version 1.25 (Mon, Jul 02 2001) +* Added RFC 822 date fix (Patrice) +* Added improved error handling by adding a $ErrorInfo variable +* Removed MailerDebug variable (obsolete with new error handler) + +Version 1.20 (Mon, Jun 25 2001) +* Added quoted-printable encoding (Patrice) +* Set Version as public and removed PrintVersion() +* Changed phpdoc to only display public variables and methods + +Version 1.19 (Thu, Jun 21 2001) +* Fixed MS Mail header bug +* Added fix for Bcc problem with mail(). *Does not work on Win32* + (See PHP bug report: http://www.php.net/bugs.php?id=11616) +* mail() no longer passes a fifth parameter when not needed + +Version 1.15 (Fri, Jun 15 2001) +[Note: these changes contributed by Patrice Fournier] +* Changed all remaining \n to \r\n +* Bcc: header no longer writen to message except +when sent directly to sendmail +* Added a small message to non-MIME compliant mail reader +* Added Sender variable to change the Sender email +used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode +* Changed boundary setting to a place it will be set only once +* Removed transfer encoding for whole message when using multipart +* Message body now uses Encoding in multipart messages +* Can set encoding and type to attachments 7bit, 8bit +and binary attachment are sent as is, base64 are encoded +* Can set Encoding to base64 to send 8 bits body +through 7 bits servers + +Version 1.10 (Tue, Jun 12 2001) +* Fixed win32 mail header bug (printed out headers in message body) + +Version 1.09 (Fri, Jun 08 2001) +* Changed date header to work with Netscape mail programs +* Altered phpdoc documentation + +Version 1.08 (Tue, Jun 05 2001) +* Added enhanced error-checking +* Added phpdoc documentation to source + +Version 1.06 (Fri, Jun 01 2001) +* Added optional name for file attachments + +Version 1.05 (Tue, May 29 2001) +* Code cleanup +* Eliminated sendmail header warning message +* Fixed possible SMTP error + +Version 1.03 (Thu, May 24 2001) +* Fixed problem where qmail sends out duplicate messages + +Version 1.02 (Wed, May 23 2001) +* Added multiple recipient and attachment Clear* methods +* Added Sendmail public variable +* Fixed problem with loading SMTP library multiple times + +Version 0.98 (Tue, May 22 2001) +* Fixed problem with redundant mail hosts sending out multiple messages +* Added additional error handler code +* Added AddCustomHeader() function +* Added support for Microsoft mail client headers (affects priority) +* Fixed small bug with Mailer variable +* Added PrintVersion() function + +Version 0.92 (Tue, May 15 2001) +* Changed file names to class.phpmailer.php and class.smtp.php to match + current PHP class trend. +* Fixed problem where body not being printed when a message is attached +* Several small bug fixes + +Version 0.90 (Tue, April 17 2001) +* Intial public release diff --git a/protected/extensions/mailer/phpmailer/LICENSE b/protected/extensions/mailer/phpmailer/LICENSE new file mode 100644 index 0000000..f3f1b3b --- /dev/null +++ b/protected/extensions/mailer/phpmailer/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/protected/extensions/mailer/phpmailer/README b/protected/extensions/mailer/phpmailer/README new file mode 100644 index 0000000..8d48dc0 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/README @@ -0,0 +1,218 @@ +/******************************************************************* +* The http://phpmailer.codeworxtech.com/ website now carries a few * +* advertisements through the Google Adsense network. Please visit * +* the advertiser sites and help us offset some of our costs. * +* Thanks .... * +********************************************************************/ + +PHPMailer +Full Featured Email Transfer Class for PHP +========================================== + +Version 5.0.0 (April 02, 2009) + +With the release of this version, we are initiating a new version numbering +system to differentiate from the PHP4 version of PHPMailer. + +Most notable in this release is fully object oriented code. + +We now have available the PHPDocumentor (phpdocs) documentation. This is +separate from the regular download to keep file sizes down. Please see the +download area of http://phpmailer.codeworxtech.com. + +We also have created a new test script (see /test_script) that you can use +right out of the box. Copy the /test_script folder directly to your server (in +the same structure ... with class.phpmailer.php and class.smtp.php in the +folder above it. Then launch the test script with: +http://www.yourdomain.com/phpmailer/test_script/index.php +from this one script, you can test your server settings for mail(), sendmail (or +qmail), and SMTP. This will email you a sample email (using contents.html for +the email body) and two attachments. One of the attachments is used as an inline +image to demonstrate how PHPMailer will automatically detect if attachments are +the same source as inline graphics and only include one version. Once you click +the Submit button, the results will be displayed including any SMTP debug +information and send status. We will also display a version of the script that +you can cut and paste to include in your projects. Enjoy! + +Version 2.3 (November 08, 2008) + +We have removed the /phpdoc from the downloads. All documentation is now on +the http://phpmailer.codeworxtech.com website. + +The phpunit.php has been updated to support PHP5. + +For all other changes and notes, please see the changelog. + +Donations are accepted at PayPal with our id "paypal@worxteam.com". + +Version 2.2 (July 15 2008) + +- see the changelog. + +Version 2.1 (June 04 2008) + +With this release, we are announcing that the development of PHPMailer for PHP5 +will be our focus from this date on. We have implemented all the enhancements +and fixes from the latest release of PHPMailer for PHP4. + +Far more important, though, is that this release of PHPMailer (v2.1) is +fully tested with E_STRICT error checking enabled. + +** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. + IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE + APPRECIATED. + +We have now added S/MIME functionality (ability to digitally sign emails). +BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. +The "Signed Emails" functionality adds the Sign method to pass the private key +filename and the password to read it, and then email will be sent with +content-type multipart/signed and with the digital signature attached. + +A quick note on E_STRICT: + +- In about half the test environments the development version was subjected + to, an error was thrown for the date() functions (used at line 1565 and 1569). + This is NOT a PHPMailer error, it is the result of an incorrectly configured + PHP5 installation. The fix is to modify your 'php.ini' file and include the + date.timezone = America/New York + directive, (for your own server timezone) +- If you do get this error, and are unable to access your php.ini file, there is + a workaround. In your PHP script, add + date_default_timezone_set('America/Toronto'); + + * do NOT try to use + $myVar = date_default_timezone_get(); + as a test, it will throw an error. + +We have also included more example files to show the use of "sendmail", "mail()", +"smtp", and "gmail". + +We are also looking for more programmers to join the volunteer development team. +If you have an interest in this, please let us know. + +Enjoy! + + +Version 2.1.0beta1 & beta2 + +please note, this is BETA software +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS +INTENDED STRICTLY FOR TESTING + +** NOTE: + +As of November 2007, PHPMailer has a new project team headed by industry +veteran Andy Prevost (codeworxtech). The first release in more than two +years will focus on fixes, adding ease-of-use enhancements, provide +basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility +features. A new release is planned before year-end 2007 that will provide +full compatiblity with PHP4 and PHP5, as well as more bug fixes. + +We are looking for project developers to assist in restoring PHPMailer to +its leadership position. Our goals are to simplify use of PHPMailer, provide +good documentation and examples, and retain backward compatibility to level +1.7.3 standards. + +If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer +and indicate your interest. + +** + +http://phpmailer.sourceforge.net/ + +This software is licenced under the LGPL. Please read LICENSE for information on the +software availability and distribution. + +Class Features: +- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs +- Redundant SMTP servers +- Multipart/alternative emails for mail clients that do not read HTML email +- Support for 8bit, base64, binary, and quoted-printable encoding +- Uses the same methods as the very popular AspEmail active server (COM) component +- SMTP authentication +- Native language support +- Word wrap, and more! + +Why you might need it: + +Many PHP developers utilize email in their code. The only PHP function +that supports this is the mail() function. However, it does not expose +any of the popular features that many email clients use nowadays like +HTML-based emails and attachments. There are two proprietary +development tools out there that have all the functionality built into +easy to use classes: AspEmail(tm) and AspMail. Both of these +programs are COM components only available on Windows. They are also a +little pricey for smaller projects. + +Since I do Linux development I�ve missed these tools for my PHP coding. +So I built a version myself that implements the same methods (object +calls) that the Windows-based components do. It is open source and the +LGPL license allows you to place the class in your proprietary PHP +projects. + + +Installation: + +Copy class.phpmailer.php into your php.ini include_path. If you are +using the SMTP mailer then place class.smtp.php in your path as well. +In the language directory you will find several files like +phpmailer.lang-en.php. If you look right before the .php extension +that there are two letters. These represent the language type of the +translation file. For instance "en" is the English file and "br" is +the Portuguese file. Chose the file that best fits with your language +and place it in the PHP include path. If your language is English +then you have nothing more to do. If it is a different language then +you must point PHPMailer to the correct translation. To do this, call +the PHPMailer SetLanguage method like so: + +// To load the Portuguese version +$mail->SetLanguage("br", "/optional/path/to/language/directory/"); + +That's it. You should now be ready to use PHPMailer! + + +A Simple Example: + +IsSMTP(); // set mailer to use SMTP +$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server +$mail->SMTPAuth = true; // turn on SMTP authentication +$mail->Username = "jswan"; // SMTP username +$mail->Password = "secret"; // SMTP password + +$mail->From = "from@example.com"; +$mail->FromName = "Mailer"; +$mail->AddAddress("josh@example.net", "Josh Adams"); +$mail->AddAddress("ellen@example.com"); // name is optional +$mail->AddReplyTo("info@example.com", "Information"); + +$mail->WordWrap = 50; // set word wrap to 50 characters +$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments +$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name +$mail->IsHTML(true); // set email format to HTML + +$mail->Subject = "Here is the subject"; +$mail->Body = "This is the HTML message body in bold!"; +$mail->AltBody = "This is the body in plain text for non-HTML mail clients"; + +if(!$mail->Send()) +{ + echo "Message could not be sent.

"; + echo "Mailer Error: " . $mail->ErrorInfo; + exit; +} + +echo "Message has been sent"; +?> + +CHANGELOG + +See ChangeLog.txt + +Download: http://sourceforge.net/project/showfiles.php?group_id=26031 + +Andy Prevost diff --git a/protected/extensions/mailer/phpmailer/aboutus.html b/protected/extensions/mailer/phpmailer/aboutus.html new file mode 100644 index 0000000..79c45ed --- /dev/null +++ b/protected/extensions/mailer/phpmailer/aboutus.html @@ -0,0 +1,169 @@ + + + + + + +

+
+
+The http://phpmailer.codeworxtech.com/ website now carries a few +advertisements through the Google Adsense network to help offset +some of our costs.
+Thanks ....
+
+

PHPMailer is the world's leading email transport class and downloaded an +average of more than 26,000 each month. In March 2009, PHPMailer was downloaded +more than 31,000 times -- that's an average of 1,000 downloads daily. Our thanks +to our new users and loyal users. We understand you have many choices available +to select from and we thank you for select our fast and stable tool for your +website and projects.

+

Credits:
+PHPMailer's original founder is Brent Matzelle. The current team is:
+Project Administrator: Andy Prevost (codeworxtech), + +codeworxtech@users.sourceforge.net
+Author: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net
+Author: Marcus Bointon (coolbru) +coolbru@users.sourceforge.net

+

PHPMailer is used in many projects ranging from Open Source to commercial +packages. Our LGPL licensing terms are very flexible and allow for including +PHPMailer to enhance projects of all types. If you discover PHPMailer being used +in a project, please let us know about it.

+

WHY USE OUR TOOLS & WHAT'S IN IT FOR YOU?

+

A valid question. We're developers too. We've been writing software, primarily for the internet, for more than 15 years. Along the way, there are two major things that had tremendous impact of our company: PHP and Open Source. PHP is without doubt the most popular platform for the internet. There has been more progress in this area of technology because of Open Source software than in any other IT segment. We have used many open source tools, some as learning tools, some as components in projects we were working on. To us, it's not about popularity ... we're committed to robust, stable, and efficient tools you can use to get your projects in your user's hands quickly. So the shorter answer: what's in it for you? rapid development and rapid deployment without fuss and with straight forward open source licensing.

+

Now, here's our team:

+ + + + + + + + + +
About Andy Prevost, AKA "codeworxtech".About Marcus Bointon, AKA "coolbru".
+

www.codeworxtech.com for more information.
+ Web design, web applications, forms: WorxStudio.com
+

+

Our company, Worx International Inc., is the publisher of several Open Source applications and developer tools as well as several commercial PHP applications. The Open Source applications are ttCMS and DCP Portal. The Open Source developer tools include QuickComponents (QuickSkin and QuickCache) and now PHPMailer. + We have staff and offices in the United States, Caribbean, the Middle + East, and our primary development center in Canada. Our company is represented by + agents and resellers globally.

+

Worx International Inc. is at the forefront of developing PHP applications. Our staff are all Zend Certified university educated and experts at object oriented programming. While Worx International Inc. can handle any project from trouble shooting programs written by others all the way to finished mission-critical applications, we specialize in taking projects from inception all the way through to implementation - on budget, and on time. If you need help with your projects, we're the team to get it done right at a reasonable price.

+

Over the years, there have been a number of tools that have been constant favorites in all of our projects. We have become the project administrators for most of these tools.

+

Our developer tools are all Open Source. Here's a brief description:

+
    +
  • PHPMailer. Originally authored by Brent Matzelle, PHPMailer is the leading "email transfer class" for PHP. PHPMailer is downloaded more than + 26000 times each and every month by developers looking for a fast, stable, simple email solution. We used it ourselves for years as our favorite tool. It's always been small (the entire footprint is + less than 100 Kb), stable, and as complete a solution as you can find. + Other tools are nowhere near as simple. Our thanks to Brent Matzelle for this superb tool - our commitment is to keep it lean, keep it focused, and compliant with standards. Visit the PHPMailer website at + http://phpmailer.codeworxtech.com/.
    + Please note: all of our focus is now on the PHPMailer for PHP5.
    + PS. While you are at it, please visit our sponsor's sites, click on their ads. + It helps offset some of our costs.
    + Want to help? We're looking for progressive developers to join our team of volunteer professionals working on PHPMailer. Our entire focus is on PHPMailer + for PHP5. If you are interested, let us know.
    +
    +
  • +
  • QuickCache. Originally authored by Jean Pierre Deckers as jpCache, QuickCache is an HTTP OpCode caching strategy that works on your entire site with only one line of code at the top of your script. The cached pages can be stored as files or as database objects. The benefits are absolutely astounding: bandwidth savings of up to 80% and screen display times increased by 8 - 10x. Visit the QuickCache website at + http://quickcache.codeworxtech.com/.
    +
    +
  • +
  • QuickSkin. Originally authored by Philipp v. Criegern and named "SmartTemplate". The project was taken over by Manuel 'EndelWar' Dalla Lana and now by "codeworxtech". QuickSkin is one of the truly outstanding templating engines available, but has always been confused with Smarty Templating Engine. QuickSkin is even more relevant today than when it was launched. It's a small footprint with big impact on your projects. It features a built in caching technology, token based substitution, and works on the concept of one single HTML file as the template. The HTML template file can contain variable information making it one small powerful tool for your developer tool kit. Visit the QuickSkin website at + http://quickskin.codeworxtech.com/.
    +
    +
  • +
+

We're committed to PHP and to the Open Source community.

+

Opportunities with Worx International Inc.:

+
    +
  • Resellers/Agents: We're always interested in talking with companies that + want to represent + Worx International Inc. in their markets. We also have private label programs for our commercial products (in certain circumstances).
  • +
  • Programmers/Developers: We are usually fully staffed, however, if you would like to be considered for a career with + Worx International Inc., we would be pleased to hear from you.
    + A few things to note:
    +
      +
    • experience level does not matter: from fresh out of college to multi-year experience - it's your + creative mind and a positive attitude we want
    • +
    • if you contact us looking for employment, include a cover letter, indicate what type of work/career you are looking for and expected compensation
    • +
    • if you are representing someone else looking for work, do not contact us. We have an exclusive relationship with a recruiting partner already and not interested in altering the arrangement. We will not hire your candidate under any circumstances unless they wish to approach us individually.
    • +
    • any contact that ignores any of these points will be discarded
    • +
  • +
  • Affiliates/Partnerships: We are interested in partnering with other firms who are leaders in their field. We clearly understand that successful companies are built on successful relationships in all industries world-wide. We currently have innovative relationships throughout the world that are mutually beneficial. Drop us a line and let's talk.
  • +
+ Regards,
+ Andy Prevost (aka, codeworxtech)
+ codeworxtech@users.sourceforge.net
+
+ We now also offer website design. hosting, and remote forms processing. Visit WorxStudio.com for more information.
+
+

Marcus is the technical director of Synchromedia Limited, a UK-based company providing online business services. Synchromedia's main services are:

+

Smartmessages.net

+

Smartmessages.net logo
Smartmessages.net
is Synchromedia's large-scale mailing list management system, providing email delivery services for a wide range of businesses, from sole traders to corporates. + We pride ourselves on personal service, and realise that every one of your subscribers is a precious asset to be handled with care. + We provide fast, reliable, high-volume delivery (some of our customers have lists of more than 1,000,000 subscribers) with fine-grained tracking while ensuring you stay fully compliant with UK, EC and US data protection laws. Smartmessages of course uses PHPMailer at its heart!

+

info@hand

+

info@hand logo
Synchromedia is the official UK distributor of info@hand, a class-leading open-source web-based CRM system. We provide licenses, hosting, planning, support and training for this very fully-featured system at very competitive prices. info@hand also uses PHPMailer!

+

How can we help you?

+

In addition to our headline services, we also provide consulting, development, hosting and sysadmin services, so if you just need a simple web hosting package, we can do that too. Not surprisingly, we know rather a lot about email, so you can talk to us about that too.

+

Please contact us if you'd like to know more.

+

Marcus is a regular attendee at PHP London, and occasionally speaks on email at technical conferences.

+
+
+
+ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/class.phpmailer.php b/protected/extensions/mailer/phpmailer/class.phpmailer.php new file mode 100644 index 0000000..92f7832 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/class.phpmailer.php @@ -0,0 +1,2068 @@ +exceptions = ($exceptions == true); + } + + /** + * Sets message type to HTML. + * @param bool $ishtml + * @return void + */ + public function IsHTML($ishtml = true) { + if ($ishtml) { + $this->ContentType = 'text/html'; + } else { + $this->ContentType = 'text/plain'; + } + } + + /** + * Sets Mailer to send message using SMTP. + * @return void + */ + public function IsSMTP() { + $this->Mailer = 'smtp'; + } + + /** + * Sets Mailer to send message using PHP mail() function. + * @return void + */ + public function IsMail() { + $this->Mailer = 'mail'; + } + + /** + * Sets Mailer to send message using the $Sendmail program. + * @return void + */ + public function IsSendmail() { + if (!stristr(ini_get('sendmail_path'), 'sendmail')) { + $this->Sendmail = '/var/qmail/bin/sendmail'; + } + $this->Mailer = 'sendmail'; + } + + /** + * Sets Mailer to send message using the qmail MTA. + * @return void + */ + public function IsQmail() { + if (stristr(ini_get('sendmail_path'), 'qmail')) { + $this->Sendmail = '/var/qmail/bin/sendmail'; + } + $this->Mailer = 'sendmail'; + } + + ///////////////////////////////////////////////// + // METHODS, RECIPIENTS + ///////////////////////////////////////////////// + + /** + * Adds a "To" address. + * @param string $address + * @param string $name + * @return boolean true on success, false if address already used + */ + public function AddAddress($address, $name = '') { + return $this->AddAnAddress('to', $address, $name); + } + + /** + * Adds a "Cc" address. + * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. + * @param string $address + * @param string $name + * @return boolean true on success, false if address already used + */ + public function AddCC($address, $name = '') { + return $this->AddAnAddress('cc', $address, $name); + } + + /** + * Adds a "Bcc" address. + * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. + * @param string $address + * @param string $name + * @return boolean true on success, false if address already used + */ + public function AddBCC($address, $name = '') { + return $this->AddAnAddress('bcc', $address, $name); + } + + /** + * Adds a "Reply-to" address. + * @param string $address + * @param string $name + * @return boolean + */ + public function AddReplyTo($address, $name = '') { + return $this->AddAnAddress('ReplyTo', $address, $name); + } + + /** + * Adds an address to one of the recipient arrays + * Addresses that have been added already return false, but do not throw exceptions + * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo' + * @param string $address The email address to send to + * @param string $name + * @return boolean true on success, false if address already used or invalid in some way + * @access private + */ + private function AddAnAddress($kind, $address, $name = '') { + if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) { + echo 'Invalid recipient array: ' . kind; + return false; + } + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + if (!self::ValidateAddress($address)) { + $this->SetError($this->Lang('invalid_address').': '. $address); + if ($this->exceptions) { + throw new phpmailerException($this->Lang('invalid_address').': '.$address); + } + echo $this->Lang('invalid_address').': '.$address; + return false; + } + if ($kind != 'ReplyTo') { + if (!isset($this->all_recipients[strtolower($address)])) { + array_push($this->$kind, array($address, $name)); + $this->all_recipients[strtolower($address)] = true; + return true; + } + } else { + if (!array_key_exists(strtolower($address), $this->ReplyTo)) { + $this->ReplyTo[strtolower($address)] = array($address, $name); + return true; + } + } + return false; + } + +/** + * Set the From and FromName properties + * @param string $address + * @param string $name + * @return boolean + */ + public function SetFrom($address, $name = '') { + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + if (!self::ValidateAddress($address)) { + $this->SetError($this->Lang('invalid_address').': '. $address); + if ($this->exceptions) { + throw new phpmailerException($this->Lang('invalid_address').': '.$address); + } + echo $this->Lang('invalid_address').': '.$address; + return false; + } + $this->From = $address; + $this->FromName = $name; + return true; + } + + /** + * Check that a string looks roughly like an email address should + * Static so it can be used without instantiation + * Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator + * Conforms approximately to RFC2822 + * @link http://www.hexillion.com/samples/#Regex Original pattern found here + * @param string $address The email address to check + * @return boolean + * @static + * @access public + */ + public static function ValidateAddress($address) { + if (function_exists('filter_var')) { //Introduced in PHP 5.2 + if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) { + return false; + } else { + return true; + } + } else { + return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address); + } + } + + ///////////////////////////////////////////////// + // METHODS, MAIL SENDING + ///////////////////////////////////////////////// + + /** + * Creates message and assigns Mailer. If the message is + * not sent successfully then it returns false. Use the ErrorInfo + * variable to view description of the error. + * @return bool + */ + public function Send() { + try { + if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { + throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL); + } + + // Set whether the message is multipart/alternative + if(!empty($this->AltBody)) { + $this->ContentType = 'multipart/alternative'; + } + + $this->error_count = 0; // reset errors + $this->SetMessageType(); + $header = $this->CreateHeader(); + $body = $this->CreateBody(); + + if (empty($this->Body)) { + throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL); + } + + // Choose the mailer and send through it + switch($this->Mailer) { + case 'sendmail': + return $this->SendmailSend($header, $body); + case 'smtp': + return $this->SmtpSend($header, $body); + case 'mail': + default: + return $this->MailSend($header, $body); + } + + } catch (phpmailerException $e) { + $this->SetError($e->getMessage()); + if ($this->exceptions) { + throw $e; + } + echo $e->getMessage()."\n"; + return false; + } + } + + /** + * Sends mail using the $Sendmail program. + * @param string $header The message headers + * @param string $body The message body + * @access protected + * @return bool + */ + protected function SendmailSend($header, $body) { + if ($this->Sender != '') { + $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); + } else { + $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); + } + if(!@$mail = popen($sendmail, 'w')) { + throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fputs($mail, $header); + fputs($mail, $body); + $result = pclose($mail); + if($result != 0) { + throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + return true; + } + + /** + * Sends mail using the PHP mail() function. + * @param string $header The message headers + * @param string $body The message body + * @access protected + * @return bool + */ + protected function MailSend($header, $body) { + $toArr = array(); + foreach($this->to as $t) { + $toArr[] = $this->AddrFormat($t); + } + $to = implode(', ', $toArr); + + $params = sprintf("-oi -f %s", $this->Sender); + if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) { + $old_from = ini_get('sendmail_from'); + ini_set('sendmail_from', $this->Sender); + if ($this->SingleTo === true && count($toArr) > 1) { + foreach ($toArr as $key => $val) { + $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); + } + } else { + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); + } + } else { + if ($this->SingleTo === true && count($toArr) > 1) { + foreach ($toArr as $key => $val) { + $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); + } + } else { + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header); + } + } + if (isset($old_from)) { + ini_set('sendmail_from', $old_from); + } + if(!$rt) { + throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL); + } + return true; + } + + /** + * Sends mail via SMTP using PhpSMTP + * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. + * @param string $header The message headers + * @param string $body The message body + * @uses SMTP + * @access protected + * @return bool + */ + protected function SmtpSend($header, $body) { + require_once $this->PluginDir . 'class.smtp.php'; + $bad_rcpt = array(); + + if(!$this->SmtpConnect()) { + throw new phpmailerException($this->Lang('smtp_connect_failed'), self::STOP_CRITICAL); + } + $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; + if(!$this->smtp->Mail($smtp_from)) { + throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL); + } + + // Attempt to send attach all recipients + foreach($this->to as $to) { + if (!$this->smtp->Recipient($to[0])) { + $bad_rcpt[] = $to[0]; + } + } + foreach($this->cc as $cc) { + if (!$this->smtp->Recipient($cc[0])) { + $bad_rcpt[] = $cc[0]; + } + } + foreach($this->bcc as $bcc) { + if (!$this->smtp->Recipient($bcc[0])) { + $bad_rcpt[] = $bcc[0]; + } + } + if (count($bad_rcpt) > 0 ) { //Create error message for any bad addresses + $badaddresses = implode(', ', $bad_rcpt); + throw new phpmailerException($this->Lang('recipients_failed') . $badaddresses); + } + if(!$this->smtp->Data($header . $body)) { + throw new phpmailerException($this->Lang('data_not_accepted'), self::STOP_CRITICAL); + } + if($this->SMTPKeepAlive == true) { + $this->smtp->Reset(); + } + return true; + } + + /** + * Initiates a connection to an SMTP server. + * Returns false if the operation failed. + * @uses SMTP + * @access public + * @return bool + */ + public function SmtpConnect() { + if(is_null($this->smtp)) { + $this->smtp = new SMTP(); + } + + $this->smtp->do_debug = $this->SMTPDebug; + $hosts = explode(';', $this->Host); + $index = 0; + $connection = $this->smtp->Connected(); + + // Retry while there is no connection + try { + while($index < count($hosts) && !$connection) { + $hostinfo = array(); + if (preg_match('/^(.+):([0-9]+)$/', $hosts[$index], $hostinfo)) { + $host = $hostinfo[1]; + $port = $hostinfo[2]; + } else { + $host = $hosts[$index]; + $port = $this->Port; + } + + $tls = ($this->SMTPSecure == 'tls'); + $ssl = ($this->SMTPSecure == 'ssl'); + + if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) { + + $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname()); + $this->smtp->Hello($hello); + + if ($tls) { + if (!$this->smtp->StartTLS()) { + throw new phpmailerException($this->Lang('tls')); + } + + //We must resend HELO after tls negotiation + $this->smtp->Hello($hello); + } + + $connection = true; + if ($this->SMTPAuth) { + if (!$this->smtp->Authenticate($this->Username, $this->Password)) { + throw new phpmailerException($this->Lang('authenticate')); + } + } + } + $index++; + if (!$connection) { + throw new phpmailerException($this->Lang('connect_host')); + } + } + } catch (phpmailerException $e) { + $this->smtp->Reset(); + throw $e; + } + return true; + } + + /** + * Closes the active SMTP session if one exists. + * @return void + */ + public function SmtpClose() { + if(!is_null($this->smtp)) { + if($this->smtp->Connected()) { + $this->smtp->Quit(); + $this->smtp->Close(); + } + } + } + + /** + * Sets the language for all class error messages. + * Returns false if it cannot load the language file. The default language is English. + * @param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br") + * @param string $lang_path Path to the language file directory + * @access public + */ + function SetLanguage($langcode = 'en', $lang_path = 'language/') { + //Define full set of translatable strings + $PHPMAILER_LANG = array( + 'provide_address' => 'You must provide at least one recipient email address.', + 'mailer_not_supported' => ' mailer is not supported.', + 'execute' => 'Could not execute: ', + 'instantiate' => 'Could not instantiate mail function.', + 'authenticate' => 'SMTP Error: Could not authenticate.', + 'from_failed' => 'The following From address failed: ', + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', + 'data_not_accepted' => 'SMTP Error: Data not accepted.', + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', + 'file_access' => 'Could not access file: ', + 'file_open' => 'File Error: Could not open file: ', + 'encoding' => 'Unknown encoding: ', + 'signing' => 'Signing Error: ', + 'smtp_error' => 'SMTP server error: ', + 'empty_message' => 'Message body empty', + 'invalid_address' => 'Invalid address', + 'variable_set' => 'Cannot set or reset variable: ' + ); + //Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"! + $l = true; + if ($langcode != 'en') { //There is no English translation file + $l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php'; + } + $this->language = $PHPMAILER_LANG; + return ($l == true); //Returns false if language not found + } + + /** + * Return the current array of language strings + * @return array + */ + public function GetTranslations() { + return $this->language; + } + + ///////////////////////////////////////////////// + // METHODS, MESSAGE CREATION + ///////////////////////////////////////////////// + + /** + * Creates recipient headers. + * @access public + * @return string + */ + public function AddrAppend($type, $addr) { + $addr_str = $type . ': '; + $addresses = array(); + foreach ($addr as $a) { + $addresses[] = $this->AddrFormat($a); + } + $addr_str .= implode(', ', $addresses); + $addr_str .= $this->LE; + + return $addr_str; + } + + /** + * Formats an address correctly. + * @access public + * @return string + */ + public function AddrFormat($addr) { + if (empty($addr[1])) { + return $this->SecureHeader($addr[0]); + } else { + return $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">"; + } + } + + /** + * Wraps message for use with mailers that do not + * automatically perform wrapping and for quoted-printable. + * Original written by philippe. + * @param string $message The message to wrap + * @param integer $length The line length to wrap to + * @param boolean $qp_mode Whether to run in Quoted-Printable mode + * @access public + * @return string + */ + public function WrapText($message, $length, $qp_mode = false) { + $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; + // If utf-8 encoding is used, we will need to make sure we don't + // split multibyte characters when we wrap + $is_utf8 = (strtolower($this->CharSet) == "utf-8"); + + $message = $this->FixEOL($message); + if (substr($message, -1) == $this->LE) { + $message = substr($message, 0, -1); + } + + $line = explode($this->LE, $message); + $message = ''; + for ($i=0 ;$i < count($line); $i++) { + $line_part = explode(' ', $line[$i]); + $buf = ''; + for ($e = 0; $e $length)) { + $space_left = $length - strlen($buf) - 1; + if ($e != 0) { + if ($space_left > 20) { + $len = $space_left; + if ($is_utf8) { + $len = $this->UTF8CharBoundary($word, $len); + } elseif (substr($word, $len - 1, 1) == "=") { + $len--; + } elseif (substr($word, $len - 2, 1) == "=") { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + $buf .= ' ' . $part; + $message .= $buf . sprintf("=%s", $this->LE); + } else { + $message .= $buf . $soft_break; + } + $buf = ''; + } + while (strlen($word) > 0) { + $len = $length; + if ($is_utf8) { + $len = $this->UTF8CharBoundary($word, $len); + } elseif (substr($word, $len - 1, 1) == "=") { + $len--; + } elseif (substr($word, $len - 2, 1) == "=") { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + + if (strlen($word) > 0) { + $message .= $part . sprintf("=%s", $this->LE); + } else { + $buf = $part; + } + } + } else { + $buf_o = $buf; + $buf .= ($e == 0) ? $word : (' ' . $word); + + if (strlen($buf) > $length and $buf_o != '') { + $message .= $buf_o . $soft_break; + $buf = $word; + } + } + } + $message .= $buf . $this->LE; + } + + return $message; + } + + /** + * Finds last character boundary prior to maxLength in a utf-8 + * quoted (printable) encoded string. + * Original written by Colin Brown. + * @access public + * @param string $encodedText utf-8 QP text + * @param int $maxLength find last character boundary prior to this length + * @return int + */ + public function UTF8CharBoundary($encodedText, $maxLength) { + $foundSplitPos = false; + $lookBack = 3; + while (!$foundSplitPos) { + $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); + $encodedCharPos = strpos($lastChunk, "="); + if ($encodedCharPos !== false) { + // Found start of encoded character byte within $lookBack block. + // Check the encoded byte value (the 2 chars after the '=') + $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); + $dec = hexdec($hex); + if ($dec < 128) { // Single byte character. + // If the encoded char was found at pos 0, it will fit + // otherwise reduce maxLength to start of the encoded char + $maxLength = ($encodedCharPos == 0) ? $maxLength : + $maxLength - ($lookBack - $encodedCharPos); + $foundSplitPos = true; + } elseif ($dec >= 192) { // First byte of a multi byte character + // Reduce maxLength to split at start of character + $maxLength = $maxLength - ($lookBack - $encodedCharPos); + $foundSplitPos = true; + } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back + $lookBack += 3; + } + } else { + // No encoded character found + $foundSplitPos = true; + } + } + return $maxLength; + } + + + /** + * Set the body wrapping. + * @access public + * @return void + */ + public function SetWordWrap() { + if($this->WordWrap < 1) { + return; + } + + switch($this->message_type) { + case 'alt': + case 'alt_attachments': + $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap); + break; + default: + $this->Body = $this->WrapText($this->Body, $this->WordWrap); + break; + } + } + + /** + * Assembles message header. + * @access public + * @return string The assembled header + */ + public function CreateHeader() { + $result = ''; + + // Set the boundaries + $uniq_id = md5(uniqid(time())); + $this->boundary[1] = 'b1_' . $uniq_id; + $this->boundary[2] = 'b2_' . $uniq_id; + + $result .= $this->HeaderLine('Date', self::RFCDate()); + if($this->Sender == '') { + $result .= $this->HeaderLine('Return-Path', trim($this->From)); + } else { + $result .= $this->HeaderLine('Return-Path', trim($this->Sender)); + } + + // To be created automatically by mail() + if($this->Mailer != 'mail') { + if(count($this->to) > 0) { + $result .= $this->AddrAppend('To', $this->to); + } elseif (count($this->cc) == 0) { + $result .= $this->HeaderLine('To', 'undisclosed-recipients:;'); + } + } + + $from = array(); + $from[0][0] = trim($this->From); + $from[0][1] = $this->FromName; + $result .= $this->AddrAppend('From', $from); + + // sendmail and mail() extract Cc from the header before sending + if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->cc) > 0)) { + $result .= $this->AddrAppend('Cc', $this->cc); + } + + // sendmail and mail() extract Bcc from the header before sending + if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) { + $result .= $this->AddrAppend('Bcc', $this->bcc); + } + + if(count($this->ReplyTo) > 0) { + $result .= $this->AddrAppend('Reply-to', $this->ReplyTo); + } + + // mail() sets the subject itself + if($this->Mailer != 'mail') { + $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject))); + } + + if($this->MessageID != '') { + $result .= $this->HeaderLine('Message-ID',$this->MessageID); + } else { + $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); + } + $result .= $this->HeaderLine('X-Priority', $this->Priority); + $result .= $this->HeaderLine('X-Mailer', 'PHPMailer ' . self::VERSION . ' (phpmailer.codeworxtech.com)'); + + if($this->ConfirmReadingTo != '') { + $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>'); + } + + // Add custom headers + for($index = 0; $index < count($this->CustomHeader); $index++) { + $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1]))); + } + if (!$this->sign_key_file) { + $result .= $this->HeaderLine('MIME-Version', '1.0'); + $result .= $this->GetMailMIME(); + } + + return $result; + } + + /** + * Returns the message MIME. + * @access public + * @return string + */ + public function GetMailMIME() { + $result = ''; + switch($this->message_type) { + case 'plain': + $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding); + $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet); + break; + case 'attachments': + case 'alt_attachments': + if($this->InlineImageExists()){ + $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE); + } else { + $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;'); + $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); + } + break; + case 'alt': + $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;'); + $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); + break; + } + + if($this->Mailer != 'mail') { + $result .= $this->LE.$this->LE; + } + + return $result; + } + + /** + * Assembles the message body. Returns an empty string on failure. + * @access public + * @return string The assembled message body + */ + public function CreateBody() { + $body = ''; + + if ($this->sign_key_file) { + $body .= $this->GetMailMIME(); + } + + $this->SetWordWrap(); + + switch($this->message_type) { + case 'alt': + $body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); + $body .= $this->EncodeString($this->AltBody, $this->Encoding); + $body .= $this->LE.$this->LE; + $body .= $this->GetBoundary($this->boundary[1], '', 'text/html', ''); + $body .= $this->EncodeString($this->Body, $this->Encoding); + $body .= $this->LE.$this->LE; + $body .= $this->EndBoundary($this->boundary[1]); + break; + case 'plain': + $body .= $this->EncodeString($this->Body, $this->Encoding); + break; + case 'attachments': + $body .= $this->GetBoundary($this->boundary[1], '', '', ''); + $body .= $this->EncodeString($this->Body, $this->Encoding); + $body .= $this->LE; + $body .= $this->AttachAll(); + break; + case 'alt_attachments': + $body .= sprintf("--%s%s", $this->boundary[1], $this->LE); + $body .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE); + $body .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body + $body .= $this->EncodeString($this->AltBody, $this->Encoding); + $body .= $this->LE.$this->LE; + $body .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body + $body .= $this->EncodeString($this->Body, $this->Encoding); + $body .= $this->LE.$this->LE; + $body .= $this->EndBoundary($this->boundary[2]); + $body .= $this->AttachAll(); + break; + } + + if ($this->IsError()) { + $body = ''; + } elseif ($this->sign_key_file) { + try { + $file = tempnam('', 'mail'); + file_put_contents($file, $body); //TODO check this worked + $signed = tempnam("", "signed"); + if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), NULL)) { + @unlink($file); + @unlink($signed); + $body = file_get_contents($signed); + } else { + @unlink($file); + @unlink($signed); + throw new phpmailerException($this->Lang("signing").openssl_error_string()); + } + } catch (phpmailerException $e) { + $body = ''; + if ($this->exceptions) { + throw $e; + } + } + } + + return $body; + } + + /** + * Returns the start of a message boundary. + * @access private + */ + private function GetBoundary($boundary, $charSet, $contentType, $encoding) { + $result = ''; + if($charSet == '') { + $charSet = $this->CharSet; + } + if($contentType == '') { + $contentType = $this->ContentType; + } + if($encoding == '') { + $encoding = $this->Encoding; + } + $result .= $this->TextLine('--' . $boundary); + $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet); + $result .= $this->LE; + $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding); + $result .= $this->LE; + + return $result; + } + + /** + * Returns the end of a message boundary. + * @access private + */ + private function EndBoundary($boundary) { + return $this->LE . '--' . $boundary . '--' . $this->LE; + } + + /** + * Sets the message type. + * @access private + * @return void + */ + private function SetMessageType() { + if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) { + $this->message_type = 'plain'; + } else { + if(count($this->attachment) > 0) { + $this->message_type = 'attachments'; + } + if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) { + $this->message_type = 'alt'; + } + if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) { + $this->message_type = 'alt_attachments'; + } + } + } + + /** + * Returns a formatted header line. + * @access public + * @return string + */ + public function HeaderLine($name, $value) { + return $name . ': ' . $value . $this->LE; + } + + /** + * Returns a formatted mail line. + * @access public + * @return string + */ + public function TextLine($value) { + return $value . $this->LE; + } + + ///////////////////////////////////////////////// + // CLASS METHODS, ATTACHMENTS + ///////////////////////////////////////////////// + + /** + * Adds an attachment from a path on the filesystem. + * Returns false if the file could not be found + * or accessed. + * @param string $path Path to the attachment. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @return bool + */ + public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { + try { + if ( !@is_file($path) ) { + throw new phpmailerException($this->Lang('file_access') . $path, self::STOP_CONTINUE); + } + $filename = basename($path); + if ( $name == '' ) { + $name = $filename; + } + + $this->attachment[] = array( + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => 'attachment', + 7 => 0 + ); + + } catch (phpmailerException $e) { + $this->SetError($e->getMessage()); + if ($this->exceptions) { + throw $e; + } + echo $e->getMessage()."\n"; + if ( $e->getCode() == self::STOP_CRITICAL ) { + return false; + } + } + return true; + } + + /** + * Return the current array of attachments + * @return array + */ + public function GetAttachments() { + return $this->attachment; + } + + /** + * Attaches all fs, string, and binary attachments to the message. + * Returns an empty string on failure. + * @access private + * @return string + */ + private function AttachAll() { + // Return text of body + $mime = array(); + $cidUniq = array(); + $incl = array(); + + // Add all attachments + foreach ($this->attachment as $attachment) { + // Check for string attachment + $bString = $attachment[5]; + if ($bString) { + $string = $attachment[0]; + } else { + $path = $attachment[0]; + } + + if (in_array($attachment[0], $incl)) { continue; } + $filename = $attachment[1]; + $name = $attachment[2]; + $encoding = $attachment[3]; + $type = $attachment[4]; + $disposition = $attachment[6]; + $cid = $attachment[7]; + $incl[] = $attachment[0]; + if ( isset($cidUniq[$cid]) ) { continue; } + $cidUniq[$cid] = true; + + $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); + $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE); + $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); + + if($disposition == 'inline') { + $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); + } + + $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE); + + // Encode as string attachment + if($bString) { + $mime[] = $this->EncodeString($string, $encoding); + if($this->IsError()) { + return ''; + } + $mime[] = $this->LE.$this->LE; + } else { + $mime[] = $this->EncodeFile($path, $encoding); + if($this->IsError()) { + return ''; + } + $mime[] = $this->LE.$this->LE; + } + } + + $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE); + + return join('', $mime); + } + + /** + * Encodes attachment in requested format. + * Returns an empty string on failure. + * @param string $path The full path to the file + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * @see EncodeFile() + * @access private + * @return string + */ + private function EncodeFile($path, $encoding = 'base64') { + try { + if (!is_readable($path)) { + throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE); + } + if (function_exists('get_magic_quotes')) { + function get_magic_quotes() { + return false; + } + } + if (PHP_VERSION < 6) { + $magic_quotes = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + } + $file_buffer = file_get_contents($path); + $file_buffer = $this->EncodeString($file_buffer, $encoding); + if (PHP_VERSION < 6) { set_magic_quotes_runtime($magic_quotes); } + return $file_buffer; + } catch (Exception $e) { + $this->SetError($e->getMessage()); + return ''; + } + } + + /** + * Encodes string to requested format. + * Returns an empty string on failure. + * @param string $str The text to encode + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * @access public + * @return string + */ + public function EncodeString ($str, $encoding = 'base64') { + $encoded = ''; + switch(strtolower($encoding)) { + case 'base64': + $encoded = chunk_split(base64_encode($str), 76, $this->LE); + break; + case '7bit': + case '8bit': + $encoded = $this->FixEOL($str); + //Make sure it ends with a line break + if (substr($encoded, -(strlen($this->LE))) != $this->LE) + $encoded .= $this->LE; + break; + case 'binary': + $encoded = $str; + break; + case 'quoted-printable': + $encoded = $this->EncodeQP($str); + break; + default: + $this->SetError($this->Lang('encoding') . $encoding); + break; + } + return $encoded; + } + + /** + * Encode a header string to best (shortest) of Q, B, quoted or none. + * @access public + * @return string + */ + public function EncodeHeader($str, $position = 'text') { + $x = 0; + + switch (strtolower($position)) { + case 'phrase': + if (!preg_match('/[\200-\377]/', $str)) { + // Can't use addslashes as we don't know what value has magic_quotes_sybase + $encoded = addcslashes($str, "\0..\37\177\\\""); + if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { + return ($encoded); + } else { + return ("\"$encoded\""); + } + } + $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); + break; + case 'comment': + $x = preg_match_all('/[()"]/', $str, $matches); + // Fall-through + case 'text': + default: + $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); + break; + } + + if ($x == 0) { + return ($str); + } + + $maxlen = 75 - 7 - strlen($this->CharSet); + // Try to select the encoding which should produce the shortest output + if (strlen($str)/3 < $x) { + $encoding = 'B'; + if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) { + // Use a custom function which correctly encodes and wraps long + // multibyte strings without breaking lines within a character + $encoded = $this->Base64EncodeWrapMB($str); + } else { + $encoded = base64_encode($str); + $maxlen -= $maxlen % 4; + $encoded = trim(chunk_split($encoded, $maxlen, "\n")); + } + } else { + $encoding = 'Q'; + $encoded = $this->EncodeQ($str, $position); + $encoded = $this->WrapText($encoded, $maxlen, true); + $encoded = str_replace('='.$this->LE, "\n", trim($encoded)); + } + + $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); + $encoded = trim(str_replace("\n", $this->LE, $encoded)); + + return $encoded; + } + + /** + * Checks if a string contains multibyte characters. + * @access public + * @param string $str multi-byte text to wrap encode + * @return bool + */ + public function HasMultiBytes($str) { + if (function_exists('mb_strlen')) { + return (strlen($str) > mb_strlen($str, $this->CharSet)); + } else { // Assume no multibytes (we can't handle without mbstring functions anyway) + return false; + } + } + + /** + * Correctly encodes and wraps long multibyte strings for mail headers + * without breaking lines within a character. + * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php + * @access public + * @param string $str multi-byte text to wrap encode + * @return string + */ + public function Base64EncodeWrapMB($str) { + $start = "=?".$this->CharSet."?B?"; + $end = "?="; + $encoded = ""; + + $mb_length = mb_strlen($str, $this->CharSet); + // Each line must have length <= 75, including $start and $end + $length = 75 - strlen($start) - strlen($end); + // Average multi-byte ratio + $ratio = $mb_length / strlen($str); + // Base64 has a 4:3 ratio + $offset = $avgLength = floor($length * $ratio * .75); + + for ($i = 0; $i < $mb_length; $i += $offset) { + $lookBack = 0; + + do { + $offset = $avgLength - $lookBack; + $chunk = mb_substr($str, $i, $offset, $this->CharSet); + $chunk = base64_encode($chunk); + $lookBack++; + } + while (strlen($chunk) > $length); + + $encoded .= $chunk . $this->LE; + } + + // Chomp the last linefeed + $encoded = substr($encoded, 0, -strlen($this->LE)); + return $encoded; + } + + /** + * Encode string to quoted-printable. + * Only uses standard PHP, slow, but will always work + * @access public + * @param string $string the text to encode + * @param integer $line_max Number of chars allowed on a line before wrapping + * @return string + */ + public function EncodeQPphp( $input = '', $line_max = 76, $space_conv = false) { + $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); + $lines = preg_split('/(?:\r\n|\r|\n)/', $input); + $eol = "\r\n"; + $escape = '='; + $output = ''; + while( list(, $line) = each($lines) ) { + $linlen = strlen($line); + $newline = ''; + for($i = 0; $i < $linlen; $i++) { + $c = substr( $line, $i, 1 ); + $dec = ord( $c ); + if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E + $c = '=2E'; + } + if ( $dec == 32 ) { + if ( $i == ( $linlen - 1 ) ) { // convert space at eol only + $c = '=20'; + } else if ( $space_conv ) { + $c = '=20'; + } + } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required + $h2 = floor($dec/16); + $h1 = floor($dec%16); + $c = $escape.$hex[$h2].$hex[$h1]; + } + if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted + $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay + $newline = ''; + // check if newline first character will be point or not + if ( $dec == 46 ) { + $c = '=2E'; + } + } + $newline .= $c; + } // end of for + $output .= $newline.$eol; + } // end of while + return $output; + } + + /** + * Encode string to RFC2045 (6.7) quoted-printable format + * Uses a PHP5 stream filter to do the encoding about 64x faster than the old version + * Also results in same content as you started with after decoding + * @see EncodeQPphp() + * @access public + * @param string $string the text to encode + * @param integer $line_max Number of chars allowed on a line before wrapping + * @param boolean $space_conv Dummy param for compatibility with existing EncodeQP function + * @return string + * @author Marcus Bointon + */ + public function EncodeQP($string, $line_max = 76, $space_conv = false) { + if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3) + return quoted_printable_encode($string); + } + $filters = stream_get_filters(); + if (!in_array('convert.*', $filters)) { //Got convert stream filter? + return $this->EncodeQPphp($string, $line_max, $space_conv); //Fall back to old implementation + } + $fp = fopen('php://temp/', 'r+'); + $string = preg_replace('/\r\n?/', $this->LE, $string); //Normalise line breaks + $params = array('line-length' => $line_max, 'line-break-chars' => $this->LE); + $s = stream_filter_append($fp, 'convert.quoted-printable-encode', STREAM_FILTER_READ, $params); + fputs($fp, $string); + rewind($fp); + $out = stream_get_contents($fp); + stream_filter_remove($s); + $out = preg_replace('/^\./m', '=2E', $out); //Encode . if it is first char on a line, workaround for bug in Exchange + fclose($fp); + return $out; + } + + /** + * Encode string to q encoding. + * @link http://tools.ietf.org/html/rfc2047 + * @param string $str the text to encode + * @param string $position Where the text is going to be used, see the RFC for what that means + * @access public + * @return string + */ + public function EncodeQ ($str, $position = 'text') { + // There should not be any EOL in the string + $encoded = preg_replace('/[\r\n]*/', '', $str); + + switch (strtolower($position)) { + case 'phrase': + $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + break; + case 'comment': + $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + case 'text': + default: + // Replace every high ascii, control =, ? and _ characters + //TODO using /e (equivalent to eval()) is probably not a good idea + $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', + "'='.sprintf('%02X', ord('\\1'))", $encoded); + break; + } + + // Replace every spaces to _ (more readable than =20) + $encoded = str_replace(' ', '_', $encoded); + + return $encoded; + } + + /** + * Adds a string or binary attachment (non-filesystem) to the list. + * This method can be used to attach ascii or binary data, + * such as a BLOB record from a database. + * @param string $string String attachment data. + * @param string $filename Name of the attachment. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @return void + */ + public function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') { + // Append to $attachment array + $this->attachment[] = array( + 0 => $string, + 1 => $filename, + 2 => $filename, + 3 => $encoding, + 4 => $type, + 5 => true, // isStringAttachment + 6 => 'attachment', + 7 => 0 + ); + } + + /** + * Adds an embedded attachment. This can include images, sounds, and + * just about any other document. Make sure to set the $type to an + * image type. For JPEG images use "image/jpeg" and for GIF images + * use "image/gif". + * @param string $path Path to the attachment. + * @param string $cid Content ID of the attachment. Use this to identify + * the Id for accessing the image in an HTML form. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @return bool + */ + public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { + + if ( !@is_file($path) ) { + $this->SetError($this->Lang('file_access') . $path); + return false; + } + + $filename = basename($path); + if ( $name == '' ) { + $name = $filename; + } + + // Append to $attachment array + $this->attachment[] = array( + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => 'inline', + 7 => $cid + ); + + return true; + } + + /** + * Returns true if an inline attachment is present. + * @access public + * @return bool + */ + public function InlineImageExists() { + foreach($this->attachment as $attachment) { + if ($attachment[6] == 'inline') { + return true; + } + } + return false; + } + + ///////////////////////////////////////////////// + // CLASS METHODS, MESSAGE RESET + ///////////////////////////////////////////////// + + /** + * Clears all recipients assigned in the TO array. Returns void. + * @return void + */ + public function ClearAddresses() { + foreach($this->to as $to) { + unset($this->all_recipients[strtolower($to[0])]); + } + $this->to = array(); + } + + /** + * Clears all recipients assigned in the CC array. Returns void. + * @return void + */ + public function ClearCCs() { + foreach($this->cc as $cc) { + unset($this->all_recipients[strtolower($cc[0])]); + } + $this->cc = array(); + } + + /** + * Clears all recipients assigned in the BCC array. Returns void. + * @return void + */ + public function ClearBCCs() { + foreach($this->bcc as $bcc) { + unset($this->all_recipients[strtolower($bcc[0])]); + } + $this->bcc = array(); + } + + /** + * Clears all recipients assigned in the ReplyTo array. Returns void. + * @return void + */ + public function ClearReplyTos() { + $this->ReplyTo = array(); + } + + /** + * Clears all recipients assigned in the TO, CC and BCC + * array. Returns void. + * @return void + */ + public function ClearAllRecipients() { + $this->to = array(); + $this->cc = array(); + $this->bcc = array(); + $this->all_recipients = array(); + } + + /** + * Clears all previously set filesystem, string, and binary + * attachments. Returns void. + * @return void + */ + public function ClearAttachments() { + $this->attachment = array(); + } + + /** + * Clears all custom headers. Returns void. + * @return void + */ + public function ClearCustomHeaders() { + $this->CustomHeader = array(); + } + + ///////////////////////////////////////////////// + // CLASS METHODS, MISCELLANEOUS + ///////////////////////////////////////////////// + + /** + * Adds the error message to the error container. + * @access protected + * @return void + */ + protected function SetError($msg) { + $this->error_count++; + if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { + $lasterror = $this->smtp->getError(); + if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) { + $msg .= '

' . $this->Lang('smtp_error') . $lasterror['smtp_msg'] . "

\n"; + } + } + $this->ErrorInfo = $msg; + } + + /** + * Returns the proper RFC 822 formatted date. + * @access public + * @return string + * @static + */ + public static function RFCDate() { + $tz = date('Z'); + $tzs = ($tz < 0) ? '-' : '+'; + $tz = abs($tz); + $tz = (int)($tz/3600)*100 + ($tz%3600)/60; + $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz); + + return $result; + } + + /** + * Returns the server hostname or 'localhost.localdomain' if unknown. + * @access private + * @return string + */ + private function ServerHostname() { + if (!empty($this->Hostname)) { + $result = $this->Hostname; + } elseif (isset($_SERVER['SERVER_NAME'])) { + $result = $_SERVER['SERVER_NAME']; + } else { + $result = 'localhost.localdomain'; + } + + return $result; + } + + /** + * Returns a message in the appropriate language. + * @access private + * @return string + */ + private function Lang($key) { + if(count($this->language) < 1) { + $this->SetLanguage('en'); // set the default language + } + + if(isset($this->language[$key])) { + return $this->language[$key]; + } else { + return 'Language string failed to load: ' . $key; + } + } + + /** + * Returns true if an error occurred. + * @access public + * @return bool + */ + public function IsError() { + return ($this->error_count > 0); + } + + /** + * Changes every end of line from CR or LF to CRLF. + * @access private + * @return string + */ + private function FixEOL($str) { + $str = str_replace("\r\n", "\n", $str); + $str = str_replace("\r", "\n", $str); + $str = str_replace("\n", $this->LE, $str); + return $str; + } + + /** + * Adds a custom header. + * @access public + * @return void + */ + public function AddCustomHeader($custom_header) { + $this->CustomHeader[] = explode(':', $custom_header, 2); + } + + /** + * Evaluates the message and returns modifications for inline images and backgrounds + * @access public + * @return $message + */ + public function MsgHTML($message, $basedir = '') { + preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images); + if(isset($images[2])) { + foreach($images[2] as $i => $url) { + // do not change urls for absolute images (thanks to corvuscorax) + if (!preg_match('#^[A-z]+://#',$url)) { + $filename = basename($url); + $directory = dirname($url); + ($directory == '.')?$directory='':''; + $cid = 'cid:' . md5($filename); + $ext = pathinfo($filename, PATHINFO_EXTENSION); + $mimeType = self::_mime_types($ext); + if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; } + if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; } + if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) { + $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message); + } + } + } + } + $this->IsHTML(true); + $this->Body = $message; + $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message))); + if (!empty($textMsg) && empty($this->AltBody)) { + $this->AltBody = html_entity_decode($textMsg); + } + if (empty($this->AltBody)) { + $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n"; + } + } + + /** + * Gets the MIME type of the embedded or inline image + * @param string File extension + * @access public + * @return string MIME type of ext + * @static + */ + public static function _mime_types($ext = '') { + $mimes = array( + 'hqx' => 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'doc' => 'application/msword', + 'bin' => 'application/macbinary', + 'dms' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'exe' => 'application/octet-stream', + 'class' => 'application/octet-stream', + 'psd' => 'application/octet-stream', + 'so' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => 'application/pdf', + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', + 'wbxml' => 'application/vnd.wap.wbxml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'php' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'js' => 'application/x-javascript', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => 'application/x-tar', + 'xhtml' => 'application/xhtml+xml', + 'xht' => 'application/xhtml+xml', + 'zip' => 'application/zip', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mpga' => 'audio/mpeg', + 'mp2' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'aif' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'rv' => 'video/vnd.rn-realvideo', + 'wav' => 'audio/x-wav', + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'png' => 'image/png', + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'txt' => 'text/plain', + 'text' => 'text/plain', + 'log' => 'text/plain', + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie', + 'doc' => 'application/msword', + 'word' => 'application/msword', + 'xl' => 'application/excel', + 'eml' => 'message/rfc822' + ); + return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; + } + + /** + * Set (or reset) Class Objects (variables) + * + * Usage Example: + * $page->set('X-Priority', '3'); + * + * @access public + * @param string $name Parameter Name + * @param mixed $value Parameter Value + * NOTE: will not work with arrays, there are no arrays to set/reset + * @todo Should this not be using __set() magic function? + */ + public function set($name, $value = '') { + try { + if (isset($this->$name) ) { + $this->$name = $value; + } else { + throw new phpmailerException($this->Lang('variable_set') . $name, self::STOP_CRITICAL); + } + } catch (Exception $e) { + $this->SetError($e->getMessage()); + if ($e->getCode() == self::STOP_CRITICAL) { + return false; + } + } + return true; + } + + /** + * Strips newlines to prevent header injection. + * @access public + * @param string $str String + * @return string + */ + public function SecureHeader($str) { + $str = str_replace("\r", '', $str); + $str = str_replace("\n", '', $str); + return trim($str); + } + + /** + * Set the private key file and password to sign the message. + * + * @access public + * @param string $key_filename Parameter File Name + * @param string $key_pass Password for private key + */ + public function Sign($cert_filename, $key_filename, $key_pass) { + $this->sign_cert_file = $cert_filename; + $this->sign_key_file = $key_filename; + $this->sign_key_pass = $key_pass; + } +} + +class phpmailerException extends Exception { + public function errorMessage() { + $errorMsg = '' . $this->getMessage() . "
\n"; + return $errorMsg; + } +} +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/class.pop3.php b/protected/extensions/mailer/phpmailer/class.pop3.php new file mode 100644 index 0000000..de6e584 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/class.pop3.php @@ -0,0 +1,407 @@ +pop_conn = 0; + $this->connected = false; + $this->error = null; + } + + /** + * Combination of public events - connect, login, disconnect + * @access public + * @param string $host + * @param integer $port + * @param integer $tval + * @param string $username + * @param string $password + */ + public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) { + $this->host = $host; + + // If no port value is passed, retrieve it + if ($port == false) { + $this->port = $this->POP3_PORT; + } else { + $this->port = $port; + } + + // If no port value is passed, retrieve it + if ($tval == false) { + $this->tval = $this->POP3_TIMEOUT; + } else { + $this->tval = $tval; + } + + $this->do_debug = $debug_level; + $this->username = $username; + $this->password = $password; + + // Refresh the error log + $this->error = null; + + // Connect + $result = $this->Connect($this->host, $this->port, $this->tval); + + if ($result) { + $login_result = $this->Login($this->username, $this->password); + + if ($login_result) { + $this->Disconnect(); + + return true; + } + + } + + // We need to disconnect regardless if the login succeeded + $this->Disconnect(); + + return false; + } + + /** + * Connect to the POP3 server + * @access public + * @param string $host + * @param integer $port + * @param integer $tval + * @return boolean + */ + public function Connect ($host, $port = false, $tval = 30) { + // Are we already connected? + if ($this->connected) { + return true; + } + + /* + On Windows this will raise a PHP Warning error if the hostname doesn't exist. + Rather than supress it with @fsockopen, let's capture it cleanly instead + */ + + set_error_handler(array(&$this, 'catchWarning')); + + // Connect to the POP3 server + $this->pop_conn = fsockopen($host, // POP3 Host + $port, // Port # + $errno, // Error Number + $errstr, // Error Message + $tval); // Timeout (seconds) + + // Restore the error handler + restore_error_handler(); + + // Does the Error Log now contain anything? + if ($this->error && $this->do_debug >= 1) { + $this->displayErrors(); + } + + // Did we connect? + if ($this->pop_conn == false) { + // It would appear not... + $this->error = array( + 'error' => "Failed to connect to server $host on port $port", + 'errno' => $errno, + 'errstr' => $errstr + ); + + if ($this->do_debug >= 1) { + $this->displayErrors(); + } + + return false; + } + + // Increase the stream time-out + + // Check for PHP 4.3.0 or later + if (version_compare(phpversion(), '5.0.0', 'ge')) { + stream_set_timeout($this->pop_conn, $tval, 0); + } else { + // Does not work on Windows + if (substr(PHP_OS, 0, 3) !== 'WIN') { + socket_set_timeout($this->pop_conn, $tval, 0); + } + } + + // Get the POP3 server response + $pop3_response = $this->getResponse(); + + // Check for the +OK + if ($this->checkResponse($pop3_response)) { + // The connection is established and the POP3 server is talking + $this->connected = true; + return true; + } + + } + + /** + * Login to the POP3 server (does not support APOP yet) + * @access public + * @param string $username + * @param string $password + * @return boolean + */ + public function Login ($username = '', $password = '') { + if ($this->connected == false) { + $this->error = 'Not connected to POP3 server'; + + if ($this->do_debug >= 1) { + $this->displayErrors(); + } + } + + if (empty($username)) { + $username = $this->username; + } + + if (empty($password)) { + $password = $this->password; + } + + $pop_username = "USER $username" . $this->CRLF; + $pop_password = "PASS $password" . $this->CRLF; + + // Send the Username + $this->sendString($pop_username); + $pop3_response = $this->getResponse(); + + if ($this->checkResponse($pop3_response)) { + // Send the Password + $this->sendString($pop_password); + $pop3_response = $this->getResponse(); + + if ($this->checkResponse($pop3_response)) { + return true; + } else { + return false; + } + } else { + return false; + } + } + + /** + * Disconnect from the POP3 server + * @access public + */ + public function Disconnect () { + $this->sendString('QUIT'); + + fclose($this->pop_conn); + } + + ///////////////////////////////////////////////// + // Private Methods + ///////////////////////////////////////////////// + + /** + * Get the socket response back. + * $size is the maximum number of bytes to retrieve + * @access private + * @param integer $size + * @return string + */ + private function getResponse ($size = 128) { + $pop3_response = fgets($this->pop_conn, $size); + + return $pop3_response; + } + + /** + * Send a string down the open socket connection to the POP3 server + * @access private + * @param string $string + * @return integer + */ + private function sendString ($string) { + $bytes_sent = fwrite($this->pop_conn, $string, strlen($string)); + + return $bytes_sent; + } + + /** + * Checks the POP3 server response for +OK or -ERR + * @access private + * @param string $string + * @return boolean + */ + private function checkResponse ($string) { + if (substr($string, 0, 3) !== '+OK') { + $this->error = array( + 'error' => "Server reported an error: $string", + 'errno' => 0, + 'errstr' => '' + ); + + if ($this->do_debug >= 1) { + $this->displayErrors(); + } + + return false; + } else { + return true; + } + + } + + /** + * If debug is enabled, display the error message array + * @access private + */ + private function displayErrors () { + echo '
';
+
+    foreach ($this->error as $single_error) {
+      print_r($single_error);
+    }
+
+    echo '
'; + } + + /** + * Takes over from PHP for the socket warning handler + * @access private + * @param integer $errno + * @param string $errstr + * @param string $errfile + * @param integer $errline + */ + private function catchWarning ($errno, $errstr, $errfile, $errline) { + $this->error[] = array( + 'error' => "Connecting to the POP3 server raised a PHP warning: ", + 'errno' => $errno, + 'errstr' => $errstr + ); + } + + // End of class +} +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/class.smtp.php b/protected/extensions/mailer/phpmailer/class.smtp.php new file mode 100644 index 0000000..ed14441 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/class.smtp.php @@ -0,0 +1,814 @@ +smtp_conn = 0; + $this->error = null; + $this->helo_rply = null; + + $this->do_debug = 0; + } + + ///////////////////////////////////////////////// + // CONNECTION FUNCTIONS + ///////////////////////////////////////////////// + + /** + * Connect to the server specified on the port specified. + * If the port is not specified use the default SMTP_PORT. + * If tval is specified then a connection will try and be + * established with the server for that number of seconds. + * If tval is not specified the default is 30 seconds to + * try on the connection. + * + * SMTP CODE SUCCESS: 220 + * SMTP CODE FAILURE: 421 + * @access public + * @return bool + */ + public function Connect($host, $port = 0, $tval = 30) { + // set the error val to null so there is no confusion + $this->error = null; + + // make sure we are __not__ connected + if($this->connected()) { + // already connected, generate error + $this->error = array("error" => "Already connected to a server"); + return false; + } + + if(empty($port)) { + $port = $this->SMTP_PORT; + } + + // connect to the smtp server + $this->smtp_conn = @fsockopen($host, // the host of the server + $port, // the port to use + $errno, // error number if any + $errstr, // error message if any + $tval); // give up after ? secs + // verify we connected properly + if(empty($this->smtp_conn)) { + $this->error = array("error" => "Failed to connect to server", + "errno" => $errno, + "errstr" => $errstr); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '
'; + } + return false; + } + + // SMTP server can take longer to respond, give longer timeout for first read + // Windows does not have support for this timeout function + if(substr(PHP_OS, 0, 3) != "WIN") + socket_set_timeout($this->smtp_conn, $tval, 0); + + // get any announcement + $announce = $this->get_lines(); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '
'; + } + + return true; + } + + /** + * Initiate a TLS communication with the server. + * + * SMTP CODE 220 Ready to start TLS + * SMTP CODE 501 Syntax error (no parameters allowed) + * SMTP CODE 454 TLS not available due to temporary reason + * @access public + * @return bool success + */ + public function StartTLS() { + $this->error = null; # to avoid confusion + + if(!$this->connected()) { + $this->error = array("error" => "Called StartTLS() without being connected"); + return false; + } + + fputs($this->smtp_conn,"STARTTLS" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; + } + + if($code != 220) { + $this->error = + array("error" => "STARTTLS not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + + // Begin encrypted connection + if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { + return false; + } + + return true; + } + + /** + * Performs SMTP authentication. Must be run after running the + * Hello() method. Returns true if successfully authenticated. + * @access public + * @return bool + */ + public function Authenticate($username, $password) { + // Start authentication + fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 334) { + $this->error = + array("error" => "AUTH not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + + // Send encoded username + fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 334) { + $this->error = + array("error" => "Username not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + + // Send encoded password + fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 235) { + $this->error = + array("error" => "Password not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + + return true; + } + + /** + * Returns true if connected to a server otherwise false + * @access public + * @return bool + */ + public function Connected() { + if(!empty($this->smtp_conn)) { + $sock_status = socket_get_status($this->smtp_conn); + if($sock_status["eof"]) { + // the socket is valid but we are not connected + if($this->do_debug >= 1) { + echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"; + } + $this->Close(); + return false; + } + return true; // everything looks good + } + return false; + } + + /** + * Closes the socket and cleans up the state of the class. + * It is not considered good to use this function without + * first trying to use QUIT. + * @access public + * @return void + */ + public function Close() { + $this->error = null; // so there is no confusion + $this->helo_rply = null; + if(!empty($this->smtp_conn)) { + // close the connection and cleanup + fclose($this->smtp_conn); + $this->smtp_conn = 0; + } + } + + ///////////////////////////////////////////////// + // SMTP COMMANDS + ///////////////////////////////////////////////// + + /** + * Issues a data command and sends the msg_data to the server + * finializing the mail transaction. $msg_data is the message + * that is to be send with the headers. Each header needs to be + * on a single line followed by a with the message headers + * and the message body being seperated by and additional . + * + * Implements rfc 821: DATA + * + * SMTP CODE INTERMEDIATE: 354 + * [data] + * . + * SMTP CODE SUCCESS: 250 + * SMTP CODE FAILURE: 552,554,451,452 + * SMTP CODE FAILURE: 451,554 + * SMTP CODE ERROR : 500,501,503,421 + * @access public + * @return bool + */ + public function Data($msg_data) { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Data() without being connected"); + return false; + } + + fputs($this->smtp_conn,"DATA" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; + } + + if($code != 354) { + $this->error = + array("error" => "DATA command not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + + /* the server is ready to accept data! + * according to rfc 821 we should not send more than 1000 + * including the CRLF + * characters on a single line so we will break the data up + * into lines by \r and/or \n then if needed we will break + * each of those into smaller lines to fit within the limit. + * in addition we will be looking for lines that start with + * a period '.' and append and additional period '.' to that + * line. NOTE: this does not count towards limit. + */ + + // normalize the line breaks so we know the explode works + $msg_data = str_replace("\r\n","\n",$msg_data); + $msg_data = str_replace("\r","\n",$msg_data); + $lines = explode("\n",$msg_data); + + /* we need to find a good way to determine is headers are + * in the msg_data or if it is a straight msg body + * currently I am assuming rfc 822 definitions of msg headers + * and if the first field of the first line (':' sperated) + * does not contain a space then it _should_ be a header + * and we can process all lines before a blank "" line as + * headers. + */ + + $field = substr($lines[0],0,strpos($lines[0],":")); + $in_headers = false; + if(!empty($field) && !strstr($field," ")) { + $in_headers = true; + } + + $max_line_length = 998; // used below; set here for ease in change + + while(list(,$line) = @each($lines)) { + $lines_out = null; + if($line == "" && $in_headers) { + $in_headers = false; + } + // ok we need to break this line up into several smaller lines + while(strlen($line) > $max_line_length) { + $pos = strrpos(substr($line,0,$max_line_length)," "); + + // Patch to fix DOS attack + if(!$pos) { + $pos = $max_line_length - 1; + $lines_out[] = substr($line,0,$pos); + $line = substr($line,$pos); + } else { + $lines_out[] = substr($line,0,$pos); + $line = substr($line,$pos + 1); + } + + /* if processing headers add a LWSP-char to the front of new line + * rfc 822 on long msg headers + */ + if($in_headers) { + $line = "\t" . $line; + } + } + $lines_out[] = $line; + + // send the lines to the server + while(list(,$line_out) = @each($lines_out)) { + if(strlen($line_out) > 0) + { + if(substr($line_out, 0, 1) == ".") { + $line_out = "." . $line_out; + } + } + fputs($this->smtp_conn,$line_out . $this->CRLF); + } + } + + // message data has been sent + fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; + } + + if($code != 250) { + $this->error = + array("error" => "DATA not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + return true; + } + + /** + * Sends the HELO command to the smtp server. + * This makes sure that we and the server are in + * the same known state. + * + * Implements from rfc 821: HELO + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500, 501, 504, 421 + * @access public + * @return bool + */ + public function Hello($host = '') { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Hello() without being connected"); + return false; + } + + // if hostname for HELO was not specified send default + if(empty($host)) { + // determine appropriate default to send to server + $host = "localhost"; + } + + // Send extended hello first (RFC 2821) + if(!$this->SendHello("EHLO", $host)) { + if(!$this->SendHello("HELO", $host)) { + return false; + } + } + + return true; + } + + /** + * Sends a HELO/EHLO command. + * @access private + * @return bool + */ + private function SendHello($hello, $host) { + fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '
'; + } + + if($code != 250) { + $this->error = + array("error" => $hello . " not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + + $this->helo_rply = $rply; + + return true; + } + + /** + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more Recipient + * commands may be called followed by a Data command. + * + * Implements rfc 821: MAIL FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,421 + * @access public + * @return bool + */ + public function Mail($from) { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Mail() without being connected"); + return false; + } + + $useVerp = ($this->do_verp ? "XVERP" : ""); + fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; + } + + if($code != 250) { + $this->error = + array("error" => "MAIL not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + return true; + } + + /** + * Sends the quit command to the server and then closes the socket + * if there is no error or the $close_on_error argument is true. + * + * Implements from rfc 821: QUIT + * + * SMTP CODE SUCCESS: 221 + * SMTP CODE ERROR : 500 + * @access public + * @return bool + */ + public function Quit($close_on_error = true) { + $this->error = null; // so there is no confusion + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Quit() without being connected"); + return false; + } + + // send the quit command to the server + fputs($this->smtp_conn,"quit" . $this->CRLF); + + // get any good-bye messages + $byemsg = $this->get_lines(); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '
'; + } + + $rval = true; + $e = null; + + $code = substr($byemsg,0,3); + if($code != 221) { + // use e as a tmp var cause Close will overwrite $this->error + $e = array("error" => "SMTP server rejected quit command", + "smtp_code" => $code, + "smtp_rply" => substr($byemsg,4)); + $rval = false; + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '
'; + } + } + + if(empty($e) || $close_on_error) { + $this->Close(); + } + + return $rval; + } + + /** + * Sends the command RCPT to the SMTP server with the TO: argument of $to. + * Returns true if the recipient was accepted false if it was rejected. + * + * Implements from rfc 821: RCPT TO: + * + * SMTP CODE SUCCESS: 250,251 + * SMTP CODE FAILURE: 550,551,552,553,450,451,452 + * SMTP CODE ERROR : 500,501,503,421 + * @access public + * @return bool + */ + public function Recipient($to) { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Recipient() without being connected"); + return false; + } + + fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; + } + + if($code != 250 && $code != 251) { + $this->error = + array("error" => "RCPT not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + return true; + } + + /** + * Sends the RSET command to abort and transaction that is + * currently in progress. Returns true if successful false + * otherwise. + * + * Implements rfc 821: RSET + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500,501,504,421 + * @access public + * @return bool + */ + public function Reset() { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Reset() without being connected"); + return false; + } + + fputs($this->smtp_conn,"RSET" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; + } + + if($code != 250) { + $this->error = + array("error" => "RSET failed", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + + return true; + } + + /** + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more Recipient + * commands may be called followed by a Data command. This command + * will send the message to the users terminal if they are logged + * in and send them an email. + * + * Implements rfc 821: SAML FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,502,421 + * @access public + * @return bool + */ + public function SendAndMail($from) { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called SendAndMail() without being connected"); + return false; + } + + fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; + } + + if($code != 250) { + $this->error = + array("error" => "SAML not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; + } + return false; + } + return true; + } + + /** + * This is an optional command for SMTP that this class does not + * support. This method is here to make the RFC821 Definition + * complete for this class and __may__ be implimented in the future + * + * Implements from rfc 821: TURN + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE FAILURE: 502 + * SMTP CODE ERROR : 500, 503 + * @access public + * @return bool + */ + public function Turn() { + $this->error = array("error" => "This method, TURN, of the SMTP ". + "is not implemented"); + if($this->do_debug >= 1) { + echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '
'; + } + return false; + } + + /** + * Get the current error + * @access public + * @return array + */ + public function getError() { + return $this->error; + } + + ///////////////////////////////////////////////// + // INTERNAL FUNCTIONS + ///////////////////////////////////////////////// + + /** + * Read in as many lines as possible + * either before eof or socket timeout occurs on the operation. + * With SMTP we can tell if we have more lines to read if the + * 4th character is '-' symbol. If it is a space then we don't + * need to read anything else. + * @access private + * @return string + */ + private function get_lines() { + $data = ""; + while($str = @fgets($this->smtp_conn,515)) { + if($this->do_debug >= 4) { + echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '
'; + echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '
'; + } + $data .= $str; + if($this->do_debug >= 4) { + echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '
'; + } + // if 4th character is a space, we are done reading, break the loop + if(substr($str,3,1) == " ") { break; } + } + return $data; + } + +} + +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ar.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ar.php new file mode 100644 index 0000000..b7c5057 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ar.php @@ -0,0 +1,27 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: لم نستطع تأكيد الهوية.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: لم نستطع الاتصال بمخدم SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: لم يتم قبول المعلومات .'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; +$PHPMAILER_LANG['execute'] = 'لم أستطع تنفيذ : '; +$PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للملف: '; +$PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع فتح الملف: '; +$PHPMAILER_LANG['from_failed'] = 'البريد التالي لم نستطع ارسال البريد له : '; +$PHPMAILER_LANG['instantiate'] = 'لم نستطع توفير خدمة البريد.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.'; +//$PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: الأخطاء التالية ' . + 'فشل في الارسال لكل من : '; +$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-br.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-br.php new file mode 100644 index 0000000..6afe60b --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-br.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ca.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ca.php new file mode 100644 index 0000000..4a160a2 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ca.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ch.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ch.php new file mode 100644 index 0000000..31ebd86 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ch.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-cz.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-cz.php new file mode 100644 index 0000000..1c8b206 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-cz.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-de.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-de.php new file mode 100644 index 0000000..5c4fd61 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-de.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-dk.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-dk.php new file mode 100644 index 0000000..b262573 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-dk.php @@ -0,0 +1,26 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; +$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; +$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; +$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-es.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-es.php new file mode 100644 index 0000000..69b6817 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-es.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-et.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-et.php new file mode 100644 index 0000000..cf61779 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-et.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-fi.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-fi.php new file mode 100644 index 0000000..12a845a --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-fi.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-fo.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-fo.php new file mode 100644 index 0000000..6bd9b0a --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-fo.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-fr.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-fr.php new file mode 100644 index 0000000..c99ac3c --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-fr.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-hu.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-hu.php new file mode 100644 index 0000000..caca0b5 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-hu.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-it.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-it.php new file mode 100644 index 0000000..fc1fcb8 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-it.php @@ -0,0 +1,27 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal server.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: '; +$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; +$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; +$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; +$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; +$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ja.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ja.php new file mode 100644 index 0000000..63cfb23 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ja.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-nl.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-nl.php new file mode 100644 index 0000000..d2c380b --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-nl.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-no.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-no.php new file mode 100644 index 0000000..65cb884 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-no.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-pl.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-pl.php new file mode 100644 index 0000000..f4fd801 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-pl.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ro.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ro.php new file mode 100644 index 0000000..f6aa922 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ro.php @@ -0,0 +1,27 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.'; +$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: '; +$PHPMAILER_LANG['execute'] = 'Nu pot executa: '; +$PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: '; +$PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: '; +$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: '; +$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; +$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).'; +$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ru.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ru.php new file mode 100644 index 0000000..d699052 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-ru.php @@ -0,0 +1,25 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к серверу SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: '; +$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; +$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; +$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: '; +$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; +$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-se.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-se.php new file mode 100644 index 0000000..67e05f5 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-se.php @@ -0,0 +1,26 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; +$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; +$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; +$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-tr.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-tr.php new file mode 100644 index 0000000..d24627a --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-tr.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-zh.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-zh.php new file mode 100644 index 0000000..fef66f8 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-zh.php @@ -0,0 +1,26 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登錄失敗。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據不被接受。'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = '未知編碼: '; +$PHPMAILER_LANG['file_access'] = '無法訪問文件:'; +$PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:'; +$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; +$PHPMAILER_LANG['execute'] = '無法執行:'; +$PHPMAILER_LANG['instantiate'] = '未知函數調用。'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; +$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:'; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +?> \ No newline at end of file diff --git a/protected/extensions/mailer/phpmailer/language/phpmailer.lang-zh_cn.php b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-zh_cn.php new file mode 100644 index 0000000..b188404 --- /dev/null +++ b/protected/extensions/mailer/phpmailer/language/phpmailer.lang-zh_cn.php @@ -0,0 +1,26 @@ + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; +//$P$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = '未知编码: '; +$PHPMAILER_LANG['execute'] = '无法执行:'; +$PHPMAILER_LANG['file_access'] = '无法访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; +$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; +$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; +$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +?> \ No newline at end of file diff --git a/protected/modules/klapper/KlapperModule.php b/protected/modules/klapper/KlapperModule.php new file mode 100644 index 0000000..7c4de44 --- /dev/null +++ b/protected/modules/klapper/KlapperModule.php @@ -0,0 +1,28 @@ +setImport(array( + 'klapper.models.*', + 'klapper.components.*', + )); + } + + public function beforeControllerAction($controller, $action) + { + if(parent::beforeControllerAction($controller, $action)) + { + // this method is called before any module controller action is performed + // you may place customized code here + return true; + } + else + return false; + } +} diff --git a/protected/modules/klapper/controllers/DefaultController.php b/protected/modules/klapper/controllers/DefaultController.php new file mode 100644 index 0000000..957551e --- /dev/null +++ b/protected/modules/klapper/controllers/DefaultController.php @@ -0,0 +1,9 @@ +render('index'); + } +} \ No newline at end of file diff --git a/protected/modules/klapper/views/default/index.php b/protected/modules/klapper/views/default/index.php new file mode 100644 index 0000000..5deea12 --- /dev/null +++ b/protected/modules/klapper/views/default/index.php @@ -0,0 +1,18 @@ +breadcrumbs=array( + $this->module->id, +); +?> +
+ Welcome to Klapper time! +
+ +widget('bootstrap.widgets.BootButton', array( + 'label'=>'Primary', + 'type'=>'primary', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse' + 'size'=>'large', // '', 'large', 'small' or 'mini' +)); ?> +widget('bootstrap.widgets.BootLabel', array( + 'type'=>'success', // '', 'success', 'warning', 'important', 'info' or 'inverse' + 'label'=>'Success', +)); ?> \ No newline at end of file diff --git a/protected/views/layouts/main.php b/protected/views/layouts/main.php index f2ff75a..72c6c6e 100644 --- a/protected/views/layouts/main.php +++ b/protected/views/layouts/main.php @@ -46,7 +46,7 @@
-
- +getUniqueId()=='site'): ?>
+
+ +
diff --git a/themes/biskit/views/site/index.php b/themes/biskit/views/site/index.php index 982c4c1..66fe60b 100644 --- a/themes/biskit/views/site/index.php +++ b/themes/biskit/views/site/index.php @@ -7,7 +7,7 @@

Directory

-

Lorem ipsum dolor sit amet, consectetur .

+

YOOOOO .

More