オープンソース・ソフトウェアの開発とダウンロード

CVS リポジトリの参照

Annotation of /pukiwiki/pukiwiki/plugin/diff.inc.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download) (as text)
Sun Jun 22 06:37:18 2003 UTC (20 years, 11 months ago) by arino
Branch: MAIN
CVS Tags: r1_4_rc3, r1_4_rc4, r1_4, r1_4_final, r1_4_1, r1_4_2
Changes since 1.2: +3 -1 lines
File MIME type: application/x-httpd-php
BugTrack/370: 任意のページごとの閲覧・編集制限

1 panda 1.1 <?php
2     /////////////////////////////////////////////////
3     // PukiWiki - Yet another WikiWikiWeb clone.
4     //
5 arino 1.3 // $Id: diff.inc.php,v 1.2 2003/01/28 14:30:39 panda Exp $
6 panda 1.1 //
7     //???若?吾??勲????茵?ず????
8     function plugin_diff_action()
9     {
10     global $script,$get,$hr;
11     global $_msg_notfound,$_msg_goto,$_msg_addline,$_msg_delline,$_title_diff;
12 arino 1.3
13     check_readable($get['page'],true,true);
14 panda 1.1
15     $r_page = rawurlencode($get['page']);
16     $s_page = htmlspecialchars($get['page']);
17     $s_name = strip_bracket($s_page);
18    
19     $msg = $_title_diff;
20     $body = '';
21    
22     if (is_page($get['page'])) {
23     $link = str_replace('$1',"<a href=\"$script?$r_page\">$s_name</a>",$_msg_goto);
24     $body = <<<EOD
25     <ul>
26     <li>$_msg_addline</li>
27     <li>$_msg_delline</li>
28     <li>$link</li>
29     </ul>
30     $hr
31     EOD;
32     }
33    
34     if (file_exists(DIFF_DIR.encode($get['page']).'.txt')) {
35     $diffdata = htmlspecialchars(join('',file(DIFF_DIR.encode($get['page']).'.txt')));
36     $diffdata = preg_replace('/^(\-)(.*)$/m','<span class="diff_removed"> $2</span>',$diffdata);
37     $diffdata = preg_replace('/^(\+)(.*)$/m','<span class="diff_added"> $2</span>',$diffdata);
38     $body .= "<pre>$diffdata</pre>\n";
39     }
40     else if (is_page($get['page'])) {
41     $diffdata = trim(htmlspecialchars(join('',get_source($get['page']))));
42     $body .= "<pre><span class=\"diff_added\">$diffdata</span></pre>\n";
43     }
44     else {
45     $title = $s_name;
46     $body = $_msg_notfound;
47     }
48    
49     return array('msg'=>$msg,'body'=>$body);
50     }
51     ?>

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26