Skip to content

Commit

Permalink
add option to escape label output
Browse files Browse the repository at this point in the history
  • Loading branch information
pxpm committed Feb 6, 2024
1 parent 8221586 commit d351902
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/config/backpack/operations/reorder.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Configurations for Backpack's ReorderOperation.
* Configurations for Backpack ReorderOperation.
*
* @see https://backpackforlaravel.com/docs/crud-operation-reorder
*/
Expand All @@ -10,4 +10,7 @@
// Define the size/looks of the content div for all CRUDs
// To override per Controller use $this->crud->setReorderContentClass('class-string')
'contentClass' => 'col-md-12 col-md-offset-2',

// should the content of the reorder label be escaped?
'escaped' => false,
];
4 changes: 2 additions & 2 deletions src/resources/views/crud/reorder.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ function tree_element($entry, $key, $all_entries, $crud)
// mark the element as shown
$all_entries[$key]->tree_element_shown = true;
$entry->tree_element_shown = true;
$entryLabel = $crud->get('reorder.escaped') ? e(object_get($entry, $crud->get('reorder.label'))) : object_get($entry, $crud->get('reorder.label'));
// show the tree element
echo '<li id="list_'.$entry->getKey().'">';
echo '<div><span class="disclose"><span></span></span>'.object_get($entry, $crud->get('reorder.label')).'</div>';
echo '<div><span class="disclose"><span></span></span>'.$entryLabel.'</div>';
// see if this element has any children
$children = [];
Expand Down

0 comments on commit d351902

Please sign in to comment.