summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/controls/DocLink.php
blob: b1043821991ab2454f2b650e8cf4ab227e23c299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

class DocLink extends THyperLink
{
	const BASE_URL='http://www.pradosoft.com/docs/manual';

	public function getClassPath()
	{
		return $this->getViewState('ClassPath','');
	}

	public function setClassPath($value)
	{
		$this->setViewState('ClassPath',$value,'');
	}

	public function onPreRender($param)
	{
		parent::onPreRender($param);
		$paths=explode('.',$this->getClassPath());
		if(count($paths)>1)
		{
			$classFile=array_pop($paths).'.html';
			$this->setNavigateUrl(self::BASE_URL . '/' . implode('.',$paths) . '/' . $classFile);
			if($this->getText() === '')
				$this->setText('API Manual');
		}
	}
}