| 1: | <?php
|
| 2: |
|
| 3: |
|
| 4: |
|
| 5: |
|
| 6: | class EditPanel extends Sphp\tools\Component{
|
| 7: | private $label = "";
|
| 8: | private $lstcomp = "";
|
| 9: |
|
| 10: | public function fu_setLabel($label,$tfield="") {
|
| 11: | $this->label = $label;
|
| 12: | $this->lstcomp = $tfield;
|
| 13: | }
|
| 14: | private function setLabel2($label,$tfield="") {
|
| 15: | if(SphpBase::page()->getEvent() == 'view' || SphpBase::page()->getEvent() == 'rowclick'){
|
| 16: | if($tfield != ""){
|
| 17: | $v1 = explode(",", $tfield);
|
| 18: | $tfield = "";
|
| 19: | foreach($v1 as $i => $col){
|
| 20: | $tfield .= " " . $this->frontobj->getComponent($col)->value;
|
| 21: | }
|
| 22: |
|
| 23: | }
|
| 24: | $label = "Edit " . $label . $tfield;
|
| 25: | }else{
|
| 26: | $label = "Add " . $label;
|
| 27: | }
|
| 28: | $this->label = $label;
|
| 29: | }
|
| 30: | protected function onrender(){
|
| 31: | $this->setLabel2($this->label,$this->lstcomp);
|
| 32: | $this->tagName = 'div';
|
| 33: | $this->setPreTag('<div class="card card-primary">
|
| 34: | <div class="card-header">
|
| 35: | <h3 class="card-title"><span style="font-size:16px;" class="pull-left hidden-xs showopacity fa fa-user"></span> <span id="editheading">'.$this->label.'</span></h3>
|
| 36: | </div>
|
| 37: | <div class="card-block">
|
| 38: | <div class="block">
|
| 39: |
|
| 40: | ');
|
| 41: | $this->class = "content px-4 py-4";
|
| 42: | $this->setPostTag('</div></div></div>');
|
| 43: |
|
| 44: | }
|
| 45: |
|
| 46: | }
|
| 47: | |