diff -aurN smeserver-manager-0.1.0.old/createlinks smeserver-manager-0.1.0/createlinks --- smeserver-manager-0.1.0.old/createlinks 2020-04-14 16:50:36.000000000 +0400 +++ smeserver-manager-0.1.0/createlinks 2020-04-16 12:54:12.796000000 +0400 @@ -5,23 +5,28 @@ #-------------------------------------------------- # functions for manager panel #-------------------------------------------------- -my $panel = "manager2"; +my $panel = 'manager2'; +my $mngrdir = '/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr'; # links to add -for ( qw( sme_core.css - sme_main.css - sme_menu.css - styles.css - ) ) +# templates to expand +for ( qw( sme_core.css sme_main.css sme_menu.css styles.css ) ) { - templates2events("/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/$_", qw( + templates2events("$mngrdir/themes/default/public/css/$_", qw( bootstrap-console-save console-save )); } -# templates to expand -for my $event ( qw( manager2-modify bootstrap-console-save console-save ) ) +templates2events("$mngrdir/conf/srvmngr.conf", + qw( manager2-modify bootstrap-console-save console-save)); + +# services to launch on event + +# actions to perform +for my $event (qw( yum-install yum-update yum-remove manager2-refresh bootstrap-console-save console-save)) { - templates2events("/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/conf/srvmngr.conf", $event); + event_link('navigation2-conf', "$event", '80'); + event_link('routes2-conf', "$event", '80'); + event_link('locales2-conf', "$event", '80'); } diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/locales2-conf smeserver-manager-0.1.0/root/etc/e-smith/events/actions/locales2-conf --- smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/locales2-conf 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-manager-0.1.0/root/etc/e-smith/events/actions/locales2-conf 2020-04-13 23:24:19.000000000 +0400 @@ -0,0 +1,79 @@ +#!/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 constant I18NMODULES => '/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Modules'; + + #------------------------- + # get locale modules list + #------------------------- +opendir DIR, I18NMODULES or die "Couldn't open ", I18NMODULES, "\n"; +my @dirs = grep (/^[A-Z]/, readdir (DIR)); +closedir DIR; + +foreach my $module (@dirs) { + + next if (-f I18NMODULES . "/$module"); + + #------------------------- + # get lexicons list + #------------------------- + opendir DIR, I18NMODULES . "/$module" or die "Couldn't open ", I18NMODULES, "\n"; + my @lexs = grep (/_..\.lex$/, readdir (DIR)); + closedir DIR; + + foreach my $lex (@lexs) { + my $long_lex = I18NMODULES . "/$module/$lex"; + next if (-d $long_lex); + + my ($mod, $lang) = split /[_.]/, $lex; + my $long_pm = I18NMODULES . "/$module/$lang". '.pm'; + if ( -f $long_pm ) { + # .pm file newer than .lex + next if ((stat($long_lex))[9] < (stat($long_pm))[9]); + } + + open(FIL, '>:encoding(UTF-8)', $long_pm) + or die "Couldn't open ", $long_pm, " for writing.\n"; + + print FIL "package SrvMngr::I18N::Modules::${module}::${lang};\n"; + print FIL "use strict;\nuse warnings;\nuse utf8;\nuse Mojo::Base 'SrvMngr::I18N';\n\n"; + print FIL "use SrvMngr::I18N::Modules::General::${lang};\n\nmy %lexicon = (\n"; + + #------------------------- + # copy lexicon to pm + #------------------------- + open(FIL2, '<:encoding(UTF-8)', $long_lex) + or die "Couldn't open ", $long_lex, " for reading.\n"; + while ( ) { + print FIL $_; + } + close FIL2; + + print FIL ");\n\nour %Lexicon = (\n"; + print FIL " %\{ SrvMngr::I18N::Modules::General::${lang}::Lexicon \},\n"; + print FIL " %lexicon\n);\n\n\n1;\n"; + + close FIL; + print "Lexicon $lang for $module ($lex) written to ${lang}.pm\n"; + } +} diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/navigation2-conf smeserver-manager-0.1.0/root/etc/e-smith/events/actions/navigation2-conf --- smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/navigation2-conf 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-manager-0.1.0/root/etc/e-smith/events/actions/navigation2-conf 2020-03-29 00:02:52.000000000 +0400 @@ -0,0 +1,159 @@ +#!/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/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller'; +use constant NAVIGATIONDIR => '/home/e-smith/db/navigation2'; +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)); + +closedir 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 ( $file =~ m/[A-Z].*\.pm$/ ); + + my $file2 = lc($file); + $file2 =~ s/\.pm$//; + + #-------------------------------------------------- + # 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 (