OSDN Git Service

BugTrack/2520 Remove spaces between heading text and dagger
[pukiwiki/pukiwiki.git] / plugin / setlinebreak.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone
3 // $Id: setlinebreak.inc.php,v 1.5 2011/01/25 15:01:01 henoheno Exp $
4 //
5 // Set linebreak plugin - on/of linebreak-to-'<br />' conversion
6 //
7 // Usage:
8 //      #setlinebreak          : Invert on/off
9 //      #setlinebreak(on)      : ON  (from this line)
10 //      #setlinebreak(off)     : OFF (from this line)
11 //      #setlinebreak(default) : Reset
12
13 function plugin_setlinebreak_convert()
14 {
15         global $line_break;
16         static $default;
17
18         if (! isset($default)) $default = $line_break;
19
20         if (func_num_args() == 0) {
21                 // Invert
22                 $line_break = ! $line_break;
23         } else {
24                 $args = func_get_args();
25                 switch (strtolower($args[0])) {
26                 case 'on':      /*FALLTHROUGH*/
27                 case 'true':    /*FALLTHROUGH*/
28                 case '1':
29                         $line_break = 1;
30                         break;
31
32                 case 'off':     /*FALLTHROUGH*/
33                 case 'false':   /*FALLTHROUGH*/
34                 case '0':
35                         $line_break = 0;
36                         break;
37
38                 case 'default':
39                         $line_break = $default;
40                         break;
41
42                 default:
43                         return '#setlinebreak: Invalid argument: ' .
44                                 htmlsc($args[0]) . '<br />';
45                 }
46         }
47         return '';
48 }
49 ?>