2024-09-26 15:46:13 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class ProjectPage extends Page {
|
|
|
|
|
public function getSteps() {
|
2024-09-26 19:14:20 +02:00
|
|
|
$steps = [];
|
2024-09-26 15:46:13 +02:00
|
|
|
|
2024-09-26 19:14:20 +02:00
|
|
|
foreach ($this->children() as $child) {
|
2024-10-16 17:32:15 +02:00
|
|
|
$files = [];
|
|
|
|
|
|
|
|
|
|
if ($child->stepName() == 'clientBrief') {
|
|
|
|
|
foreach ($child->moodboard()->toFiles() as $file) {
|
|
|
|
|
$files[] = getFileData($file);
|
|
|
|
|
}
|
2024-10-16 18:43:04 +02:00
|
|
|
foreach ($child->pdf()->toFiles() as $file) {
|
|
|
|
|
$files[] = getFileData($file);
|
|
|
|
|
}
|
2024-10-16 17:32:15 +02:00
|
|
|
}
|
|
|
|
|
|
2024-09-26 19:14:20 +02:00
|
|
|
$steps[] = [
|
|
|
|
|
'text' => $child->title()->value(),
|
|
|
|
|
'value' => $child->stepName()->value(),
|
|
|
|
|
'index' => $child->stepIndex()->value(),
|
|
|
|
|
'modified' => $child->modified('Y-MM-dd'),
|
2024-10-16 17:32:15 +02:00
|
|
|
'uri' => $child->uri(),
|
|
|
|
|
'files' => $files
|
2024-09-26 15:46:13 +02:00
|
|
|
];
|
2024-09-26 19:14:20 +02:00
|
|
|
}
|
2024-09-26 15:46:13 +02:00
|
|
|
|
2024-09-26 18:46:33 +02:00
|
|
|
usort($steps, function ($a, $b) {
|
|
|
|
|
return $a['index'] <=> $b['index'];
|
|
|
|
|
});
|
|
|
|
|
|
2024-09-26 15:46:13 +02:00
|
|
|
return $steps;
|
|
|
|
|
}
|
|
|
|
|
}
|