@@ -193,21 +193,30 @@ public static function addButtons(rex_extension_point $ep): array
193
193
// Paste button - always available in slice menu
194
194
if ($ clipboard ) {
195
195
$ sourceInfo = $ clipboard ['source_info ' ] ?? null ;
196
- $ tooltipText = rex_i18n::msg ('bloecks_paste_slice ' );
196
+
197
+ // Get paste position from config
198
+ $ pastePosition = $ addon ->getConfig ('paste_position ' , 'after ' );
199
+ $ isPasteBefore = $ pastePosition === 'before ' ;
200
+
201
+ // Set tooltip text based on paste position
202
+ $ tooltipText = $ isPasteBefore ? rex_i18n::msg ('bloecks_paste_slice_before ' ) : rex_i18n::msg ('bloecks_paste_slice_after ' );
203
+ $ hiddenLabel = $ isPasteBefore ? 'Paste before ' : 'Paste after ' ;
197
204
198
205
if ($ sourceInfo ) {
199
206
$ actionText = 'cut ' === $ clipboard ['action ' ] ? rex_i18n::msg ('bloecks_action_cut ' ) : rex_i18n::msg ('bloecks_action_copied ' );
207
+ $ positionText = $ isPasteBefore ? rex_i18n::msg ('paste_position_before ' ) : rex_i18n::msg ('paste_position_after ' );
200
208
$ tooltipText = sprintf (
201
- '%s: "%s" aus "%s" (ID: %d) ' ,
209
+ '%s: "%s" aus "%s" (ID: %d) - %s ' ,
202
210
$ actionText ,
203
211
$ sourceInfo ['module_name ' ],
204
212
$ sourceInfo ['article_name ' ],
205
213
$ sourceInfo ['article_id ' ],
214
+ $ positionText
206
215
);
207
216
}
208
217
209
218
$ buttons [] = [
210
- 'hidden_label ' => ' Paste after ' ,
219
+ 'hidden_label ' => $ hiddenLabel ,
211
220
'url ' => '# ' ,
212
221
'icon ' => 'paste ' ,
213
222
'attributes ' => [
@@ -217,6 +226,7 @@ public static function addButtons(rex_extension_point $ep): array
217
226
'data-article-id ' => $ articleId ,
218
227
'data-clang-id ' => $ clang ,
219
228
'data-ctype-id ' => $ ctype ,
229
+ 'data-paste-position ' => $ pastePosition ,
220
230
],
221
231
];
222
232
}
@@ -302,6 +312,9 @@ public static function addPasteToModuleSelect(rex_extension_point $ep): string
302
312
303
313
// Add paste button before module selection
304
314
$ sourceInfo = $ clipboard ['source_info ' ] ?? null ;
315
+
316
+ // Get paste position from config
317
+ $ pastePosition = $ addon ->getConfig ('paste_position ' , 'after ' );
305
318
306
319
// Bestimme den Modulnamen für den Button-Text
307
320
$ moduleName = '' ;
@@ -349,11 +362,12 @@ public static function addPasteToModuleSelect(rex_extension_point $ep): string
349
362
}
350
363
351
364
$ pasteButton = sprintf (
352
- '<div class="rex-toolbar"><div class="btn-toolbar"><a href="#" class="btn btn-success bloecks-paste" title="%s" data-target-slice="0" data-article-id="%d" data-clang-id="%d" data-ctype-id="%d"><i class="rex-icon rex-icon-paste"></i> %s</a></div></div> ' ,
365
+ '<div class="rex-toolbar"><div class="btn-toolbar"><a href="#" class="btn btn-success bloecks-paste" title="%s" data-target-slice="0" data-article-id="%d" data-clang-id="%d" data-ctype-id="%d" data-paste-position="%s" ><i class="rex-icon rex-icon-paste"></i> %s</a></div></div> ' ,
353
366
htmlspecialchars ($ tooltipText ),
354
367
$ articleId ,
355
368
$ clang ,
356
369
$ ctype ,
370
+ $ pastePosition ,
357
371
htmlspecialchars ($ buttonText ),
358
372
);
359
373
0 commit comments