2007-06-30 01:19:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class BulkAddTheme extends Themelet {
|
2007-07-06 17:21:17 +00:00
|
|
|
var $messages = array();
|
|
|
|
|
2007-07-28 20:30:01 +00:00
|
|
|
/*
|
|
|
|
* Show a standard page for results to be put into
|
|
|
|
*/
|
2009-01-04 11:54:16 -08:00
|
|
|
public function display_upload_results(Page $page) {
|
2007-06-30 01:19:11 +00:00
|
|
|
$page->set_title("Adding folder");
|
|
|
|
$page->set_heading("Adding folder");
|
|
|
|
$page->add_block(new NavBlock());
|
2015-08-23 16:09:52 +01:00
|
|
|
$html = "";
|
2007-07-06 17:21:17 +00:00
|
|
|
foreach($this->messages as $block) {
|
2016-03-21 18:14:48 -05:00
|
|
|
$html .= "<br/>" . $block->body;
|
2007-07-06 17:21:17 +00:00
|
|
|
}
|
2016-03-21 18:14:48 -05:00
|
|
|
$page->add_block(new Block("Results", $html));
|
2007-06-30 01:19:11 +00:00
|
|
|
}
|
|
|
|
|
2007-07-28 20:30:01 +00:00
|
|
|
/*
|
|
|
|
* 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 14:26:46 +01:00
|
|
|
public function display_admin_block() {
|
2015-08-23 16:09:52 +01:00
|
|
|
global $page;
|
2007-06-30 01:19:11 +00:00
|
|
|
$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 11:18:37 -08:00
|
|
|
|
2010-09-22 12:56:19 +01: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>
|
2007-06-30 01:19:11 +00:00
|
|
|
</form>
|
|
|
|
";
|
|
|
|
$page->add_block(new Block("Bulk Add", $html));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function add_status($title, $body) {
|
2007-07-06 17:21:17 +00:00
|
|
|
$this->messages[] = new Block($title, $body);
|
2007-06-30 01:19:11 +00:00
|
|
|
}
|
|
|
|
}
|