forked from koala-framework/koala-framework
/
Component.php
46 lines (42 loc) · 1.6 KB
/
Component.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
class Kwc_Form_Dynamic_Component extends Kwc_Abstract_Composite_Component
{
public static function getSettings()
{
$ret = parent::getSettings();
$ret['componentName'] = trlKwfStatic('Form');
$ret['componentIcon'] = 'application_form';
$ret['componentCategory'] = 'content';
$ret['generators']['child']['component']['paragraphs'] = 'Kwc_Form_Dynamic_Paragraphs_Component';
$ret['generators']['child']['component']['form'] = 'Kwc_Form_Dynamic_Form_Component';
$ret['ownModel'] = 'Kwf_Component_FieldModel';
$ret['editComponents'] = array('paragraphs');
$ret['menuConfig'] = 'Kwc_Form_Dynamic_MenuConfig';
return $ret;
}
public function getMailSettings()
{
$spamCheck = true;
$c = $this->getData();
while ($c) {
foreach (Kwc_Abstract::getSetting($c->componentClass, 'plugins') as $plugin) {
if (is_instance_of($plugin, 'Kwf_Component_Plugin_Interface_Login')) {
$spamCheck = false;
break;
}
}
if ($c->isPage) break;
$c = $c->parent;
}
$row = $this->getRow();
return array(
'recipient' => $row->recipient,
'recipient_cc' => $row->recipient_cc,
'subject' => $row->subject,
'send_confirm_mail' => $row->send_confirm_mail,
'confirm_field_component_id' => $row->confirm_field_component_id,
'confirm_subject' => $row->confirm_subject,
'check_spam' => $spamCheck
);
}
}