コード例 #1
0
ファイル: Delete.php プロジェクト: bravadomizzou/dewdrop
 /**
  * When receiving a POST, get the row editor setup and then call its
  * delete() method.
  */
 public function process()
 {
     if ($this->request->isPost()) {
         $rowEditor = $this->component->getRowEditor();
         $rowEditor->link();
         $rowEditor->delete();
         $this->result = 'success';
     }
 }
コード例 #2
0
ファイル: Restore.php プロジェクト: deltasystems/dewdrop
 /**
  * When receiving a POST, get the row editor setup and then call its
  * delete() method.
  *
  * @param ResponseHelper $response
  */
 public function process(ResponseHelper $response)
 {
     if ($this->request->isPost()) {
         $rowEditor = $this->component->getRowEditor();
         $rowEditor->link();
         $rowEditor->restore();
         $this->logActivity($rowEditor);
         $this->result = 'success';
     }
 }
コード例 #3
0
 public function render()
 {
     $this->component->getPermissions()->haltIfNotAllowed('create');
     $renderer = $this->view->editControlRenderer();
     $rowEditor = $this->component->getRowEditor();
     $field = $this->component->getFields()->get($this->request->getQuery('field'));
     $value = $this->request->getQuery('value');
     $rowEditor->link();
     if ($field instanceof ManyToManyField) {
         $field->setValue([$value]);
     } else {
         $field->setValue($value);
     }
     $this->component->setShouldRenderLayout(false);
     return $renderer->getControlRenderer()->render($field, 0);
 }
コード例 #4
0
 public function getRowEditor()
 {
     if (!$this->rowEditor) {
         $this->rowEditor = $this->component->getRowEditor();
     }
     return $this->rowEditor;
 }
コード例 #5
0
ファイル: Edit.php プロジェクト: deltasystems/dewdrop
 /**
  * @return \Dewdrop\Fields\RowEditor
  */
 public function getRowEditor()
 {
     return $this->component->getRowEditor();
 }