-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdisplay_functions.php
More file actions
99 lines (90 loc) · 4.37 KB
/
display_functions.php
File metadata and controls
99 lines (90 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
function show_revisions(){
$revisions=$_SESSION['current']['revisions'];
if (!empty($revisions)){
$result='';
$first=array_pop($revisions);
if ($first==''){
return '';
}
foreach ($revisions as $revision){
$result='<li>'.$revision.'</li>'.PHP_EOL.$result;
}
$revisions[]=$first;
$result='<li><form class="edit_rev" method="POST" action="."><input id="first_revision" type="submit" name="revision" value="'.$first.'"></input></form></li>'.PHP_EOL.$result;
return $_SESSION['current']['namespace'].'/<br/>'.$_SESSION['current']['page'].'<br/><ul class="revisions">'.PHP_EOL.$result.'</ul>'.PHP_EOL;
}
}
function show_submit_form($code){
$result='<form action="." method="POST" class="submission">'.PHP_EOL;
$result.='<textarea name="submission">'.$code.'</textarea>'.PHP_EOL;
$result.='<div class="submits">'.PHP_EOL;
if (isset($_SESSION['autoscript']) && ($_SESSION['autoscript']==1)){
$result.='<input type="submit" name="stopAuto" value="'.t('stop automatic submissions').'">'.PHP_EOL;
} else {
$result.='<input type="submit" name="startAuto" value="'.t('start automatic submissions').'">'.PHP_EOL;
}
$result.='<input id="todo-submit" type="submit" name="submitaddtodo" value="'.t('submit and add TODO').'">'.PHP_EOL;
$result.='<input id="plain-submit" type="submit"></div></form>'.PHP_EOL;
return $result;
}
function ask_for_source(){
$result ='<form method="POST" action=".">'.PHP_EOL;
$result.='<input type="text" name="source[url]" />'.t('Source Wiki (Twiki)').'<br/>'.PHP_EOL;
$result.='<input type="text" name="source[user]" />'.t('User name (optional)').'<br/>'.PHP_EOL;
$result.='<input type="password" name="source[password]"/>'.t('Password (optional)').'<br/>'.PHP_EOL;
$result.='<input type="submit"/>'.PHP_EOL;
$result.='</form>'.PHP_EOL;
if (!function_exists('curl_version')){
$result.=t('Warning: It seems like the cURL library is not installed. The converter will not work without cURL!');
}
return $result;
}
function ask_for_destination(){
$result ='<form method="POST" action=".">'.PHP_EOL;
$result.='<input type="text" name="destination[url]" />'.t('Destination Wiki (Mediawiki)').'<br/>'.PHP_EOL;
$result.='<input type="text" name="destination[user]" />'.t('User name (optional)').'<br/>'.PHP_EOL;
$result.='<input type="password" name="destination[password]"/>'.t('Password (optional)').'<br/>'.PHP_EOL;
$result.='<input type="submit"/>'.PHP_EOL;
$result.='</form>'.PHP_EOL;
$result.=t('Note').': '.t('The pages to be transferred will be determined by the namespaes present in the destination MediaWiki.').'<br/>'.PHP_EOL;
$result.=t('Make sure to <a href="http://www.mediawiki.org/wiki/Manual:Namespace">create approprate namespaces</a> in the destination wiki before going to the next step!').'<br/>'.PHP_EOL;
$result.=t('The following namespaces are defined in the source TWiki:').'<br/>'.PHP_EOL;
$result.=get_source_namespaces();
return $result;
}
function show_links_open(){
$result='<form class="editlink" method="POST" action="."><ul class="namespace">'.PHP_EOL;
$first=false;
foreach ($_SESSION['links_open'] as $namespace=>$links){
$result.='<li>'.$namespace.PHP_EOL.'<ul class="link">'.PHP_EOL;
foreach ($links as $num => $link){
$result.='<li><input ';
if (!$first){
$first=true;
$result.='id="first_open_page" ';
}
$result.='type="submit" name="edit" value="'.$namespace.':'.$link.'"></input></li>'.PHP_EOL;
}
$result.='</ul>'.PHP_EOL.'</li>'.PHP_EOL;
}
$result.='</ul></form>'.PHP_EOL;
return $result;
}
function display_source(){
return '<iframe src="'.$_SESSION['source']['url'].'">Ihr Browser scheint keine IFrames zu unterstützen.</iframe>';
}
function display_destination(){
return '<iframe src="'.$_SESSION['destination']['url'].'">Ihr Browser scheint keine IFrames zu unterstützen.</iframe>';
}
function add_session_closer(){
return '<form class="session_closer" method="POST" action=".">
<input type="submit" name="closesession" value="neue Session" />
</form>';
}
function display_session(){
$result='Session:<pre>'.print_r($_SESSION,true).'</pre>';
$result.='POST:<pre>'.print_r($_POST,true).'</pre>';
return $result;
}
?>