#!/usr/bin/perl -w #---------------------------------------------------------------------- # copyright (C) 1999-2006 Mitel Networks Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # #---------------------------------------------------------------------- package esmith; use strict; use esmith::NavigationDB; use esmith::I18N; use constant WEBFUNCTIONS => '/etc/e-smith/web/functions'; use constant NAVIGATIONDIR => '/home/e-smith/db/navigation'; use constant NEW_NAVDIR => '/home/e-smith/db'; my $navigation_ignore = "(\.\.?|navigation|noframes|online-manual|(internal|pleasewait)(-.*)?)"; my $i18n = new esmith::I18N; my %navdbs; opendir FUNCTIONS, WEBFUNCTIONS or die "Couldn't open ", WEBFUNCTIONS, "\n"; my @files = grep (!/^${navigation_ignore}$/, readdir (FUNCTIONS)); my @langs = $i18n->availableLanguages(); use XML::Parser; my $parser = new XML::Parser (Style => 'Tree', ProtocolEncoding => 'UTF-8'); foreach my $file (@files) { next if (-d WEBFUNCTIONS . "/$file"); next unless (-x WEBFUNCTIONS . "/$file"); #-------------------------------------------------- # extract heading, description and weight information # from CGI script #-------------------------------------------------- open(SCRIPT, WEBFUNCTIONS . "/$file"); my $heading = undef; my $description = undef; my $heading_weight = undef; my $description_weight = undef; while (