File: PHPReportBookmark.php

package info (click to toggle)
phpreports 0.4.7-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 664 kB
  • ctags: 1,362
  • sloc: php: 3,248; xml: 203; makefile: 29; sh: 17; python: 10
file content (80 lines) | stat: -rwxr-xr-x 1,772 bytes parent folder | download | duplicates (3)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
	/**
		Column bookmark object
		It can be of three types:
		1) DYNAMIC    - get the link value from the field value specified on the LINK element text
		2)	STATIC     - get the link value from the LINK element text
		3) EXPRESSION - get the link value from the evaluated LINK element text
	*/	
	class PHPReportBookmark {
		var $_sType;
		var $_sExpr;
		var $_iId;
		var $_sCellClass;	// cell class
		var $_sTextClass;	// cell class

		function PHPReportBookmark($sType_="STATIC",$sExpr_="",$iId_=0,$sCellClass_="") {
			$this->_sType			=$sType_;
			$this->_sExpr			=$sExpr_;
			$this->_iId				=$iId_;
			$this->_sCellClass	=$sCellClass_;
		}

		function setType($sType_="STATIC") {
			$this->_sType=strtoupper($sType_);
		}
		
		function getType() {
			return $this->_sType;
		}
		
		function setExpr($sExpr_="") {
			$this->_sExpr=$sExpr_;
		}
		
		function getExpr() {
			return $this->_sExpr;
		}

		function setId($iId_) {
			$this->_iId=$iId_;
		}

		function getId() {
			return $this->_iId;
		}
		
		function setCellClass($sCellClass_) {
			$this->_sCellClass=$sCellClass_;
		}

		function getCellClass() {
			return $this->_sCellClass;
		}
		
		function setTextClass($sTextClass_) {
			$this->_sTextClass=$sTextClass_;
		}

		function getTextClass() {
			return $this->_sTextClass;
		}

		function getBookmarkValue($oCol_=null) {
			$sVal		= "";
			$oError	= new PHPReportsErrorTr();

			if($this->_sType=="STATIC")
				$sVal=$this->_sExpr;
			else if($this->_sType=="DYNAMIC") {
				if(!isset($oCol_))
					$oError->showMsg("DYNBOOK");
				$sVal=$oCol_->getValue($this->_sExpr);
			}else if($this->_sType=="EXPRESSION") 						
				if(!isset($oCol_))
					$oError->showMsg("EXPBOOK");
				$sVal = $oCol_->availExpr($this->_sExpr);
			return $sVal;
		}
	}
?>