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/ext/bulk_add/theme.php

47 lines
1.3 KiB
PHP
Raw Normal View History

<?php
class BulkAddTheme extends Themelet {
2016-06-19 22:05:57 +00:00
private $messages = array();
/*
* Show a standard page for results to be put into
*/
2009-01-04 19:54:16 +00:00
public function display_upload_results(Page $page) {
$page->set_title("Adding folder");
$page->set_heading("Adding folder");
$page->add_block(new NavBlock());
2015-08-23 15:09:52 +00:00
$html = "";
foreach($this->messages as $block) {
2016-03-21 23:14:48 +00:00
$html .= "<br/>" . $block->body;
}
2016-03-21 23:14:48 +00:00
$page->add_block(new Block("Results", $html));
}
/*
* Add a section to the admin page. This should contain a form which
* links to bulk_add with POST[dir] set to the name of a server-side
* directory full of images
*/
2010-05-28 13:26:46 +00:00
public function display_admin_block() {
2015-08-23 15:09:52 +00:00
global $page;
$html = "
Add a folder full of images; any subfolders will have their names
used as tags for the images within.
<br>Note: this is the folder as seen by the server -- you need to
upload via FTP or something first.
2009-01-04 19:18:37 +00:00
<p>".make_form(make_link("bulk_add"))."
2012-03-13 15:23:56 +00:00
<table class='form'>
<tr><th>Folder</th><td><input type='text' name='dir' size='40'></td></tr>
<tr><td colspan='2'><input type='submit' value='Add'></td></tr>
</table>
</form>
";
$page->add_block(new Block("Bulk Add", $html));
}
public function add_status($title, $body) {
$this->messages[] = new Block($title, $body);
}
}