Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"require": {
"php": ">=7.2",
"winter/wn-backend-module": "~1.2.8",
"composer/installers": "~1.0"
},
"replace": {
Expand Down
57 changes: 26 additions & 31 deletions controllers/Notifications.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
<?php namespace Winter\Notify\Controllers;

use Str;
use Lang;
use File;
use Mail;
use Flash;
use Backend;
use Redirect;
use BackendMenu;
<?php

namespace Winter\Notify\Controllers;

use Backend\Classes\Controller;
use Winter\Notify\Models\NotificationRule;
use Backend\Facades\Backend;
use Backend\Facades\BackendMenu;
use Exception;
use System\Classes\SettingsManager;
use Winter\Notify\Classes\EventBase;
use ApplicationException;
use Exception;
use Winter\Notify\Models\NotificationRule;
use Winter\Storm\Exception\ApplicationException;

/**
* Notification rules controller
Expand All @@ -30,12 +26,11 @@ class Notifications extends Controller

public $requiredPermissions = ['winter.notify.manage_notifications'];

public $listConfig = 'config_list.yaml';
public $formConfig = 'config_form.yaml';

public $eventAlias;
protected $eventClass;

public $formLayout = 'fancy';

public function __construct()
{
parent::__construct();
Expand All @@ -52,24 +47,24 @@ public function index()

public function create($eventAlias = null)
{
try {
if (!$eventAlias) {
throw new ApplicationException('Missing a rule code');
}

$this->eventAlias = $eventAlias;
$this->bodyClass = 'compact-container breadcrumb-fancy';
$this->asExtension('FormController')->create();
}
catch (Exception $ex) {
$this->handleError($ex);
if (empty($eventAlias)) {
abort(404);
}

$this->eventAlias = $eventAlias;

$this->asExtension('FormController')->create();
}

public function update($recordId = null, $context = null)
public function create_onSave($eventAlias = null)
{
$this->bodyClass = 'compact-container breadcrumb-fancy';
$this->asExtension('FormController')->update($recordId, $context);
if (empty($eventAlias)) {
abort(404);
}

$this->eventAlias = $eventAlias;

return $this->asExtension('FormController')->create_onSave();
}

public function formExtendModel($model)
Expand Down Expand Up @@ -122,7 +117,7 @@ public function index_onLoadRuleEventForm()

protected function getEventClass()
{
$alias = post('event_alias', $this->eventAlias);
$alias = $this->eventAlias;

if ($this->eventClass !== null) {
return $this->eventClass;
Expand Down
49 changes: 0 additions & 49 deletions controllers/notifications/_form_toolbar.htm

This file was deleted.

31 changes: 0 additions & 31 deletions controllers/notifications/create.htm

This file was deleted.

2 changes: 0 additions & 2 deletions controllers/notifications/index.htm

This file was deleted.

30 changes: 0 additions & 30 deletions controllers/notifications/update.htm

This file was deleted.

1 change: 0 additions & 1 deletion models/notificationrule/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ fields:

toolbar:
type: partial
path: form_toolbar
cssClass: collapse-visible

tabs:
Expand Down