summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/controls/DocLink.php
blob: 12b8e89884a73b1d0964137c10f3bf13f7dfdb5a (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
31
<?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');
		}
	}
}

?>