This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/contrib/svn_update/theme.php

53 lines
1.4 KiB
PHP
Raw Normal View History

<?php
class SVNUpdateTheme extends Themelet {
2009-01-04 19:54:16 +00:00
public function display_form(Page $page) {
$html = "
<a href='".make_link("update/view_changes")."'>Check for Updates</a>
";
$page->add_block(new Block("Update", $html));
}
2009-01-04 19:54:16 +00:00
public function display_update_todo(Page $page, $log, $branches) {
$h_log = html_escape($log);
$updates = "
<textarea rows='20' cols='80'>$h_log</textarea>
<br/>
<form action='".make_link("update/update")."' method='POST'>
<input type='submit' value='Install Updates'>
</form>
";
$options = "";
foreach($branches as $name => $nice) {
$options .= "<option value='$name'>$nice</option>";
}
$branches = "
<form action='".make_link("update/switch")."' method='POST'>
<select name='branch'>
$options
</select>
<input type='submit' value='Change Branch'>
</form>
";
$page->set_title("Updates Available");
$page->set_heading("Updates Available");
$page->add_block(new NavBlock());
$page->add_block(new Block("Updates For Current Branch", $updates));
$page->add_block(new Block("Available Branches", $branches));
}
2009-01-04 19:54:16 +00:00
public function display_update_log(Page $page, $log) {
$h_log = html_escape($log);
$html = "
<textarea rows='20' cols='80'>$h_log</textarea>
";
$page->set_title("Update Log");
$page->set_heading("Update Log");
$page->add_block(new NavBlock());
$page->add_block(new Block("Update Log", $html));
}
}
?>