1: <?php
2:
3:
4:
5:
6: class HLabel_Line extends Sphp\tools\Component{
7: private $label = "";
8: private $labelfor = "";
9: private $compsize = "col-md-12";
10: private $blnReq = false;
11: private $href = "";
12:
13: public function fu_setLabel($label,$labelfor) {
14: $this->label = $label;
15: $this->labelfor = $labelfor;
16: }
17: public function fu_setSize($compsize,$f="") {
18: $this->compsize = $compsize;
19: }
20: public function fu_setHref($val) {
21: $this->href = $val;
22: }
23: public function fu_setRequired() {
24: $this->blnReq = true;
25: }
26: protected function onrender(){
27: $this->tagName = 'div';
28: $this->fu_unsetRenderTag();
29: $req = "";
30: $hlink = "";
31: if($this->blnReq){
32: $req = "*";
33: }
34: if($this->href!=""){
35: $hlink = '<a href="#" onclick="getURLinDialog(\''.$this->href.'\',{}); return false;">'.$this->label.'</a>';
36: }else{
37: $hlink = $this->label;
38: }
39:
40: $this->setPreTag('<div class="control-group">
41: <div class="row"><div class="'.$this->compsize.'"><div class="controls">
42: <label class="control-label" for="'.$this->labelfor.'">'. $req . $hlink.'</label>
43: ');
44:
45: $this->setPostTag(' </div>
46: </div></div>
47: </div>
48: ');
49: $this->blnReq = false;
50: $this->href = "";
51:
52: }
53:
54: }
55: ?>