Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public function getPageLast()
 {
     $pageNumber = $this->getPageNumber();
     $pageCount = $this->getPageCount();
     if ($pageNumber < $pageCount) {
         $image = new MLink('', '&nbsp;');
         //            $image->setAction('!' . $this->grid->name . '.goPage(' . $pageCount . ');');
         $this->goPage[] = array('id' => $image->getId(), 'page' => $pageCount);
         $image->setClass('mGridNavigatorImage mGridNavigatorImageLastOn');
     } else {
         $image = new MDiv('', '&nbsp;');
         $image->setClass('mGridNavigatorImage mGridNavigatorImageLastOff');
     }
     return $image;
 }