/** * Render a checkbox list base on the subset and superset collections. * * @param string $relationId the relationship id, used to render the form field key. * @param BaseCollection[] the related collection. (optional) * @param BaseCollection[] the superset collection. */ public function renderList($relationId, $subset, $superset) { $ul = new Element('ul'); $ul->addClass('actionkit-checkbox-view'); // now we should render the superset, and set the checkbox to be // connected from the $this->checked array. foreach ($superset as $item) { $li = $this->renderItem($relationId, $subset, $item, isset($this->checked[$item->id])); $li->appendTo($ul); } return $ul; }
/** * Here is a hack for supportting for $label->for( $elementId ); * * Due to the PHP yacc parser issue, we can't define a method named "for". */ public function __call($m, $a) { if ($m === "for") { $this->setAttributeValue($m, $a[0]); } return parent::__call($m, $a); }
function __construct($text = null, $attributes = array()) { if ($text && is_string($text)) { $textNode = new DOMText($text); $this->addChild($textNode); } parent::__construct('legend', $attributes); }
public function __construct($attributes = array()) { parent::__construct($this->tagName, $attributes); }
/** * Set attributes * */ public function setAttributes($as) { // filter out options $intersects = array_intersect(array_keys($as), $this->optionNames); foreach ($intersects as $k) { unset($as[$k]); } parent::setAttributes($as); }
public function createContainer() { $container = new Element('div'); $container->addClass('__region'); return $container; }
/** * For each existing (one-many) records, * create it's own subaction view for these existing * records. */ public function buildOneToManyRelationalActionViewForExistingRecords($record, $relationId, $relation = null) { if (!$relation) { $relation = $this->action->getRelation($relationId); } $container = new Element('div'); // If the record is loaded and the relation is defined if ($collection = $record->fetchOneToManyRelationCollection($relationId)) { foreach ($collection as $subrecord) { $subview = $this->createRelationalActionView($relationId, $relation, $subrecord); $container->append($subview); } } return $container; }
public function createContainerElement() { $el = new Element('div'); $el->addClass('__region'); return $el; }
public function __construct($text) { $this->append($text); parent::__construct($this->tagName); }