Skip to content

Commit 37a93a6

Browse files
daniellienertmarkusguenther
authored andcommitted
TASK: Refactor controller to not use static fusion path
The fusion path is now dynamically determined by controller / action This enables additional actions with separate templates for that controller.
1 parent 204e381 commit 37a93a6

File tree

4 files changed

+261
-288
lines changed

4 files changed

+261
-288
lines changed

Classes/Controller/BackendController.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,6 @@ class BackendController extends ActionController
110110
*/
111111
protected $linkingService;
112112

113-
/**
114-
* Initializes the view before invoking an action method.
115-
*
116-
* @param ViewInterface $view The view to be initialized
117-
* @return void
118-
*/
119-
public function initializeView(ViewInterface $view)
120-
{
121-
$view->setFusionPath('backend');
122-
}
123-
124113
/**
125114
* Displays the backend interface
126115
*
Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
Neos.Neos.Ui.BackendController.index = Neos.Fusion:Template {
2+
templatePath = 'resource://Neos.Neos.Ui/Private/Templates/Backend/Index.html'
3+
4+
headScripts = ${headScripts}
5+
headStylesheets = ${headStylesheets}
6+
splashScreenPartial = ${splashScreenPartial}
7+
8+
headIcons = Neos.Fusion:Join {
9+
appleTouchIcon = Neos.Fusion:Tag {
10+
tagName = 'link'
11+
attributes {
12+
href = Neos.Fusion:ResourceUri {
13+
path = 'resource://Neos.Neos.Ui/Public/Images/apple-touch-icon.png'
14+
}
15+
sizes = '180x180'
16+
rel = 'apple-touch-icon'
17+
}
18+
}
19+
favicon16 = Neos.Fusion:Tag {
20+
tagName = 'link'
21+
attributes {
22+
href = Neos.Fusion:ResourceUri {
23+
path = 'resource://Neos.Neos.Ui/Public/Images/favicon-16x16.png'
24+
}
25+
sizes = '16x16'
26+
rel = 'icon'
27+
type = 'image/png'
28+
}
29+
}
30+
favicon32 = Neos.Fusion:Tag {
31+
tagName = 'link'
32+
attributes {
33+
href = Neos.Fusion:ResourceUri {
34+
path = 'resource://Neos.Neos.Ui/Public/Images/favicon-32x32.png'
35+
}
36+
sizes = '32x32'
37+
rel = 'icon'
38+
type = 'image/png'
39+
}
40+
}
41+
safariPinnedTab = Neos.Fusion:Tag {
42+
tagName = 'link'
43+
attributes {
44+
href = Neos.Fusion:ResourceUri {
45+
path = 'resource://Neos.Neos.Ui/Public/Images/safari-pinned-tab.svg'
46+
}
47+
rel = 'mask-icon'
48+
color = '#00adee'
49+
}
50+
}
51+
}
52+
53+
configuration = Neos.Fusion:DataStructure {
54+
nodeTree = ${Configuration.setting('Neos.Neos.userInterface.navigateComponent.nodeTree')}
55+
structureTree = ${Configuration.setting('Neos.Neos.userInterface.navigateComponent.structureTree')}
56+
allowedTargetWorkspaces = ${Neos.Ui.Workspace.getAllowedTargetWorkspaces()}
57+
endpoints = Neos.Fusion:DataStructure {
58+
nodeTypeSchema = Neos.Fusion:UriBuilder {
59+
package = 'Neos.Neos'
60+
controller = 'Backend\\Schema'
61+
action = 'nodeTypeSchema'
62+
absolute = true
63+
arguments = Neos.Fusion:DataStructure {
64+
# TODO: dirty hack to not have to re-implement neos:backend.configurationCacheVersion VH
65+
version = Neos.Fusion:Template {
66+
templatePath = 'resource://Neos.Neos.Ui/Private/Templates/Backend/ConfigurationVersion.html'
67+
@process.trim = ${String.trim(value)}
68+
}
69+
}
70+
}
71+
translations = Neos.Fusion:UriBuilder {
72+
package = 'Neos.Neos'
73+
controller = 'Backend\\Backend'
74+
action = 'xliffAsJson'
75+
absolute = true
76+
arguments = Neos.Fusion:DataStructure {
77+
locale = ${interfaceLanguage}
78+
79+
# TODO: dirty hack to not have to re-implement neos:backend.configurationCacheVersion VH
80+
version = Neos.Fusion:Template {
81+
templatePath = 'resource://Neos.Neos.Ui/Private/Templates/Backend/ConfigurationVersion.html'
82+
@process.trim = ${String.trim(value)}
83+
}
84+
}
85+
}
86+
}
87+
@process.json = ${Json.stringify(value)}
88+
}
89+
90+
routes = Neos.Fusion:DataStructure {
91+
prototype(Neos.Fusion:UriBuilder) {
92+
absolute = true
93+
}
94+
95+
ui = Neos.Fusion:DataStructure {
96+
service = Neos.Fusion:DataStructure {
97+
prototype(Neos.Fusion:UriBuilder) {
98+
package = 'Neos.Neos.Ui'
99+
controller = 'BackendService'
100+
}
101+
102+
change = Neos.Fusion:UriBuilder {
103+
action = 'change'
104+
}
105+
publish = Neos.Fusion:UriBuilder {
106+
action = 'publish'
107+
}
108+
discard = Neos.Fusion:UriBuilder {
109+
action = 'discard'
110+
}
111+
changeBaseWorkspace = Neos.Fusion:UriBuilder {
112+
action = 'changeBaseWorkspace'
113+
}
114+
copyNodes = Neos.Fusion:UriBuilder {
115+
action = 'copyNodes'
116+
}
117+
cutNodes = Neos.Fusion:UriBuilder {
118+
action = 'cutNodes'
119+
}
120+
clearClipboard = Neos.Fusion:UriBuilder {
121+
action = 'clearClipboard'
122+
}
123+
loadTree = Neos.Fusion:UriBuilder {
124+
action = 'loadTree'
125+
}
126+
flowQuery = Neos.Fusion:UriBuilder {
127+
action = 'flowQuery'
128+
}
129+
getWorkspaceInfo = Neos.Fusion:UriBuilder {
130+
action = 'getWorkspaceInfo'
131+
}
132+
getAdditionalNodeMetadata = Neos.Fusion:UriBuilder {
133+
action = 'getAdditionalNodeMetadata'
134+
}
135+
}
136+
}
137+
core = Neos.Fusion:DataStructure {
138+
prototype(Neos.Fusion:UriBuilder) {
139+
package = 'Neos.Neos'
140+
}
141+
142+
content = Neos.Fusion:DataStructure {
143+
prototype(Neos.Fusion:UriBuilder) {
144+
controller = 'Backend\\Content'
145+
}
146+
147+
imageWithMetadata = Neos.Fusion:UriBuilder {
148+
action = 'imageWithMetaData'
149+
}
150+
createImageVariant = Neos.Fusion:UriBuilder {
151+
action = 'createImageVariant'
152+
}
153+
loadMasterPlugins = Neos.Fusion:UriBuilder {
154+
action = 'masterPlugins'
155+
}
156+
loadPluginViews = Neos.Fusion:UriBuilder {
157+
action = 'pluginViews'
158+
}
159+
uploadAsset = Neos.Fusion:UriBuilder {
160+
action = 'uploadAsset'
161+
}
162+
}
163+
service = Neos.Fusion:DataStructure {
164+
assetProxies = Neos.Fusion:UriBuilder {
165+
controller = 'Service\\AssetProxies'
166+
action = 'index'
167+
}
168+
assets = Neos.Fusion:UriBuilder {
169+
controller = 'Service\\Assets'
170+
action = 'index'
171+
}
172+
nodes = Neos.Fusion:UriBuilder {
173+
controller = 'Service\\Nodes'
174+
action = 'index'
175+
}
176+
userPreferences = Neos.Fusion:UriBuilder {
177+
subpackage = 'Service'
178+
controller = 'UserPreference'
179+
action = 'index'
180+
format = 'json'
181+
}
182+
dataSource = Neos.Fusion:UriBuilder {
183+
subpackage = 'Service'
184+
controller = 'DataSource'
185+
action = 'index'
186+
format = 'json'
187+
}
188+
contentDimensions = Neos.Fusion:UriBuilder {
189+
package = 'Neos.Neos'
190+
controller = 'Service\\ContentDimensions'
191+
action = 'index'
192+
}
193+
}
194+
modules = Neos.Fusion:DataStructure {
195+
prototype(Neos.Fusion:UriBuilder) {
196+
controller = 'Backend\\Module'
197+
}
198+
workspaces = Neos.Fusion:UriBuilder {
199+
action = 'index'
200+
arguments {
201+
module = 'management/workspaces'
202+
}
203+
}
204+
userSettings = Neos.Fusion:UriBuilder {
205+
controller = 'Backend\\Module'
206+
action = 'index'
207+
arguments {
208+
module = 'user/usersettings'
209+
}
210+
}
211+
mediaBrowser = Neos.Fusion:UriBuilder {
212+
controller = 'Backend\\Module'
213+
action = 'index'
214+
arguments {
215+
module = 'media/browser'
216+
}
217+
}
218+
}
219+
login = Neos.Fusion:UriBuilder {
220+
controller = 'Login'
221+
action = 'index'
222+
format = 'json'
223+
}
224+
logout = Neos.Fusion:UriBuilder {
225+
controller = 'Login'
226+
action = 'logout'
227+
}
228+
}
229+
@process.json = ${Json.stringify(value)}
230+
}
231+
232+
frontendConfiguration = Neos.Neos.Ui:RenderConfiguration {
233+
path = 'frontendConfiguration'
234+
@process.json = ${Json.stringify(value)}
235+
}
236+
237+
nodeTypes = Neos.Fusion:DataStructure {
238+
roles = ${Configuration.setting('Neos.Neos.Ui.nodeTypeRoles')}
239+
groups = ${Neos.Ui.PositionalArraySorter.sort(Configuration.setting('Neos.Neos.nodeTypes.groups'))}
240+
241+
@process.json = ${Json.stringify(value)}
242+
}
243+
244+
menu = Neos.Neos.Ui:Component.ModuleMenu
245+
246+
initialState = Neos.Neos.Ui:RenderConfiguration {
247+
path = 'initialState'
248+
context {
249+
documentNode = ${documentNode}
250+
site = ${site}
251+
user = ${user}
252+
clipboardNodes = ${clipboardNodes}
253+
clipboardMode = ${clipboardMode}
254+
}
255+
256+
@process.json = ${Json.stringify(value)}
257+
}
258+
259+
env = ${Configuration.setting('Neos.Flow.core.context')}
260+
}

0 commit comments

Comments
 (0)