public function decode(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { if ($context->getRequest()->getParameter('BLAZE_COMMAND_IDENTIFIER') == $component->getClientId($context)) { $component->setClicked(true); $component->queueEvent(new \blaze\web\event\ActionEvent($component)); } }
public function decode(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { if ($context->getRequest()->getParameter($component->getClientId($context)) != null) { $component->setClicked(true); $component->queueEvent(new \blaze\web\event\ActionEvent($component)); } }
public function renderAttributes(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $messages = $context->getMessages($component->getFor()); if (count($messages) > 0) { parent::renderAttributes($context, $component); } }
public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $writer = $context->getResponse()->getWriter(); $value = $component->getValue(); if ($value != null) { $writer->write($value); } }
public function addComponentToCache(UIComponent $component) { $id = $component->getId(); if (isset($this->idSet[$id])) { throw new \blaze\web\application\BlazeException('Component has an already existing id: ' . $id); } $this->idSet[$id] = $component; }
protected function getValue(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $value = $component->getValue(); if ($value !== null) { return $value; } return ''; }
public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $writer = $context->getResponse()->getWriter(); if ($component->getBlock() === 'true') { $writer->write('<blockquote'); } else { $writer->write('<q'); } }
public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $writer = $context->getResponse()->getWriter(); $writer->write('<script'); $src = $component->getSrc(); $writer->write(' type="text/javascript"'); if ($src != null) { $writer->write(' src="' . $src . '"'); } $writer->write('>'); }
public function addChild(\blaze\web\component\UIComponent $child) { if ($child instanceof html\SelectItem || $child instanceof html\SelectItems) { $this->items[] = $child->setParent($this); return $this; } else { // Not possible because of XSD //return parent::addChild($child); throw new \blaze\lang\IllegalArgumentException(); } }
private function getTypeTag(\blaze\web\component\UIComponent $component) { $type = $component->getType(); switch ($type) { case 'span': return 'span'; case 'div': default: return 'div'; } }
public function renderChildren(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { if ($component->getUseMap() == true) { $writer = $context->getResponse()->getWriter(); $writer->write('<map name="' . $component->getClientId($context) . 'Map">'); parent::renderChildren($context, $component); $writer->write('</map>'); } else { parent::renderChildren($context, $component); } }
public function addChild(\blaze\web\component\UIComponent $child) { if ($this->header == null && $child instanceof DataTableHeader) { return $this->header = $child->setParent($this); } else { if ($this->footer == null && $child instanceof DataTableFooter) { return $this->footer = $child->setParent($this); } else { return parent::addChild($child); } } }
public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $writer = $context->getResponse()->getWriter(); $writer->write('<base'); $href = $component->getHref(); $target = $component->getTarget(); if ($href != null) { $writer->write(' href="' . $href . '"'); } if ($target != null) { $writer->write(' target="' . $target . '"'); } $writer->write('/>'); }
public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $writer = $context->getResponse()->getWriter(); $writer->write('<link rel="stylesheet" type="text/css" media="screen"'); $href = $component->getHref(); $charset = $component->getCharset(); if ($href != null) { $writer->write(' href="' . $href . '"'); } if ($charset != null) { $writer->write(' charset="' . $charset . '"'); } else { $writer->write(' charset="utf-8"'); } $writer->write('/>'); }
public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $writer = $context->getResponse()->getWriter(); $type = $component->getType(); $writer->write('<script type="text/javascript">'); foreach ($component->getEffects() as $effect) { $id = $component->getParent()->getClientId($context); $writer->write('var listener = '); $effect->processRender($context); $writer->write(';'); $writer->write('var element = document.getElementById(\'' . $id . '\');'); // $writer->write('if(document.addEventListener) // element.addEventListener(\''.$type.'\', listener, false); // else // element.attachEvent(\'on'.$type.'\', listener);'); $writer->write('element.on' . $type . ' = listener;'); } $writer->write('</script>'); }
public function renderAttributes(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $writer = $context->getResponse()->getWriter(); $id = $component->getClientId($context); $styleClass = $component->getStyleClass(); $style = $component->getStyle(); $title = $component->getTitle(); if ($id != null) { $writer->write(' id="' . $id . '"'); } if ($title != null) { $writer->write(' title="' . $title . '"'); } if ($styleClass != null) { $writer->write(' class="' . $styleClass . '"'); } if ($style != null) { $writer->write(' style="' . $style . '"'); } }
private function getTypeTag(\blaze\web\component\UIComponent $component) { $type = $component->getType(); switch ($type) { case 'em': return 'em'; case 'strong': return 'strong'; case 'dfn': return 'dfn'; case 'code': return 'code'; case 'samp': return 'samp'; case 'kbd': return 'kbd'; case 'var': return 'var'; case 'cite': return 'cite'; case 'b': return 'b'; case 'h1': return 'h1'; case 'h2': return 'h2'; case 'h3': return 'h3'; case 'h4': return 'h4'; case 'h5': return 'h5'; case 'h6': return 'h6'; case 'none': return null; case 'p': default: return 'p'; } }
public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $writer = $context->getResponse()->getWriter(); $writer->write('<meta'); if ($component instanceof \blaze\web\component\html\ContentType) { $writer->write(' http-equiv="Content-Type" content="' . $component->getValue() . '; charset=' . $component->getCharset() . '"'); } else { if ($component instanceof \blaze\web\component\html\ContentLanguage) { $writer->write(' http-equiv="Content-Language" content="' . $component->getValue() . '"'); } else { if ($component instanceof \blaze\web\component\html\Keywords) { $writer->write(' name="keywords" content="' . $component->getValue() . '"'); } else { if ($component instanceof \blaze\web\component\html\Description) { $writer->write(' name="description" content="' . $component->getValue() . '"'); } } } } $writer->write('/>'); }
public function decode(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $val = $context->getRequest()->getParameter($component->getClientId($context)); $component->setSubmittedValue($val === 'true'); }
public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { $writer = $context->getResponse()->getWriter(); $writer->write('<title>'); $writer->write($component->getValue()); }
private function getRoot(\blaze\web\component\UIComponent $component) { $parent = $component->getParent(); if ($parent == null) { return $component; } else { return $this->getRoot($parent); } }
public function decode(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { if ($context->getRequest()->getParameter('BLAZE_FORM_IDENTIFIER') == $component->getClientId($context)) { $component->setSubmitted(true); } }
private function recursiveCheckSelected(\blaze\web\component\UIComponent $component) { if ($component instanceof \blaze\web\component\UICommand) { return $component->getClicked(); } $found = false; foreach ($component->getChildren() as $child) { if ($found) { break; } if ($this->recursiveCheckSelected($child) === true) { $found = true; } } return $found; }
public function renderChildren(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component) { foreach ($component->getChildren() as $child) { $child->processRender($context); } }
public function addChild(\blaze\web\component\UIComponent $child) { $this->children[] = $child->setParent($this); return $this; }