Esempio n. 1
0
 public function generateControl($i, $row)
 {
     $class = "mGridActionIconDetail";
     $row = $this->grid->data[$this->grid->currentRow];
     $n = count($row);
     $href = $this->href;
     if (preg_match('/%(.*)%/', $href, $matches)) {
         $value = preg_replace('/%(.*)%/', $row[$matches[0][1]], $href);
     }
     $href = str_replace("%r%", $this->grid->currentRow, $href);
     $hrefOn = str_replace("%s%", '1', $href);
     $hrefOff = str_replace("%s%", '0', $href);
     $controlOn = new MImage('', '', $this->path[true]);
     $controlOff = new MImage('', '', $this->path[false]);
     $controlOn->addAttribute('onclick', $hrefOn);
     $controlOn->setClass($class);
     $controlOff->addAttribute('onclick', $hrefOff);
     $controlOff->setClass($class);
     $this->control[$i] = new MDiv('', array($controlOn, $controlOff), 'detail');
     return $this->control[$i];
 }