예제 #1
0
 /**
  * Setup notification fields and pass various dependencies to the View.
  */
 public function render()
 {
     $gateway = new NotificationGateway($this->component->getDb());
     $select = $gateway->selectByComponent($this->component->getFullyQualifiedName());
     $fields = $gateway->buildFields($this->component->url('notification-edit'), $this->component->getFields());
     $this->view->assign(['fields' => $fields, 'listing' => new Listing($select, $gateway->field('dewdrop_notification_subscription_id')), 'component' => $this->component, 'componentModel' => $this->component->getPrimaryModel()]);
     return $this->renderView();
 }
예제 #2
0
 /**
  * Ensure the user has permissions to work with notifications in this component
  * and setup Fields and RowEditor objects.
  */
 public function init()
 {
     $this->component->getPermissions()->haltIfNotAllowed('notifications');
     $gateway = new NotificationGateway($this->component->getDb());
     $this->fields = $gateway->buildFields($this->component->url('notification-edit'), $this->component->getFields());
     $this->rowEditor = new RowEditor($this->fields, $this->request);
     $this->rowEditor->linkByQueryString('dewdrop_notification_subscriptions', 'dewdrop_notification_subscription_id');
     $this->rowEditor->link();
 }