66 'computed ' => [
77 // https://github.com/getkirby/kirby/blob/master/config/sections/pages.php
88 'data ' => function () {
9-
109 $ data = [];
1110
12- foreach ($ this ->pages as $ item ) {
13- $ blueprint = $ item ->blueprint (); // panel-view-extended
14- $ permissions = $ item ->permissions ();
15- $ image = $ item ->panelImage ($ this ->image );
16-
17- // escape the default text
18- // TODO: no longer needed in 3.6
19- $ text = $ item ->toString ($ this ->text );
20- if ($ this ->text === '{{ page.title }} ' ) {
21- $ text = Escape::html ($ text );
22- }
11+ foreach ($ this ->pages as $ page ) {
12+ $ blueprint = $ page ->blueprint (); // panel-view-extended
13+ $ panel = $ page ->panel ();
14+ $ permissions = $ page ->permissions ();
2315
24- $ data [] = [
25- 'id ' => $ item -> id (),
26- 'dragText ' => $ item -> dragText (),
27- 'text ' => $ text ,
28- ' info ' => $ item -> toString ( $ this ->info ?? false ) ,
29- ' parent ' => $ item -> parentId (),
30- ' icon ' => $ item -> panelIcon ( $ image ),
31- 'image ' => $ image ,
32- 'link ' => $ item -> panelUrl (true ),
33- 'status ' => $ item -> status (),
16+ $ item = [
17+ 'dragText ' => $ panel -> dragText (),
18+ 'id ' => $ page -> id (),
19+ 'image ' => $ panel -> image (
20+ $ this ->image ,
21+ $ this -> layout === ' table ' ? ' list ' : $ this -> layout
22+ ),
23+ 'info ' => $ page -> toSafeString ( $ this -> info ?? false ) ,
24+ 'link ' => $ panel -> url (true ),
25+ 'parent ' => $ page -> parentId (),
3426 'permissions ' => [
3527 'sort ' => $ permissions ->can ('sort ' ),
3628 'changeSlug ' => $ permissions ->can ('changeSlug ' ),
3729 'changeStatus ' => $ permissions ->can ('changeStatus ' ),
38- 'changeTitle ' => $ permissions ->can ('changeTitle ' )
30+ 'changeTitle ' => $ permissions ->can ('changeTitle ' ),
3931 ],
32+ 'status ' => $ page ->status (),
33+ 'template ' => $ page ->intendedTemplate ()->name (),
34+ 'text ' => $ page ->toSafeString ($ this ->text ),
4035 'blueprintOptions ' => $ blueprint ->options () // panel-view-extended
4136 ];
37+
38+ if ($ this ->layout === 'table ' ) {
39+ $ item = $ this ->columnsValues ($ item , $ page );
40+ }
41+
42+ $ data [] = $ item ;
4243 }
44+
4345 return $ data ;
46+
47+
4448 }
4549 ]
4650];
0 commit comments