Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
class Layout extends TTemplateControl
4
{
5
	public function __construct()
6
	{
7
		if(isset($this->Request['notheme']))
8
			$this->Service->RequestedPage->EnableTheming=false;
9
		parent::__construct();
10
	}
11
 
12
	public function onLoad($param)
13
	{
14
		parent::onLoad($param);
15
		$url=$this->Request->RequestUri;
16
		if(strpos($url,'?')===false)
17
			$url.='?notheme=true';
18
		else
19
			$url.='&amp;notheme=true';
20
		$this->PrinterLink->NavigateUrl=$url;
21
 
22
		if(isset($this->Request['notheme']))
23
		{
24
			$this->MainMenu->Visible=false;
25
			$this->TopicPanel->Visible=false;
26
		}
27
 
28
		$this->languages->DataSource = TPropertyValue::ensureArray($this->Application->Parameters['languages']);
29
		$this->languages->dataBind();
30
	}
31
 
32
	public function languageLinkCreated($sender, $param)
33
	{
34
		$item = $param->Item;
35
		if($item->ItemType == TListItemType::Item || $item->ItemType == TListItemType::AlternatingItem)
36
		{
37
			$params = $this->Request->toArray();
38
			$params['lang'] = $sender->DataKeys[$item->ItemIndex];
39
			unset($params[$this->Request->ServiceID]);
40
			$url = $this->Service->ConstructUrl($this->Service->RequestedPagePath, $params);
41
			$item->link->NavigateUrl = $url;
42
			if($this->Application->Globalization->Culture == $params['lang'])
43
				$item->link->CssClass="active";
44
		}
45
	}
46
}
47
 
48
?>