Skip to content

Commit e88ddaf

Browse files
Do not display suggestions box on index page
1 parent 2917967 commit e88ddaf

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

build/scripts/templates/page.html

+1-9
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,7 @@
4848
<div class="span7"></div>
4949
<div class="span1 pull-right">{next}</div>
5050
</div>
51-
<div class="row">
52-
<div class="span2"></div>
53-
<div class="span8">
54-
<div class="alert alert-info" style="text-align: center;">
55-
Please <a href="https://github.com/sebastianbergmann/phpunit-documentation/issues">open a ticket</a> on GitHub to suggest improvements to this page. Thanks!
56-
</div>
57-
</div>
58-
<div class="span2"></div>
59-
</div>
51+
{suggestions}
6052
</div>
6153
</div>
6254
<hr/>

build/scripts/webify.php

+13-11
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@ function webify_file($file, $toc, $languageList, $versionList)
9292
dirname(__FILE__) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'page.html'
9393
);
9494

95-
$title = '';
96-
$content = '';
97-
$prev = '';
98-
$next = '';
95+
$title = '';
96+
$content = '';
97+
$prev = '';
98+
$next = '';
99+
$suggestions = '';
99100

100101
if ($filename !== 'index.html') {
101102
if (strpos($filename, 'appendixes') === 0) {
@@ -110,11 +111,12 @@ function webify_file($file, $toc, $languageList, $versionList)
110111
$type = 'chapter';
111112
}
112113

113-
$buffer = file_get_contents($file);
114-
$title = get_substring($buffer, '<title>', '</title>', FALSE, FALSE);
115-
$content = get_substring($buffer, '<div class="' . $type . '"', '<div class="navfooter">', TRUE, FALSE);
116-
$prev = get_substring($buffer, '<link rel="prev" href="', '" title', FALSE, FALSE);
117-
$next = get_substring($buffer, '<link rel="next" href="', '" title', FALSE, FALSE);
114+
$buffer = file_get_contents($file);
115+
$title = get_substring($buffer, '<title>', '</title>', FALSE, FALSE);
116+
$content = get_substring($buffer, '<div class="' . $type . '"', '<div class="navfooter">', TRUE, FALSE);
117+
$prev = get_substring($buffer, '<link rel="prev" href="', '" title', FALSE, FALSE);
118+
$next = get_substring($buffer, '<link rel="next" href="', '" title', FALSE, FALSE);
119+
$suggestions = '<div class="row"><div class="span2"></div><div class="span8"><div class="alert alert-info" style="text-align: center;">Please <a href="https://github.com/sebastianbergmann/phpunit-documentation/issues">open a ticket</a> on GitHub to suggest improvements to this page. Thanks!</div></div><div class="span2"></div></div>';
118120

119121
if (!empty($prev)) {
120122
$prev = '<a accesskey="p" href="' . $prev . '">Prev</a>';
@@ -126,8 +128,8 @@ function webify_file($file, $toc, $languageList, $versionList)
126128
}
127129

128130
$buffer = str_replace(
129-
array('{title}', '{content}', '{toc}', '{languages}', '{versions}', '{prev}', '{next}', '<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">', '<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">'),
130-
array($title, $content, $toc, $languageList, $versionList, $prev, $next, '<div class="alert alert-error">', '<div class="alert alert-info">'),
131+
array('{title}', '{content}', '{toc}', '{languages}', '{versions}', '{prev}', '{next}', '<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">', '<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">', '{suggestions}'),
132+
array($title, $content, $toc, $languageList, $versionList, $prev, $next, '<div class="alert alert-error">', '<div class="alert alert-info">', $suggestions),
131133
$template
132134
);
133135

0 commit comments

Comments
 (0)