OSDN Git Service

リソースのパスのプレフィックス処理を修正。
authortakezoe <takezoe@871d6764-1e22-0410-b313-a55050885396>
Thu, 1 Dec 2011 15:10:18 +0000 (15:10 +0000)
committertakezoe <takezoe@871d6764-1e22-0410-b313-a55050885396>
Thu, 1 Dec 2011 15:10:18 +0000 (15:10 +0000)
takezoe/plugin/book/Install.pm
takezoe/plugin/book/Memolist.pm

index 9610bf3..afa54bb 100644 (file)
@@ -50,6 +50,7 @@ sub install {
        for(my $i = 0; $i < $#paths; $i++){
                $path_prefix .= '../';
        }
+       $wiki->{book_plugin_path_prefix} = $path_prefix;
        
        my $head_info = <<"END_OF_HEAD";
 <link href="${path_prefix}plugin/book/google-code-prettify/sunburst.css" type="text/css" rel="stylesheet" />
index f31cd38..f073694 100644 (file)
@@ -27,12 +27,6 @@ sub paragraph {
        my $buf = '';
        my $count = 1;
        
-       my @paths = split(/\//, $wiki->get_CGI()->path_info());
-       my $path_prefix = '';
-       for(my $i = 0; $i < $#paths; $i++){
-               $path_prefix .= '../';
-       }
-       
        foreach my $memo (@{$plugin->{'memolist'}}){
                $buf .= '<li><a href="#todo-'.$count.'">';
                $icon = '';
@@ -44,7 +38,7 @@ sub paragraph {
                        $icon = 'delete.png';
                }
                if($icon ne ''){
-                       $buf .= '<img src="'.$path_prefix.'plugin/book/icons/'.$icon.'" style="border: 0px; position: relative; top: 4px; padding-right: 2px;">';
+                       $buf .= '<img src="'.$wiki->{book_plugin_path_prefix}.'plugin/book/icons/'.$icon.'" style="border: 0px; position: relative; top: 4px; padding-right: 2px;">';
                        $memo =~ s/^\[.+?\]//;
                }
                $buf .= Util::escapeHTML($memo).'</a></li>';