aboutsummaryrefslogtreecommitdiffstats
path: root/web/api/read/template-list
blob: 81b99862b9140164aa2159dd1651d09832aa40d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /usr/bin/perl
# vim:ts=8:sw=8

use lib '/opt/gondul/include';
use nms::web;
use strict;
use warnings;

my @dirs = ("/opt/gondul/web/templates","/opt/gondul/data/templates");

foreach my $template_dir (@dirs) {
opendir (DIR, $template_dir) or next;
while (my $file = readdir(DIR)) {
        next if ($file =~ m/^\./);
        my %meh;
        $meh{'file'} = $file;

        push @{$nms::web::json{'templates'}},\%meh;
}
}
nms::web::finalize_output();