Skip to content
Browse files

Initial commit of sample Yii project to use as basis

  • Loading branch information...
1 parent 65e06f4 commit cd47228acf02d744f2c9552534da0e93d2b36b34 root committed May 21, 2011
Showing with 19,500 additions and 0 deletions.
  1. +11 −0 README
  2. +10 −0 install.sh
  3. +1 −0 protected/.htaccess
  4. +23 −0 protected/components/Controller.php
  5. +33 −0 protected/components/UserIdentity.php
  6. +24 −0 protected/config/console.php
  7. +120 −0 protected/config/main.php
  8. +17 −0 protected/config/test.php
  9. +180 −0 protected/controllers/ContactUsController.php
  10. +191 −0 protected/controllers/Meet20110224Controller.php
  11. +142 −0 protected/controllers/SiteController.php
  12. +28 −0 protected/data/schema.mysql.sql
  13. +28 −0 protected/data/schema.sqlite.sql
  14. BIN protected/data/testdrive.db
  15. +242 −0 protected/extensions/yii-mail/YiiMail.php
  16. +145 −0 protected/extensions/yii-mail/YiiMailMessage.php
  17. +462 −0 ...cted/extensions/yii-mail/doc/Swift/ByteStream/Swift_ByteStream_AbstractFilterableInputStream.html
  18. +405 −0 protected/extensions/yii-mail/doc/Swift/ByteStream/Swift_ByteStream_ArrayByteStream.html
  19. +374 −0 protected/extensions/yii-mail/doc/Swift/ByteStream/Swift_ByteStream_FileByteStream.html
  20. +203 −0 protected/extensions/yii-mail/doc/Swift/ByteStream/Swift_FileStream.html
  21. +302 −0 protected/extensions/yii-mail/doc/Swift/ByteStream/Swift_InputByteStream.html
  22. +229 −0 protected/extensions/yii-mail/doc/Swift/ByteStream/Swift_OutputByteStream.html
  23. +164 −0 ...am/_vendors---swiftMailer---classes---Swift---ByteStream---AbstractFilterableInputStream.php.html
  24. +164 −0 ...Swift/ByteStream/_vendors---swiftMailer---classes---Swift---ByteStream---ArrayByteStream.php.html
  25. +164 −0 .../Swift/ByteStream/_vendors---swiftMailer---classes---Swift---ByteStream---FileByteStream.php.html
  26. +164 −0 ...ions/yii-mail/doc/Swift/ByteStream/_vendors---swiftMailer---classes---Swift---FileStream.php.html
  27. +164 −0 ...yii-mail/doc/Swift/ByteStream/_vendors---swiftMailer---classes---Swift---InputByteStream.php.html
  28. +164 −0 ...ii-mail/doc/Swift/ByteStream/_vendors---swiftMailer---classes---Swift---OutputByteStream.php.html
  29. +391 −0 protected/extensions/yii-mail/doc/Swift/CharacterStream/Swift_CharacterStream.html
  30. +471 −0 ...ted/extensions/yii-mail/doc/Swift/CharacterStream/Swift_CharacterStream_ArrayCharacterStream.html
  31. +471 −0 protected/extensions/yii-mail/doc/Swift/CharacterStream/Swift_CharacterStream_NgCharacterStream.html
  32. +164 −0 ...Stream/_vendors---swiftMailer---classes---Swift---CharacterStream---ArrayCharacterStream.php.html
  33. +164 −0 ...terStream/_vendors---swiftMailer---classes---Swift---CharacterStream---NgCharacterStream.php.html
  34. +184 −0 ...ail/doc/Swift/CharacterStream/_vendors---swiftMailer---classes---Swift---CharacterStream.php.html
  35. +311 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_CharacterReader.html
  36. +195 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_CharacterReaderFactory.html
  37. +221 −0 ...ensions/yii-mail/doc/Swift/Encoder/Swift_CharacterReaderFactory_SimpleCharacterReaderFactory.html
  38. +323 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_CharacterReader_GenericFixedWidthReader.html
  39. +295 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_CharacterReader_UsAsciiReader.html
  40. +298 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_CharacterReader_Utf8Reader.html
  41. +218 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_Encoder.html
  42. +249 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_Encoder_Base64Encoder.html
  43. +442 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_Encoder_QpEncoder.html
  44. +263 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_Encoder_Rfc2231Encoder.html
  45. +250 −0 protected/extensions/yii-mail/doc/Swift/Encoder/Swift_Encoding.html
  46. +164 −0 ...der/_vendors---swiftMailer---classes---Swift---CharacterReader---GenericFixedWidthReader.php.html
  47. +164 −0 ...Swift/Encoder/_vendors---swiftMailer---classes---Swift---CharacterReader---UsAsciiReader.php.html
  48. +164 −0 ...oc/Swift/Encoder/_vendors---swiftMailer---classes---Swift---CharacterReader---Utf8Reader.php.html
  49. +164 −0 ...ns/yii-mail/doc/Swift/Encoder/_vendors---swiftMailer---classes---Swift---CharacterReader.php.html
  50. +164 −0 ...---swiftMailer---classes---Swift---CharacterReaderFactory---SimpleCharacterReaderFactory.php.html
  51. +164 −0 ...mail/doc/Swift/Encoder/_vendors---swiftMailer---classes---Swift---CharacterReaderFactory.php.html
  52. +164 −0 ...ail/doc/Swift/Encoder/_vendors---swiftMailer---classes---Swift---Encoder---Base64Encoder.php.html
  53. +164 −0 ...ii-mail/doc/Swift/Encoder/_vendors---swiftMailer---classes---Swift---Encoder---QpEncoder.php.html
  54. +164 −0 ...il/doc/Swift/Encoder/_vendors---swiftMailer---classes---Swift---Encoder---Rfc2231Encoder.php.html
  55. +164 −0 ...extensions/yii-mail/doc/Swift/Encoder/_vendors---swiftMailer---classes---Swift---Encoder.php.html
  56. +164 −0 ...xtensions/yii-mail/doc/Swift/Encoder/_vendors---swiftMailer---classes---Swift---Encoding.php.html
  57. +261 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_CommandEvent.html
  58. +197 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_CommandListener.html
  59. +237 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_Event.html
  60. +359 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_EventDispatcher.html
  61. +192 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_EventListener.html
  62. +320 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_EventObject.html
  63. +261 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_ResponseEvent.html
  64. +197 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_ResponseListener.html
  65. +402 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_SendEvent.html
  66. +222 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_SendListener.html
  67. +421 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_SimpleEventDispatcher.html
  68. +211 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_TransportChangeEvent.html
  69. +272 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_TransportChangeListener.html
  70. +239 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_TransportExceptionEvent.html
  71. +197 −0 protected/extensions/yii-mail/doc/Swift/Events/Swift_Events_TransportExceptionListener.html
  72. +164 −0 ...i-mail/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---CommandEvent.php.html
  73. +164 −0 ...ail/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---CommandListener.php.html
  74. +164 −0 ...ions/yii-mail/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---Event.php.html
  75. +164 −0 ...ail/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---EventDispatcher.php.html
  76. +164 −0 ...-mail/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---EventListener.php.html
  77. +164 −0 ...ii-mail/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---EventObject.php.html
  78. +164 −0 ...-mail/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---ResponseEvent.php.html
  79. +164 −0 ...il/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---ResponseListener.php.html
  80. +164 −0 .../yii-mail/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---SendEvent.php.html
  81. +164 −0 ...i-mail/doc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---SendListener.php.html
  82. +164 −0 ...c/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---SimpleEventDispatcher.php.html
  83. +164 −0 ...oc/Swift/Events/_vendors---swiftMailer---classes---Swift---Events---TransportChangeEvent.php.html
  84. +164 −0 ...Swift/Events/_vendors---swiftMailer---classes---Swift---Events---TransportChangeListener.php.html
  85. +164 −0 ...Swift/Events/_vendors---swiftMailer---classes---Swift---Events---TransportExceptionEvent.php.html
  86. +164 −0 ...ft/Events/_vendors---swiftMailer---classes---Swift---Events---TransportExceptionListener.php.html
  87. +427 −0 protected/extensions/yii-mail/doc/Swift/KeyCache/Swift_KeyCache.html
  88. +472 −0 protected/extensions/yii-mail/doc/Swift/KeyCache/Swift_KeyCache_ArrayKeyCache.html
  89. +523 −0 protected/extensions/yii-mail/doc/Swift/KeyCache/Swift_KeyCache_DiskKeyCache.html
  90. +315 −0 protected/extensions/yii-mail/doc/Swift/KeyCache/Swift_KeyCache_KeyCacheInputStream.html
  91. +447 −0 protected/extensions/yii-mail/doc/Swift/KeyCache/Swift_KeyCache_NullKeyCache.html
