Пример #1
0
 /**
  * @copydoc GridRow::initialize()
  */
 function initialize($request, $template = null)
 {
     parent::initialize($request, $template);
     // add grid row actions: edit, delete
     $element = parent::getData();
     assert(is_a($element, 'ReviewFormElement'));
     $rowId = $this->getId();
     $router = $request->getRouter();
     if (!empty($rowId) && is_numeric($rowId)) {
         // add 'edit' grid row action
         $this->addAction(new LinkAction('edit', new AjaxModal($router->url($request, null, null, 'editReviewFormElement', null, array('rowId' => $rowId, 'reviewFormId' => $element->getReviewFormId())), __('grid.action.edit'), 'modal_edit', true), __('grid.action.edit'), 'edit'));
         // add 'delete' grid row action
         $this->addAction(new LinkAction('delete', new RemoteActionConfirmationModal($request->getSession(), __('manager.reviewFormElements.confirmDelete'), null, $router->url($request, null, null, 'deleteReviewFormElement', null, array('rowId' => $rowId, 'reviewFormId' => $element->getReviewFormId()))), __('grid.action.delete'), 'delete'));
     }
 }