Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 public function renderEnd(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component)
 {
     $writer = $context->getResponse()->getWriter();
     $messages = $context->getMessages($component->getFor());
     if (count($messages) > 0) {
         $writer->write('>');
         foreach ($messages as $message) {
             $writer->write('<li>');
             $writer->write($message->getSummary());
             $writer->write('</li>');
         }
         $writer->write('</ul>');
     }
 }
Пример #4
0
 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('/>');
 }
Пример #5
0
 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('/>');
 }
Пример #6
0
 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>');
 }
Пример #7
0
 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 . '"');
     }
 }
Пример #8
0
 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('/>');
 }
Пример #9
0
 public function renderEnd(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component)
 {
     $writer = $context->getResponse()->getWriter();
     $writer->write('/>');
 }
 public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component)
 {
     $writer = $context->getResponse()->getWriter();
     parent::renderBegin($context, $component);
     $writer->write('<textarea');
 }
Пример #11
0
 private function renderOption(\blaze\web\application\BlazeContext $context, $id, $label, $selected, $disabled)
 {
     $writer = $context->getResponse()->getWriter();
     $writer->write('<option');
     $writer->write(' value="' . $id . '"');
     if ($selected) {
         $writer->write(' selected="selected"');
     }
     if ($disabled) {
         $writer->write(' disabled="disabled"');
     }
     $writer->write('>');
     $writer->write($label);
     $writer->write('</option>');
 }
Пример #12
0
 private function renderTableCell(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component, $parent, $head)
 {
     $writer = $context->getResponse()->getWriter();
     if ($parent != null) {
         //            $colspan = $parent->getSpan();
         $styleClass = $parent->getStyleClass();
         $style = $parent->getStyle();
         if ($head) {
             $writer->write('<th');
         } else {
             $writer->write('<td');
         }
         //            if ($colspan != null)
         //                $writer->write(' colspan="' . $colspan . '"');
         if ($styleClass != null) {
             $writer->write(' class="' . $styleClass . '"');
         }
         if ($style != null) {
             $writer->write(' style="' . $style . '"');
         }
         $writer->write('>');
         $parent->processRender($context);
         $this->recursiveUnsetClientId($parent);
         if ($head) {
             $writer->write('</th>');
         } else {
             $writer->write('</td>');
         }
     }
 }
Пример #13
0
 public function renderEnd(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component)
 {
     $writer = $context->getResponse()->getWriter();
     $tag = $this->getTypeTag($component);
     if ($tag != null) {
         $writer->write('</' . $tag . '>');
     }
 }
Пример #14
0
 public function renderBegin(\blaze\web\application\BlazeContext $context, \blaze\web\component\UIComponent $component)
 {
     $writer = $context->getResponse()->getWriter();
     $writer->write('<script type="text/javascript">function commandLinkClick(link){ var parentForm=link.parentNode; while(parentForm.nodeName != "FORM"){ parentForm=parentForm.parentNode; } var identifier = document.createElement("input"); identifier.type="hidden"; identifier.name="BLAZE_COMMAND_IDENTIFIER"; identifier.value=link.id; parentForm.appendChild(identifier); parentForm.submit(); return false;} </script>');
     $writer->write('<a');
 }