93 if ($this->_hasCheckedList ===
true) {
94 $jsCode = include dirname(__FILE__) .
'/../../components/jsTemplates/tplCheckedList.php';
95 $jsCode = \str_replace(
"%identifier%",
"#" . $this->identifier, $jsCode);
96 $jsCode = \str_replace(
"%fireOnInit%", $this->_fireOnInit, $jsCode);
97 $jsCode = \str_replace(
"%onChange%", $this->_ckItemChange, $jsCode);
105 return parent::run($js);
154 if (isset($this->_maxVisible) && $this->_maxVisible < $this->
count()) {
158 $visibility->attach(
"#" . $this->identifier);
159 $visibility->setOnTopVisible(
"$(this).children('.notVisible').hide();$(this).find('.points').show();");
160 $visibility->compile($js, $view);
161 $this->_visibility = $visibility;
164 return parent::compile($js, $view);
176 public function addCheckedList($items = array(), $masterItem = NULL, $values = array(), $notAllChecked =
false, $name =
null) {
177 $count = $this->
count();
179 if (isset($masterItem)) {
180 if (\is_array($masterItem)) {
183 $masterO->setName($name);
184 if (isset($masterItem[1])) {
185 if (\array_search($masterItem[1], $values) !==
false) {
186 $masterO->getDataField()->setProperty(
"checked",
"");
192 if ($notAllChecked) {
193 $masterO->getDataField()->addClass(
"_notAllChecked");
195 $masterO->getHtmlCk()->addToProperty(
"class",
"master");
196 $masterO->setClass(
"item");
201 $this->
setFireOnInit(UString::getBooleanStr($this->_fireOnInit ||
count($items) < 30));
202 foreach ($items as $val => $caption) {
204 if (\array_search($val, $values) !==
false) {
205 $itemO->getDataField()->setProperty(
"checked",
"");
208 $itemO->setName($name);
209 $itemO->setClass(
"item");
212 if (isset($masterO) ===
true) {
214 $list->setClass(
"list");
215 $masterO->addContent($list);
219 $this->_hasCheckedList =
true;
224 if (! \is_array($icons)) {
225 $icons = \array_fill(0, \
sizeof($this->content), $icons);
227 $max = \min(\
sizeof($icons), \
sizeof($this->content));
228 for ($i = 0; $i < $max; $i ++) {
229 $this->content[$i]->addIcon($icons[$i]);