new export options
This commit is contained in:
@@ -37,6 +37,30 @@ abstract class BaseExporter
|
||||
$this->columns = Column::columnsFromJson($table->revision->columns);
|
||||
}
|
||||
|
||||
protected function getHeaderComment($prefix = " ")
|
||||
{
|
||||
$table = $this->table;
|
||||
$owner = $this->table->owner;
|
||||
|
||||
$s =
|
||||
$prefix."Table \"$table->title\" by $owner->title\n".
|
||||
$prefix."exported ".date('M n, Y \\a\\t G:i')."\n".
|
||||
$prefix."\n".
|
||||
$prefix."License: ". str_replace("\n", "\n$prefix", $table->license ?: 'CC0') ."\n".
|
||||
$prefix."\n".
|
||||
$prefix."Upstream: https://datatable.directory/$owner->handle/$table->name\n";
|
||||
|
||||
$s .=
|
||||
$prefix."\n".
|
||||
$prefix."Columns:\n";
|
||||
|
||||
foreach ($this->columns as $c) {
|
||||
$s .= $prefix." - $c->name ... $c->title\n";
|
||||
}
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string - mime type for the downloaded file
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user