-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkapitelliste.php
More file actions
140 lines (125 loc) · 3.47 KB
/
Copy pathkapitelliste.php
File metadata and controls
140 lines (125 loc) · 3.47 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
/*
* volxbibelwiki2
* Simon Bruechner, 04.07.2008
*/
/**
* Liste mit allen biblischen Büchern (Neues Testament) aus dem Volxbibel-
* MediaWiki
*
* exakt in der Schreibweise aus dem Wiki! Namensänderungen und Ergänzugen im
* Wiki müssen hier auch gepflegt werden! Deutsche Umlaute sind erlaubt, genauso
* ".", "," und " " sowie Ziffern
*
* @see http://wiki.volxbibel.com
*/
$arrayNT = array(
'Matthäus',
'Markus',
'Lukas',
'Johannes',
'Apostelgeschichte',
'Römer',
'1.Korinther',
'2.Korinther',
'Galater',
'Epheser',
'Philipper',
'Kolosser',
'1.Thessalonicher',
'2.Thessalonicher',
'1.Timotheus',
'2.Timotheus',
'Titus',
'Philemon',
'Hebräer',
'Jakobus',
'1.Petrus',
'2.Petrus',
'1.Johannes',
'2.Johannes',
'3.Johannes',
'Judas',
'Offenbarung',
);
$arrayAT = array(
'1.Mose',
'Psalmen',
);
require_once 'HTML/QuickForm.php';
$Form = new HTML_QuickForm('exportform');
// NT
foreach ($arrayNT as $buch) {
$group[] =& HTML_QuickForm::createElement('checkbox', $buch, $buch, $buch/*, array('checked' => 'true')*/);
}
// AT
foreach ($arrayAT as $buch) {
$group2[] =& HTML_QuickForm::createElement('checkbox', $buch, $buch, $buch/*, array('checked' => 'true')*/);
}
$Form->addGroup($group, 'nt', 'Neues Testament:', '<br />');
$Form->addGroup($group2, 'at', 'Altes Testament<br />(experimentell):', '<br />');
$Form->addElement('submit', null, 'Exportiere Ausgewählte Bücher');
if ($Form->validate()) {
// XML Ordner leeren
function remove_directory($dir) {
if ($handle = opendir("$dir")) {
while (false !== ($item = readdir($handle))) {
if ($item != "." && $item != "..") {
if (is_dir("$dir/$item")) {
remove_directory("$dir/$item");
} else {
unlink("$dir/$item");
}
}
}
closedir($handle);
rmdir($dir);
}
}
remove_directory(dirname(__FILE__).'/xml/');
mkdir(dirname(__FILE__).'/xml/');
/**
* Gibt die Reihenfolge der Bücher in der Bibel aus
*/
function getKey($element) {
global $arrayNT;
foreach ($arrayNT as $key => $value) {
if ($element === $value) {
// Starte mit 1
return ($key + 1);
}
}
global $arrayAT;
foreach ($arrayAT as $key => $value) {
if ($element === $value) {
// Starte mit 1
return ($key + 1);
}
}
}
#var_dump($Form->exportValue('nt'));
#var_dump($Form->exportValue('at'));
require_once dirname(__FILE__).'/export.php';
foreach ($Form->exportValue('nt') as $buch => $value) {
echo 'Exportiere: '.$buch.' <br/>';
new VolxbibelExport($buch, getKey($buch), FALSE);
}
if (TRUE) {
require_once "File/Archive.php";
$fileName = 'volxbibel-'.date('dmY').'.zip';
File_Archive::extract(
$src = array(dirname(__FILE__).'/xml/*.xml'),
File_Archive::toArchive(dirname(__FILE__).'/'.$fileName, File_Archive::toFiles() )
);
if (is_file(dirname(__FILE__).'/'.$fileName)) {
$download = TRUE;
}
}
}
$Form->display();
if (!empty($download)) {
echo '<script language="javascript">
setTimeout("document.location.href=\''.dirname($_SERVER['PHP_SELF']).'/download.php?file='.$fileName.'\';", 1000);
</script>';
}
?>