/** * @see HtmlComponent */ public function RenderImpl() { parent::RenderImpl(); if ($this->bookmarkable === true) { $_BASEURL = WebApplication::$app->getResponse()->getHostUrl(); if ($this->encode == true) { $url = serialize(array($this->pagename, $this->params)); if (strlen($url) % 3 == 1) { $url .= ' '; } if (strlen($url) % 3 == 2) { $url .= ' '; } $url = $_BASEURL . "/?r=" . base64_encode(serialize(array($this->pagename, $this->params))); } else { $this->pagename = str_replace("\\", "/", ltrim($this->pagename, "\\")); $url = $_BASEURL . "/?p=" . $this->pagename; if (count($this->params) > 0) { $_param = implode("/", $this->params); $url .= "&arg=" . $_param; } } } else { $url = $this->owner->getURLNode() . "::" . $this->id; //для вызова обработчика } $this->setAttribute("href", "{$url}"); }
/** * @see HtmlComponent */ public function RenderImpl() { parent::RenderImpl(); $link = $this->getLink(); if (strlen($link) > 0) { if (strpos($link, '://') === false) { // $link = "http://".$_SERVER["HTTP_HOST"]."/". $link; if ($link[0] != '/') { $link = '/' . $link; } } $this->setAttribute("href", $link); } }
/** * @see HtmlComponent */ public function RenderImpl() { parent::RenderImpl(); if ($this->getFormOwner() == null) { throw new \Zippy\Exception("Element '" . $this->id . "' outside FORM tag"); } $formid = $this->getFormOwner()->id; if ($this->disabled == true) { $this->setAttribute("href", ""); $this->setAttribute("onclick", ""); return; } $url = $this->owner->getURLNode() . '::' . $this->id; $url = substr($url, 2 + strpos($url, 'q=')); $this->setAttribute("onclick", "javascript:{if(beforeZippy('{$this->id}') ==false) return false; \$('#" . $formid . "_q').attr('value','" . $url . "'); \$('#" . $formid . "').submit();event.returnValue=false; return false;}"); // $this->setAttribute("onclick","javascript:{ var q = $('#".$formid."_q').attr('value');$('#".$formid."_q').attr('value',q+'::".$this->id."');$('#".$formid."').submit();return false;}"); }
/** * @see HtmlComponent */ public function RenderImpl() { parent::RenderImpl(); if ($this->event == null) { $this->setAttribute("href", ""); $this->setAttribute("onclick", ""); return; } if ($this->disabled == true) { $this->setAttribute("href", ""); $this->setAttribute("onclick", ""); return; } $this->setAttribute("href", "javascript:void(0);"); if ($this->event->isajax == false) { $url = $this->owner->getURLNode() . "::" . $this->id; $this->setAttribute("onclick", "if(beforeZippy('{$this->id}') ==false) return false;window.location='{$url}';event.returnValue=false; return false;"); } else { $url = $this->owner->getURLNode() . "::" . $this->id . "&ajax=true"; $this->setAttribute("onclick", "if(beforeZippy('{$this->id}') ==false) return false;getUpdate('{$url}');event.returnValue=false; return false;"); } }