Duplicate scripts/stylesheets now included once

This commit is contained in:
Marcin Kurczewski 2013-10-09 19:40:38 +02:00
parent 4a006168e5
commit 078b95fc8e

View file

@ -7,10 +7,10 @@
<?php else: ?> <?php else: ?>
<title><?php echo $this->context->title ?></title> <title><?php echo $this->context->title ?></title>
<?php endif ?> <?php endif ?>
<?php foreach ($this->context->stylesheets as $name): ?> <?php foreach (array_unique($this->context->stylesheets) as $name): ?>
<link rel="stylesheet" type="text/css" href="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/css/' . $name) ?>"/> <link rel="stylesheet" type="text/css" href="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/css/' . $name) ?>"/>
<?php endforeach ?> <?php endforeach ?>
<?php foreach ($this->context->scripts as $name): ?> <?php foreach (array_unique($this->context->scripts) as $name): ?>
<script type="text/javascript" src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/js/' . $name) ?>"></script> <script type="text/javascript" src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/js/' . $name) ?>"></script>
<?php endforeach ?> <?php endforeach ?>
</head> </head>