source: temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/text_wiki_sample.php @ 405

Revision 405, 4.6 KB checked in by root, 20 years ago (diff)
Line 
1<?php
2
3//  $xoopsOption['nocommon'] = true ;
4//  require '../../../mainfile.php' ;
5
6    $lang = empty( $_GET['lang'] ) ? '' : str_replace( '..' , '' , $_GET['lang'] ) ;
7
8    if( file_exists( "../language/$lang/text_wiki_sample.wiki" ) ) {
9        $fp = fopen( "../language/$lang/text_wiki_sample.wiki" , 'r' ) ;
10    } else {
11        $fp = fopen( "../language/english/text_wiki_sample.wiki" , 'r' ) ;
12    }
13    $wiki_source = fread( $fp , 65536 ) ;
14    fclose( $fp ) ;
15
16    if( ! defined( 'PATH_SEPARATOR' ) ) define( 'PATH_SEPARATOR' , DIRECTORY_SEPARATOR == '/' ? ':' : ';' ) ;
17    ini_set( 'include_path' , ini_get('include_path') . PATH_SEPARATOR . dirname(dirname(dirname(dirname(__FILE__)))) . '/common/PEAR' ) ;
18    include_once "Text/Wiki.php";
19    // include_once "Text/sunday_Wiki.php";
20    $wiki = new Text_Wiki(); // create instance
21
22    // Configuration
23    $wiki->deleteRule( 'Wikilink' ); // remove a rule for auto-linking
24    $wiki->setFormatConf( 'Xhtml' , 'translate' , false ) ; // remove HTML_ENTITIES
25
26    // $wiki = new sunday_Text_Wiki(); // create instance
27    //$text = str_replace ( "\r\n", "\n", $text );
28    //$text = str_replace ( "~\n", "[br]", $text );
29    //$text = $wiki->transform($text);
30    //$content = str_replace ( "[br]", "<br/>", $text );
31    // special thx to minahito! you are great!!
32    $wiki_body = $wiki->transform( $wiki_source ) ;
33   
34    echo '
35    <html>
36    <head>
37        <title>PEAR::Text_Wiki Sample</title>
38        <style>
39        body, p, br, td, th {
40            font-family: "Lucida Grande", Verdana, Arial, Geneva;
41            font-size: 9pt;
42            color: black;
43            line-spacing: 120%;
44        }
45       
46        table {
47            border-spacing: 0px;
48            border: 1px solid gray;
49        }
50       
51        th , td {
52            margin: 1px;
53            border: 1px solid silver;
54            padding: 4px;
55        }
56       
57        h1 { font-size: 24pt;}
58        h2 { font-size: 18pt; border-bottom: 1px solid gray; clear: both;}
59        h3 { font-size: 14pt;}
60        h4 { font-size: 12pt;}
61        h5 { font-size: 10pt;}
62        h6 { font-size: 9pt;}
63       
64   
65        blockquote {
66            border: 1px solid silver;
67            background: #eee;
68            margin: 4px;
69            padding: 4px 12px;
70        }
71       
72        table.admin {
73            border: 2px solid #039;
74            border-spacing: 0px;
75            padding: 0px;
76        }
77       
78        th.admin {
79            padding: 4px;
80            background: #039;
81            color: white;
82            font-weight: bold;
83            vertical-align: bottom;
84        }
85       
86        td.admin {
87            border: 1px solid white;
88            padding: 4px;
89            background: #eee;
90            vertical-align: top;
91        }
92       
93       
94        a:link, a:active, a:visited {
95            color: blue;
96            text-decoration: none;
97            border-bottom: 1px solid blue;
98        }
99       
100        a:hover {
101            color: blue;
102            text-decoration: none;
103            border-bottom: 1px dotted blue;
104        }
105       
106   
107        li {
108            margin-top: 3pt;
109            margin-bottom: 3pt;
110        }
111       
112        pre {
113            border: 1px dashed #036;
114            background: #eee;
115            padding: 6pt;
116            font-family: ProFont, Monaco, Courier, "Andale Mono", monotype;
117            font-size: 9pt;
118        }
119       
120        input[type="text"], input[type="password"], textarea {
121            font-family: ProFont, Monaco, Courier, "Andale Mono", monotype;
122            font-size: 9pt;
123        }
124       
125        table.nav_table {
126            width: 100%;
127        }
128       
129        td.tabs_marginal {
130            background: white;
131            border-bottom: 1px solid black;
132        }
133       
134        td.tabs_unselect {
135            background: #aaa;
136            border-top: 1px solid black;
137            border-left: 1px solid black;
138            border-right: 1px solid black;
139            border-bottom: 1px solid black;
140            text-align: center;
141        }
142       
143        td.tabs_selected {
144            background: #ddd;
145            border-top: 1px solid black;
146            border-left: 1px solid black;
147            border-right: 1px solid black;
148            border-bottom: none;
149            text-align: center;
150            font-weight: bold;
151        }
152       
153        td.wide_marginal {
154            background: #ddd;
155            border-bottom: 1px solid black;
156        }
157       
158        td.wide_unselect {
159            background: #ddd;
160            border-bottom: 1px solid black;
161            text-align: center;
162        }
163       
164        td.wide_selected {
165            background: #ddd;
166            border-bottom: 1px solid black;
167            text-align: center;
168            font-weight: bold;
169        }
170       
171        td.tall_unselect {
172            font-weight: normal;
173        }
174       
175        td.tall_selected {
176            font-weight: normal;
177        }
178       
179        table.yawiki {
180            border-spacing: 0px;
181            border: 1px solid gray;
182        }
183       
184        tr.yawiki {
185        }
186       
187        th.yawiki {
188            margin: 1px;
189            border: 1px solid silver;
190            padding: 4px;
191            font-weight: bold;
192        }
193       
194        td.yawiki {
195            margin: 1px;
196            border: 1px solid silver;
197            padding: 4px;
198        }
199       
200        th.yawiki-form {
201            text-align: right;
202            padding: 4px;
203        }
204       
205        td.yawiki-form {
206            text-align: left;
207            padding: 4px;
208        }
209       
210        legend.yawiki-form {
211            font-size: 120%;
212        }
213       
214        label.yawiki-form {
215            font-weight: bold;
216        }
217       
218        div.toc_list {
219            border: 1px solid #ccc;
220            background-color: #eee;
221            padding: 1em;
222            margin-bottom: 2em;
223            float: left;
224            clear: both;
225        }
226       
227        div.toc_item {
228            font-size: 90%;
229            margin-top: 0.5em;
230        }
231       
232    </style>
233    </head>
234    <body>
235    '.$wiki_body.'
236    </body>
237    </html>
238    ' ;
239   
240?>
Note: See TracBrowser for help on using the repository browser.