Example #1
0
 public function setHeader($value = null)
 {
     if (!is_object($value) || strtolower(get_class($value)) !== 'crow') {
         $value = new CRowHeader($value);
     }
     $this->colnum = $value->itemsCount();
     $value = new CTag('thead', true, $value);
     $this->header = $value->toString();
     return $this;
 }
Example #2
0
 public function toString($destroy = true)
 {
     $url = $this->url;
     if ($this->use_sid) {
         if (array_key_exists('zbx_sessionid', $_COOKIE)) {
             $url .= strpos($url, '&') !== false || strpos($url, '?') !== false ? '&' : '?';
             $url .= 'sid=' . substr($_COOKIE['zbx_sessionid'], 16, 16);
         }
         $confirm_script = $this->confirm_message !== '' ? 'Confirm(' . CJs::encodeJson($this->confirm_message) . ') && ' : '';
         $this->onClick("javascript: return " . $confirm_script . "redirect('" . $url . "', 'post', 'sid', true)");
         $this->setAttribute('href', 'javascript:void(0)');
     } else {
         $this->setAttribute('href', $url);
         if ($this->confirm_message !== '') {
             $this->onClick('javascript: return Confirm(' . CJs::encodeJson($this->confirm_message) . ');');
         }
     }
     return parent::toString($destroy);
 }