Code Duplication    Length = 12-21 lines in 3 locations

application/blocks/file/templates/Bulletin Attachment - No File/view.php 1 location

@@ 4-16 (lines=13) @@
1
<?php  defined('C5_EXECUTE') or die("Access Denied.");
2
$f = $controller->getFileObject();
3
$fp = new Permissions($f);
4
if ($f && $fp->canViewFile()) {
5
	$c = Page::getCurrentPage();
6
	if($c instanceof Page) {
7
		$cID = $c->getCollectionID();
8
	}
9
10
	?>
11
	<div class="ccm-block-file">
12
		<a href="<?php echo ($forceDownload ? $f->getForceDownloadURL() : $f->getDownloadURL()); ?>"> <i class="fa fa-paperclip"></i> &nbsp; &nbsp; <?php echo stripslashes($controller->getLinkText()) ?></a>
13
	</div>
14
15
16
<?php }
17
18
$c = Page::getCurrentPage();
19
 if (!$f && $c->isEditMode()) { ?>

application/blocks/file/templates/Bulletin Attachment/view.php 1 location

@@ 4-15 (lines=12) @@
1
<?php  defined('C5_EXECUTE') or die("Access Denied.");
2
$f = $controller->getFileObject();
3
$fp = new Permissions($f);
4
if ($f && $fp->canViewFile()) {
5
	$c = Page::getCurrentPage();
6
	if($c instanceof Page) {
7
		$cID = $c->getCollectionID();
8
	}
9
10
	?>
11
	<div class="ccm-block-file">
12
		<a href="<?php echo ($forceDownload ? $f->getForceDownloadURL() : $f->getDownloadURL()); ?>"> <i class="fa fa-paperclip"></i> &nbsp; &nbsp; <?php echo stripslashes($controller->getLinkText()) ?></a>
13
	</div>
14
15
<?php }

application/blocks/file/view.php 1 location

@@ 4-24 (lines=21) @@
1
<?php  defined('C5_EXECUTE') or die("Access Denied.");
2
$f = $controller->getFileObject();
3
$fp = new Permissions($f);
4
if ($f && $fp->canViewFile()) {
5
	$c = Page::getCurrentPage();
6
	if($c instanceof Page) {
7
		$cID = $c->getCollectionID();
8
	}
9
10
	?>
11
	<style>
12
		.related-file-block a {
13
			text-decoration: none;
14
		}
15
		.related-file-block a:hover {
16
			color: #3598dc;
17
		}
18
	</style>
19
	<div class="related-file-block">
20
		<a href="<?php echo ($forceDownload ? $f->getForceDownloadURL() : $f->getDownloadURL()); ?>"> <i class="fa fa-paperclip"></i> &nbsp; <?php echo stripslashes($controller->getLinkText()) ?></a>
21
	</div> <!-- END related-file-block -->
22
23
24
<?php }
25
26
$c = Page::getCurrentPage();
27
 if (!$f && $c->isEditMode()) { ?>