public static function link($column, $i, $row) { $value = $row[$column->index ?: 0]; $control = new MLink(); $n = count($row); $action = $column->action ?: $column->href; if (preg_match_all('/#([^#]*)#/', $action, $matches)) { if (is_array($matches[1])) { foreach ($matches[1] as $match) { $action = preg_replace('/#' . $match . '#/', trim($row[$match]), $action); } } } if ($column->options) { $control->setText(($column->grid->showid ? " ({$value})" : '') . $column->options[$value]); } $action = str_replace('#?#', $value, $action); $control->setId(uniqid()); $control->setAction($action); $control->setText($value); $control->setClass('mGridLink'); return $control; }
public function getPageLast() { $pageNumber = $this->getPageNumber(); $pageCount = $this->getPageCount(); if ($pageNumber < $pageCount) { $image = new MLink('', ' '); // $image->setAction('!' . $this->grid->name . '.goPage(' . $pageCount . ');'); $this->goPage[] = array('id' => $image->getId(), 'page' => $pageCount); $image->setClass('mGridNavigatorImage mGridNavigatorImageLastOn'); } else { $image = new MDiv('', ' '); $image->setClass('mGridNavigatorImage mGridNavigatorImageLastOff'); } return $image; }