-
Notifications
You must be signed in to change notification settings - Fork 13
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
Showing
9 changed files
with
212 additions
and
19 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
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,25 @@ | ||
<?php | ||
/* | ||
* Copyright MADE/YOUR/DAY OG <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* RockSolid Custom Elements DCA | ||
* | ||
* @author Martin Auswöger <[email protected]> | ||
*/ | ||
|
||
$GLOBALS['TL_DCA']['tl_form_field']['config']['onload_callback'][] = array('MadeYourDay\Contao\CustomElements', 'onloadCallback'); | ||
$GLOBALS['TL_DCA']['tl_form_field']['config']['onsubmit_callback'][] = array('MadeYourDay\Contao\CustomElements', 'onsubmitCallback'); | ||
$GLOBALS['TL_DCA']['tl_form_field']['fields']['rsce_data'] = array( | ||
'label' => &$GLOBALS['TL_LANG']['tl_form_field']['rsce_data'], | ||
'exclude' => true, | ||
'inputType' => 'rsce_list_hidden', | ||
'sql' => "mediumblob NULL", | ||
'save_callback' => array( | ||
array('MadeYourDay\\Contao\\CustomElements', 'saveDataCallback'), | ||
), | ||
); |
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,15 @@ | ||
<?php | ||
/* | ||
* Copyright MADE/YOUR/DAY OG <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* RockSolid Custom Elements tl_form_field translations | ||
* | ||
* @author Martin Auswöger <[email protected]> | ||
*/ | ||
|
||
$GLOBALS['TL_LANG']['tl_form_field']['rsce_data'][0] = 'Custom Elements Daten'; |
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,15 @@ | ||
<?php | ||
/* | ||
* Copyright MADE/YOUR/DAY OG <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* RockSolid Custom Elements tl_form_field translations | ||
* | ||
* @author Martin Auswöger <[email protected]> | ||
*/ | ||
|
||
$GLOBALS['TL_LANG']['tl_form_field']['rsce_data'][0] = 'Custom Elements Data'; |
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
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
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,60 @@ | ||
<?php | ||
/* | ||
* Copyright MADE/YOUR/DAY OG <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace MadeYourDay\Contao\Form; | ||
|
||
use MadeYourDay\Contao\Element\CustomElement; | ||
use MadeYourDay\Contao\Model\DummyModel; | ||
|
||
/** | ||
* Custom form widget | ||
* | ||
* @author Martin Auswöger <[email protected]> | ||
*/ | ||
class CustomWidget extends \Widget | ||
{ | ||
/** | ||
* @var string Template | ||
*/ | ||
protected $strTemplate = 'form_rsce_plain'; | ||
|
||
/** | ||
* @var CustomElement | ||
*/ | ||
private $customElement; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function __construct($data = null) | ||
{ | ||
if (!empty($data['class'])) { | ||
$data['cssID'] = serialize(array('', $data['class'])); | ||
} | ||
|
||
$this->customElement = new CustomElement(new DummyModel(null, $data)); | ||
|
||
parent::__construct($data); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function generate() | ||
{ | ||
return $this->customElement->generate(); | ||
} | ||
|
||
/** | ||
* Do not validate | ||
*/ | ||
public function validate() | ||
{ | ||
return; | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
/* | ||
* Copyright MADE/YOUR/DAY OG <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace MadeYourDay\Contao\Model; | ||
|
||
/** | ||
* Dummy model | ||
* | ||
* @author Martin Auswöger <[email protected]> | ||
*/ | ||
class DummyModel extends \Model | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function __construct(\Database\Result $objResult = null, $data = array()) | ||
{ | ||
$this->arrModified = array(); | ||
$this->setRow($data); | ||
} | ||
} |
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,2 @@ | ||
<?php | ||
echo $this->generate(); |