| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,63 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+/** |
|
| 4 |
+ * eSales Media Formilicious for Contao Open Source CMS |
|
| 5 |
+ * |
|
| 6 |
+ * Copyright (C) 2013-2014 eSalesMedia |
|
| 7 |
+ * |
|
| 8 |
+ * @package eSM_formilicious |
|
| 9 |
+ * @link http://www.esales-media.de |
|
| 10 |
+ * @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL |
|
| 11 |
+ * |
|
| 12 |
+ * @author Benjamin Roth <benjamin@esales-media.de> |
|
| 13 |
+ */ |
|
| 14 |
+ |
|
| 15 |
+namespace eSM_formilicious; |
|
| 16 |
+ |
|
| 17 |
+abstract class Widget extends \Contao\Widget |
|
| 18 |
+{
|
|
| 19 |
+ |
|
| 20 |
+ /** |
|
| 21 |
+ * Extract the Widget attributes from a Data Container array |
|
| 22 |
+ * |
|
| 23 |
+ * @param array $arrData The field configuration array |
|
| 24 |
+ * @param string $strName The field name in the form |
|
| 25 |
+ * @param mixed $varValue The field value |
|
| 26 |
+ * @param string $strField The field name in the database |
|
| 27 |
+ * @param string $strTable The table name in the database |
|
| 28 |
+ * @param object $objDca An optional DataContainer object |
|
| 29 |
+ * |
|
| 30 |
+ * @return array An attributes array that can be passed to a widget |
|
| 31 |
+ */ |
|
| 32 |
+ public static function getAttributesFromDca($arrData, $strName, $varValue=null, $strField='', $strTable='', $objDca=null) |
|
| 33 |
+ {
|
|
| 34 |
+ $arrAttributes = parent::getAttributesFromDca($arrData, $strName, $varValue, $strField, $strTable, $objDca); |
|
| 35 |
+ |
|
| 36 |
+ if (isset($arrData['eval']['eSM_fl_width'])) |
|
| 37 |
+ {
|
|
| 38 |
+ $arrAttributes['eSM_fl_width'] = $arrData['eval']['eSM_fl_width']; |
|
| 39 |
+ } |
|
| 40 |
+ |
|
| 41 |
+ if (isset($arrData['eval']['eSM_fl_clear'])) |
|
| 42 |
+ {
|
|
| 43 |
+ $arrAttributes['eSM_fl_clear'] = $arrData['eval']['eSM_fl_clear']; |
|
| 44 |
+ } |
|
| 45 |
+ |
|
| 46 |
+ if (isset($arrData['eval']['eSM_fl_class'])) |
|
| 47 |
+ {
|
|
| 48 |
+ $arrAttributes['eSM_fl_class'] = $arrData['eval']['eSM_fl_class']; |
|
| 49 |
+ } |
|
| 50 |
+ |
|
| 51 |
+ if (isset($arrData['eval']['eSM_fl_lblpadding'])) |
|
| 52 |
+ {
|
|
| 53 |
+ $arrAttributes['eSM_fl_lblpadding'] = $arrData['eval']['eSM_fl_lblpadding']; |
|
| 54 |
+ } |
|
| 55 |
+ |
|
| 56 |
+ if (isset($arrData['eval']['eSM_fl_alignment'])) |
|
| 57 |
+ {
|
|
| 58 |
+ $arrAttributes['eSM_fl_alignment'] = $arrData['eval']['eSM_fl_alignment']; |
|
| 59 |
+ } |
|
| 60 |
+ |
|
| 61 |
+ return $arrAttributes; |
|
| 62 |
+ } |
|
| 63 |
+} |
|
| 0 | 64 |
\ No newline at end of file |
| ... | ... |
@@ -25,7 +25,10 @@ ClassLoader::addNamespaces(array |
| 25 | 25 |
*/ |
| 26 | 26 |
ClassLoader::addClasses(array |
| 27 | 27 |
( |
| 28 |
- // Hooks |
|
| 28 |
+ // Classes |
|
| 29 |
+ 'eSM_formilicious\Widget' => 'system/modules/eSM_formilicious/classes/Widget.php', |
|
| 30 |
+ |
|
| 31 |
+ // Hooks |
|
| 29 | 32 |
'eSM_formilicious\FormiliciousHooks' => 'system/modules/eSM_formilicious/hooks/FormiliciousHooks.php', |
| 30 | 33 |
|
| 31 | 34 |
// Modules |