Skip to content

Commit 16ad538

Browse files
[Task] code clean-up
1 parent 08741c9 commit 16ad538

File tree

2 files changed

+9
-84
lines changed

2 files changed

+9
-84
lines changed

Classes/DataHandler/ProcessCmdmap.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,29 +69,12 @@ public function execute_processCmdmap(
6969
&& !$commandIsProcessed
7070
&& !$parentObj->isImporting
7171
) {
72-
/*
7372
$dataArray = [
7473
'pid' => $value,
7574
'CType' => 'shortcut',
7675
'records' => $id,
7776
'header' => 'Reference',
7877
];
79-
*/
80-
if ($reference === 1) {
81-
$dataArray = [
82-
'pid' => $value,
83-
'CType' => 'shortcut',
84-
'records' => $id,
85-
'header' => 'Reference',
86-
];
87-
} else {
88-
$dataArray = [
89-
'pid' => $value,
90-
'records' => $id,
91-
// 'CType' => 'shortcut',
92-
// 'header' => 'Reference',
93-
];
94-
}
9578
$commandArray = [];
9679

9780
// used for overriding container and column with real target values

Resources/Public/JavaScript/paste-reference-drag-drop.js

Lines changed: 9 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ DragDrop.default = {
100100
reference
101101
) {
102102

103+
/*
103104
console.log({
104105
'draggableParameter': draggableParameter,
105106
'droppableElement': droppableElement,
@@ -108,6 +109,7 @@ DragDrop.default = {
108109
'reference': reference,
109110
});
110111
console.trace(draggableParameter);
112+
*/
111113

112114
let draggable;
113115
let draggableElement = null;
@@ -156,7 +158,7 @@ DragDrop.default = {
156158
if (typeof foundTarget === 'undefined') {
157159
targetPid = draggable.getPid();
158160
sorting = 0;
159-
console.log('Setting sorting=0 for first element in container column:', {
161+
// console.log('Setting sorting=0 for first element in container column:', {
160162
colPos: colPos,
161163
txContainerParent: txContainerParent,
162164
});
@@ -165,6 +167,7 @@ DragDrop.default = {
165167
targetPid = 0 - parseInt(foundTarget);
166168
}
167169

170+
/*
168171
console.log({
169172
'foundTarget': foundTarget,
170173
'targetPid': targetPid,
@@ -174,6 +177,7 @@ DragDrop.default = {
174177
'txContainerParent': txContainerParent,
175178
'languageUid': languageUid
176179
});
180+
*/
177181

178182
let task = {
179183
'new': false,
@@ -208,8 +212,10 @@ DragDrop.default = {
208212
args.sorting = sorting;
209213
}
210214

215+
/*
211216
console.log('Drop operation args:', args);
212217
console.log(draggable);
218+
*/
213219
if (task.new) {
214220
console.log('newAction');
215221
this.newAction(args);
@@ -257,13 +263,6 @@ console.log(draggable);
257263
* Process modal selection with proper container parent parameters from Draggable context
258264
*/
259265
processModalSelection: function (args) {
260-
/*
261-
// Validate container context before processing
262-
if (args.containerContext && !args.containerContext.hasValidHierarchy) {
263-
console.error('Invalid container hierarchy detected in modal selection');
264-
return;
265-
}
266-
*/
267266

268267
// till now, selecting CEs from the modal produce always copies
269268
// idea: with a good visual interface moves and / or paste-reference could theoretically be integrated
@@ -292,19 +291,6 @@ console.log(draggable);
292291
parameters.cmd.tt_content[args.draggableElement][datahandlerCommand].update.tx_container_parent = args.txContainerParent;
293292
}
294293

295-
/*
296-
// Handle sorting using container context
297-
if (args.containerContext && args.containerContext.isFirstElement) {
298-
parameters.cmd.tt_content[args.draggableElement][datahandlerCommand].update.sorting = 0;
299-
console.log('Setting sorting=0 for modal selection in container column:', {
300-
colPos: args.colPos,
301-
containerParent: args.containerParent,
302-
containerContext: args.containerContext
303-
});
304-
} else if (args.sorting !== undefined) {
305-
parameters.cmd.tt_content[args.draggableElement][datahandlerCommand].update.sorting = args.sorting;
306-
} else
307-
*/
308294
if(args.sorting === 0) {
309295
parameters.cmd.tt_content[args.draggableElement][datahandlerCommand].update.sorting = "0";
310296
}
@@ -321,13 +307,6 @@ console.log(draggable);
321307
* Process clipboard selection using Draggable-generated container information
322308
*/
323309
processClipboardSelection: function (args) {
324-
/*
325-
// Validate container context before processing
326-
if (args.containerContext && !args.containerContext.hasValidHierarchy) {
327-
console.error('Invalid container hierarchy detected in clipboard selection');
328-
return;
329-
}
330-
*/
331310

332311
const datahandlerCommand = args.isCopyAction ? 'copy' : 'move';
333312

@@ -352,19 +331,6 @@ console.log(draggable);
352331
parameters.CB.update.tx_container_parent = args.txContainerParent;
353332
}
354333

355-
/*
356-
// Handle sorting using container context for first-element scenarios
357-
if (args.containerContext && args.containerContext.isFirstElement) {
358-
parameters.CB.update.sorting = 0;
359-
console.log('Setting sorting=0 for clipboard selection in container column:', {
360-
colPos: args.colPos,
361-
containerParent: args.containerParent,
362-
containerContext: args.containerContext
363-
});
364-
} else if (args.containerContext && args.containerContext.targetSorting !== undefined) {
365-
parameters.CB.update.sorting = args.containerContext.targetSorting;
366-
} else
367-
*/
368334
if (args.sorting !== undefined) {
369335
parameters.CB.update.sorting = args.sorting;
370336
}
@@ -407,15 +373,13 @@ console.log(draggable);
407373
DragDrop.default.droppableElement.substring(1)
408374
);
409375
if (!pasteAction) {
410-
// ----------------------------------------------------------------
411-
// TODO: detach() and insertAfter() are still from jquery, replace!
412-
// ----------------------------------------------------------------
413-
376+
/*
414377
console.log(
415378
DragDrop.default.contentIdentifier,
416379
DragDrop.default.contentIdentifier.substring(1),
417380
DragDrop.default.droppableElement.substring(1)
418381
);
382+
*/
419383

420384
if (!droppableElement.parent().hasClass(
421385
DragDrop.default.contentIdentifier.substring(1)
@@ -428,14 +392,6 @@ console.log(draggable);
428392
if (targetElement && targetElement.parentElement) {
429393
targetElement.parentElement.insertBefore(draggableElement, targetElement.nextSibling);
430394
}
431-
/*
432-
draggableElement
433-
.detach()
434-
.css({ top: 0, left: 0 })
435-
.insertAfter(
436-
droppableElement.closest(DragDrop.default.droppableElement)
437-
);
438-
*/
439395
} else {
440396
draggableElement.remove();
441397
draggableElement.style.top = '0';
@@ -445,16 +401,6 @@ console.log(draggable);
445401
if (targetElement && targetElement.parentElement) {
446402
targetElement.parentElement.insertBefore(draggableElement, targetElement.nextSibling);
447403
}
448-
449-
/*
450-
console.log(DragDrop.default.contentIdentifier, DragDrop.default.droppableElement.substring(1));
451-
draggableElement
452-
.detach()
453-
.css({ top: 0, left: 0 })
454-
.insertAfter(
455-
droppableElement.closest(DragDrop.default.contentIdentifier)
456-
);
457-
*/
458404
}
459405
}
460406
if (parameters.basicAction == 'copy' || parameters.basicAction == 'move') {
@@ -464,10 +410,6 @@ console.log(draggable);
464410
targetPid: thisClass.getCurrentPageId(),
465411
action: parameters.basicAction
466412
});
467-
if (parameters.basicAction == 'move') {
468-
469-
// $clipboard.removeElement($key);
470-
}
471413
}
472414
self.location.hash = droppableElement.closest(DragDrop.default.contentIdentifier).id;
473415
/*

0 commit comments

Comments
 (0)