1
|
|
|
<? |
2
|
|
|
/** |
3
|
|
|
* @param \library\storage\Document $document |
4
|
|
|
* @param string $cmsPrefix |
5
|
|
|
* @param string $slugPrefix |
6
|
|
|
*/ |
7
|
|
|
function renderDocument($document, $cmsPrefix, $slugPrefix = '') {?> |
8
|
|
|
<div class="grid-box-10"> |
9
|
|
|
<h3> |
10
|
|
|
<a class="btn documentTitle" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix . $document->slug?>" title="Edit"> |
11
|
|
|
<i class="fa fa-file-text-o"></i> |
12
|
|
|
<small class="state <?=strtolower($document->state)?>"><i class="fa <?=$document->state == 'published' ? 'fa-check-circle-o' : 'fa-times-circle-o' ?>"></i></small> |
13
|
|
|
<?=$document->title?> |
14
|
|
|
</a> |
15
|
|
|
<? if ($document->unpublishedChanges) : ?><small class="small unpublished-changes">Unpublished Changes</small><? endif ?> |
|
|
|
|
16
|
|
|
<small class="small documentType"><?=$document->documentType?></small> |
17
|
|
|
<small class="small lastModified" title="<?=date('r', $document->lastModificationDate)?>"> |
18
|
|
|
<span class="label">Modified:</span> |
19
|
|
|
<?=\library\cc\StringUtil::timeElapsedString($document->lastModificationDate)?> |
20
|
|
|
</small> |
21
|
|
|
<small class="small lastModifiedBy"> |
22
|
|
|
<span class="label">By:</span> |
23
|
|
|
<?=$document->lastModifiedBy?> |
24
|
|
|
</small> |
25
|
|
|
</h3> |
26
|
|
|
</div> |
27
|
|
|
<div class="documentActions grid-box-2"> |
28
|
|
View Code Duplication |
<? if ($document->state == 'unpublished' || $document->unpublishedChanges) : ?> |
|
|
|
|
29
|
|
|
<?renderAction('Publish', |
30
|
|
|
'publish', |
31
|
|
|
\library\cc\Request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug, |
32
|
|
|
'check');?> |
33
|
|
|
<? endif ?> |
34
|
|
|
<? if ($document->state == 'published') : ?> |
35
|
|
|
<?renderAction('Unpublish', |
36
|
|
|
'unpublish', |
37
|
|
|
\library\cc\Request::$subfolders . $cmsPrefix . '/documents/unpublish-document?slug=' . $slugPrefix . $document->slug, |
38
|
|
|
'times');?> |
39
|
|
|
<? endif ?> |
40
|
|
|
<?renderAction('Edit', |
41
|
|
|
'', |
42
|
|
|
\library\cc\Request::$subfolders . $cmsPrefix . '/documents/edit-document?slug=' . $slugPrefix . $document->slug, |
43
|
|
|
'pencil');?> |
44
|
|
View Code Duplication |
<? if ($document->state == 'unpublished') : ?> |
|
|
|
|
45
|
|
|
<?renderAction('Delete', |
46
|
|
|
'error', |
47
|
|
|
\library\cc\Request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug, |
48
|
|
|
'trash', |
49
|
|
|
'return confirm(\'Are you sure you want to delete this document?\');');?> |
|
|
|
|
50
|
|
|
<? endif ?> |
51
|
|
|
</div> |
52
|
|
|
<?}?> |
53
|
|
|
|
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.