/** * Adds attributes to renderer. * @param THtmlWriter the renderer * @throws TInvalidDataValueException if default button is not right. */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); if (($butt = $this->getDefaultButton()) !== '') { $writer->addAttribute('id', $this->getClientID()); } }
/** * Adds attributes to renderer. * @param THtmlWriter the renderer * @throws TInvalidDataValueException if associated control cannot be found using the ID */ protected function addAttributesToRender($writer) { if ($this->_forControl !== '') { $writer->addAttribute('for', $this->_forControl); } parent::addAttributesToRender($writer); }
/** * Adds attributes related to an HTML image element to renderer. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { $writer->addAttribute('src', $this->getImageUrl()); $writer->addAttribute('alt', $this->getAlternateText()); if (($desc = $this->getDescriptionUrl()) !== '') { $writer->addAttribute('longdesc', $desc); } if (($align = $this->getImageAlign()) !== '') { $writer->addAttribute('align', $align); } parent::addAttributesToRender($writer); }
/** * Adds attributes to renderer. * @param THtmlWriter the renderer * @throws TInvalidDataValueException if default button is not right. */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); if (($butt = $this->getDefaultButton()) !== '') { if (($button = $this->findControl($butt)) === null) { throw new TInvalidDataValueException('panel_defaultbutton_invalid', $butt); } else { $writer->addAttribute('id', $this->getClientID()); $this->getPage()->getClientScript()->registerDefaultButton($this, $button); } } }
/** * Sets name attribute to the unique ID of the control. * This method overrides the parent implementation with additional file update control specific attributes. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { $this->getPage()->ensureRenderInForm($this); parent::addAttributesToRender($writer); $writer->addAttribute('type', 'file'); $writer->addAttribute('name', $this->getUniqueID()); $isEnabled = $this->getEnabled(true); if (!$isEnabled && $this->getEnabled()) { // in this case parent will not render 'disabled' $writer->addAttribute('disabled', 'disabled'); } }
/** * Adds attributes related to a hyperlink element to renderer. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { $isEnabled = $this->getEnabled(true); if ($this->getEnabled() && !$isEnabled) { $writer->addAttribute('disabled', 'disabled'); } parent::addAttributesToRender($writer); if (($url = $this->getNavigateUrl()) !== '' && $isEnabled) { $writer->addAttribute('href', $url); } if (($target = $this->getTarget()) !== '') { $writer->addAttribute('target', $target); } }
/** * Adds attribute name-value pairs to renderer. * This overrides the parent implementation with additional button specific attributes. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { $page = $this->getPage(); $page->ensureRenderInForm($this); if (($uniqueID = $this->getUniqueID()) !== '') { $writer->addAttribute('name', $uniqueID); } if ($this->getEnabled(true)) { if ($this->getEnableClientScript() && $this->needPostBackScript()) { $this->renderClientControlScript($writer); } } else { if ($this->getEnabled()) { // in this case, parent will not render 'disabled' $writer->addAttribute('disabled', 'disabled'); } } parent::addAttributesToRender($writer); }
/** * Adds attributes to renderer. * @param THtmlWriter the renderer */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); if (($colspan = $this->getColumnSpan()) > 0) { $writer->addAttribute('colspan', "{$colspan}"); } if (($rowspan = $this->getRowSpan()) > 0) { $writer->addAttribute('rowspan', "{$rowspan}"); } }
/** * Adds attribute name-value pairs to renderer. * This overrides the parent implementation with additional button specific attributes. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { $page = $this->getPage(); $page->ensureRenderInForm($this); $writer->addAttribute('id', $this->getClientID()); // We call parent implementation here because some attributes // may be overwritten in the following parent::addAttributesToRender($writer); if ($this->getEnabled(true) && $this->getEnableClientScript()) { $this->renderLinkButtonHref($writer); $this->renderClientControlScript($writer); } else { if ($this->getEnabled()) { // in this case, parent will not render 'disabled' $writer->addAttribute('disabled', 'disabled'); } } }
/** * Adds attributes to renderer. * @param THtmlWriter the renderer */ protected function addAttributesToRender($writer) { $writer->addAttribute('class', $this->Parent->getPageCssClass()); $writer->addAttribute('id', $this->ClientID); $style = ($w = $this->getWidth()) !== '' ? 'width:' . $w . ';' : ''; $style .= ($h = $this->getHeight()) !== '' ? 'height:' . $h . ';' : ''; $style .= !$this->Parent->isDefault($this->ClientID) ? 'display:none;' : ''; if ($style !== '') { $writer->addAttribute('style', $style); } parent::addAttributesToRender($writer); }
protected function addAttributesToRender($writer) { $display = $this->getDisplay(); $visible = $this->getEnabled(true) && count($this->getErrorMessages()) > 0; if (!$visible) { if ($display === TValidationSummaryDisplayStyle::None || $display === TValidationSummaryDisplayStyle::Dynamic) { $writer->addStyleAttribute('display', 'none'); } else { $writer->addStyleAttribute('visibility', 'hidden'); } } $writer->addAttribute('id', $this->getClientID()); parent::addAttributesToRender($writer); }
/** * Adds attribute name-value pairs to renderer. * This overrides the parent implementation with additional button specific attributes. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { $writer->addAttribute('type', 'text/javascript'); $writer->addAttribute('src', $this->getClientScriptUrl()); parent::addAttributesToRender($writer); }
/** * Attach JavaScript helpers if this control has other controls. * * @see addAttributesToRender() */ protected function addAttributesToRender($writer) { if ($this->Controls->Count > 1 && $this->_expand) { $writer->addAttribute('class', 'colapse'); } parent::addAttributesToRender($writer); }
/** * Adds attribute name-value pairs to renderer. * This method overrides the parent implementation with additional TKeyboard specific attributes. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); if ($this->getPage()->getClientSupportsJavaScript()) { $writer->addAttribute('id', $this->getClientID()); } }
/** * Adds attributes to renderer. * @param THtmlWriter the renderer * @throws TInvalidDataValueException if default button is not right. */ protected function addAttributesToRender($writer) { $this->setCssClass('weekScheduler_container'); parent::addAttributesToRender($writer); }
/** * Adds attributes to renderer. * @param THtmlWriter the renderer */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $border = 0; if ($this->getHasStyle()) { if ($this->getGridLines() !== TTableGridLines::None) { if (($border = $this->getBorderWidth()) === '') { $border = 1; } else { $border = (int) $border; } } } $writer->addAttribute('border', "{$border}"); }
/** * Add the specified css classes to the track * @param THtmlWriter writer */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $writer->addAttribute('id', $this->getClientID()); if ($this->getCssClass() === '') { $class = $this->getDirection() == TSliderDirection::Horizontal ? 'HorizontalSlider' : 'VerticalSlider'; $writer->addAttribute('class', 'Slider ' . $class); } }
/** * Adds attribute name-value pairs to renderer. * This method overrides the parent implementation with additional textbox specific attributes. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { $page = $this->getPage(); $page->ensureRenderInForm($this); if (($uid = $this->getUniqueID()) !== '') { $writer->addAttribute('name', $uid); } if (($textMode = $this->getTextMode()) === TTextBoxMode::MultiLine) { if (($rows = $this->getRows()) <= 0) { $rows = self::DEFAULT_ROWS; } if (($cols = $this->getColumns()) <= 0) { $cols = self::DEFAULT_COLUMNS; } $writer->addAttribute('rows', "{$rows}"); $writer->addAttribute('cols', "{$cols}"); if (!$this->getWrap()) { $writer->addAttribute('wrap', 'off'); } } else { if ($textMode === TTextBoxMode::SingleLine) { $writer->addAttribute('type', 'text'); if (($text = $this->getText()) !== '') { $writer->addAttribute('value', $text); } } else { if ($this->getPersistPassword() && ($text = $this->getText()) !== '') { $writer->addAttribute('value', $text); } $writer->addAttribute('type', 'password'); } if (($act = $this->getAutoCompleteType()) !== 'None') { if ($act === 'Disabled') { $writer->addAttribute('autocomplete', 'off'); } else { if ($act === 'Search') { $writer->addAttribute('vcard_name', 'search'); } else { if ($act === 'HomeCountryRegion') { $writer->addAttribute('vcard_name', 'HomeCountry'); } else { if ($act === 'BusinessCountryRegion') { $writer->addAttribute('vcard_name', 'BusinessCountry'); } else { if (strpos($act, 'Business') === 0) { $act = 'Business' . '.' . substr($act, 8); } else { if (strpos($act, 'Home') === 0) { $act = 'Home' . '.' . substr($act, 4); } } $writer->addAttribute('vcard_name', 'vCard.' . $act); } } } } } if (($cols = $this->getColumns()) > 0) { $writer->addAttribute('size', "{$cols}"); } if (($maxLength = $this->getMaxLength()) > 0) { $writer->addAttribute('maxlength', "{$maxLength}"); } } if ($this->getReadOnly()) { $writer->addAttribute('readonly', 'readonly'); } $isEnabled = $this->getEnabled(true); if (!$isEnabled && $this->getEnabled()) { // in this case parent will not render 'disabled' $writer->addAttribute('disabled', 'disabled'); } if ($isEnabled && $this->getEnableClientScript() && ($this->getAutoPostBack() || $textMode === TTextBoxMode::SingleLine) && $page->getClientSupportsJavaScript()) { $this->renderClientControlScript($writer); } parent::addAttributesToRender($writer); }
/** * Adds attribute name-value pairs to renderer. * This overrides the parent implementation with additional button specific attributes. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { if ($this->getID() !== '') { $writer->addAttribute('name', $this->getUniqueID()); } if (($src = $this->getFrameUrl()) !== '') { $writer->addAttribute('src', $src); } if (($align = strtolower($this->getAlign())) !== 'notset') { $writer->addAttribute('align', $align); } $scrollBars = $this->getScrollBars(); if ($scrollBars === TInlineFrameScrollBars::None) { $writer->addAttribute('scrolling', 'no'); } else { if ($scrollBars === TInlineFrameScrollBars::Both) { $writer->addAttribute('scrolling', 'yes'); } } if (!$this->getShowBorder()) { $writer->addAttribute('frameborder', '0'); } if (($longdesc = $this->getDescriptionUrl()) !== '') { $writer->addAttribute('longdesc', $longdesc); } if (($marginheight = $this->getMarginHeight()) !== -1) { $writer->addAttribute('marginheight', $marginheight); } if (($marginwidth = $this->getMarginWidth()) !== -1) { $writer->addAttribute('marginwidth', $marginwidth); } parent::addAttributesToRender($writer); }
/** * Adds attributes to renderer. * @param THtmlWriter the renderer */ protected function addAttributesToRender($writer) { if (!$this->getActive() && $this->getPage()->getClientSupportsJavaScript()) { $this->getStyle()->setStyleField('display', 'none'); } $this->getStyle()->mergeWith($this->getParent()->getViewStyle()); parent::addAttributesToRender($writer); $writer->addAttribute('id', $this->getClientID()); }
protected function addAttributesToRender($writer) { $writer->addAttribute('id', $this->getClientID()); parent::addAttributesToRender($writer); }
/** * Ensure that the ID attribute is rendered and registers the javascript code * for initializing the active control. */ protected function addAttributesToRender($writer) { //calls the TWebControl to avoid rendering other attribute normally render for a textbox. TWebControl::addAttributesToRender($writer); $writer->addAttribute('id', $this->getLabelClientID()); $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions()); }
/** * Adds attribute name-value pairs to renderer. * This overrides the parent implementation with additional button specific attributes. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { $page = $this->getPage(); $page->ensureRenderInForm($this); $writer->addAttribute('type', strtolower($this->getButtonType())); if (($uniqueID = $this->getUniqueID()) !== '') { $writer->addAttribute('name', $uniqueID); } if ($this->getButtonTag() === TButtonTag::Button) { $this->addParsedObject($this->getText()); } else { $writer->addAttribute('value', $this->getText()); } if ($this->getEnabled(true)) { if ($this->getEnableClientScript() && $this->needPostBackScript()) { $this->renderClientControlScript($writer); } } else { if ($this->getEnabled()) { // in this case, parent will not render 'disabled' $writer->addAttribute('disabled', 'disabled'); } } parent::addAttributesToRender($writer); }