/
doc.php
122 lines (87 loc) · 3.42 KB
/
doc.php
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
<?php
class phpList_API_Doc{
private $classes;
function __construct()
{
}
function addClass( $classname ){
$this->classes[] = $classname;
}
function output(){
$this->header();
foreach( $this->classes as $class ){
$reflect = new ReflectionClass( $class );
$methods = $reflect->getMethods();
foreach( $methods as $method ){
echo '<section>';
echo '<div class="page-header">';
echo '<h2>' . $method->name . '</h2>';
echo '</div>';
echo '<div class="row">';
echo '<div class="span12">';
$comment = $method->getDocComment();
$comment = str_replace( '/**', '', $comment );
$comment = str_replace( '*/', '', $comment );
$comment = str_replace( '[*', '<span class="label label-warning">', $comment );
$comment = str_replace( '[', '<span class="label label-success">', $comment );
$comment = str_replace( ']', '</span>', $comment );
$comment = str_replace( '{', '<span class="badge">', $comment );
$comment = str_replace( '}', '</span>', $comment );
$comment = str_replace( '*', '', $comment );
//$comment = str_replace( '<br><br>', '', $comment );
echo trim($comment);
echo '</div>';
echo '</div>';
echo '<br/>';
echo '<section>';
}
}
$this->footer();
exit;
}
function header(){
?>
<!DOCTYPE html>
<html>
<head>
<title>API Plugin to phpList</title>
<!-- Bootstrap -->
<link href="http://netdna.bootstrapcdn.com/bootswatch/2.1.1/cerulean/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
<div class="container">
<p> </p>
<header class="jumbotron subhead" id="overview">
<div class="row">
<div class="span6">
<h1>API Plugin to phpList</h1>
<p class="lead">Documentation generated <?php echo date('Y-m-d H:i:s'); ?></p>
</div>
</div>
</header>
<div class="row">
<div class="span12">
<div class="well">
The following methods is called by Body Param [cmd] to the plugin URL via request method POST.
<p>
<span class="label label-warning">Required body parameter</span><br/>
<span class="label label-success">Optional body parameter</span><br/>
<span class="badge">Datatype</span><br/>
</p>
</div>
</div>
</div>
<?php
}
function footer(){
?>
<footer id="footer">
<p class="pull-right"><a href="#">Back to top</a></p>
</footer>
</div>
</body>
</html>
<?php
}
}
?>