diff options
| author | Andreas Brachold <vdr07@deltab.de> | 2007-09-11 17:44:02 +0000 |
|---|---|---|
| committer | Andreas Brachold <vdr07@deltab.de> | 2007-09-11 17:44:02 +0000 |
| commit | b3afe1bf2625101e8db9400d15f272c2e454b1b5 (patch) | |
| tree | 9b8659f7ede833c7b7ac1507bacabbcb47e64769 | |
| parent | 1ea70eb921caac0ef881c72ac7023fa100835b85 (diff) | |
| download | xxv-b3afe1bf2625101e8db9400d15f272c2e454b1b5.tar.gz xxv-b3afe1bf2625101e8db9400d15f272c2e454b1b5.tar.bz2 | |
* Refactoring HTTPD/TELNET - move command usage (MODUL TELNET now none essential )
* Some little fixes
| -rw-r--r-- | html/bloecke/percentbar.tmpl | 8 | ||||
| -rw-r--r-- | html/now.tmpl | 4 | ||||
| -rw-r--r-- | html/schema.tmpl | 21 | ||||
| -rw-r--r-- | lib/XXV/MODULES/HTTPD.pm | 71 | ||||
| -rw-r--r-- | lib/XXV/MODULES/TELNET.pm | 79 | ||||
| -rw-r--r-- | lib/XXV/MODULES/WAPD.pm | 2 | ||||
| -rw-r--r-- | locale/de.po | 93 | ||||
| -rw-r--r-- | locale/de/LC_MESSAGES/xxv.mo | bin | 65042 -> 65141 bytes |
8 files changed, 148 insertions, 130 deletions
diff --git a/html/bloecke/percentbar.tmpl b/html/bloecke/percentbar.tmpl index f8b17fe..16ebaab 100644 --- a/html/bloecke/percentbar.tmpl +++ b/html/bloecke/percentbar.tmpl @@ -9,13 +9,13 @@ %?> <div align="center" style='position:absolute'> - <img src="<?% ground %?>" width="<?% barwidth %?>" title='<?% percent | format "%02d" %?>%'> - <div style='position:absolute; top:0px; left:0px; clip:rect(0px, <?% percent * barexp | format "%d" %?>px, <?% percent * barexp | format "%d" %?>px, 0px)'> - <img src="<?% over %?>" width="<?% barwidth %?>" title='<?% percent | format "%02d" %?>%'> + <img src="<?% ground %?>" width="<?% barwidth %?>" title='<?% percent div 1 | format "%02d" %?>%'> + <div style='position:absolute; top:0px; left:0px; clip:rect(0px, <?% ( percent * barexp ) div 1 %?>px, <?% ( percent * barexp ) div 1 %?>px, 0px)'> + <img src="<?% over %?>" width="<?% barwidth %?>" title='<?% percent div 1 | format "%02d" %?>%'> </div> <?% IF barwidth > 200 %?> <div style='position:absolute; top:10px; left:<?% barwidth - 70 %?>px; color:#FFFFFF;font-weight:bold'> - <?% percent | format "%02d" %?>% + <?% percent div 1 | format "%02d" %?>% </div> <?% END %?> </div> diff --git a/html/now.tmpl b/html/now.tmpl index 795fc9e..e124a67 100644 --- a/html/now.tmpl +++ b/html/now.tmpl @@ -86,9 +86,9 @@ <td><?% IF param.timers.${id} && param.timers.${id}.Status %?><b><?% END %?><?% stop %?><?% IF param.timers.${id} && param.timers.${id}.Status %?></b><?% END %?></td> <?% UNLESS duration > 100 OR duration <= 0 %?> <td width="100" valign='bottom'><nobr> - <?% per = (100 - duration) + 0.999 | format('%d'); per = (per > 100 ? 100 : per) %?> + <?% per = ( (100 - duration) + 0.999 ) div 1 ; per = (per > 100 ? 100 : per) %?> <?% per2 = 100 - per %?> - <?% text = per | format("<br><font size='1'>${per}%%</font>") %?> + <?% text = per div 1 | format("<br><font size='1'>${per}%%</font>") %?> <table width="100%" cellspacing='0' cellpadding='0'> <tr> <td bgcolor="#dedede"><img src='images/blank.png' width="<?% per %?>" height='1' hspace=0 vspace=0><?% IF param.timers.${id} && param.timers.${id}.Status %?><b><?% END %?><?% (per > 19 ? text : " ") %?></td> diff --git a/html/schema.tmpl b/html/schema.tmpl index 38ad6d6..5869c4e 100644 --- a/html/schema.tmpl +++ b/html/schema.tmpl @@ -21,7 +21,10 @@ Duration = param.zeitbis - param.zeitvon; <form> <h1><?% gettext("What is running at") %?> <?% day %?><br/> -<?% gettext('Display') %?> <?% gettext('from') %?> <?% date.format(param.zeitvon, '%H:%M', locale) %?> <?% gettext('to') %?> <?% date.format(param.zeitbis, '%H:%M', locale) %?> <?% gettext("o'clock") %?> +<?% gettext('Display') %?> +<?% gettext('from') %?> <?% date.format(param.zeitvon, '%H:%M', locale) %?> +<?% gettext('to') %?> <?% date.format(param.zeitbis, '%H:%M', locale) %?> +<?% gettext("o'clock") %?> </h1> <!-- TableTemplate --> @@ -42,7 +45,7 @@ Duration = param.zeitbis - param.zeitvon; colspan = colspan + 1; zeit = param.zeitvon + c; -%?> - <td bgcolor="white" width="<?% offset = (c % 3600 ? 1 : 2);(percent - offset) | format('%d') %?>" align='right'> + <td bgcolor="white" width="<?% offset = (c % 3600 ? 1 : 2);(percent - offset) div 1 %?>" align='right'> <?% IF c == abstand && zeit > date.now %?> <a href='?cmd=schema&data=<?% (param.zeitvon - Duration) %?>&__cgrp=<?% param.channelgroup %?>'><</a> <?% END %?> @@ -64,10 +67,10 @@ Duration = param.zeitbis - param.zeitvon; p = (a / Duration) * width; %?> <div style="position:absolute; z-index:1"> - <div style="position:relative; top:0px; left:0px; width:<?% p | format('%d') %?>px; height:10px; z-index:2; border:thin solid #804000; background-color:#FF0000; text-align: right; -moz-opacity:0.2; filter:Alpha(opacity=20)"><font size="1"> </font></div> + <div style="position:relative; top:0px; left:0px; width:<?% p div 1 %?>px; height:10px; z-index:2; border:thin solid #804000; background-color:#FF0000; text-align: right; -moz-opacity:0.2; filter:Alpha(opacity=20)"><font size="1"> </font></div> </div> <div style="position:absolute; z-index:1"> - <div style="position:relative; top:0px; left:<?% p | format('%d') %?>px; width:1px; height:100%; border-left:1px solid red; margin:0px; z-Index: 2;"><img alt="" src='images/blank.png' width='1' height='<?% data.keys.size * 23 %?>' border="0" hspace="0" vspace="0" /></div> + <div style="position:relative; top:0px; left:<?% p div 1 %?>px; width:1px; height:100%; border-left:1px solid red; margin:0px; z-Index: 2;"><img alt="" src='images/blank.png' width='1' height='<?% data.keys.size * 23 %?>' border="0" hspace="0" vspace="0" /></div> </div> <?%- END -%?> <?%- WHILE c < Duration; @@ -75,7 +78,7 @@ Duration = param.zeitbis - param.zeitvon; percent = (abstand / Duration) * width -%?><img alt="" style="background:white" src='images/blank.png' width="<?%- offset = (c % 3600 ? 1 : 2); - (percent - offset) | format('%d') + (percent - offset) div 1 -%?>" height='10' /><img alt="" style="background:<?% c % 900 ? "gray" : "black" %?>" src='images/blank.png' @@ -119,7 +122,7 @@ Duration = param.zeitbis - param.zeitvon; percent = (laenge / Duration) * width; ges = ges + percent; -%?> - <img alt="" src='images/blank.png' width='<?% percent | format('%d') %?>' height=8 border=0 align='left' /> + <img alt="" src='images/blank.png' width='<?% percent div 1 %?>' height=8 border=0 align='left' /> <?% END; IF second_start < oldend; dur = second_stop - oldend; @@ -132,7 +135,7 @@ Duration = param.zeitbis - param.zeitvon; percent = width - ges; END; ges = ges + percent; - trun = percent / 10 | format('%d'); + trun = ( percent / 10 ) div 1; IF dur < 300; trun = 3; @@ -140,9 +143,9 @@ Duration = param.zeitbis - param.zeitvon; -%?> <?% d=[epgStart, " - ", epgStop ,"<br />", epgDesc ];desc=d.join("") %?> <?% IF trun <= 3 %?> - <?% INCLUDE bloecke/tooltip.tmpl cmd="display" title=epgTitle subtitle=epgSubTitle eventid=epgId linkid=epgId ttp_offset=-200 %?><img alt="" src='images/blank.png' width='<?% percent | format('%d') %?>' height=8 border=0 hspace=0 vspace=0 align='left' /></a> + <?% INCLUDE bloecke/tooltip.tmpl cmd="display" title=epgTitle subtitle=epgSubTitle eventid=epgId linkid=epgId ttp_offset=-200 %?><img alt="" src='images/blank.png' width='<?% percent div 1 %?>' height=8 border=0 hspace=0 vspace=0 align='left' /></a> <?% ELSE %?> - <table class='<?% PROCESS getStatus e=event t=param.timers r=param.runningTimer %?>' align="left" width="<?% percent | format('%d') %?>" cellpadding="0" cellspacing="0"><tr><td> + <table class='<?% PROCESS getStatus e=event t=param.timers r=param.runningTimer %?>' align="left" width="<?% percent div 1 %?>" cellpadding="0" cellspacing="0"><tr><td> <?% INCLUDE bloecke/tooltip.tmpl cmd="display" title=epgTitle subtitle=epgSubTitle eventid=epgId linkid=epgId ttp_offset=-200 %?> <?% chop(epgTitle,trun) %?></a></td></tr></table> <?% END %?> diff --git a/lib/XXV/MODULES/HTTPD.pm b/lib/XXV/MODULES/HTTPD.pm index 72acbb7..ee0652c 100644 --- a/lib/XXV/MODULES/HTTPD.pm +++ b/lib/XXV/MODULES/HTTPD.pm @@ -107,6 +107,24 @@ sub module { }, }, Commands => { + help => { + description => gettext("This will display all commands or description of module 'name'."), + short => 'h', + callback => sub{ + return $obj->usage(@_); + }, + }, + reload => { + description => gettext("Restart all modules."), + short => 'rel', + callback => sub{ + my ($w, $c, $l) = @_; + $Module::Reload::Debug = 2; + Module::Reload->check; + $c->message(gettext("Modules loaded.")); + }, + Level => 'admin' + }, checkvalue => { hidden => 'yes', callback => sub{ $obj->checkvalue(@_) }, @@ -361,7 +379,7 @@ sub _readline { sub parseRequest { # ------------------ my $obj = shift || return error('No object defined!'); - my $socket = shift || return error('No handle defined!' ); + my $socket = shift || return error('No handle defined!'); my $logout = shift || 0; binmode $socket; @@ -396,7 +414,7 @@ sub parseRequest { } else { #dumper($line); } - $obj->{STATUS}->{'readbytes'} += length($line) if($line); + $obj->{STATUS}->{'readbytes'} += length($line); } $data->{Request} =~ s/%([a-f0-9][a-f0-9])/pack("C", hex($1))/ieg @@ -469,7 +487,54 @@ sub handleInput { sub usage { # ------------------ my $obj = shift || return error('No object defined!'); - return main::getModule('TELNET')->usage(@_); + my $watcher = shift || return error('No watcher defined!'); + my $console = shift || return error('No console defined!'); + my $modulename = shift || 0; + my $hint = shift || ''; + my $user = shift || $console->{USER}; + + my $u = main::getModule('USER'); + unless($user) { + my $loginObj = $obj; + $loginObj = main::getModule('HTTPD') + if ($console->{TYP} eq 'HTML') ; + $loginObj = main::getModule('WAPD') + if ($console->{TYP} eq 'WML') ; + $user = $loginObj->{USER}; + } + + my $ret; + push(@$ret, sprintf(gettext("%sThis is the xxv %s server.\nPlease use the following commands:\n"), + ($hint ? "$hint\n\n" : ''), $console->typ)); + + my $mods = main::getModules(); + my @realModName; + + # Search for command and display the Description + foreach my $modName (sort keys %{$mods}) { + my $modCfg = $mods->{$modName}->{MOD}; + push(@realModName, $mods->{$modName}->{MOD}->{Name}); + next if($modulename and uc($modulename) ne $modCfg->{Name}); + foreach my $cmdName (sort keys %{$modCfg->{Commands}}) { + push(@$ret, + [ + (split('::', $modName))[-1], + $modCfg->{Commands}->{$cmdName}->{short}, + $cmdName, + $modCfg->{Commands}->{$cmdName}->{description}, + ] + ) if(! $modCfg->{Commands}->{$cmdName}->{hidden} and ($u->{active} ne 'y') || $u->allowCommand($modCfg, $cmdName, $user, "1")); + } + } + + $console->menu( + $ret, + { + periods => $mods->{'XXV::MODULES::EPG'}->{periods}, + CHANNELS => $mods->{'XXV::MODULES::CHANNELS'}->ChannelArray('Name'), + CONFIGS => [ sort @realModName ], + }, + ); } # ------------------ diff --git a/lib/XXV/MODULES/TELNET.pm b/lib/XXV/MODULES/TELNET.pm index 7974109..d12fbeb 100644 --- a/lib/XXV/MODULES/TELNET.pm +++ b/lib/XXV/MODULES/TELNET.pm @@ -49,13 +49,6 @@ sub module { }, }, Commands => { - help => { - description => gettext("This will display all commands or description of module 'name'."), - short => 'h', - callback => sub{ - return $obj->usage(@_); - }, - }, quit => { description => gettext("This will exit the telnet session"), short => 'q', @@ -88,17 +81,6 @@ sub module { }, Level => 'admin' }, - reload => { - description => gettext("Restart all modules."), - short => 'rel', - callback => sub{ - my ($w, $c, $l) = @_; - $Module::Reload::Debug = 2; - Module::Reload->check; - $c->message(gettext("Modules loaded.")); - }, - Level => 'admin' - }, }, }; return $args; @@ -247,60 +229,6 @@ sub init { } # ------------------ -sub usage { -# ------------------ - my $obj = shift || return error('No object defined!'); - my $watcher = shift || return error ('No Watcher!'); - my $console = shift || return error ('No Console'); - my $modulename = shift || 0; - my $hint = shift || ''; - my $user = shift || $console->{USER}; - - my $u = main::getModule('USER'); - unless($user) { - my $loginObj = $obj; - $loginObj = main::getModule('HTTPD') - if ($console->{TYP} eq 'HTML') ; - $loginObj = main::getModule('WAPD') - if ($console->{TYP} eq 'WML') ; - $user = $loginObj->{USER}; - } - - my $ret; - push(@$ret, sprintf(gettext("%sThis is the xxv %s server.\nPlease use the following commands:\n"), - ($hint ? "$hint\n\n" : ''), $console->typ)); - - my $mods = main::getModules(); - my @realModName; - - # Search for command and display the Description - foreach my $modName (sort keys %{$mods}) { - my $modCfg = $mods->{$modName}->{MOD}; - push(@realModName, $mods->{$modName}->{MOD}->{Name}); - next if($modulename and uc($modulename) ne $modCfg->{Name}); - foreach my $cmdName (sort keys %{$modCfg->{Commands}}) { - push(@$ret, - [ - (split('::', $modName))[-1], - $modCfg->{Commands}->{$cmdName}->{short}, - $cmdName, - $modCfg->{Commands}->{$cmdName}->{description}, - ] - ) if(! $modCfg->{Commands}->{$cmdName}->{hidden} and ($u->{active} ne 'y') || $u->allowCommand($modCfg, $cmdName, $user, "1")); - } - } - - $console->menu( - $ret, - { - periods => $mods->{'XXV::MODULES::EPG'}->{periods}, - CHANNELS => $mods->{'XXV::MODULES::CHANNELS'}->ChannelArray('Name'), - CONFIGS => [ sort @realModName ], - }, - ); -} - -# ------------------ sub handleInput { # ------------------ my $obj = shift || return error('No object defined!'); @@ -324,4 +252,11 @@ sub handleInput { } } +# ------------------ +sub usage { +# ------------------ + my $obj = shift || return error('No object defined!'); + return main::getModule('HTTPD')->usage(@_); +} + 1; diff --git a/lib/XXV/MODULES/WAPD.pm b/lib/XXV/MODULES/WAPD.pm index 95ca6bf..26966ef 100644 --- a/lib/XXV/MODULES/WAPD.pm +++ b/lib/XXV/MODULES/WAPD.pm @@ -327,7 +327,7 @@ sub handleInput { sub usage { # ------------------ my $obj = shift || return error('No object defined!'); - return main::getModule('TELNET')->usage(@_); + return main::getModule('HTTPD')->usage(@_); } # ------------------ diff --git a/locale/de.po b/locale/de.po index c6a1748..4ea2187 100644 --- a/locale/de.po +++ b/locale/de.po @@ -1060,10 +1060,25 @@ msgstr "Alle Aufnahmen mit Titel" #-------------------- #: ../html/schema.tmpl:24 +msgid "Display" +msgstr "Zeige" + +#-------------------- +#: ../html/schema.tmpl:25 +msgid "from" +msgstr "von" + +#-------------------- +#: ../html/schema.tmpl:26 msgid "to" msgstr "bis" #-------------------- +#: ../html/schema.tmpl:27 +msgid "o'clock" +msgstr "Uhr" + +#-------------------- #: ../html/search.tmpl:12 msgid "Found %s items" msgstr "%s Sendungen gefunden" @@ -2180,7 +2195,22 @@ msgid "Dump additional debugging information, required only for software develop msgstr "Ausgeben von zusätzliche Informationen zur Fehlersuche, wird nur für die Software-Entwicklung benötigt." #-------------------- -#: ../lib/XXV/MODULES/HTTPD.pm:262 ../lib/XXV/MODULES/WAPD.pm:196 +#: ../lib/XXV/MODULES/HTTPD.pm:111 +msgid "This will display all commands or description of module 'name'." +msgstr "Dieses zeigt alle Befehle oder das Hilfetext des 'Modulnamen'" + +#-------------------- +#: ../lib/XXV/MODULES/HTTPD.pm:118 +msgid "Restart all modules." +msgstr "Dieses lädt alle Module neu." + +#-------------------- +#: ../lib/XXV/MODULES/HTTPD.pm:124 +msgid "Modules loaded." +msgstr "Module neugeladen." + +#-------------------- +#: ../lib/XXV/MODULES/HTTPD.pm:280 ../lib/XXV/MODULES/WAPD.pm:196 msgid "You are not authorized to use this system!" msgstr "Sie haben keine Berechtigungen für dieses System!" @@ -2190,12 +2220,21 @@ msgid "This module is a multisession HTTPD server." msgstr "Dieses Modul ist ein Mehrfachsitzung HTTPD Server." #-------------------- -#: ../lib/XXV/MODULES/HTTPD.pm:483 +#: ../lib/XXV/MODULES/HTTPD.pm:505 +msgid "" +"%sThis is the xxv %s server.\n" +"Please use the following commands:\n" +msgstr "" +"%sDas ist der xxv-%s-Server.\n" +"Bitte verwende folgende Befehle:\n" + +#-------------------- +#: ../lib/XXV/MODULES/HTTPD.pm:549 msgid "Traffic on HTTPD socket since %s: sent: %s kbytes - received: %s kbytes - connections: %d." msgstr "Datenverkehr des HTTPD Anschlusses seit %s: gesendet: %s kBytes - empfangen: %s kBytes - Verbindungen: %d." #-------------------- -#: ../lib/XXV/MODULES/HTTPD.pm:529 +#: ../lib/XXV/MODULES/HTTPD.pm:595 msgid "Could not open file '%s'! : %s" msgstr "Konnte Datei '%s' nicht öffnen : %s" @@ -3340,12 +3379,7 @@ msgid "Send a command to svdrp" msgstr "Sende ein Kommando zum svdrp" #-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:20 -msgid "This module is a multisession telnet server." -msgstr "Dieses Modul ist ein Mehrfachsitzungstelnet-Server." - -#-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:215 +#: ../lib/XXV/MODULES/TELNET.pm:197 msgid "" "Welcome to xxv system version: %s.\\r\n" "This is session %s.\\r\n" @@ -3354,70 +3388,51 @@ msgstr "" "Das ist Sitzung %s.\\r\n" #-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:224 +#: ../lib/XXV/MODULES/TELNET.pm:20 +msgid "This module is a multisession telnet server." +msgstr "Dieses Modul ist ein Mehrfachsitzungstelnet-Server." + +#-------------------- +#: ../lib/XXV/MODULES/TELNET.pm:206 msgid "Welcome to xxv system." msgstr "Willkommen im xxv-System." #-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:228 +#: ../lib/XXV/MODULES/TELNET.pm:210 msgid "Welcome to xxv system. Please Login:" msgstr "Willkommen im xxv-System. Bitte Anmelden:" #-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:234 +#: ../lib/XXV/MODULES/TELNET.pm:216 msgid "Sorry, but permission denied!" msgstr "Entschuldigung, aber Erlaubnis verweigert!" #-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:268 -msgid "" -"%sThis is the xxv %s server.\n" -"Please use the following commands:\n" -msgstr "" -"%sDas ist der xxv-%s-Server.\n" -"Bitte verwende folgende Befehle:\n" - -#-------------------- #: ../lib/XXV/MODULES/TELNET.pm:39 msgid "Number of port to listen for telnet clients" msgstr "Nummer des Port, um auf Telnet-Clients zu lauschen" #-------------------- #: ../lib/XXV/MODULES/TELNET.pm:53 -msgid "This will display all commands or description of module 'name'." -msgstr "Dieses zeigt alle Befehle oder das Hilfetext des 'Modulnamen'" - -#-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:60 msgid "This will exit the telnet session" msgstr "Das beendet die Telnetsitzung" #-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:65 ../lib/XXV/MODULES/USER.pm:110 +#: ../lib/XXV/MODULES/TELNET.pm:58 ../lib/XXV/MODULES/USER.pm:110 msgid "Session closed." msgstr "Sitzung geschlossen." #-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:70 ../lib/XXV/MODULES/TELNET.pm:81 +#: ../lib/XXV/MODULES/TELNET.pm:63 ../lib/XXV/MODULES/TELNET.pm:74 msgid "This will exit the xxv system." msgstr "Das wird das xxv-System beenden." #-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:78 +#: ../lib/XXV/MODULES/TELNET.pm:71 msgid "Are you sure to exit the xxv system?" msgstr "Sind Sie sicher, das XXV-System zu beenden?" #-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:92 -msgid "Restart all modules." -msgstr "Dieses lädt alle Module neu." - -#-------------------- -#: ../lib/XXV/MODULES/TELNET.pm:98 -msgid "Modules loaded." -msgstr "Module neugeladen." - -#-------------------- #: ../lib/XXV/MODULES/TIMERS.pm:100 msgid "Edit timer 'tid'" msgstr "Bearbeite Timer 'tid'" diff --git a/locale/de/LC_MESSAGES/xxv.mo b/locale/de/LC_MESSAGES/xxv.mo Binary files differindex d4694b6..fd4ecf7 100644 --- a/locale/de/LC_MESSAGES/xxv.mo +++ b/locale/de/LC_MESSAGES/xxv.mo |
