"checkbox"); protected $inline; protected $maxheight; public function jQueryDocumentReady() { parent::jQueryDocumentReady(); if(!empty($this->inline)) echo 'jQuery("#', $this->attributes["id"], ' .pfbc-checkbox:last").css("margin-right", "0");'; else echo 'jQuery("#', $this->attributes["id"], ' .pfbc-checkbox:last").css({ "padding-bottom": "0", "border-bottom": "none" });'; if(!empty($this->maxheight) && is_numeric($this->maxheight)) { echo <<attributes["id"]} .pfbc-checkboxes"); if(checkboxes.outerHeight() > {$this->maxheight}) { checkboxes.css({ "height": "{$this->maxheight}px", "overflow": "auto", "overflow-x": "hidden" }); } JS; } } public function render() { if(isset($this->attributes["value"])) { if(!is_array($this->attributes["value"])) $this->attributes["value"] = array($this->attributes["value"]); } else $this->attributes["value"] = array(); if(substr($this->attributes["name"], -2) != "[]") $this->attributes["name"] .= "[]"; $count = 0; $existing = ""; echo '
'; foreach($this->options as $value => $text) { $value = $this->getOptionValue($value); echo '
getAttributes(array("id", "value", "checked", "name", "onclick")), ' value="', $this->filter($value), '"'; if(in_array($value, $this->attributes["value"])) echo ' checked="checked"'; echo ' onclick="updateChecksort(this, \'', $this->filter($text), '\');"/>
'; if(in_array($value, $this->attributes["value"])) $existing .= '
  • ' . $text . '
  • '; ++$count; } echo '
    '; if(!empty($this->inline)) echo '
    '; echo '
    '; } function renderJS() { echo <<' + text + ''); else jQuery("#" + id + "-sort-" + index).remove(); } } JS; } function renderCSS() { if(!empty($this->inline)) echo '#', $this->attributes["id"], ' .pfbc-checkbox { float: left; margin-right: 0.5em; }'; else echo '#', $this->attributes["id"], ' .pfbc-checkbox { padding: 0.5em 0; border-bottom: 1px solid #f4f4f4; }'; parent::renderCSS(); } }