summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/controls/DocLink.php
blob: 758a1645ce4782230fb09d099984e3aa82e309b1 (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='class-'.array_pop($paths).'.html';
			$this->setNavigateUrl(self::BASE_URL . '/' . $classFile);
			if($this->getText() === '')
				$this->setText('API Manual');
		}
	}
}