forked from Cavemanon/cavepaintings
PSR-2. I'm not a huge fan, but ugly consistency beats no consistency...
This commit is contained in:
@@ -1,28 +1,31 @@
|
||||
<?php
|
||||
|
||||
class BulkAddCSVTheme extends Themelet {
|
||||
private $messages = array();
|
||||
class BulkAddCSVTheme extends Themelet
|
||||
{
|
||||
private $messages = [];
|
||||
|
||||
/*
|
||||
* Show a standard page for results to be put into
|
||||
*/
|
||||
public function display_upload_results(Page $page) {
|
||||
$page->set_title("Adding images from csv");
|
||||
$page->set_heading("Adding images from csv");
|
||||
$page->add_block(new NavBlock());
|
||||
foreach($this->messages as $block) {
|
||||
$page->add_block($block);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Show a standard page for results to be put into
|
||||
*/
|
||||
public function display_upload_results(Page $page)
|
||||
{
|
||||
$page->set_title("Adding images from csv");
|
||||
$page->set_heading("Adding images from csv");
|
||||
$page->add_block(new NavBlock());
|
||||
foreach ($this->messages as $block) {
|
||||
$page->add_block($block);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a section to the admin page. This should contain a form which
|
||||
* links to bulk_add_csv with POST[csv] set to the name of a server-side
|
||||
* csv file
|
||||
*/
|
||||
public function display_admin_block() {
|
||||
global $page;
|
||||
$html = "
|
||||
/*
|
||||
* Add a section to the admin page. This should contain a form which
|
||||
* links to bulk_add_csv with POST[csv] set to the name of a server-side
|
||||
* csv file
|
||||
*/
|
||||
public function display_admin_block()
|
||||
{
|
||||
global $page;
|
||||
$html = "
|
||||
Add images from a csv. Images will be tagged and have their
|
||||
source and rating set (if \"Image Ratings\" is enabled)
|
||||
<br>Specify the absolute or relative path to a local .csv file. Check <a href=\"" . make_link("ext_doc/bulk_add_csv") . "\">here</a> for the expected format.
|
||||
@@ -34,11 +37,11 @@ class BulkAddCSVTheme extends Themelet {
|
||||
</table>
|
||||
</form>
|
||||
";
|
||||
$page->add_block(new Block("Bulk Add CSV", $html));
|
||||
}
|
||||
$page->add_block(new Block("Bulk Add CSV", $html));
|
||||
}
|
||||
|
||||
public function add_status($title, $body) {
|
||||
$this->messages[] = new Block($title, $body);
|
||||
}
|
||||
public function add_status($title, $body)
|
||||
{
|
||||
$this->messages[] = new Block($title, $body);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user