<?php

class PrintPanelView extends Slot {

	var $url = '';

	function __construct($pquery) {
		parent::__construct($pquery);
	}

	function init() {
		$flag = !empty($this->LocalTarget[0]) && ($this->LocalTarget[0]=='night-vision-search.html' || $this->LocalTarget[0]=='atnsearchresult')? true : false;
		$url = parse_url(getenv('REQUEST_URI'));
		$this->encodeUrl($this->LocalTarget);
		$this->url = $this->Home.'/PrintPage/'.implode('/',$this->LocalTarget).(!empty($url['query']) && $flag? '?'.$url['query'] : '');
	}

	function fillElements() {
		$this->TempFillEls['link'] = $this->url;
	}

	function encodeUrl(&$array) {
		foreach($array as $key => $value) $array[$key] = urlencode($value);
	}
}
?>