function get() { $slctDivId = $this->getAttribute('id') . '_div'; // Wert aus dem select in die checkbox übernehmen $this->chkbox_element->setValue($this->getValue()); $html = ''; $html .= ' <script type="text/javascript"> <!-- jQuery(function($) { $("#enable_restrictions_chkbx").click(function() { $("#' . $slctDivId . '").slideToggle("slow"); if($(this).is(":checked")) { $("option:selected", "#' . $slctDivId . '").each(function () { $(this).removeAttr("selected"); }); } }); if($("#enable_restrictions_chkbx").is(":checked")) { $("#' . $slctDivId . '").hide(); } }); //--> </script>'; $html .= $this->chkbox_element->get(); $element = parent::get(); $html .= str_replace('class="rex-form-row"', 'id="' . $slctDivId . '" class="rex-form-row"', $element); return $html; }
public function get() { $slctDivId = $this->getAttribute('id') . '-div'; // Wert aus dem select in die checkbox übernehmen $this->chkbox_element->setValue($this->getValue()); $html = ''; $html .= ' <script type="text/javascript"> <!-- jQuery(function($) { $("#enable-restrictions-checkbox").click(function() { $("#' . $slctDivId . '").slideToggle("slow"); if($(this).is(":checked")) { $("option:selected", "#' . $slctDivId . '").each(function () { $(this).removeAttr("selected"); }); } }); if($("#enable-restrictions-checkbox").is(":checked")) { $("#' . $slctDivId . '").hide(); } }); //--> </script>'; $html .= $this->chkbox_element->get(); $html .= '<div id="' . $slctDivId . '">' . parent::get() . '</div>'; return $html; }
public function get() { $field = new rex_form_checkbox_element('', $this->table); $field->setAttribute('name', $this->getAttribute('name')); $field->setAttribute('id', $this->getAttribute('id')); if ($this->getValue() == rex_complex_perm::ALL) { $field->setValue('|' . rex_complex_perm::ALL . '|'); } $field->addOption($this->checkboxLabel, rex_complex_perm::ALL); $this->setAttribute('class', 'form-control'); return $field->get() . parent::get(); }