Changeset 2076

Show
Ignore:
Timestamp:
11/02/06 18:26:32
Author:
miyagawa
Message:

QR code support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Mixxi/trunk/lib/Mixxi/Controller/URL.pm

    r2071 r2076  
    6060} 
    6161 
    62 my %reserved_alias = map { $_ => 1 } qw( url id ); 
     62my %reserved_alias = map { $_ => 1 } qw( url id qr ); 
    6363 
    6464sub validate_alias { 
  • Mixxi/trunk/lib/Mixxi/Schema/Url.pm

    r2067 r2076  
    3333} 
    3434 
    35 sub canonical
     35sub canon_path
    3636    my $self = shift; 
    3737 
    38     my $base = Mixxi->config->{tinyurl_base}; 
    3938    if ($self->alias) { 
    40         return $base . $self->alias; 
     39        return $self->alias; 
    4140    } else { 
    42         return $base . "u/" . $self->id_enc; 
     41        return "u/" . $self->id_enc; 
    4342    } 
    4443} 
  • Mixxi/trunk/mixxi.yml

    r2073 r2076  
    88  json_driver: JSON::Syck 
    99  expose_stash: json_data 
     10View::QRcode: 
     11  module_size: 3 
     12 
  • Mixxi/trunk/root/url/create.tt

    r2075 r2076  
    33 
    44Long URL: [% url.url | html %]<br /> 
    5 Short URL: <a href="[% url.canonical | html %]">[% url.canonical | html %]</a> 
     5Short URL: <a href="[% c.uri_for('/') %][% url.canon_path | html %]">[% c.uri_for('/') %][% url.canon_path | html %]</a><br /> 
     6 
     7<p><img src="[% c.uri_for('/qr/') %][% url.canon_path | html %]" /></p>  
    68 
    79[% INCLUDE footer.tt %]