Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ENHANCEMENT: Export DataObjects to CSV #30

Merged
merged 1 commit into from

3 participants

@streamflyer

Hi Uncle Cheese
I added an export button to the list of DataObjects to save them as a CSV file. Maybe this is useful for others as well :-)

Cheers
Nicolas

@unclecheese unclecheese merged commit 3a5e9e2 into unclecheese:master
@Zauberfisch

It should be possible to disable exporting on a DOM.
(Using the permissions, I think CTF already does that $ctf->removePermission('export');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 19, 2011
  1. @streamflyer
This page is out of date. Refresh to see the latest.
View
4 code/DataObjectManager.php
@@ -480,6 +480,10 @@ public function AddLink() {
return Controller::join_links($this->BaseLink(), 'add');
}
+ public function ExportLink() {
+ return Controller::join_links($this->BaseLink(), 'export');
+ }
+
public function ShowAll()
{
return $this->showAll == "1";
View
3  css/dataobject_manager.css
@@ -68,6 +68,9 @@
.dataobjectmanager-search .sbox input {background: white url('../images/srch_bg.gif') repeat-x top left;float: left;border: 0;height: 13px; width: 112px;padding: 3px;font: 11px/13px arial;color: #666;}
.dataobjectmanager-search .srch_clear {background: white url('../images/srch_r_f2.gif') no-repeat top left;}
+.dataobjectmanager-button {position: absolute; top: 5px; left: 5px; padding: 2px 0px; background-color: #eee; border-color: #CCCCCC #999999 #999999 #CCCCCC; border-style: double; border-width: 2px;}
+.dataobjectmanager-button a {padding: 5px 5px; font-size: 1.1em; color: #333; text-decoration: none;}
+.dataobjectmanager-button a:hover {background-color: #f4f4f4;}
.dataobjectmanager-filter {position:relative;width:30%;float:right;text-align:right;}
.dataobjectmanager-filter select {width:100%;max-width:250px;}
View
1  lang/de_DE.php
@@ -11,6 +11,7 @@
$lang['de_DE']['DataObjectManager']['DISPLAYING'] = 'Zeige';
$lang['de_DE']['DataObjectManager']['DRAGDROP'] = 'Drag & Drop neuordnen';
$lang['de_DE']['DataObjectManager']['ERROR'] = 'Fehler';
+$lang['de_DE']['DataObjectManager']['EXPORT'] = '%s exportieren';
$lang['de_DE']['DataObjectManager']['IMPORTFROMFOLDER'] = 'Importieren aus einem existierenden Ordner';
$lang['de_DE']['DataObjectManager']['NOFILTER'] = 'Kein Filter';
$lang['de_DE']['DataObjectManager']['NOITEMSFOUND'] = 'Keine %s gefunden';
View
1  lang/en_US.php
@@ -14,6 +14,7 @@
$lang['en_US']['DataObjectManager']['DISPLAYING'] = 'Displaying';
$lang['en_US']['DataObjectManager']['DRAGDROP'] = 'Allow drag & drop reordering';
$lang['en_US']['DataObjectManager']['ERROR'] = 'Error';
+$lang['en_US']['DataObjectManager']['EXPORT'] = 'Export %s';
$lang['en_US']['DataObjectManager']['IMPORTFROMFOLDER'] = 'Import from an existing folder';
$lang['en_US']['DataObjectManager']['NOFILTER'] = 'No filter';
$lang['en_US']['DataObjectManager']['NOITEMSFOUND'] = 'No %s found';
View
9 templates/DataObjectManager.ss
@@ -87,10 +87,13 @@
<div class="bottom-controls">
<div class="rounded_table_bottom_right">
<div class="rounded_table_bottom_left">
- <div class="sort-control">
- <% if Sortable %>
+ <% if Sortable %>
+ <div class="sort-control">
<input id="showall-{$id}" type="checkbox" <% if ShowAll %>checked="checked"<% end_if %> value="<% if Paginated %>$ShowAllLink<% else %>$PaginatedLink<% end_if %>" /><label for="showall-{$id}"><% _t('DataObjectManager.DRAGDROP','Allow drag &amp; drop reordering') %></label>
- <% end_if %>
+ </div>
+ <% end_if %>
+ <div class="dataobjectmanager-button">
+ <a href="$ExportLink"><% sprintf(_t('DataObjectManager.EXPORT','Export %s'),$PluralTitle) %></span></a>
</div>
<div class="per-page-control">
<% if ShowAll %><% else %>$PerPageDropdown<% end_if %>
Something went wrong with that request. Please try again.