diff options
author | Andreas Mair <amair.sob@googlemail.com> | 2006-02-10 11:07:59 +0100 |
---|---|---|
committer | Andreas Mair <amair.sob@googlemail.com> | 2006-02-10 11:07:59 +0100 |
commit | c908714dd89aad8aac9a01a93bdd44375d6bf69f (patch) | |
tree | cdd478697c50da254b9ea05be4cad9aade756e5b | |
parent | 241fa247256050d545d0d4024f260012c20c498d (diff) | |
download | vdradmin-am-c908714dd89aad8aac9a01a93bdd44375d6bf69f.tar.gz vdradmin-am-c908714dd89aad8aac9a01a93bdd44375d6bf69f.tar.bz2 |
2006-02-10: 3.4.3rc3v3.4.3rc3
- Changed handling of refering pages; should work much better now.
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | template/default/copper/style.css | 1 | ||||
-rw-r--r-- | template/default/default/style.css | 6 | ||||
-rw-r--r-- | template/default/navigation.html | 13 | ||||
-rw-r--r-- | template/default/prog_detail.html | 2 | ||||
-rw-r--r-- | template/default/prog_summary.html | 2 | ||||
-rw-r--r-- | template/default/style.css | 3 | ||||
-rwxr-xr-x | tools/check.sh | 6 | ||||
-rw-r--r-- | tools/lib/String/Escape.pm | 625 | ||||
-rwxr-xr-x | tools/tmplgettext | 158 | ||||
-rwxr-xr-x | tools/update-po | 21 | ||||
-rwxr-xr-x | vdradmind.pl | 84 |
12 files changed, 57 insertions, 867 deletions
@@ -4,6 +4,9 @@ E-Mail: mail AT andreas DOT vdr-developer DOT org VDR-Portal: amair ----------------------------------------------------------- +2006-02-10: 3.4.3rc3 +- Changed handling of refering pages; should work much better now. + 2006-02-06: 3.4.3rc2 - For timers that are checked by AutoTimer for start/stop times the broadcast's length must at least match 90% of the original timer's length (excluding before/behind buffers). - Reworked detection of already programmed AutoTimers and made it compatible to VDR v1.3.23+ (Based on suggestions by Jouni Karvo). diff --git a/template/default/copper/style.css b/template/default/copper/style.css index 2db059c..6bbb183 100644 --- a/template/default/copper/style.css +++ b/template/default/copper/style.css @@ -145,4 +145,3 @@ label + input { margin-left: 1em; } #navigation a { color: black; font-weight: bold; text-decoration: none; } #navigation a:hover { font-size: 13px; color: #ff0000 } #navigation input { width: 130px; } -#navigation .bottom { position:absolute; bottom: 5px; } diff --git a/template/default/default/style.css b/template/default/default/style.css index 0b57a2f..f2ec8c6 100644 --- a/template/default/default/style.css +++ b/template/default/default/style.css @@ -562,9 +562,3 @@ body.help .heading { #navigation input { width: 140px; } -#navigation .bottom { - position:absolute; - left: 0px; - right: 0px; - bottom: 5px; -} diff --git a/template/default/navigation.html b/template/default/navigation.html index fd51a95..9a5881a 100644 --- a/template/default/navigation.html +++ b/template/default/navigation.html @@ -65,13 +65,7 @@ <div class="navi"> <a href="vdradmin.pl?aktion=tv_show" target="main"><%! Watch TV !%></a> </div> - <form action="vdradmin.pl" method="get" name="FormName" target="main" class="search"> - <input type="text" name="search" /><br /> - <input type="submit" name="submit" value="<%! Search !%>" /> - <input type="hidden" name="aktion" value="prog_summary" /> - </form> - </div> - <div class="nav_bar bottom"> + <div class="separator"></div> <div class="navi"> <a href="vdradmin.pl?aktion=help" target="main"><%! Help !%></a></a> </div> @@ -79,6 +73,11 @@ <div class="navi"> <a href="vdradmin.pl?aktion=about" target="main"><%! About !%></a> </div> + <form action="vdradmin.pl" method="get" name="FormName" target="main" class="search"> + <input type="text" name="search" /><br /> + <input type="submit" name="submit" value="<%! Search !%>" /> + <input type="hidden" name="aktion" value="prog_summary" /> + </form> </div> </body> </html> diff --git a/template/default/prog_detail.html b/template/default/prog_detail.html index 825ed43..3f27f0c 100644 --- a/template/default/prog_detail.html +++ b/template/default/prog_detail.html @@ -46,7 +46,7 @@ <tmpl_if recurl> <a href="javascript:window.close();opener.location.href='<tmpl_var recurl>'">[<%! record !%>]</a> </tmpl_if> - <a href="vdradmin.pl?search=<tmpl_var find_title>&aktion=prog_summary&submit=go11)" target="main">[<%! search !%>]</a> + <a href="vdradmin.pl?search=<tmpl_var find_title>&aktion=prog_summary&submit=go11" target="main">[<%! search !%>]</a> </tmpl_if> <tmpl_if imdburl> <a href="<tmpl_var imdburl>" target="_blank" title="<%! Lookup movie in the Internet-Movie-Database (IMDb) !%>">[IMDb]</a> diff --git a/template/default/prog_summary.html b/template/default/prog_summary.html index 3940872..5dbbce2 100644 --- a/template/default/prog_summary.html +++ b/template/default/prog_summary.html @@ -79,7 +79,7 @@ <td class="col_center"> <tmpl_if recurl> <a href="javascript:callurl('<tmpl_var switchurl>');"><img src="bilder/sum_view.gif" width="58" height="22" border="0" alt="<%! TV select !%>" onmouseover="window.status='<%! TV select !%>';return true" title="<%! TV select !%>" /></a> - <a href="vdradmin.pl?search=<tmpl_var find_title>&aktion=prog_summary&submit=go11)"><img src="bilder/sum_find.gif" width="58" height="22" border="0" alt="<%! Search for other show times !%>" onmouseover="window.status='<%! Search for other show times !%>';return true" title="<%! Search for other show times !%>" /></a> + <a href="vdradmin.pl?search=<tmpl_var find_title>&aktion=prog_summary&submit=go11"><img src="bilder/sum_find.gif" width="58" height="22" border="0" alt="<%! Search for other show times !%>" onmouseover="window.status='<%! Search for other show times !%>';return true" title="<%! Search for other show times !%>" /></a> <tmpl_if summary> <a href="javascript:popup('<tmpl_var infurl>');"><img src="bilder/sum_info.gif" width="58" height="22" border="0" alt="<%! More Information !%>" onmouseover="window.status='<%! More Information !%>';return true" title="<%! More Information !%>" /></a> <tmpl_else> diff --git a/template/default/style.css b/template/default/style.css index 888b23b..7d88708 100644 --- a/template/default/style.css +++ b/template/default/style.css @@ -114,7 +114,7 @@ label + input { margin-left: 1em; } #prog_summary .date { text-align: right; margin-top: 3px; float: left; } #prog_summary .duration { text-align: right; margin-top: 3px; } #prog_summary .title { margin-top: 1em; width: 246px; overflow: hidden; white-space: nowrap; } -#prog_summary .summary { margin-top: 1em; margin-bottom: 3px; width: 240px; height: 124px; overflow: hidden; white-space: normal; } +#prog_summary .summary { margin-top: 1em; margin-bottom: 3px; width: 240px; height: 124px; overflow: auto; white-space: normal; } /* Tooltips */ .tt_table { width: 250px; border: 2px solid #333399; background-color: #ccccff; } @@ -147,4 +147,3 @@ label + input { margin-left: 1em; } #navigation a { color: black; font-weight: bold; text-decoration: none; } #navigation a:hover { text-decoration: underline; } #navigation input { width: 130px; } -#navigation .bottom { position:absolute; bottom: 5px; } diff --git a/tools/check.sh b/tools/check.sh deleted file mode 100755 index 823d724..0000000 --- a/tools/check.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -[ -z "$1" ] && exit 1 - -cat $1 | sed -e 's#<\(tmpl_[^>]*\)>#<%!\1 /!%>#g' -e 's#</\(tmpl_[^>]*\)>#<%!\1 /!%>#g' | tidy -xml -#cat $1 | sed -e 's#\(<tmpl_var [^>]*\)>#\1 />#g' -e 's#\(<tmpl_else\)>#\1 />#g' | tidy -xml diff --git a/tools/lib/String/Escape.pm b/tools/lib/String/Escape.pm deleted file mode 100644 index 2c40f45..0000000 --- a/tools/lib/String/Escape.pm +++ /dev/null @@ -1,625 +0,0 @@ -### String::Escape - Backslash escaping, word splitting, and elision functions - -### Copyright 2002 Matthew Simon Cavalletto. - # You may use this software under the same terms as Perl. - -######################################################################## - -package String::Escape; - -require 5; -use strict; -use Carp; -use Exporter; - -use vars qw( $VERSION @ISA @EXPORT_OK ); -$VERSION = 2002.001; - -push @ISA, qw( Exporter ); -push @EXPORT_OK, qw( - escape - printable unprintable - elide - quote unquote quote_non_words qprintable unqprintable - string2list string2hash list2string list2hash hash2string hash2list -); - -######################################################################## - -### Call by-name interface - -# %Escapes - escaper function references by name -use vars qw( %Escapes ); -%Escapes = ( - %Escapes, - 'none' => sub ($) { $_[0]; }, - - 'uppercase' => sub ($) { uc $_[0] }, - 'lowercase' => sub ($) { lc $_[0] }, - 'initialcase' => sub ($) { ucfirst lc $_[0] }, - - 'quote' => \"e, - 'unquote' => \&unquote, - 'quote_non_words' => \"e_non_words, - - 'printable' => \&printable, - 'unprintable' => \&unprintable, - - 'qprintable' => 'printable quote_non_words', - 'unqprintable' => 'unquote unprintable', - - 'elide' => \&elide, -); - -# String::Escape::add( $name, $subroutine ); -sub add ($$) { $Escapes{ shift(@_) } = shift(@_); } - -# @defined_names = String::Escape::names(); -sub names () { keys(%Escapes); } - -# $escaped = escape($escape_spec, $value); -# @escaped = escape($escape_spec, @values); -sub escape ($@) { - my ($escape_spec, @values) = @_; - - croak "escape called with multiple values but in scalar context" - if ($#values > 0 && ! wantarray); - - my @escapes = expand_escape_spec($escape_spec); - # warn "Escaping: ". join(' ', @escapes) . "\n"; - my ($value, $escaper); - foreach $value ( @values ) { - foreach $escaper ( @escapes ) { - $value = &$escaper( $value ); - } - } - - return wantarray ? @values : $values[0]; -} - -# @escape_functions = expand_escape_spec($escape_spec); -sub expand_escape_spec { - my $escape_spec = shift; - - if ( ref($escape_spec) eq 'CODE' ) { - return $escape_spec; - } elsif ( ref($escape_spec) eq 'ARRAY' ) { - return map { expand_escape_spec($_) } @$escape_spec; - } elsif ( ! ref($escape_spec) ) { - return map { - expand_escape_spec($_) - } map { - $Escapes{$_} or croak "unsupported escape specification '$_'; " . - "should be one of " . join(', ', names()) - } split(/\s+/, $escape_spec); - } else { - croak "unsupported escape specification '$escape_spec'"; - } -} - -######################################################################## - -### Double Quoting - -# $with_surrounding_quotes = quote( $string_value ); -sub quote ($) { '"' . $_[0] . '"' } - -# $remove_surrounding_quotes = quote( $string_value ); -sub unquote ($) { local $_ = $_[0]; s/\A\"(.*)\"\Z/$1/s; $_; } - -# $word_or_phrase_with_surrounding_quotes = quote( $string_value ); -sub quote_non_words ($) { - ( ! length $_[0] or $_[0] =~ /[^\w\_\-\/\.\:\#]/ ) ? '"'.$_[0].'"' : $_[0] -} - -### Backslash Escaping - -use vars qw( %Printable %Unprintable ); -%Printable = ( ( map { chr($_), unpack('H2', chr($_)) } (0..255) ), - "\\"=>'\\', "\r"=>'r', "\n"=>'n', "\t"=>'t', "\""=>'"' ); -%Unprintable = ( reverse %Printable ); - -# $special_characters_escaped = printable( $source_string ); -sub printable ($) { - local $_ = ( defined $_[0] ? $_[0] : '' ); - s/([\r\n\t\"\\\x00-\x1f\x7F-\xFF])/\\$Printable{$1}/sg; - return $_; -} - -# $original_string = unprintable( $special_characters_escaped ); -sub unprintable ($) { - local $_ = ( defined $_[0] ? $_[0] : '' ); - s/((?:\A|\G|[^\\]))\\([rRnNtT\"\\]|[\da-fA-F]{2})/$1.$Unprintable{lc($2)}/gse; - return $_; -} - -# quoted_and_escaped = qprintable( $source_string ); -sub qprintable ($) { quote_non_words printable $_[0] } - -# $original_string = unqprintable( quoted_and_escaped ); -sub unqprintable ($) { unprintable unquote $_[0] } - -######################################################################## - -### Elision - -use vars qw( $Elipses $DefaultLength $DefaultStrictness ); -$Elipses = '...'; -$DefaultLength = 60; -$DefaultStrictness = 10; - -# $elided_string = elide($string); -# $elided_string = elide($string, $length); -# $elided_string = elide($string, $length, $word_boundary_strictness); - # Return a single-quoted, shortened version of the string, with ellipsis -sub elide ($;$$) { - my $source = shift; - my $length = scalar(@_) ? shift() : $DefaultLength; - my $word_limit = scalar(@_) ? shift() : $DefaultStrictness; - - # If the source is already short, we don't need to do anything - return $source if (length($source) < $length); - - # Leave room for the elipses and make sure we include at least one character. - $length -= length( $Elipses ); - $length = 1 if ( $length < 1 ); - - my $excerpt; - - # Try matching $length characters or less at a word boundary. - $excerpt = ( $source =~ /^(.{0,$length})(?:\s|\Z)/ )[0] if ( $word_limit ); - - # Ignore boundaries if that fails or returns much less than we wanted. - $excerpt = substr($source, 0, $length) if ( ! defined $excerpt or - length($excerpt) < length($source) and - ! length($excerpt) || abs($length - length($excerpt)) > $word_limit); - - return $excerpt . $Elipses; -} - -######################################################################## - -# @words = string2list( $space_separated_phrases ); -sub string2list { - my $text = shift; - - carp "string2list called with a non-text argument, '$text'" if (ref $text); - - my @words; - my $word = ''; - - while ( defined $text and length $text ) { - if ($text =~ s/\A(?: ([^\"\s\\]+) | \\(.) )//mx) { - $word .= $1; - } elsif ($text =~ s/\A"((?:[^\"\\]|\\.)*)"//mx) { - $word .= $1; - } elsif ($text =~ s/\A\s+//m){ - push(@words, unprintable($word)); - $word = ''; - } elsif ($text =~ s/\A"//) { - carp "string2list found an unmatched quote at '$text'"; - return; - } else { - carp "string2list parse exception at '$text'"; - return; - } - } - push(@words, unprintable($word)); - - return @words; -} - -# $space_sparated_string = list2string( @words ); -sub list2string { - join ( ' ', map qprintable($_), @_ ); -} - -# %hash = list2hash( @words ); -sub list2hash { - my @pairs; - foreach (@_) { - my ($key, $val) = m/\A(.*?)(?:\=(.*))?\Z/s; - push @pairs, $key, $val; - } - return @pairs; -} - -# @words = hash2list( %hash ); -sub hash2list { - my @words; - while ( scalar @_ ) { - my ($key, $value) = ( shift, shift ); - push @words, qprintable($key) . '=' . qprintable($value) - } - return @words; -} - -# %hash = string2hash( $string ); -sub string2hash { - return list2hash( string2list( shift ) ); -} - -# $string = hash2string( %hash ); -sub hash2string { - join ( ' ', hash2list( @_ ) ); -} - -######################################################################## - -1; - -__END__ - -=pod - -=head1 NAME - -String::Escape - Registry of string functions, including backslash escapes - - -=head1 SYNOPSIS - - use String::Escape qw( printable unprintable ); - # Convert control, high-bit chars to \n or \xxx escapes - $output = printable($value); - # Convert escape sequences back to original chars - $value = unprintable($input); - - use String::Escape qw( elide ); - # Shorten strings to fit, if necessary - foreach (@_) { print elide( $_, 79 ) . "\n"; } - - use String::Escape qw( string2list list2string ); - # Pack and unpack simple lists by quoting each item - $list = list2string( @list ); - @list = string2list( $list ); - - use String::Escape qw( string2hash hash2string ); - # Pack and unpack simple hashes by quoting each item - $hash = hash2string( %hash ); - %hash = string2hash( $hash ); - - use String::Escape qw( escape ); - # Defer selection of escaping routines until runtime - $escape_name = $use_quotes ? 'qprintable' : 'printable'; - @escaped = escape($escape_name, @values); - - -=head1 DESCRIPTION - -This module provides a flexible calling interface to some frequently-performed string conversion functions, including applying and removing C/Unix-style backslash escapes like \n and \t, wrapping and removing double-quotes, and truncating to fit within a desired length. - -Furthermore, the escape() function provides for dynamic selection of operations by using a package hash variable to map escape specification strings to the functions which implement them. The lookup imposes a bit of a performance penalty, but allows for some useful late-binding behaviour. Compound specifications (ex. 'quoted uppercase') are expanded to a list of functions to be applied in order. Other modules may also register their functions here for later general use. (See the "CALLING BY NAME" section below for more.) - - -=head1 FUNCTION REFERENCE - -=head2 Escaping And Unescaping Functions - -Each of these functions takes a single simple scalar argument and -returns its escaped (or unescaped) equivalent. - -=over 4 - -=item quote($value) : $escaped - -Add double quote characters to each end of the string. - -=item quote_non_words($value) : $escaped - -As above, but only quotes empty, punctuated, and multiword values; simple values consisting of alphanumerics without special characters are not quoted. - -=item unquote($value) : $escaped - -If the string both begins and ends with double quote characters, they are removed, otherwise the string is returned unchanged. - -=item printable($value) : $escaped - -=item unprintable($value) : $escaped - -These functions convert return, newline, tab, backslash and unprintable -characters to their backslash-escaped equivalents and back again. - -=item qprintable($value) : $escaped - -=item unqprintable($value) : $escaped - -The qprintable function applies printable escaping and then wraps the results -with quote_non_words, while unqprintable applies unquote and then unprintable. -(Note that this is I<not> MIME quoted-printable encoding.) - -=back - -=head2 Simple Arrays and Hashes - -=over 4 - -=item @words = string2list( $space_separated_phrases ); - -Converts a space separated string of words and quoted phrases to an array; - -=item $space_sparated_string = list2string( @words ); - -Joins an array of strings into a space separated string of words and quoted phrases; - -=item %hash = string2hash( $string ); - -Converts a space separated string of equal-sign-associated key=value pairs into a simple hash. - -=item $string = hash2string( %hash ); - -Converts a simple hash into a space separated string of equal-sign-associated key=value pairs. - -=item %hash = list2hash( @words ); - -Converts an array of equal-sign-associated key=value strings into a simple hash. - -=item @words = hash2list( %hash ); - -Converts a hash to an array of equal-sign-associated key=value strings. - -=back - -=head2 String Elision Function - -This function extracts the leading portion of a provided string and appends ellipsis if it's longer than the desired maximum excerpt length. - -=over 4 - -=item elide($string) : $elided_string - -=item elide($string, $length) : $elided_string - -=item elide($string, $length, $word_boundary_strictness) : $elided_string - -If the original string is shorter than $length, it is returned unchanged. At most $length characters are returned; if called with a single argument, $length defaults to $DefaultLength. - -Up to $word_boundary_strictness additional characters may be ommited in order to make the elided portion end on a word boundary; you can pass 0 to ignore word boundaries. If not provided, $word_boundary_strictness defaults to $DefaultStrictness. - -=item $Elipses - -The string of characters used to indicate the end of the excerpt. Initialized to '...'. - -=item $DefaultLength - -The default target excerpt length, used when the elide function is called with a single argument. Initialized to 60. - -=item $DefaultStrictness - -The default word-boundary flexibility, used when the elide function is called without the third argument. Initialized to 10. - -=back - -=head1 CALLING BY NAME - -These functions provide for the registration of string-escape specification -names and corresponding functions, and then allow the invocation of one or -several of these functions on one or several source string values. - -=over 4 - -=item escape($escapes, $value) : $escaped_value - -=item escape($escapes, @values) : @escaped_values - -Returns an altered copy of the provided values by looking up the escapes string in a registry of string-modification functions. - -If called in a scalar context, operates on the single value passed in; if -called in a list contact, operates identically on each of the provided values. - -Valid escape specifications are: - -=over 4 - -=item one of the keys defined in %Escapes - -The coresponding specification will be looked up and used. - -=item a sequence of names separated by whitespace, - -Each name will be looked up, and each of the associated functions will be applied successively, from left to right. - -=item a reference to a function - -The provided function will be called on with each value in turn. - -=item a reference to an array - -Each item in the array will be expanded as provided above. - -=back - -A fatal error will be generated if you pass an unsupported escape specification, or if the function is called with multiple values in a scalar context. - -=item String::Escape::names() : @defined_escapes - -Returns a list of defined escape specification strings. - -=item String::Escape::add( $escape_name, \&escape_function ); - -Add a new escape specification and corresponding function. - -=item %Escapes : $name, $operation, ... - -By default, the %Escapes hash is initialized to contain the following mappings: - -=over 4 - -=item quote, unquote, or quote_non_words - -=item printable, unprintable, qprintable, or unqprintable, - -=item elide - -Run the above-described functions of the same names. - -=item uppercase, lowercase, or initialcase - -Alters the case of letters in the string to upper or lower case, or for initialcase, sets the first letter to upper case and all others to lower. - -=item none - -Return an unchanged copy of the original value. - -=back - -=back - - -=head1 EXAMPLES - -Here are a few example uses of these functions, along with their output. - -=head2 Backslash Escaping - -C<print printable( "\tNow is the time\nfor all good folks\n" );> - - \tNow is the time\nfor all good folks\n - -C<print unprintable( '\\tNow is the time\\nfor all good folks\\n' );> - - Now is the time - for all good folks - - - -=head2 Escape By Name - -C<print escape('qprintable', "\tNow is the time\nfor all good folks\n" );> - - "\tNow is the time\nfor all good folks\n" - -C<print escape('uppercase qprintable', "\tNow is the time\nfor all good folks\n" );> - - "\tNOW IS THE TIME\nFOR ALL GOOD FOLKS\n" - - -C<print join '--', escape('printable', "\tNow is the time\n", "for all good folks\n" );> - - \tNow is the time\n--for all good folks\n - - -=head2 String Elision Function - -C<$string = 'foo bar baz this that the other';> - -C<print elide( $string, 100 );> - - foo bar baz this that the other - - -C<print elide( $string, 12 );> - - foo bar... - - -C<print elide( $string, 12, 0 );> - - foo bar b... - - -=head2 Simple Arrays and Hashes - -C<print list2string('hello', 'I move next march');> - - hello "I move next march" - - -C<@list = string2list('one "second item" 3 "four\nlines\nof\ntext"');> - -C<print $list[1];> - - second item - - -C<print hash2string( 'foo' =E<gt> 'Animal Cities', 'bar' =E<gt> 'Cheap' );> - - foo="Animal Cities" bar=Cheap - - -C<%hash = string2hash('key=value "undefined key" words="the cat in the hat"');> - -C<print $hash{'words'};> - - the cat in the hat - -C<print exists $hash{'undefined_key'} and ! defined $hash{'undefined_key'};> - - 1 - - -=head1 PREREQUISITES AND INSTALLATION - -This package should run on any standard Perl 5 installation. - -To install this package, download and unpack the distribution archive from -http://www.evoscript.com/dist/ or your favorite CPAN mirror, and execute -the standard "perl Makefile.PL", "make test", "make install" sequence. - - -=head1 STATUS AND SUPPORT - -This release of String::Escape is intended for public review and feedback. -It has been tested in several environments and no major problems have been -discovered, but it should be considered "beta" pending that feedback. - - Name DSLI Description - -------------- ---- --------------------------------------------- - String:: - ::Escape bdpf Registry of useful string escaping functions - -Further information and support for this module is available at E<lt>www.evoscript.orgE<gt>. - -Please report bugs or other problems to C<E<lt>simonm@cavalletto.orgE<gt>>. - -The following changes are in progress or under consideration: - -=over 4 - -=item * - -Use word-boundary test in elide's regular expression rather than \s|\Z. - -=item * - -Check for possible problems in the use of printable escaping functions and list2hash. For example, are the encoded strings for hashes with high-bit characters in their keys properly unquoted and unescaped? - -=item * - -Update string2list; among other things, embedded quotes (eg: a@"!a) shouldn't cause phrase breaks. - -=back - - -=head1 SEE ALSO - -Numerous modules provide collections of string manipulation functions; see L<String::Edit> for an example. - -The string2list function is similar to to the quotewords function in the standard distribution; see L<Text::ParseWords>. - -Use other packages to stringify more complex data structures; see L<Data::PropertyList>, L<Data::Dumper>, or other similar package. - - -=head1 CREDITS AND COPYRIGHT - -=head2 Developed By - - M. Simon Cavalletto, simonm@cavalletto.org - Evolution Softworks, www.evoscript.org - -=head2 Contributors - - Eleanor J. Evans piglet@piglet.org - Jeremy G. Bishop - -=head2 Copyright - -Copyright 2002 Matthew Simon Cavalletto. - -Portions copyright 1996, 1997, 1998, 2001 Evolution Online Systems, Inc. - -=head2 License - -You may use, modify, and distribute this software under the same terms as Perl. - -=cut diff --git a/tools/tmplgettext b/tools/tmplgettext deleted file mode 100755 index 5a756ab..0000000 --- a/tools/tmplgettext +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/perl - -# -# tmplgettext <regexp> <directories> -# -# Creates a gettext pot-template from any text template specified by <regexp> -# in <directories> (recursivly) -# -# Any text matching /<%! (.*) !%>/ (even across multiple lines) will be -# interpreted as a translatable strings like in gettext("foo") or _("foo"). -# -# e.g.: tmplgettext "^.*\.html$" ./templates >templates.pot -# -# Output goes to stdout. -# -# 04/2005 - Tobias Grimm <vdr@e-tobi.net> -# - -my $BASENAME; -BEGIN { - $BASENAME = $1; - unshift(@INC, $BASENAME . "../tools/lib/"); -} - -use String::Escape qw(printable); -use File::Find; - -my $START_TAG = "<%! "; -my $END_TAG = " !%>"; - -my $filePattern = ""; - -sub WritePotHeader -{ - my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = - localtime(time); - - print "# -# Translators, if you are not familiar with the PO format, gettext -# documentation is worth reading, especially sections dedicated to -# this format, e.g. by running: -# info -n '(gettext)PO Files' -# info -n '(gettext)Header Entry' -# -# Some information specific to po-debconf are available at -# /usr/share/doc/po-debconf/README-trans -# or http://www.debian.org/intl/l10n/po-debconf/README-trans -# -# Developers do not need to manually edit POT or PO files. -# -#, fuzzy -msgid \"\" -msgstr \"\" -\"Project-Id-Version: VDRAdmin-0.97-AM3.3\\n\" -\"Report-Msgid-Bugs-To: Andreas Mair <mail@andreas.vdr-developer.org>\\n\"\n"; - - # FIXME: Correctly set timezone - - printf "\"POT-Creation-Date: %4d-%02d-%02d %02d:%02d+0100\"\n", - $year + 1900, $mon + 1, $mday, $hour, $min; - - print "\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\" -\"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n\" -\"Language-Team: LANGUAGE <LL@li.org>\\n\" -\"MIME-Version: 1.0\\n\" -\"Content-Type: text/plain; charset=CHARSET\\n\" -\"Content-Transfer-Encoding: 8bit\\n\"\n\n"; -} - -sub my_normalize { - my $text = shift; - $text =~ s/[\t\n]//g; - return printable($text); -} - -sub WritePotEntry -{ - my ($fileName, $lineNumber, $msgid) = @_; - my $escapedMsgid = my_normalize($msgid); - - print "#: $fileName:$lineNumber\n"; - print "msgid \"$escapedMsgid\"\n"; - print "msgstr \"\"\n\n"; -} - -sub ExtractMsgids -{ - my ($fileName, @fileContent) = @_; - my $text = ""; - my $isTextStarted = 0; - my $lineCounter = 0; - my $textStartLine; - - foreach my $line (@fileContent) - { - my $lookAhead; - - $lineCounter++; - - if ($isTextStarted = 1) - { - $text = $text . "\n"; - } - - for (my $index=0; $index < length($line); $index++) - { - $lookAhead = substr($line, $index, length($START_TAG)); - if ($lookAhead eq $START_TAG) - { - $index = $index + length($START_TAG); # skip whole tag - $isTextStarted = 1; - $textStartLine = $lineCounter; - $text = ""; - } - - $lookAhead = substr($line, $index, length($END_TAG)); - if ($lookAhead eq $END_TAG) - { - if ($isTextStarted) - { - $index = $index + length($END_TAG); # skip whole tag - if (length($text) > 0) - { - WritePotEntry($fileName, $textStartLine, $text); - } - $isTextStarted = 0; - } - } - - if ($isTextStarted) - { - $text = $text . substr($line, $index, 1); - } - } - } -} - -sub ProcessFile -{ - if ($File::Find::name =~ /$filePattern/) - { - open(HTML, "< $File::Find::name"); - my @fileContent = <HTML>; - close(HTML); - - ExtractMsgids($File::Find::name, @fileContent); - } -} - -# -# main() -# - -$filePattern = shift(@ARGV); - -WritePotHeader; - -find({no_chdir => 1, wanted => \&ProcessFile}, @ARGV); diff --git a/tools/update-po b/tools/update-po deleted file mode 100755 index 0aebd31..0000000 --- a/tools/update-po +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -e - -pushd po/ -../tools/tmplgettext "^.*\.html$" ../template >tmp-html-x.pot -msguniq tmp-html-x.pot >vdradmin.pot - -xgettext --from-code=ISO-8859-1 -L Perl ../vdradmind.pl -j -o vdradmin.pot -#xgettext --from-code=ISO-8859-1 -L Perl ../template/i18n.pl -j -o vdradmin.pot -rm tmp-*.pot -popd - - -for LANG in de es fi fr nl ; do - echo -n "$LANG: " - if msgmerge po/$LANG.po po/vdradmin.pot >temp.po ; then - mv -f temp.po po/$LANG.po - echo " untranslated=$(msgattrib --untranslated po/$LANG.po | grep ^msgid | wc -l) fuzzy=$(msgattrib --fuzzy po/$LANG.po | grep ^msgid | wc -l)" - else - echo "error merging po/$LANG.po and po/vdradmin.pot" - fi -done diff --git a/vdradmind.pl b/vdradmind.pl index 52ea88b..a141ca1 100755 --- a/vdradmind.pl +++ b/vdradmind.pl @@ -91,7 +91,7 @@ sub LOG_DEBUG () { 32768 }; my %CONFIG; $CONFIG{LOGLEVEL} = 81; # 32799 -$CONFIG{LOGGING} = 1; +$CONFIG{LOGGING} = 0; $CONFIG{LOGFILE} = "vdradmind.log"; $CONFIG{MOD_GZIP} = 0; $CONFIG{CACHE_TIMEOUT} = 60; @@ -176,7 +176,7 @@ $CONFIG{TV_EXT} = "m3u"; $CONFIG{REC_MIMETYPE} = "video/x-mpegurl"; $CONFIG{REC_EXT} = "m3u"; -my $VERSION = "3.4.3rc2"; +my $VERSION = "3.4.3rc3"; my $SERVERVERSION = "vdradmind/$VERSION"; my $LINVDR = isLinVDR(); my $VDRVERSION = 0; @@ -2309,10 +2309,11 @@ sub prog_detail { $displaysubtitle =~ s/\|/<br \/>\n/g; $find_title =~ s/^.*~\([^~]*\)/$1/; - my $old_aktion; - $old_aktion = "&old_aktion=" . $q->param("old_aktion") if($q->param("old_aktion")); + # Do not use prog_detail as referer. + # Use the referer we received. + my $referer = getReferer(); my $recurl; - $recurl = sprintf("%s?aktion=timer_new_form%s&epg_id=%s&vdr_id=%s", $MyURL, $old_aktion, $epg_id, $vdr_id) unless($q->param("old_aktion") =~ "timer_list"); + $recurl = sprintf("%s?aktion=timer_new_form&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $epg_id, $vdr_id, Encode_Referer($referer)) unless($referer =~ "timer_list"); my $template = TemplateNew("prog_detail.html"); my $vars = { @@ -2349,6 +2350,8 @@ sub prog_list { return(headerForward("$MyURL?aktion=prog_list&vdr_id=1")); } + my $myself = Encode_Referer($MyURL . "?" . $Query); + # my @channel; for my $channel (@CHAN) { @@ -2401,8 +2404,8 @@ sub prog_list { duration => my_strftime("%H:%M", $event->{stop}), title => CGI::escapeHTML($event->{title}), subtitle => CGI::escapeHTML($event->{subtitle}), - recurl => sprintf("%s?aktion=timer_new_form&old_aktion=prog_list&epg_id=%s&vdr_id=%s", $MyURL, $event->{event_id}, $event->{vdr_id}), - infurl => $event->{summary} ? sprintf("%s?aktion=prog_detail&old_aktion=prog_list&epg_id=%s&vdr_id=%s", $MyURL, $event->{event_id}, $event->{vdr_id}) : undef, + recurl => sprintf("%s?aktion=timer_new_form&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself), + infurl => $event->{summary} ? sprintf("%s?aktion=prog_detail&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself) : undef, newd => 0, anchor => "id" . $event->{event_id} }); @@ -2454,6 +2457,7 @@ sub prog_list2 { # my $vdr_id; my @channel; + my $myself = Encode_Referer($MyURL . "?" . $Query); for my $channel (@CHAN) { # if its wished, display only wanted channels @@ -2521,8 +2525,8 @@ sub prog_list2 { duration => my_strftime("%H:%M", $event->{stop}), title => CGI::escapeHTML($event->{title}), subtitle => CGI::escapeHTML($event->{subtitle}), - recurl => sprintf("%s?aktion=timer_new_form&old_aktion=prog_list2&epg_id=%s&vdr_id=%s", $MyURL, $event->{event_id}, $event->{vdr_id}), - infurl => $event->{summary} ? sprintf("%s?aktion=prog_detail&old_aktion=prog_list2&epg_id=%s&vdr_id=%s", $MyURL, $event->{event_id}, $event->{vdr_id}) : undef, + recurl => sprintf("%s?aktion=timer_new_form&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself), + infurl => $event->{summary} ? sprintf("%s?aktion=prog_detail&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself) : undef, newd => 0, anchor => "id" . $event->{event_id} }); @@ -2533,7 +2537,6 @@ sub prog_list2 { push(@show, { endd => 1 }); } # end: for $vdr_id - # my($template) = TemplateNew("prog_list2.html"); my $vars = { @@ -2545,8 +2548,8 @@ sub prog_list2 { progname => GetChannelDescByNumber($vdr_id), switchurl => "$MyURL?aktion=prog_switch&channel=" . $vdr_id, stream_live_on => $CONFIG{ST_FUNC} && $CONFIG{ST_LIVE_ON}, - prevdayurl => $day > $current_day ? "$MyURL?aktion=prog_list2&day=" . ($day - 1) : undef, - nextdayurl => $last_day > $day ? "$MyURL?aktion=prog_list2&day=" . ($day + 1) : undef, + prevdayurl => $day > $current_day ? "$MyURL?aktion=prog_list2&day=" . ($day - 1): undef, + nextdayurl => $last_day > $day ? "$MyURL?aktion=prog_list2&day=" . ($day + 1): undef, toolbarurl => "$MyURL?aktion=toolbar" }; $template->param($vars); @@ -2577,6 +2580,7 @@ sub timer_list { my @timer; my @timer2; my @days; + my $myself = Encode_Referer($MyURL . "?" . $Query); my ($TagAnfang, $TagEnde); for my $timer (ParseTimer(0)) { @@ -2606,7 +2610,7 @@ sub timer_list { $timer->{starttime} = my_strftime("%y%m%d", $timer->{startsse}); $timer->{stoptime} = my_strftime("%y%m%d", $timer->{stopsse}); $timer->{sortfield} = $timer->{cdesc} . $timer->{startsse}; - $timer->{infurl} = $timer->{event_id} ? sprintf("%s?aktion=prog_detail&old_aktion=timer_list&epg_id=%s&vdr_id=%s", $MyURL, $timer->{event_id}, $timer->{vdr_id}) : undef, + $timer->{infurl} = $timer->{event_id} ? sprintf("%s?aktion=prog_detail&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $timer->{event_id}, $timer->{vdr_id}, $myself) : undef, $timer->{start} = my_strftime("%H:%M", $timer->{start}); $timer->{stop} = my_strftime("%H:%M", $timer->{stop}); @@ -2905,7 +2909,7 @@ sub timer_new_form { } # determine referer (redirect to where we come from) - my $ref = getReferer($epg_id); + my $ref = getReferer(); # check if we may use Event-IDs in general or not if($CONFIG{NO_EVENTID} == 1) { @@ -2944,7 +2948,7 @@ sub timer_new_form { timer_id => $timer_id ? $timer_id : 0, channels => \@channels, newtimer => $timer_id ? 0 : 1, - referer => Encode_Referer($ref), + referer => $ref ? Encode_Referer($ref) : undef, help_url => HelpURL("timer_new") }; @@ -3060,9 +3064,9 @@ sub timer_add { } - #XXX - if($q->param("referer")) { - return(headerForward(Decode_Referer($q->param("referer")))); + my $ref = getReferer(); + if($ref) { + return(headerForward($ref)); } else { return(headerForward("$MyURL?aktion=timer_list")); } @@ -3155,20 +3159,18 @@ sub rec_stream { } sub getReferer { - my $epg_id = shift; - if(defined($epg_id)) { - if($Referer =~ /(.*)\#\d+$/) { -# print("1: $1, $epg_id\n"); - return sprintf("%s#id%s", $1, $epg_id); -# } elsif ($Referer) { -# print("2: $Referer, $epg_id\n"); -# return sprintf("%s#id%s", $Referer, $epg_id); - } else { - my $vdr_id = $q->param("vdr_id"); -# print("3: " . $q->param("old_aktion") . ", $vdr_id, $epg_id\n"); - return sprintf("./vdradmin.pl?aktion=%s%s#id%s", $q->param("old_aktion"), ($vdr_id ? "&vdr_id=$vdr_id" : ""), $epg_id); + my $epg_id = $q->param("epg_id"); + my $ref = $q->param("referer"); + if ($ref) { + $ref = Decode_Referer($ref); + if ($ref =~ /#/) { + return $ref; + } else { + return sprintf("%s%s", $ref, $epg_id ? "#id$epg_id" : ""); } - } + } else { + return undef; + } } ############################################################################# @@ -3596,6 +3598,8 @@ sub prog_timeline { return if(UptoDate()); my $time = $q->param("time"); + my $myself = Encode_Referer($MyURL . "?" . $Query); + # zeitpunkt bestimmen my $event_time; my $event_time_to; @@ -3684,8 +3688,8 @@ sub prog_timeline { vdr_id => $event->{vdr_id}, proglink => sprintf("%s?aktion=prog_list&vdr_id=%s", $MyURL, $event->{vdr_id}), switchurl=> sprintf("%s?aktion=prog_switch&channel=%s", $MyURL, $event->{vdr_id}), - infurl => ($event->{summary} ? sprintf("%s?aktion=prog_detail&old_aktion=prog_timeline&epg_id=%s&vdr_id=%s", $MyURL, $event->{event_id}, $event->{vdr_id}) : undef), - recurl => sprintf("%s?aktion=timer_new_form&epg_id=%s&vdr_id=%s", $MyURL, $event->{event_id}, $event->{vdr_id}), + infurl => ($event->{summary} ? sprintf("%s?aktion=prog_detail&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself) : undef), + recurl => sprintf("%s?aktion=timer_new_form&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself), anchor => $event->{event_id}, timer => ( defined $TIM->{ $event->{title} } && $TIM->{ $event->{title} }->{vdr_id} == $event->{vdr_id} ? 1 : 0 ), }); @@ -3830,6 +3834,7 @@ sub prog_summary { $displaysubtitle =~ s/\n/<br \/>\n/g; $displaysubtitle =~ s/\|/<br \/>\n/g; } + my $myself = Encode_Referer($MyURL . "?" . $Query); push(@show, { date => my_strftime("%x", $event->{start}), longdate => my_strftime("%A, %x", $event->{start}), @@ -3844,8 +3849,8 @@ sub prog_summary { switchurl => sprintf("%s?aktion=prog_switch&channel=%s", $MyURL, $event->{vdr_id}), streamurl => sprintf("%s%s?aktion=live_stream&channel=%s", $MyStreamBase, $CONFIG{TV_EXT}, $event->{vdr_id}), stream_live_on => $CONFIG{ST_FUNC} && $CONFIG{ST_LIVE_ON}, - infurl => $event->{summary} ? sprintf("%s?aktion=prog_detail&old_aktion=prog_summary&epg_id=%s&vdr_id=%s", $MyURL, $event->{event_id}, $event->{vdr_id}) : undef, - recurl => sprintf("%s?aktion=timer_new_form&old_aktion=prog_summary&epg_id=%s&vdr_id=%s", $MyURL, $event->{event_id}, $event->{vdr_id}), + infurl => $event->{summary} ? sprintf("%s?aktion=prog_detail&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself) : undef, + recurl => sprintf("%s?aktion=timer_new_form&epg_id=%s&vdr_id=%s&referer=%s", $MyURL, $event->{event_id}, $event->{vdr_id}, $myself), find_title => uri_escape($event->{title}), anchor => "id" . $event->{event_id} }); @@ -4364,10 +4369,10 @@ sub recRunCmd { sub rec_edit { # determine referer (redirect to where we come from) - my $ref = ($Referer ? Encode_Referer($Referer) : undef); + my $ref = getReferer(); my $template = TemplateNew("rec_edit.html"); - my $vars = getRecInfo($q->param("id"), $ref); + my $vars = getRecInfo($q->param("id"), $ref ? Encode_Referer($ref) : undef); $template->param($vars); my $output; my $out = $template->output; @@ -4385,8 +4390,9 @@ sub rec_rename { $CONFIG{CACHE_REC_LASTUPDATE} = 0; } - if($q->param("referer")) { - return headerForward(Decode_Referer($q->param("referer"))); + my $ref = getReferer(); + if($ref) { + return headerForward($ref); } else { return headerForward("$MyURL?aktion=rec_list&sortby=" . $q->param("sortby") . "&desc=" . $q->param("desc")); } |