-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2349fcf
Showing
15 changed files
with
413 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
msi.iws | ||
.idea/ | ||
nbproject/ | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
.svn | ||
.sass-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
namespace In2code\Powermailextended\Controller; | ||
|
||
/** | ||
* Using a Slot to call a Powermail Signal | ||
* | ||
* Class FormControllerExtended | ||
* @package In2code\Powermailextended\Controller | ||
*/ | ||
class FormController { | ||
|
||
/** | ||
* @param \In2code\Powermail\Domain\Model\Mail $mail | ||
* @param string $hash | ||
* @param \In2code\Powermail\Controller\FormController $pObj | ||
*/ | ||
public function manipulateMailObjectOnCreate($mail, $hash, $pObj) { | ||
foreach ($mail->getAnswers() as $answer) { | ||
if ($answer->getValue() === 'alex') { | ||
$answer->setValue('alexander'); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
namespace In2code\Powermailextended\Domain\Model; | ||
|
||
/** | ||
* Class Field | ||
* @package In2code\Powermailextended\Domain\Model | ||
*/ | ||
class Field extends \In2code\Powermail\Domain\Model\Field { | ||
|
||
/** | ||
* New property text | ||
* | ||
* @var string $txPowermailextendedPowermailText | ||
*/ | ||
protected $txPowermailextendedPowermailText; | ||
|
||
/** | ||
* New property readonly | ||
* | ||
* @var string $txPowermailextendedPowermailReadonly | ||
*/ | ||
protected $txPowermailextendedPowermailReadonly; | ||
|
||
/** | ||
* @param string $txPowermailextendedPowermailReadonly | ||
* @return void | ||
*/ | ||
public function setTxPowermailextendedPowermailReadonly($txPowermailextendedPowermailReadonly) { | ||
$this->txPowermailextendedPowermailReadonly = $txPowermailextendedPowermailReadonly; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTxPowermailextendedPowermailReadonly() { | ||
return $this->txPowermailextendedPowermailReadonly; | ||
} | ||
|
||
/** | ||
* @param string $txPowermailextendedPowermailText | ||
* @return void | ||
*/ | ||
public function setTxPowermailextendedPowermailText($txPowermailextendedPowermailText) { | ||
$this->txPowermailextendedPowermailText = $txPowermailextendedPowermailText; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTxPowermailextendedPowermailText() { | ||
return $this->txPowermailextendedPowermailText; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
namespace In2code\Powermailextended\Domain\Model; | ||
|
||
/** | ||
* Class Form | ||
* @package In2code\Powermailextended\Domain\Model | ||
*/ | ||
class Form extends \In2code\Powermail\Domain\Model\Form { | ||
|
||
/** | ||
* pages | ||
* | ||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\In2code\Powermailextended\Domain\Model\Page> | ||
*/ | ||
protected $pages; | ||
|
||
/** | ||
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $pages | ||
* @return void | ||
*/ | ||
public function setPages($pages) { | ||
$this->pages = $pages; | ||
} | ||
|
||
/** | ||
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage | ||
*/ | ||
public function getPages() { | ||
return $this->pages; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
namespace In2code\Powermailextended\Domain\Model; | ||
|
||
/** | ||
* Class Page | ||
* @package In2code\Powermailextended\Domain\Model | ||
*/ | ||
class Page extends \In2code\Powermail\Domain\Model\Page { | ||
|
||
/** | ||
* Powermail Fields | ||
* | ||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\In2code\Powermailextended\Domain\Model\Field> | ||
*/ | ||
protected $fields = NULL; | ||
|
||
/** | ||
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $fields | ||
* @return void | ||
*/ | ||
public function setFields($fields) { | ||
$this->fields = $fields; | ||
} | ||
|
||
/** | ||
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage | ||
*/ | ||
public function getFields() { | ||
return $this->fields; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
namespace In2code\Powermailextended\Domain\Repository; | ||
|
||
/** | ||
* Class FormRepository | ||
* @package In2code\Powermailextended\Domain\Repository | ||
*/ | ||
class FormRepository extends \In2code\Powermail\Domain\Repository\FormRepository {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
namespace In2code\Powermailextended\Domain\Validator; | ||
|
||
/** | ||
* ZipValidator | ||
*/ | ||
class ZipValidator { | ||
|
||
/** | ||
* Check if given number is higher than in configuration | ||
* | ||
* @param string $value | ||
* @param string $validationConfiguration | ||
* @return bool | ||
*/ | ||
public function validate100($value, $validationConfiguration) { | ||
if (is_numeric($value) && $value >= $validationConfiguration) { | ||
return TRUE; | ||
} | ||
return FALSE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Add new Field | ||
plugin.tx_powermail { | ||
view { | ||
templateRootPath > | ||
templateRootPaths { | ||
10 = EXT:powermail/Resources/Private/Templates/ | ||
} | ||
partialRootPath > | ||
partialRootPaths { | ||
10 = EXT:powermail/Resources/Private/Partials/ | ||
20 = EXT:powermailextended/Resources/Private/Partials/ | ||
} | ||
layoutRootPath > | ||
layoutRootPaths { | ||
10 = EXT:powermail/Resources/Private/Layouts/ | ||
} | ||
} | ||
} | ||
|
||
|
||
# Add new Validation | ||
plugin.tx_powermail { | ||
settings.setup { | ||
validation { | ||
native = 1 | ||
client = 1 | ||
server = 1 | ||
customValidation { | ||
100 = \In2code\Powermailextended\Domain\Validator\ZipValidator | ||
} | ||
} | ||
} | ||
_LOCAL_LANG.default.validationerror_validation.100 = Please add a ZIP with 8 begginning | ||
_LOCAL_LANG.de.validationerror_validation.100 = Bitte eine bayerische PLZ eintragen | ||
} | ||
|
||
page.includeJSFooter.powermailextended = EXT:powermailextended/Resources/Public/JavaScripts/ZipValidation.js | ||
|
||
|
||
# Add new Field Properties | ||
config.tx_extbase{ | ||
persistence{ | ||
classes{ | ||
In2code\Powermail\Domain\Model\Form { | ||
subclasses { | ||
0 = In2code\Powermailextended\Domain\Model\Form | ||
} | ||
} | ||
In2code\Powermail\Domain\Model\Page { | ||
subclasses { | ||
0 = In2code\Powermailextended\Domain\Model\Page | ||
} | ||
} | ||
In2code\Powermail\Domain\Model\Field { | ||
subclasses { | ||
0 = In2code\Powermailextended\Domain\Model\Field | ||
} | ||
} | ||
In2code\Powermailextended\Domain\Model\Form { | ||
mapping { | ||
tableName = tx_powermail_domain_model_forms | ||
} | ||
} | ||
In2code\Powermailextended\Domain\Model\Page { | ||
mapping { | ||
tableName = tx_powermail_domain_model_pages | ||
} | ||
} | ||
In2code\Powermailextended\Domain\Model\Field { | ||
mapping { | ||
tableName = tx_powermail_domain_model_fields | ||
} | ||
} | ||
} | ||
} | ||
objects { | ||
In2code\Powermail\Domain\Repository\FormRepository.className = In2code\Powermailextended\Domain\Repository\FormRepository | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{namespace vh=In2code\Powermail\ViewHelpers} | ||
|
||
<div id="powermail_fieldwrap_{field.uid}" class="powermail_fieldwrap powermail_fieldwrap_input powermail_fieldwrap_{field.uid} {field.css}"> | ||
<h2> | ||
{field.txPowermailextendedPowermailText} | ||
</h2> | ||
<label for="powermail_field_{field.marker}" class="powermail_label" title="{field.description}"> | ||
<vh:string.RawAndRemoveXss>{field.title}</vh:string.RawAndRemoveXss><f:if condition="{field.mandatory}"><span class="mandatory">*</span></f:if> | ||
</label> | ||
<f:if condition="{field.txPowermailextendedPowermailReadonly}"> | ||
<f:then> | ||
<f:form.textfield | ||
type="{vh:Validation.FieldTypeFromValidation(field:field)}" | ||
property="{field.marker}" | ||
placeholder="{field.placeholder}" | ||
readonly="readonly" | ||
value="{vh:Misc.PrefillField(field:field, mail:mail)}" | ||
class="powermail_field powermail_input {vh:Validation.ErrorClass(field:field, class:'powermail_field_error')}" | ||
additionalAttributes="{vh:Validation.ValidationDataAttribute(field:field)}" | ||
id="powermail_field_{field.marker}" /> | ||
</f:then> | ||
<f:else> | ||
<f:form.textfield | ||
type="{vh:Validation.FieldTypeFromValidation(field:field)}" | ||
property="{field.marker}" | ||
placeholder="{field.placeholder}" | ||
value="{vh:Misc.PrefillField(field:field, mail:mail)}" | ||
class="powermail_field powermail_input {vh:Validation.ErrorClass(field:field, class:'powermail_field_error')}" | ||
additionalAttributes="{vh:Validation.ValidationDataAttribute(field:field)}" | ||
id="powermail_field_{field.marker}" /> | ||
</f:else> | ||
</f:if> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div> | ||
<h2>This is a complete new Field</h2> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* <input type="text" data-parsley-custom100="1" data-parsley-error-message="Please try again" /> | ||
*/ | ||
|
||
window.ParsleyValidator | ||
.addValidator('custom100', function (value, requirement) { | ||
if (value >= 80000) { | ||
return true; | ||
} | ||
return false; | ||
}, 32) | ||
.addMessage('en', 'custom100', 'Error'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/*************************************************************** | ||
* Extension Manager/Repository config file for ext "powermail". | ||
* | ||
* Auto generated 04-07-2013 17:03 | ||
* | ||
* Manual updates: | ||
* Only the data in the array - everything else is removed by next | ||
* writing. "version" and "dependencies" must not be touched! | ||
***************************************************************/ | ||
|
||
$EM_CONF[$_EXTKEY] = array ( | ||
'title' => 'powermailextended', | ||
'description' => 'Sample Extension to extend powermail 2.1: Add new validators, Add new Fieldtypes or Add new Field Properties', | ||
'category' => 'plugin', | ||
'shy' => 0, | ||
'version' => '2.1.0', | ||
'dependencies' => '', | ||
'conflicts' => '', | ||
'priority' => '', | ||
'loadOrder' => '', | ||
'module' => '', | ||
'state' => 'beta', | ||
'uploadfolder' => 0, | ||
'createDirs' => 'uploads/tx_powermail', | ||
'modify_tables' => '', | ||
'clearcacheonload' => 0, | ||
'lockType' => '', | ||
'author' => 'Powermail dev team', | ||
'author_email' => 'alexander.kellner@in2code.de', | ||
'author_company' => 'in2code.de', | ||
'CGLcompliance' => '', | ||
'CGLcompliance_note' => '', | ||
'constraints' => array( | ||
'depends' => array( | ||
'typo3' => '6.2.0-6.2.99', | ||
'powermail' => '2.1.0-2.1.99', | ||
), | ||
'conflicts' => array(), | ||
'suggests' => array(), | ||
), | ||
'_md5_values_when_last_written' => '', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
// enable SignalSlot | ||
//$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\SignalSlot\Dispatcher'); | ||
//$signalSlotDispatcher->connect( | ||
// 'In2code\Powermail\Controller\FormController', | ||
// 'createActionBeforeRenderView', | ||
// 'In2code\Powermailextended\Controller\FormController', | ||
// 'manipulateMailObjectOnCreate', | ||
// FALSE | ||
//); |
Oops, something went wrong.