|
1
|
|
|
<? |
|
2
|
|
|
/** |
|
3
|
|
|
* @param CloudControl\Cms\storage\Document $document |
|
4
|
|
|
* @param string $cmsPrefix |
|
5
|
|
|
* @param string $slugPrefix |
|
6
|
|
|
* @param bool $root |
|
7
|
|
|
* @param \CloudControl\Cms\cc\Request $request |
|
8
|
|
|
*/ |
|
9
|
|
|
function renderFolder($document, $cmsPrefix, $slugPrefix = '', $root = false, $request) |
|
10
|
|
|
{ ?> |
|
11
|
|
|
<div class="grid-box-8"> |
|
12
|
|
|
<h3> |
|
13
|
|
|
<a class="btn documentTitle openFolder" data-slug="<?= $slugPrefix . $document->slug ?>" title="Open"> |
|
14
|
|
|
<i class="fa fa-folder-o "></i> <?= $document->title ?> |
|
15
|
|
|
</a> |
|
16
|
|
|
</h3> |
|
17
|
|
|
</div> |
|
18
|
|
|
<div class="documentActions grid-box-4"> |
|
19
|
|
|
<? renderAction('Edit', |
|
20
|
|
|
'', |
|
21
|
|
|
$request::$subfolders . $cmsPrefix . '/documents/edit-folder?slug=' . $slugPrefix . $document->slug, |
|
22
|
|
|
'pencil'); ?> |
|
23
|
|
|
<? renderAction('Delete', |
|
24
|
|
|
'error', |
|
25
|
|
|
$request::$subfolders . $cmsPrefix . '/documents/delete-folder?slug=' . $slugPrefix . $document->slug, |
|
26
|
|
|
'trash', |
|
27
|
|
|
'return confirm(\'Are you sure you want to delete this document?\');'); ?> |
|
|
|
|
|
|
28
|
|
|
</div> |
|
29
|
|
|
<ul class="documents grid-wrapper nested<?= $root ? ' root' : '' ?>"> |
|
30
|
|
|
<? foreach ($document->getContent() as $subDocument) : ?> |
|
31
|
|
|
<li class="grid-container"> |
|
32
|
|
|
<? if ($subDocument->type == 'document') : ?> |
|
33
|
|
|
<? renderDocument($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/', $request); ?> |
|
34
|
|
|
<? elseif ($subDocument->type == 'folder') : ?> |
|
35
|
|
|
<? renderFolder($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/', false, $request); ?> |
|
36
|
|
|
<? endif ?> |
|
37
|
|
|
</li> |
|
38
|
|
|
<? endforeach ?> |
|
39
|
|
|
<? if (count($document->getContent()) == 0) : ?> |
|
40
|
|
|
<li class="grid-container"> |
|
41
|
|
|
<div class="grid-box-12"> |
|
42
|
|
|
<i class="fa fa-ellipsis-h empty"></i> |
|
43
|
|
|
<i>Empty</i> |
|
44
|
|
|
</div> |
|
45
|
|
|
</li> |
|
46
|
|
|
<? endif ?> |
|
47
|
|
|
</ul> |
|
48
|
|
|
<? } ?> |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: