/**
  * Returns the attributes to be rendered.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     unset($attributes['id']);
     return $attributes;
 }
 /**
  * This overrides the parent implementation by rendering more THyperLink-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attr = parent::getAttributesToRender();
     $href = $this->getNavigateUrl();
     if (strlen($href) && $this->isEnabled()) {
         $attr['href'] = pradoEncodeData($href);
     }
     $target = $this->getTarget();
     if (strlen($target)) {
         $attr['target'] = $target;
     }
     return $attr;
 }
 /**
  * This overrides the parent implementation by rendering more TLinkButton-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attr = parent::getAttributesToRender();
     if ($this->isEnabled()) {
         $page = $this->getPage();
         $postBack = $page->getPostBackClientEvent($this, '');
         if ($this->causesValidation() && $this->Page->isEndScriptRegistered('TValidator')) {
             $script = "Prado.Validation.AddTarget('{$this->ClientID}');";
             $this->Page->registerEndScript($this->ClientID . 'target', $script);
         }
         $attr['href'] = "javascript:{$postBack}";
     }
     return $attr;
 }
Example #4
0
 /**
  * Returns the attributes to be rendered.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $url = $this->getBackImageUrl();
     if (strlen($url)) {
         $this->setStyle(array('background-image' => "url({$url})"));
     }
     $attributes = parent::getAttributesToRender();
     if (($cellSpacing = $this->getCellSpacing()) >= 0) {
         $attributes['cellspacing'] = $cellSpacing;
     } else {
         $attributes['cellspacing'] = '0';
     }
     if (($cellPadding = $this->getCellPadding()) >= 0) {
         $attributes['cellpadding'] = $cellPadding;
     } else {
         $attributes['cellpadding'] = '0';
     }
     $grid = $this->getGridLines();
     if ($grid != 'None') {
         if ($grid == 'Horizontal') {
             $attributes['rules'] = 'rows';
         } else {
             if ($grid == 'Both') {
                 $attributes['rules'] = 'all';
             } else {
                 if ($grid == 'Vertical') {
                     $attributes['rules'] = 'cols';
                 }
             }
         }
         if (!isset($attributes['border'])) {
             $attributes['border'] = '1';
         }
     }
     $align = $this->getHorizontalAlign();
     if ($align != 'NotSet') {
         $attributes['align'] = $align;
     }
     return $attributes;
 }
 /**
  * Returns the attributes to be rendered.
  * This method overrides the parent's implementation.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['name'] = $this->getUniqueID();
     if ($this->isReadOnly()) {
         $attributes['readonly'] = 'readonly';
     }
     if ($this->isAutoPostBack()) {
         $page = $this->getPage();
         $script = $page->getPostBackClientEvent($this, '');
         $attributes['onchange'] = "javascript:{$script}";
     }
     $type = $this->getTextMode();
     if ($type === 'MultiLine') {
         if (($rows = $this->getRows()) > 0) {
             $attributes['rows'] = $rows;
         }
         if (($cols = $this->getColumns()) > 0) {
             $attributes['cols'] = $cols;
         }
         if (!$this->isWrap()) {
             $attributes['wrap'] = 'off';
         }
     } else {
         $attributes['type'] = $type === 'Password' ? 'password' : 'text';
         if (($cols = $this->getColumns()) > 0) {
             $attributes['size'] = $cols;
         }
         if (($maxLength = $this->getMaxLength()) > 0) {
             $attributes['maxlength'] = $maxLength;
         }
         $attributes['value'] = $this->isEncodeText() ? pradoEncodeData($this->getText()) : $this->getText();
     }
     return $attributes;
 }
 /**
  * This overrides the parent implementation by rendering more TWebControl-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     if ($this->getGenerateCss()) {
         unset($attributes['style']);
     }
     if (!$this->isEnabled()) {
         $attributes['disabled'] = "disabled";
     }
     $tabIndex = $this->getTabIndex();
     if (!empty($tabIndex)) {
         $attributes['tabindex'] = $tabIndex;
     }
     $toolTip = $this->getToolTip();
     if (strlen($toolTip)) {
         $attributes['title'] = $toolTip;
     }
     $accessKey = $this->getAccessKey();
     if (strlen($accessKey)) {
         $attributes['accesskey'] = $accessKey;
     }
     $cssClass = $this->getCssClass();
     if (strlen($cssClass)) {
         $attributes['class'] = $cssClass;
     }
     return $attributes;
 }
 /**
  * Returns the attributes to be rendered.
  * This method overrides the parent's implementation.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes["id"] = $this->getClientID();
     $attributes["type"] = "checkbox";
     $attributes["name"] = $this->getClientID();
     if ($this->isChecked()) {
         $attributes["checked"] = "checked";
     }
     if (!$this->isEnabled()) {
         $attributes["disabled"] = "disabled";
     }
     if ($this->isAutoPostBack()) {
         $page = $this->getPage();
         $script = $page->getPostBackClientEvent($this, '');
         $attributes["onclick"] = "javascript:{$script}";
     }
     $accessKey = $this->getAccessKey();
     if (strlen($accessKey)) {
         $attributes["acesskey"] = $accessKey;
     }
     $tabIndex = $this->getTabIndex();
     if (!empty($tabIndex)) {
         $attributes["tabindex"] = $tabIndex;
     }
     return $attributes;
 }
Example #8
0
 /**
  * This overrides the parent implementation by rendering more TImage-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['src'] = $this->getImageUrl();
     $attributes['border'] = $this->getBorder();
     $attributes['alt'] = $this->isEncodeText() ? pradoEncodeData($this->getAlternateText()) : $this->getAlternateText();
     $align = $this->getImageAlign();
     if (strlen($align)) {
         $attributes['align'] = $align;
     }
     return $attributes;
 }
Example #9
0
 /**
  * This overrides the parent implementation by rendering more TButton-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['type'] = "submit";
     $attributes['name'] = $this->getUniqueID();
     $attributes['value'] = $this->isEncodeText() ? pradoEncodeData($this->getText()) : $this->getText();
     if ($this->causesValidation() && $this->Page->isEndScriptRegistered('TValidator')) {
         $script = "Prado.Validation.AddTarget('{$this->ClientID}');";
         $this->Page->registerEndScript($this->ClientID . 'target', $script);
     }
     return $attributes;
 }
 /**
  * This overrides the parent implementation by rendering the FOR
  * attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attr = parent::getAttributesToRender();
     $forID = $this->getForID();
     $parent = $this->getParent();
     $for = $parent->findObject($forID);
     if (is_null($for)) {
         throw new Exception("Invalid \"For\" attribute in TFormLabel value: {$forID}.");
     } else {
         if ($for instanceof TListControl) {
             if (isset($attr['onclick'])) {
                 $onclick = explode(';', $attr['onclick']);
             }
             $onclick[] = 'document.getElementById(\'' . $for->getClientID() . '\').focus();return false;';
             $attr['onclick'] = implode(';', $onclick);
         }
         $attr['for'] = $for->getClientID();
     }
     return $attr;
 }
 /**
  * Returns the attributes to be rendered.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $align = $this->getHorizontalAlign();
     if ($align != 'NotSet') {
         $attributes['align'] = strtolower($align);
     }
     $valign = $this->getVerticalAlign();
     if ($valign != 'NotSet') {
         $attributes['valign'] = strtolower($valign);
     }
     unset($attributes['id']);
     return $attributes;
 }
 /**
  * Returns the attributes to be rendered.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     if (($colspan = $this->getColumnSpan()) > 0) {
         $attributes['colspan'] = $colspan;
     }
     if (($rowspan = $this->getRowSpan()) > 0) {
         $attributes['rowspan'] = $rowspan;
     }
     if (!$this->isWrap()) {
         $attributes['nowrap'] = 'nowrap';
     }
     $align = $this->getHorizontalAlign();
     if ($align != 'NotSet') {
         $attributes['align'] = strtolower($align);
     }
     $valign = $this->getVerticalAlign();
     if ($valign != 'NotSet') {
         $attributes['valign'] = strtolower($valign);
     }
     unset($attributes['id']);
     return $attributes;
 }
Example #13
0
 /**
  * This overrides the parent implementation by rendering more TPanel-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $url = $this->getBackImageUrl();
     if (strlen($url)) {
         $this->setStyle(array('background-image' => "url({$url})"));
     }
     $attributes = parent::getAttributesToRender();
     $align = $this->getHorizontalAlign();
     if (strlen($align)) {
         $attributes['align'] = $align;
     }
     if (!$this->isWrap()) {
         $attributes['nowrap'] = 'nowrap';
     }
     return $attributes;
 }
 /**
  * This overrides the parent implementation by rendering more TButton-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['type'] = 'file';
     $attributes['name'] = $this->getUniqueID();
     return $attributes;
 }
 /**
  * This overrides the parent implementation by rendering more TButton-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['type'] = 'file';
     $attributes['name'] = $this->getUniqueID();
     if (($cols = $this->getColumns()) > 0) {
         $attributes['size'] = $cols;
     }
     return $attributes;
 }