Sorry, we could not display the entire diff because too many files (2,506) changed.
View
11 README
@@ -0,0 +1,11 @@
+2011-04-30
+Paul Lowndes
+
+This is the old landing page for Honolulu Hackerspace, done using the Yii Framework.
+
+The code was not done cleanly, nor was it intended for public consumption, so go through the config file carefully.
+
+You will need PHP 5 and MySQL (since the dump file provided is MySQL) but it is possible to convert it to PG or another.
+
+Run the install script, set up the DB, set the config file(s) as specified, point your web root to the web folder, and that should be it!
+
View
10 install.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+echo 'Create the DB using the provided schema.'
+echo 'Then you will need to set the various items in config/main.php'
+echo 'Be careful and go through them all!'
+echo 'The project was not intended to be user-friendly, nor cleanly done, so pay attention to all parameters.'
+echo 'You might need to sift through some views or models or something, which is the idea anyway. Yii is a nice framework to use'
+
+chmod -R 777 protected/runtime
+chmod -R 777 web/assets
+echo 'Okay, the log file and assets have been set to wide open permissions!'
View
1 protected/.htaccess
@@ -0,0 +1 @@
+deny from all
View
23 protected/components/Controller.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Controller is the customized base controller class.
+ * All controller classes for this application should extend from this base class.
+ */
+class Controller extends CController
+{
+ /**
+ * @var string the default layout for the controller view. Defaults to '//layouts/column1',
+ * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
+ */
+ public $layout='//layouts/column1';
+ /**
+ * @var array context menu items. This property will be assigned to {@link CMenu::items}.
+ */
+ public $menu=array();
+ /**
+ * @var array the breadcrumbs of the current page. The value of this property will
+ * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
+ * for more details on how to specify this property.
+ */
+ public $breadcrumbs=array();
+}
View
33 protected/components/UserIdentity.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * UserIdentity represents the data needed to identity a user.
+ * It contains the authentication method that checks if the provided
+ * data can identity the user.
+ */
+class UserIdentity extends CUserIdentity
+{
+ /**
+ * Authenticates a user.
+ * The example implementation makes sure if the username and password
+ * are both 'demo'.
+ * In practical applications, this should be changed to authenticate
+ * against some persistent user identity storage (e.g. database).
+ * @return boolean whether authentication succeeds.
+ */
+ public function authenticate()
+ {
+ $users=array(
+ // username => password
+ 'demo'=>'demoasfq3135135t',
+ 'admin'=>'admina345aastq34rt',
+ );
+ if(!isset($users[$this->username]))
+ $this->errorCode=self::ERROR_USERNAME_INVALID;
+ else if($users[$this->username]!==$this->password)
+ $this->errorCode=self::ERROR_PASSWORD_INVALID;
+ else
+ $this->errorCode=self::ERROR_NONE;
+ return !$this->errorCode;
+ }
+}
View
24 protected/config/console.php
@@ -0,0 +1,24 @@
+<?php
+
+// This is the configuration for yiic console application.
+// Any writable CConsoleApplication properties can be configured here.
+return array(
+ 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
+ 'name'=>'My Console Application',
+ // application components
+ 'components'=>array(
+ 'db'=>array(
+ 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
+ ),
+ // uncomment the following to use a MySQL database
+ /*
+ 'db'=>array(
+ 'connectionString' => 'mysql:host=localhost;dbname=testdrive',
+ 'emulatePrepare' => true,
+ 'username' => 'root',
+ 'password' => '',
+ 'charset' => 'utf8',
+ ),
+ */
+ ),
+);
View
120 protected/config/main.php
@@ -0,0 +1,120 @@
+<?php
+
+// uncomment the following to define a path alias
+// Yii::setPathOfAlias('local','path/to/local-folder');
+
+// This is the main Web application configuration. Any writable
+// CWebApplication properties can be configured here.
+$settingsMain = array(
+ 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
+ 'name'=>'Organization Name of City, State',
+
+ // preloading 'log' component
+ 'preload'=>array('log'),
+
+ // autoloading model and component classes
+ 'import'=>array(
+ 'application.models.*',
+ 'application.components.*',
+ 'ext.yii-mail.YiiMailMessage',
+ ),
+
+ 'modules'=>array(
+
+ ),
+
+ // application components
+ 'components'=>array(
+ 'user'=>array(
+ // enable cookie-based authentication
+ 'allowAutoLogin'=>true,
+ ),
+ // uncomment the following to enable URLs in path-format
+
+ 'urlManager'=>array(
+ 'urlFormat'=>'path',
+ 'appendParams' => true,
+ 'showScriptName' => false,
+ //'rules'=>array(
+ // '<controller:\w+>/<id:\d+>'=>'<controller>/view',
+ // '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
+ // '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
+ //),
+ ),
+
+ 'db'=>array(
+ 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
+ ),
+ // uncomment the following to use a MySQL database
+
+ 'db'=>array(
+ 'connectionString' => 'mysql:host=localhost;dbname=streetgrindzapp', //set db name
+ 'emulatePrepare' => true,
+ 'username' => 'streetgrindzuser', //set username
+ 'password' => 'dev', //set password
+ 'charset' => 'utf8',
+ ),
+
+ 'errorHandler'=>array(
+ // use 'site/error' action to display errors
+ 'errorAction'=>'site/error',
+ ),
+ 'log'=>array(
+ 'class'=>'CLogRouter',
+ 'routes'=>array(
+ array(
+ 'class'=>'CFileLogRoute',
+ 'levels'=>'error, warning',
+ ),
+ // uncomment the following to show log messages on web pages
+ /*
+ array(
+ 'class'=>'CWebLogRoute',
+ ),
+ */
+ ),
+ ),
+ 'mail' => array(
+ 'class' => 'ext.yii-mail.YiiMail',
+ 'transportType' => 'php',
+ 'viewPath' => 'application.views',
+ 'logging' => true,
+ 'dryRun' => false
+ ),
+ ),
+
+ // application-level parameters that can be accessed
+ // using Yii::app()->params['paramName']
+ 'params'=>array(
+ // this is used in contact page
+ 'adminEmail'=>'admin@mydomain.com',
+ 'contactEmail'=>'contact@mydomain.com',
+ ),
+);
+
+if ($_SERVER['HTTP_HOST'] === 'www.myurl.com' || $_SERVER['HTTP_HOST'] === 'myurl.com') {
+ $settingsMain['components']['log']['routes'][] =
+ array(
+ 'class' => 'CEmailLogRoute',
+ 'levels' => 'error, warning',
+ 'emails' => 'error@mydomain.com',
+ );
+} else {
+ $settingsMain['components']['log']['routes'][] =
+ array(
+ 'class' => 'CWebLogRoute',
+ 'levels' => 'error, warning',
+ );
+ $settingsMain['modules']['gii'] =
+ array(
+ 'class' => 'system.gii.GiiModule',
+ 'password' => 'admin',
+ 'ipFilters' =>
+ array(
+ '192.168.1.100',
+ '192.168.1.101', /// SET IP's for dev machine here
+ '192.168.1.110'
+ )
+ );
+}
+return $settingsMain;
View
17 protected/config/test.php
@@ -0,0 +1,17 @@
+<?php
+
+return CMap::mergeArray(
+ require(dirname(__FILE__).'/main.php'),
+ array(
+ 'components'=>array(
+ 'fixture'=>array(
+ 'class'=>'system.test.CDbFixtureManager',
+ ),
+ /* uncomment the following to provide test database connection
+ 'db'=>array(
+ 'connectionString'=>'DSN for test database',
+ ),
+ */
+ ),
+ )
+);
View
180 protected/controllers/ContactUsController.php
@@ -0,0 +1,180 @@
+<?php
+
+class ContactUsController extends Controller
+{
+ /**
+ * @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('admin'),
+ ),
+ array('allow', // allow authenticated user to perform 'create' and 'update' actions
+ 'actions'=>array('create'),
+ 'users'=>array('*'),
+ ),
+ array('allow', // allow authenticated user to perform 'create' and 'update' actions
+ 'actions'=>array('update'),
+ 'users'=>array('admin'),
+ ),
+ 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 ContactUs;
+
+ // Uncomment the following line if AJAX validation is needed
+ // $this->performAjaxValidation($model);
+
+ if(isset($_POST['ContactUs']))
+ {
+ $model->attributes=$_POST['ContactUs'];
+ if($model->save())
+ $this->redirect(array('view','id'=>$model->id));
+ }
+
+ $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['ContactUs']))
+ {
+ $model->attributes=$_POST['ContactUs'];
+ if($model->save())
+ $this->redirect(array('view','id'=>$model->id));
+ }
+
+ $this->render('update',array(
+ 'model'=>$model,
+ ));
+ }
+
+ /**
+ * Deletes a particular model.
+ * If deletion is successful, the browser will be redirected to the 'index' 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('ContactUs');
+ $this->render('index',array(
+ 'dataProvider'=>$dataProvider,
+ ));
+ }
+
+ /**
+ * Manages all models.
+ */
+ public function actionAdmin()
+ {
+ $model=new ContactUs('search');
+ $model->unsetAttributes(); // clear any default values
+ if(isset($_GET['ContactUs']))
+ $model->attributes=$_GET['ContactUs'];
+
+ $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=ContactUs::model()->findByPk((int)$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']==='contact-us-form')
+ {
+ echo CActiveForm::validate($model);
+ Yii::app()->end();
+ }
+ }
+}
View
191 protected/controllers/Meet20110224Controller.php
@@ -0,0 +1,191 @@
+<?php
+
+class Meet20110224Controller extends Controller
+{
+ /**
+ * @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'),
+ 'users'=>array('*'),
+ ),
+ 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 Meet20110224;
+ //
+ // // Uncomment the following line if AJAX validation is needed
+ // // $this->performAjaxValidation($model);
+ //
+ // if(isset($_POST['Meet20110224']))
+ // {
+ // $model->attributes=$_POST['Meet20110224'];
+ // if($model->save())
+ // $this->redirect(array('view','id'=>$model->id));
+ // }
+ //
+ // $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['Meet20110224']))
+ // {
+ // $model->attributes=$_POST['Meet20110224'];
+ // if($model->save())
+ // $this->redirect(array('view','id'=>$model->id));
+ // }
+ //
+ // $this->render('update',array(
+ // 'model'=>$model,
+ // ));
+ //}
+
+ /**
+ * Deletes a particular model.
+ * If deletion is successful, the browser will be redirected to the 'index' 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()
+ {
+ $modelCreate=new Meet20110224;
+
+ // Uncomment the following line if AJAX validation is needed
+ // $this->performAjaxValidation($model);
+ $msg = '';
+ if(isset($_POST['Meet20110224'])) {
+ $modelCreate->attributes=$_POST['Meet20110224'];
+ if($modelCreate->save()) {
+ $msg = 'Thank you for registering for the meet and greet at Murphy\'s';
+ }
+ }
+
+ $model=new Meet20110224('search');
+ $model->unsetAttributes(); // clear any default values
+ if(isset($_GET['Meet20110224']))
+ $model->attributes=$_GET['Meet20110224'];
+
+ $this->render('admin',array(
+ 'model'=>$model,
+ 'modelCreate'=>$modelCreate,
+ 'msg'=>$msg,
+ ));
+
+ //$dataProvider=new CActiveDataProvider('Meet20110224');
+ //$this->render('index',array(
+ // 'dataProvider'=>$dataProvider,
+ //));
+ }
+
+ /**
+ * Manages all models.
+ */
+ //public function actionAdmin()
+ //{
+ // $model=new Meet20110224('search');
+ // $model->unsetAttributes(); // clear any default values
+ // if(isset($_GET['Meet20110224']))
+ // $model->attributes=$_GET['Meet20110224'];
+ //
+ // $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=Meet20110224::model()->findByPk((int)$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']==='meet20110224-form')
+ {
+ echo CActiveForm::validate($model);
+ Yii::app()->end();
+ }
+ }
+}
View
142 protected/controllers/SiteController.php
@@ -0,0 +1,142 @@
+<?php
+
+class SiteController extends Controller
+{
+ /**
+ * Declares class-based actions.
+ */
+ public function actions()
+ {
+ return array(
+ // captcha action renders the CAPTCHA image displayed on the contact page
+ 'captcha'=>array(
+ 'class'=>'CCaptchaAction',
+ 'backColor'=>0xFFFFFF,
+ ),
+ // page action renders "static" pages stored under 'protected/views/site/pages'
+ // They can be accessed via: index.php?r=site/page&view=FileName
+ 'page'=>array(
+ 'class'=>'CViewAction',
+ ),
+ );
+ }
+
+ /**
+ * This is the default 'index' action that is invoked
+ * when an action is not explicitly requested by users.
+ */
+ public function actionIndex()
+ {
+ // renders the view file 'protected/views/site/index.php'
+ // using the default layout 'protected/views/layouts/main.php'
+ $this->render('index');
+ }
+
+ /**
+ * This is the action to handle external exceptions.
+ */
+ public function actionError()
+ {
+ if($error=Yii::app()->errorHandler->error)
+ {
+ if(Yii::app()->request->isAjaxRequest)
+ echo $error['message'];
+ else
+ $this->render('error', $error);
+ }
+ }
+
+ /**
+ * Displays the contact page
+ */
+ public function actionContact()
+ {
+ //$model=new ContactForm;
+ //if(isset($_POST['ContactForm']))
+ //{
+ // $model->attributes=$_POST['ContactForm'];
+ // if($model->validate())
+ // {
+ // $headers="From: {$model->email}\r\nReply-To: {$model->email}";
+ // mail(Yii::app()->params['adminEmail'],$model->subject,$model->body,$headers);
+ // Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');
+ // $this->refresh();
+ // }
+ //}
+ //$this->render('contact',array('model'=>$model));
+ $model=new ContactUs;
+
+ // Uncomment the following line if AJAX validation is needed
+ // $this->performAjaxValidation($model);
+
+ if(isset($_POST['ContactUs']))
+ {
+ $model->attributes=$_POST['ContactUs'];
+ if($model->save()) {
+ $this->render('thankYou',array(
+ 'model'=>$model,
+ ));
+ $this->sendContactMails($model);
+ return;
+ }
+ }
+
+ $this->render('/contactUs/create',array(
+ 'model'=>$model,
+ ));
+ }
+
+ private function sendContactMails($model) {
+ $message = new YiiMailMessage;
+ $message->view = 'emails/toUserContactForm';
+ $message->setBody(array('model'=>$model), 'text/html');
+ $message->subject = 'Thank you';
+ $message->addTo($model->email_address);
+ $message->from = Yii::app()->params['adminEmail'];
+ Yii::app()->mail->send($message);
+
+ $message = new YiiMailMessage;
+ $message->view = 'emails/toAdminFromUserContactForm';
+ $message->setBody(array('model'=>$model), 'text/html');
+ $message->subject = 'Contact Form Filled Out';
+ $message->addTo(Yii::app()->params['contactEmail']);
+ $message->from = Yii::app()->params['adminEmail'];
+ Yii::app()->mail->send($message);
+
+ }
+
+ /**
+ * Displays the login page
+ */
+ public function actionLogin()
+ {
+ $model=new LoginForm;
+
+ // if it is ajax validation request
+ if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')
+ {
+ echo CActiveForm::validate($model);
+ Yii::app()->end();
+ }
+
+ // collect user input data
+ if(isset($_POST['LoginForm']))
+ {
+ $model->attributes=$_POST['LoginForm'];
+ // validate user input and redirect to the previous page if valid
+ if($model->validate() && $model->login())
+ $this->redirect(Yii::app()->user->returnUrl);
+ }
+ // display the login form
+ $this->render('login',array('model'=>$model));
+ }
+
+ /**
+ * Logs out the current user and redirect to homepage.
+ */
+ public function actionLogout()
+ {
+ Yii::app()->user->logout();
+ $this->redirect(Yii::app()->homeUrl);
+ }
+}
View
28 protected/data/schema.mysql.sql
@@ -0,0 +1,28 @@
+CREATE TABLE tbl_user (
+ id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ username VARCHAR(128) NOT NULL,
+ password VARCHAR(128) NOT NULL,
+ email VARCHAR(128) NOT NULL
+);
+
+INSERT INTO tbl_user (username, password, email) VALUES ('test1', 'pass1', 'test1@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test2', 'pass2', 'test2@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test3', 'pass3', 'test3@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test4', 'pass4', 'test4@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test5', 'pass5', 'test5@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test6', 'pass6', 'test6@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test7', 'pass7', 'test7@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test8', 'pass8', 'test8@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test9', 'pass9', 'test9@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test10', 'pass10', 'test10@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test11', 'pass11', 'test11@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test12', 'pass12', 'test12@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test13', 'pass13', 'test13@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test14', 'pass14', 'test14@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test15', 'pass15', 'test15@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test16', 'pass16', 'test16@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test17', 'pass17', 'test17@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test18', 'pass18', 'test18example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test19', 'pass19', 'test19example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test20', 'pass20', 'test20@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test21', 'pass21', 'test21@example.com');
View
28 protected/data/schema.sqlite.sql
@@ -0,0 +1,28 @@
+CREATE TABLE tbl_user (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ username VARCHAR(128) NOT NULL,
+ password VARCHAR(128) NOT NULL,
+ email VARCHAR(128) NOT NULL
+);
+
+INSERT INTO tbl_user (username, password, email) VALUES ('test1', 'pass1', 'test1@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test2', 'pass2', 'test2@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test3', 'pass3', 'test3@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test4', 'pass4', 'test4@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test5', 'pass5', 'test5@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test6', 'pass6', 'test6@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test7', 'pass7', 'test7@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test8', 'pass8', 'test8@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test9', 'pass9', 'test9@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test10', 'pass10', 'test10@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test11', 'pass11', 'test11@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test12', 'pass12', 'test12@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test13', 'pass13', 'test13@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test14', 'pass14', 'test14@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test15', 'pass15', 'test15@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test16', 'pass16', 'test16@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test17', 'pass17', 'test17@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test18', 'pass18', 'test18example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test19', 'pass19', 'test19example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test20', 'pass20', 'test20@example.com');
+INSERT INTO tbl_user (username, password, email) VALUES ('test21', 'pass21', 'test21@example.com');
View
BIN protected/data/testdrive.db
Binary file not shown.
View
242 protected/extensions/yii-mail/YiiMail.php
@@ -0,0 +1,242 @@
+<?php
+/**
+* YiiMail class file.
+*
+* @author Jonah Turnquist <poppitypop@gmail.com>
+* @link https://code.google.com/p/yii-mail/
+* @package Yii-Mail
+*/
+
+/**
+* YiiMail is an application component used for sending email.
+*
+* You may configure it as below. Check the public attributes and setter
+* methods of this class for more options.
+* <pre>
+* return array(
+* ...
+* 'import => array(
+* ...
+* 'ext.mail.YiiMailMessage',
+* ),
+* 'components' => array(
+* 'mail' => array(
+* 'class' => 'ext.yii-mail.YiiMail',
+* 'transportType' => 'php',
+* 'viewPath' => 'application.views.mail',
+* 'logging' => true,
+* 'dryRun' => false
+* ),
+* ...
+* )
+* );
+* </pre>
+*
+* Example usage:
+* <pre>
+* $message = new YiiMailMessage;
+* $message->setBody('Message content here with HTML', 'text/html');
+* $message->subject = 'My Subject';
+* $message->addTo('johnDoe@domain.com');
+* $message->from = Yii::app()->params['adminEmail'];
+* Yii::app()->mail->send($message);
+* </pre>
+*/
+class YiiMail extends CApplicationComponent
+{
+ /**
+ * @var bool whether to log messages using Yii::log().
+ * Defaults to true.
+ */
+ public $logging = true;
+
+ /**
+ * @var bool whether to disable actually sending mail.
+ * Defaults to false.
+ */
+ public $dryRun = false;
+
+ /**
+ * @var string the delivery type. Can be either 'php' or 'smtp'. When
+ * using 'php', PHP's {@link mail()} function will be used.
+ * Defaults to 'php'.
+ */
+ public $transportType = 'php';
+
+ /**
+ * @var string the path to the location where mail views are stored.
+ * Defaults to 'application.views.mail'.
+ */
+ public $viewPath = 'application.views.mail';
+
+ /**
+ * @var string options specific to the transport type being used.
+ * To set options for STMP, set this attribute to an array where the keys
+ * are the option names and the values are their values.
+ * Possible options for SMTP are:
+ * <ul>
+ * <li>host</li>
+ * <li>username</li>
+ * <li>password</li>
+ * <li>port</li>
+ * <li>encryption</li>
+ * <li>timeout</li>
+ * <li>extensionHandlers</li>
+ * </ul>
+ * See the SwiftMailer documentaion for the option meanings.
+ */
+ public $transportOptions;
+
+ /**
+ * @var mixed Holds the SwiftMailer transport
+ */
+ protected $transport;
+
+ /**
+ * @var mixed Holds the SwiftMailer mailer
+ */
+ protected $mailer;
+
+ private static $registeredScripts = false;
+
+ /**
+ * Calls the {@link registerScripts()} method.
+ */
+ public function init() {
+ $this->registerScripts();
+ parent::init();
+ }
+
+ /**
+ * Send a {@link YiiMailMessage} as it would be sent in a mail client.
+ *
+ * All recipients (with the exception of Bcc) will be able to see the other
+ * recipients this message was sent to.
+ *
+ * If you need to send to each recipient without disclosing details about the
+ * other recipients see {@link batchSend()}.
+ *
+ * Recipient/sender data will be retreived from the {@link YiiMailMessage}
+ * object.
+ *
+ * The return value is the number of recipients who were accepted for
+ * delivery.
+ *
+ * @param YiiMailMessage $message
+ * @param array &$failedRecipients, optional
+ * @return int
+ * @see batchSend()
+ */
+ public function send(YiiMailMessage $message, &$failedRecipients = null) {
+ if ($this->logging===true) self::log($message);
+ if ($this->dryRun===true) return count($message->to);
+ else return $this->getMailer()->send($message->message, $failedRecipients);
+ }
+
+ /**
+ * Send the given {@link YiiMailMessage} to all recipients individually.
+ *
+ * This differs from {@link send()} in the way headers are presented to the
+ * recipient. The only recipient in the "To:" field will be the individual
+ * recipient it was sent to.
+ *
+ * If an iterator is provided, recipients will be read from the iterator
+ * one-by-one, otherwise recipient data will be retreived from the
+ * {@link YiiMailMessage} object.
+ *
+ * Sender information is always read from the {@link YiiMailMessage} object.
+ *
+ * The return value is the number of recipients who were accepted for
+ * delivery.
+ *
+ * @param YiiMailMessage $message
+ * @param array &$failedRecipients, optional
+ * @param Swift_Mailer_RecipientIterator $it, optional
+ * @return int
+ * @see send()
+ */
+ public function batchSend(YiiMailMessage $message, &$failedRecipients = null, Swift_Mailer_RecipientIterator $it = null) {
+ if ($this->logging===true) self::log($message);
+ if ($this->dryRun===true) return count($message->to);
+ else return $this->getMailer()->batchSend($message->message, $failedRecipients, $it);
+ }
+
+ /**
+ * Sends a message in an extremly simple but less extensive way.
+ *
+ * @param mixed from address, string or array of the form $address => $name
+ * @param mixed to address, string or array of the form $address => $name
+ * @param string subject
+ * @param string body
+ */
+ public function sendSimple($from, $to, $subject, $body) {
+ $message = new YiiMailMessage;
+ $message->setSubject($subject)
+ ->setFrom($from)
+ ->setTo($to)
+ ->setBody($body, 'text/html');
+
+ if ($this->logging===true) self::log($message);
+ if ($this->dryRun===true) return count($message->to);
+ else return $this->getMailer()->send($message);
+ }
+
+ /**
+ * Logs a YiiMailMessage in a (hopefully) readable way using Yii::log.
+ * @return string log message
+ */
+ public static function log(YiiMailMessage $message) {
+ $msg = 'Sending email to '.implode(', ', array_keys($message->to))."\n".
+ implode('', $message->headers->getAll())."\n".
+ $message->body
+ ;
+ Yii::log($msg, CLogger::LEVEL_INFO, 'ext.yii-mail.YiiMail'); // TODO: attempt to determine alias/category at runtime
+ return $msg;
+ }
+
+ /**
+ * Gets the SwiftMailer transport class instance, initializing it if it has
+ * not been created yet
+ * @return mixed {@link Swift_MailTransport} or {@link Swift_SmtpTransport}
+ */
+ public function getTransport() {
+ if ($this->transport===null) {
+ switch ($this->transportType) {
+ case 'php':
+ $this->transport = Swift_MailTransport::newInstance();
+ if ($this->transportOptions !== null)
+ $this->transport->setExtraParams($this->transportOptions);
+ break;
+ case 'smtp':
+ $this->transport = Swift_SmtpTransport::newInstance();
+ foreach ($this->transportOptions as $option => $value)
+ $this->transport->{'set'.ucfirst($option)}($value); // sets option with the setter method
+ break;
+ }
+ }
+
+ return $this->transport;
+ }
+
+ /**
+ * Gets the SwiftMailer {@link Swift_Mailer} class instance
+ * @return Swift_Mailer
+ */
+ public function getMailer() {
+ if ($this->mailer===null)
+ $this->mailer = Swift_Mailer::newInstance($this->getTransport());
+
+ return $this->mailer;
+ }
+
+ /**
+ * Registers swiftMailer autoloader and includes the required files
+ */
+ public function registerScripts() {
+ if (self::$registeredScripts) return;
+ self::$registeredScripts = true;
+ require dirname(__FILE__).'/vendors/swiftMailer/classes/Swift.php';
+ Yii::registerAutoloader(array('Swift','autoload'));
+ require dirname(__FILE__).'/vendors/swiftMailer/swift_init.php';
+ }
+}
View
145 protected/extensions/yii-mail/YiiMailMessage.php
@@ -0,0 +1,145 @@
+<?php
+/**
+* YiiMailMessage class file.
+*
+* @author Jonah Turnquist <poppitypop@gmail.com>
+* @link https://code.google.com/p/yii-mail/
+* @package Yii-Mail
+*/
+
+/**
+* Any requests to set or get attributes or call methods on this class that are
+* not found in that class are redirected to the {@link Swift_Mime_Message}
+* object.
+*
+* This means you need to look at the Swift Mailer documentation to see what
+* methods are availiable for this class. There are a <b>lot</b> of methods,
+* more than I wish to document. Any methods availiable in
+* {@link Swift_Mime_Message} are availiable here.
+*
+* Documentation for the most important methods can be found at
+* {@link http://swiftmailer.org/docs/messages}
+*
+* The YiiMailMessage component also allows using a shorthand for methods in
+* {@link Swift_Mime_Message} that start with set* or get*
+* For instance, instead of calling $message->setFrom('...') you can use
+* $message->from = '...'.
+*
+* Here are a few methods to get you started:
+* <ul>
+* <li>setSubject('Your subject')</li>
+* <li>setFrom(array('john@doe.com' => 'John Doe'))</li>
+* <li>setTo(array('receiver@domain.org', 'other@domain.org' => 'Name'))</li>
+* <li>attach(Swift_Attachment::fromPath('my-document.pdf'))</li>
+* </ul>
+*/
+class YiiMailMessage extends CComponent {
+
+ /**
+ * @var string the view to use for rendering the body, null if no view is
+ * used. An extra variable $mail will be passed to the view .which you may
+ * use to set e.g. the email subject from within the view
+ */
+ public $view;
+
+ /**
+ * @var Swift_Mime_Message
+ */
+ public $message;
+
+ /**
+ * Any requests to set or get attributes or call methods on this class that
+ * are not found are redirected to the {@link Swift_Mime_Message} object.
+ * @param string the attribute name
+ */
+ public function __get($name) {
+ try {
+ return parent::__get($name);
+ } catch (CException $e) {
+ $getter = 'get'.$name;
+ if(method_exists($this->message, $getter))
+ return $this->message->$getter();
+ else
+ throw $e;
+ }
+ }
+
+ /**
+ * Any requests to set or get attributes or call methods on this class that
+ * are not found are redirected to the {@link Swift_Mime_Message} object.
+ * @param string the attribute name
+ */
+ public function __set($name, $value) {
+ try {
+ return parent::__set($name, $value);
+ } catch (CException $e) {
+ $setter = 'set'.$name;
+ if(method_exists($this->message, $setter))
+ $this->message->$setter($value);
+ else
+ throw $e;
+ }
+ }
+
+ /**
+ * Any requests to set or get attributes or call methods on this class that
+ * are not found are redirected to the {@link Swift_Mime_Message} object.
+ * @param string the method name
+ */
+ public function __call($name, $parameters) {
+ try {
+ return parent::__call($name, $parameters);
+ } catch (CException $e) {
+ if(method_exists($this->message, $name))
+ return call_user_func_array(array($this->message, $name), $parameters);
+ else
+ throw $e;
+ }
+ }
+
+ /**
+ * You may optionally set some message info using the paramaters of this
+ * constructor.
+ * Use {@link view} and {@link setBody()} for more control.
+ *
+ * @param string $subject
+ * @param string $body
+ * @param string $contentType
+ * @param string $charset
+ * @return Swift_Mime_Message
+ */
+ public function __construct($subject = null, $body = null, $contentType = null, $charset = null) {
+ Yii::app()->mail->registerScripts();
+ $this->message = Swift_Message::newInstance($subject = null, $body = null, $contentType = null, $charset = null);
+ }
+
+ /**
+ * Set the body of this entity, either as a string, or array of view
+ * variables if a view is set, or as an instance of
+ * {@link Swift_OutputByteStream}.
+ *
+ * @param mixed the body of the message. If a $this->view is set and this
+ * is a string, this is passed to the view as $body. If $this->view is set
+ * and this is an array, the array values are passed to the view like in the
+ * controller render() method
+ * @param string content type optional. For html, set to 'html/text'
+ * @param string charset optional
+ */
+ public function setBody($body = '', $contentType = null, $charset = null) {
+ if ($this->view !== null) {
+ if (!is_array($body)) $body = array('body'=>$body);
+
+ // if Yii::app()->controller doesn't exist create a dummy
+ // controller to render the view (needed in the console app)
+ if(!($controller = Yii::app()->controller))
+ $controller = new CController('YiiMail');
+
+ // renderPartial won't work with CConsoleApplication, so use
+ // renderInternal - this requires that we use an actual path to the
+ // view rather than the usual alias
+ $viewPath = Yii::getPathOfAlias(Yii::app()->mail->viewPath.'.'.$this->view).'.php';
+ $body = $controller->renderInternal($viewPath, array_merge($body, array('mail'=>$this)), true);
+ }
+ return $this->message->setBody($body, $contentType, $charset);
+ }
+}
View
462 ...ensions/yii-mail/doc/Swift/ByteStream/Swift_ByteStream_AbstractFilterableInputStream.html
@@ -0,0 +1,462 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Docs For Class Swift_ByteStream_AbstractFilterableInputStream</title>
+ <link rel="stylesheet" href="../../media/stylesheet.css" />
+ <script src="../../media/lib/classTree.js"></script>
+<link id="webfx-tab-style-sheet" type="text/css" rel="stylesheet" href="../../media/lib/tab.webfx.css" />
+<script type="text/javascript" src="../../media/lib/tabpane.js"></script>
+ <script language="javascript" type="text/javascript" src="../../media/lib/ua.js"></script>
+<script language="javascript" type="text/javascript">
+ var imgPlus = new Image();
+ var imgMinus = new Image();
+ imgPlus.src = "../../media/images/plus.gif";
+ imgMinus.src = "../../media/images/minus.gif";
+
+ function showNode(Node){
+ switch(navigator.family){
+ case 'nn4':
+ // Nav 4.x code fork...
+ var oTable = document.layers["span" + Node];
+ var oImg = document.layers["img" + Node];
+ break;
+ case 'ie4':
+ // IE 4/5 code fork...
+ var oTable = document.all["span" + Node];
+ var oImg = document.all["img" + Node];
+ break;
+ case 'gecko':
+ // Standards Compliant code fork...
+ var oTable = document.getElementById("span" + Node);
+ var oImg = document.getElementById("img" + Node);
+ break;
+ }
+ oImg.src = imgMinus.src;
+ oTable.style.display = "block";
+ }
+
+ function hideNode(Node){
+ switch(navigator.family){
+ case 'nn4':
+ // Nav 4.x code fork...
+ var oTable = document.layers["span" + Node];
+ var oImg = document.layers["img" + Node];
+ break;
+ case 'ie4':
+ // IE 4/5 code fork...
+ var oTable = document.all["span" + Node];
+ var oImg = document.all["img" + Node];
+ break;
+ case 'gecko':
+ // Standards Compliant code fork...
+ var oTable = document.getElementById("span" + Node);
+ var oImg = document.getElementById("img" + Node);
+ break;
+ }
+ oImg.src = imgPlus.src;
+ oTable.style.display = "none";
+ }
+
+ function nodeIsVisible(Node){
+ switch(navigator.family){
+ case 'nn4':
+ // Nav 4.x code fork...
+ var oTable = document.layers["span" + Node];
+ break;
+ case 'ie4':
+ // IE 4/5 code fork...
+ var oTable = document.all["span" + Node];
+ break;
+ case 'gecko':
+ // Standards Compliant code fork...
+ var oTable = document.getElementById("span" + Node);
+ break;
+ }
+ return (oTable && oTable.style.display == "block");
+ }
+
+ function toggleNodeVisibility(Node){
+ if (nodeIsVisible(Node)){
+ hideNode(Node);
+ }else{
+ showNode(Node);
+ }
+ }
+</script>
+<!-- template designed by Julien Damon based on PHPEdit's generated templates, and tweaked by Greg Beaver -->
+<body bgcolor="#ffffff" >
+<!-- Start of Class Data -->
+<h2>
+ Class Swift_ByteStream_AbstractFilterableInputStream
+</h2> (line <span class="linenumber">21</span>)
+<div class="tab-pane" id="tabPane1">
+<script type="text/javascript">
+tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ));
+</script>
+
+<div class="tab-page" id="Description">
+<h2 class="tab">Description</h2>
+<pre>
+</pre>
+<p>
+ <b><i>Located in File: <a href="_vendors---swiftMailer---classes---Swift---ByteStream---AbstractFilterableInputStream.php.html">/vendors/swiftMailer/classes/Swift/ByteStream/AbstractFilterableInputStream.php</a></i></b><br>
+</p>
+<!-- ========== Info from phpDoc block ========= -->
+<h5>Provides the base functionality for an InputStream supporting filters.</h5>
+<ul>
+ <li><strong>author:</strong> - Chris Corbyn</li>
+ <li><strong>abstract:</strong> - </li>
+ </ul>
+<br /><hr />
+<span class="type">Classes extended from Swift_ByteStream_AbstractFilterableInputStream:</span>
+ <dl>
+ <dt><a href="../../Swift/ByteStream/Swift_ByteStream_FileByteStream.html">Swift_ByteStream_FileByteStream</a></dt>
+ <dd>Allows reading and writing of bytes to and from a file.</dd>
+ </dl>
+ <dl>
+ <dt><a href="../../Swift/Transport/Swift_Transport_StreamBuffer.html">Swift_Transport_StreamBuffer</a></dt>
+ <dd>A generic IoBuffer implementation supporting remote sockets and local processes.</dd>
+ </dl>
+ </p>
+</div>
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "Description" ) );</script>
+<div class="tab-page" id="tabPage1">
+
+<h2 class="tab">Class Variables</h2>
+<!-- ============ VARIABLE DETAIL =========== -->
+<strong>Summary:</strong><br />
+<hr />
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage1" ) );</script>
+
+</div>
+<div class="tab-page" id="constantsTabpage">
+
+<h2 class="tab">Class Constants</h2>
+<!-- ============ VARIABLE DETAIL =========== -->
+<strong>Summary:</strong><br />
+<hr />
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "constantsTabpage" ) );</script>
+
+</div>
+<div class="tab-page" id="tabPage2">
+<h2 class="tab">Method Detail</h2>
+<!-- ============ METHOD DETAIL =========== -->
+<strong>Summary:</strong><br />
+<div class="method-summary">
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodaddFilter" title="details" class="method-name">addFilter</a>
+ (<span class="var-type"><a href="../../Swift/Swift_StreamFilter.html">Swift_StreamFilter</a></span>&nbsp;<span class="var-name">$filter</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodbind" title="details" class="method-name">bind</a>
+ (<span class="var-type"><a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a></span>&nbsp;<span class="var-name">$is</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodcommit" title="details" class="method-name">commit</a>
+ ()
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodflushBuffers" title="details" class="method-name">flushBuffers</a>
+ ()
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodremoveFilter" title="details" class="method-name">removeFilter</a>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodunbind" title="details" class="method-name">unbind</a>
+ (<span class="var-type"><a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a></span>&nbsp;<span class="var-name">$is</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodwrite" title="details" class="method-name">write</a>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$bytes</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#method_commit" title="details" class="method-name">_commit</a>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$bytes</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#method_flush" title="details" class="method-name">_flush</a>
+ ()
+ </div>
+</div>
+<hr />
+<A NAME='method_detail'></A>
+
+
+<a name="methodaddFilter" id="methodaddFilter"><!-- --></a>
+<div style="background='#ffffff'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method addFilter</strong> (line <span class="linenumber">55</span>)
+ </h4>
+<h4><i>void</i> <strong>addFilter(
+<a href="../../Swift/Swift_StreamFilter.html">Swift_StreamFilter</a>
+$filter, string
+$key)</strong></h4>
+
+ <hr class="separator" />
+ <div class="notes">Implementation of:</div>
+ <dl>
+ <dt><a href="../../Swift/Swift_Filterable.html#methodaddFilter">Swift_Filterable::addFilter()</a></dt>
+ <dd>Add a new StreamFilter, referenced by $key.</dd>
+ </dl>
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Add a StreamFilter to this InputByteStream.</h5>
+ <h4>Parameters</h4>
+ <ul>
+ <li><strong><a href="../../Swift/Swift_StreamFilter.html">Swift_StreamFilter</a> $filter</strong>: </li>
+ <li><strong>string $key</strong>: </li>
+ </ul>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>access</strong> - public</li>
+ </ul>
+</div>
+<a name="methodbind" id="methodbind"><!-- --></a>
+<div style="background='#eeeeee'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method bind</strong> (line <span class="linenumber">106</span>)
+ </h4>
+<h4><i>void</i> <strong>bind(
+<a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a>
+$is)</strong></h4>
+
+ <hr class="separator" />
+ <div class="notes">Implementation of:</div>
+ <dl>
+ <dt><a href="../../Swift/ByteStream/Swift_InputByteStream.html#methodbind">Swift_InputByteStream::bind()</a></dt>
+ <dd>Attach $is to this stream.</dd>
+ </dl>
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Attach $is to this stream.</h5>
+<div class="desc"><p>The stream acts as an observer, receiving all data that is written. All <a href="../../Swift/ByteStream/Swift_ByteStream_AbstractFilterableInputStream.html#methodwrite">write()</a> and <a href="../../Swift/ByteStream/Swift_ByteStream_AbstractFilterableInputStream.html#methodflushBuffers">flushBuffers()</a> operations will be mirrored.</p></div>
+ <h4>Parameters</h4>
+ <ul>
+ <li><strong><a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a> $is</strong>: </li>
+ </ul>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>access</strong> - public</li>
+ </ul>
+</div>
+<a name="methodcommit" id="methodcommit"><!-- --></a>
+<div style="background='#ffffff'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method commit</strong> (line <span class="linenumber">94</span>)
+ </h4>
+<h4><i>void</i> <strong>commit(
+)</strong></h4>
+
+ <hr class="separator" />
+ <div class="notes">Implementation of:</div>
+ <dl>
+ <dt><a href="../../Swift/ByteStream/Swift_InputByteStream.html#methodcommit">Swift_InputByteStream::commit()</a></dt>
+ <dd>For any bytes that are currently buffered inside the stream, force them off the buffer.</dd>
+ </dl>
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>For any bytes that are currently buffered inside the stream, force them off the buffer.</h5>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>throws</strong> - Swift_IoException</li>
+ <li><strong>access</strong> - public</li>
+ </ul>
+</div>
+<a name="methodflushBuffers" id="methodflushBuffers"><!-- --></a>
+<div style="background='#eeeeee'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method flushBuffers</strong> (line <span class="linenumber">139</span>)
+ </h4>
+<h4><i>void</i> <strong>flushBuffers(
+)</strong></h4>
+
+ <hr class="separator" />
+ <div class="notes">Implementation of:</div>
+ <dl>
+ <dt><a href="../../Swift/ByteStream/Swift_InputByteStream.html#methodflushBuffers">Swift_InputByteStream::flushBuffers()</a></dt>
+ <dd>Flush the contents of the stream (empty it) and set the internal pointer to the beginning.</dd>
+ </dl>
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Flush the contents of the stream (empty it) and set the internal pointer to the beginning.</h5>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>throws</strong> - Swift_IoException</li>
+ <li><strong>access</strong> - public</li>
+ </ul>
+</div>
+<a name="methodremoveFilter" id="methodremoveFilter"><!-- --></a>
+<div style="background='#ffffff'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method removeFilter</strong> (line <span class="linenumber">64</span>)
+ </h4>
+<h4><i>void</i> <strong>removeFilter(
+string
+$key)</strong></h4>
+
+ <hr class="separator" />
+ <div class="notes">Implementation of:</div>
+ <dl>
+ <dt><a href="../../Swift/Swift_Filterable.html#methodremoveFilter">Swift_Filterable::removeFilter()</a></dt>
+ <dd>Remove an existing filter using $key.</dd>
+ </dl>
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Remove an already present StreamFilter based on its $key.</h5>
+ <h4>Parameters</h4>
+ <ul>
+ <li><strong>string $key</strong>: </li>
+ </ul>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>access</strong> - public</li>
+ </ul>
+</div>
+<a name="methodunbind" id="methodunbind"><!-- --></a>
+<div style="background='#eeeeee'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method unbind</strong> (line <span class="linenumber">119</span>)
+ </h4>
+<h4><i>void</i> <strong>unbind(
+<a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a>
+$is)</strong></h4>
+
+ <hr class="separator" />
+ <div class="notes">Implementation of:</div>
+ <dl>
+ <dt><a href="../../Swift/ByteStream/Swift_InputByteStream.html#methodunbind">Swift_InputByteStream::unbind()</a></dt>
+ <dd>Remove an already bound stream.</dd>
+ </dl>
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Remove an already bound stream.</h5>
+<div class="desc"><p>If $is is not bound, no errors will be raised. If the stream currently has any buffered data it will be written to $is before unbinding occurs.</p></div>
+ <h4>Parameters</h4>
+ <ul>
+ <li><strong><a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a> $is</strong>: </li>
+ </ul>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>access</strong> - public</li>
+ </ul>
+</div>
+<a name="methodwrite" id="methodwrite"><!-- --></a>
+<div style="background='#ffffff'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method write</strong> (line <span class="linenumber">74</span>)
+ </h4>
+<h4><i>void</i> <strong>write(
+string
+$bytes)</strong></h4>
+
+ <hr class="separator" />
+ <div class="notes">Implementation of:</div>
+ <dl>
+ <dt><a href="../../Swift/ByteStream/Swift_InputByteStream.html#methodwrite">Swift_InputByteStream::write()</a></dt>
+ <dd>Writes $bytes to the end of the stream.</dd>
+ </dl>
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Writes $bytes to the end of the stream.</h5>
+ <h4>Parameters</h4>
+ <ul>
+ <li><strong>string $bytes</strong>: </li>
+ </ul>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>throws</strong> - Swift_IoException</li>
+ <li><strong>access</strong> - public</li>
+ </ul>
+</div>
+<a name="method_commit" id="method_commit"><!-- --></a>
+<div style="background='#eeeeee'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method _commit</strong> (line <span class="linenumber">42</span>)
+ </h4>
+<h4><i>void</i> <strong>_commit(
+string
+$bytes)</strong></h4>
+ <p>Overridden in child classes as:<br />
+ <dl>
+ <dt><a href="../../Swift/ByteStream/Swift_ByteStream_FileByteStream.html#method_commit">Swift_ByteStream_FileByteStream::_commit()</a></dt>
+ <dd>Just write the bytes to the file</dd>
+ </dl>
+ <dl>
+ <dt><a href="../../Swift/Transport/Swift_Transport_StreamBuffer.html#method_commit">Swift_Transport_StreamBuffer::_commit()</a></dt>
+ <dd>Write this bytes to the stream</dd>
+ </dl>
+ </p>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Commit the given bytes to the storage medium immediately.</h5>
+ <h4>Parameters</h4>
+ <ul>
+ <li><strong>string $bytes</strong>: </li>
+ </ul>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>abstract</strong> - </li>
+ <li><strong>access</strong> - protected</li>
+ </ul>
+</div>
+<a name="method_flush" id="method_flush"><!-- --></a>
+<div style="background='#ffffff'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method _flush</strong> (line <span class="linenumber">48</span>)
+ </h4>
+<h4><i>void</i> <strong>_flush(
+)</strong></h4>
+ <p>Overridden in child classes as:<br />
+ <dl>
+ <dt><a href="../../Swift/ByteStream/Swift_ByteStream_FileByteStream.html#method_flush">Swift_ByteStream_FileByteStream::_flush()</a></dt>
+ <dd>Not used</dd>
+ </dl>
+ <dl>
+ <dt><a href="../../Swift/Transport/Swift_Transport_StreamBuffer.html#method_flush">Swift_Transport_StreamBuffer::_flush()</a></dt>
+ <dd>Flush the stream contents</dd>
+ </dl>
+ </p>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Flush any buffers/content with immediate effect.</h5>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>abstract</strong> - </li>
+ <li><strong>access</strong> - protected</li>
+ </ul>
+</div>
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage2" ) );</script>
+</div>
+<div class="tab-page" id="iVars">
+<h2 class="tab">Inherited Variables</h2>
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "iVars" ) );</script>
+<!-- =========== VAR INHERITED SUMMARY =========== -->
+<A NAME='var_inherited_summary'><!-- --></A>
+<h3>Inherited Class Variable Summary</h3>
+
+ </div>
+<div class="tab-page" id="iMethods">
+<h2 class="tab">Inherited Methods</h2>
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "iMethods" ) );</script>
+<!-- =========== INHERITED METHOD SUMMARY =========== -->
+<A NAME='functions_inherited'><!-- --></A>
+<h3>Inherited Method Summary</h3>
+
+ </div>
+</div>
+<script type="text/javascript">
+//<![CDATA[
+
+setupAllTabs();
+
+//]]>
+</script>
+ <div id="credit">
+ <hr />
View
405 protected/extensions/yii-mail/doc/Swift/ByteStream/Swift_ByteStream_ArrayByteStream.html
@@ -0,0 +1,405 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Docs For Class Swift_ByteStream_ArrayByteStream</title>
+ <link rel="stylesheet" href="../../media/stylesheet.css" />
+ <script src="../../media/lib/classTree.js"></script>
+<link id="webfx-tab-style-sheet" type="text/css" rel="stylesheet" href="../../media/lib/tab.webfx.css" />
+<script type="text/javascript" src="../../media/lib/tabpane.js"></script>
+ <script language="javascript" type="text/javascript" src="../../media/lib/ua.js"></script>
+<script language="javascript" type="text/javascript">
+ var imgPlus = new Image();
+ var imgMinus = new Image();
+ imgPlus.src = "../../media/images/plus.gif";
+ imgMinus.src = "../../media/images/minus.gif";
+
+ function showNode(Node){
+ switch(navigator.family){
+ case 'nn4':
+ // Nav 4.x code fork...
+ var oTable = document.layers["span" + Node];
+ var oImg = document.layers["img" + Node];
+ break;
+ case 'ie4':
+ // IE 4/5 code fork...
+ var oTable = document.all["span" + Node];
+ var oImg = document.all["img" + Node];
+ break;
+ case 'gecko':
+ // Standards Compliant code fork...
+ var oTable = document.getElementById("span" + Node);
+ var oImg = document.getElementById("img" + Node);
+ break;
+ }
+ oImg.src = imgMinus.src;
+ oTable.style.display = "block";
+ }
+
+ function hideNode(Node){
+ switch(navigator.family){
+ case 'nn4':
+ // Nav 4.x code fork...
+ var oTable = document.layers["span" + Node];
+ var oImg = document.layers["img" + Node];
+ break;
+ case 'ie4':
+ // IE 4/5 code fork...
+ var oTable = document.all["span" + Node];
+ var oImg = document.all["img" + Node];
+ break;
+ case 'gecko':
+ // Standards Compliant code fork...
+ var oTable = document.getElementById("span" + Node);
+ var oImg = document.getElementById("img" + Node);
+ break;
+ }
+ oImg.src = imgPlus.src;
+ oTable.style.display = "none";
+ }
+
+ function nodeIsVisible(Node){
+ switch(navigator.family){
+ case 'nn4':
+ // Nav 4.x code fork...
+ var oTable = document.layers["span" + Node];
+ break;
+ case 'ie4':
+ // IE 4/5 code fork...
+ var oTable = document.all["span" + Node];
+ break;
+ case 'gecko':
+ // Standards Compliant code fork...
+ var oTable = document.getElementById("span" + Node);
+ break;
+ }
+ return (oTable && oTable.style.display == "block");
+ }
+
+ function toggleNodeVisibility(Node){
+ if (nodeIsVisible(Node)){
+ hideNode(Node);
+ }else{
+ showNode(Node);
+ }
+ }
+</script>
+<!-- template designed by Julien Damon based on PHPEdit's generated templates, and tweaked by Greg Beaver -->
+<body bgcolor="#ffffff" >
+<!-- Start of Class Data -->
+<h2>
+ Class Swift_ByteStream_ArrayByteStream
+</h2> (line <span class="linenumber">20</span>)
+<div class="tab-pane" id="tabPane1">
+<script type="text/javascript">
+tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ));
+</script>
+
+<div class="tab-page" id="Description">
+<h2 class="tab">Description</h2>
+<pre>
+</pre>
+<p>
+ <b><i>Located in File: <a href="_vendors---swiftMailer---classes---Swift---ByteStream---ArrayByteStream.php.html">/vendors/swiftMailer/classes/Swift/ByteStream/ArrayByteStream.php</a></i></b><br>
+</p>
+<!-- ========== Info from phpDoc block ========= -->
+<h5>Allows reading and writing of bytes to and from an array.</h5>
+<ul>
+ <li><strong>author:</strong> - Chris Corbyn</li>
+ </ul>
+<br /><hr />
+</div>
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "Description" ) );</script>
+<div class="tab-page" id="tabPage1">
+
+<h2 class="tab">Class Variables</h2>
+<!-- ============ VARIABLE DETAIL =========== -->
+<strong>Summary:</strong><br />
+<hr />
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage1" ) );</script>
+
+</div>
+<div class="tab-page" id="constantsTabpage">
+
+<h2 class="tab">Class Constants</h2>
+<!-- ============ VARIABLE DETAIL =========== -->
+<strong>Summary:</strong><br />
+<hr />
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "constantsTabpage" ) );</script>
+
+</div>
+<div class="tab-page" id="tabPage2">
+<h2 class="tab">Method Detail</h2>
+<!-- ============ METHOD DETAIL =========== -->
+<strong>Summary:</strong><br />
+<div class="method-summary">
+ <div class="method-definition">
+ <span class="method-result">Swift_ByteStream_ArrayByteStream</span>
+ <a href="#method__construct" title="details" class="method-name">__construct</a>
+ ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$stack</span> = <span class="var-default">null</span>])
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodbind" title="details" class="method-name">bind</a>
+ (<span class="var-type"><a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a></span>&nbsp;<span class="var-name">$is</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodcommit" title="details" class="method-name">commit</a>
+ ()
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodflushBuffers" title="details" class="method-name">flushBuffers</a>
+ ()
+ </div>
+ <div class="method-definition">
+ <span class="method-result">string</span>
+ <a href="#methodread" title="details" class="method-name">read</a>
+ (<span class="var-type">int</span>&nbsp;<span class="var-name">$length</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">boolean</span>
+ <a href="#methodsetReadPointer" title="details" class="method-name">setReadPointer</a>
+ (<span class="var-type">int</span>&nbsp;<span class="var-name">$byteOffset</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodunbind" title="details" class="method-name">unbind</a>
+ (<span class="var-type"><a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a></span>&nbsp;<span class="var-name">$is</span>)
+ </div>
+ <div class="method-definition">
+ <span class="method-result">void</span>
+ <a href="#methodwrite" title="details" class="method-name">write</a>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$bytes</span>)
+ </div>
+</div>
+<hr />
+<A NAME='method_detail'></A>
+
+
+<a name="method__construct" id="method__construct"><!-- --></a>
+<div style="background='#eeeeee'"><h4>
+<img src="../../media/images/Constructor.gif" border="0" /> <strong class="method">Constructor __construct</strong> (line <span class="linenumber">53</span>)
+ </h4>
+<h4><i>Swift_ByteStream_ArrayByteStream</i> <strong>__construct(
+[mixed
+$stack = null])</strong></h4>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Create a new ArrayByteStream.</h5>
+<div class="desc"><p>If $stack is given the stream will be populated with the bytes it contains.</p></div>
+ <h4>Parameters</h4>
+ <ul>
+ <li><strong>mixed $stack</strong>: of bytes in string or array form, optional</li>
+ </ul>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>access</strong> - public</li>
+ </ul>
+</div>
+<a name="methodbind" id="methodbind"><!-- --></a>
+<div style="background='#ffffff'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method bind</strong> (line <span class="linenumber">131</span>)
+ </h4>
+<h4><i>void</i> <strong>bind(
+<a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a>
+$is)</strong></h4>
+
+ <hr class="separator" />
+ <div class="notes">Implementation of:</div>
+ <dl>
+ <dt><a href="../../Swift/ByteStream/Swift_InputByteStream.html#methodbind">Swift_InputByteStream::bind()</a></dt>
+ <dd>Attach $is to this stream.</dd>
+ </dl>
+ <!-- ========== Info from phpDoc block ========= -->
+<h5>Attach $is to this stream.</h5>
+<div class="desc"><p>The stream acts as an observer, receiving all data that is written. All <a href="../../Swift/ByteStream/Swift_ByteStream_ArrayByteStream.html#methodwrite">write()</a> and <a href="../../Swift/ByteStream/Swift_ByteStream_ArrayByteStream.html#methodflushBuffers">flushBuffers()</a> operations will be mirrored.</p></div>
+ <h4>Parameters</h4>
+ <ul>
+ <li><strong><a href="../../Swift/ByteStream/Swift_InputByteStream.html">Swift_InputByteStream</a> $is</strong>: </li>
+ </ul>
+
+ <h4>Info</h4>
+ <ul>
+ <li><strong>access</strong> - public</li>
+ </ul>
+</div>
+<a name="methodcommit" id="methodcommit"><!-- --></a>
+<div style="background='#eeeeee'"><h4>
+<img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method commit</strong> (line <span class="linenumber">120</span>)
+ </h4>