Skip to content

Commit

Permalink
Merge pull request #277 from brightskyit/patch-1
Browse files Browse the repository at this point in the history
Update Module url route validation only for web apps
  • Loading branch information
kartik-v authored Jun 3, 2021
2 parents a0ca2bd + e1dc954 commit 2033124
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,15 @@ public function init()
'iconTypeAttribute' => 'icon_type'
];
$nodeActions = ArrayHelper::getValue($this->treeViewSettings, 'nodeActions', []);
$nodeActions += [
self::NODE_MANAGE => Url::to(['/treemanager/node/manage']),
self::NODE_SAVE => Url::to(['/treemanager/node/save']),
self::NODE_REMOVE => Url::to(['/treemanager/node/remove']),
self::NODE_MOVE => Url::to(['/treemanager/node/move']),
];
// prepends Error in Console Applications
if (\Yii::$app instanceof \yii\web\Application) {
$nodeActions += [
self::NODE_MANAGE => Url::to(['/treemanager/node/manage']),
self::NODE_SAVE => Url::to(['/treemanager/node/save']),
self::NODE_REMOVE => Url::to(['/treemanager/node/remove']),
self::NODE_MOVE => Url::to(['/treemanager/node/move']),
];
}
$this->treeViewSettings['nodeActions'] = $nodeActions;
}
}

0 comments on commit 2033124

Please sign in to comment.