Skip to content
Browse files

Implementeert om alleen xsl bestanden te laten zien.

  • Loading branch information...
1 parent 18c3abd commit 6debfc2aea24e8b6f08659d27247b0bf089c829e root committed
Showing with 5 additions and 3 deletions.
  1. +4 −2 functions.php
  2. +1 −1 toevoegen.php
View
6 functions.php
@@ -77,7 +77,7 @@ function paste2sessionactive($var, $part = 'document', $value) {
paste2sessionpassive($var, $_SESSION[$part]['activeid'], $part, $value);
}
- function dirtoselect($name, $dir, $active = '', $empty = false, $maxdate = 0) {
+ function dirtoselect($name, $dir, $active = '', $empty = false, $maxdate = 0, $extension = '') {
$templates = array();
if ($empty===true) $templates[] = '';
if (is_dir($dir)) {
@@ -85,7 +85,9 @@ function dirtoselect($name, $dir, $active = '', $empty = false, $maxdate = 0) {
while (($file = readdir($dh)) !== false) {
if (!is_dir($dir.'/'.$file)) {
if ($maxdate == 0 || (filectime($dir.'/'.$file) > $maxdate)) {
- $templates[]=$file;
+ if ($extension == '' || (substr( $file, strlen( $file ) - strlen( $extension ) ) === $extension)) {
+ $templates[]=$file;
+ }
}
}
}
View
2 toevoegen.php
@@ -233,7 +233,7 @@
<legend><?php echo TEXTPAGE; ?></legend>
<fieldset>
<legend><?php echo TEMPLATE; ?></legend>
- <?php echo dirtoselect('text_template', TEMPLATEDIR, active('text_template')); ?>
+ <?php echo dirtoselect('text_template', TEMPLATEDIR, active('text_template'), 0, '.xsl'); ?>
<?php
$stmt = $dbh->prepare('SELECT content_category_image.id, content_category.title AS "category_title", content_category_image.title AS "title" FROM content_category, content_category_image WHERE content_category.id=content_category_image.categoryid'.(isset($_SESSION['category']) ? ' AND content_category.title = :category' : '').' ORDER BY content_category.title, content_category_image.title;');
if (isset($_SESSION['category'])) $stmt->bindParam(':category', $_SESSION['category'], PDO::PARAM_STR, 20);

0 comments on commit 6debfc2

Please sign in to comment.
Something went wrong with that request. Please try again.