forked from koala-framework/koala-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Component.php
49 lines (45 loc) · 1.4 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
47
48
49
<?php
class Kwc_Basic_Link_Component extends Kwc_Abstract_Composite_Component
{
public static function getSettings()
{
$ret = array_merge(parent::getSettings(), array(
'ownModel' => 'Kwc_Basic_Link_Model',
'componentName' => trlKwfStatic('Link'),
'componentIcon' => 'page_white_link',
'default' => array(),
));
$ret['componentCategory'] = 'content';
$ret['generators']['child']['component'] = array(
'linkTag' => 'Kwc_Basic_LinkTag_Component',
);
$ret['flags']['searchContent'] = true;
$ret['flags']['hasFulltext'] = true;
$ret['throwHasContentChangedOnRowColumnsUpdate'] = 'text';
return $ret;
}
public function getTemplateVars()
{
$ret = parent::getTemplateVars();
$ret['text'] = $this->_getRow()->text;
if (!$this->hasContent($ret['linkTag'])) $ret['rootElementClass'] .= ' emptyLink';
return $ret;
}
public function getSearchContent()
{
return $this->_getRow()->text;
}
public function getFulltextContent()
{
$ret = array();
$text = $this->_getRow()->text;
$ret['content'] = $text;
$ret['normalContent'] = $text;
return $ret;
}
public function hasContent()
{
if (!$this->_getRow()->text) return false;
return parent::hasContent();
}
}