Display import button only for LSobject type with configured ioFormat
authorBenjamin Renard <brenard@easter-eggs.com>
Thu, 30 Jul 2015 16:13:07 +0000 (18:13 +0200)
committerBenjamin Renard <brenard@easter-eggs.com>
Thu, 30 Jul 2015 16:13:07 +0000 (18:13 +0200)
public_html/view.php

index 79bf1f9..932610a 100644 (file)
@@ -140,11 +140,13 @@ if(LSsession :: startLSsession()) {
               'url' => 'create.php?LSobject='.$LSobject,
               'action' => 'create'
             );
-            $LSview_actions['import'] = array (
-              'label' => 'Import',
-              'url' => 'import.php?LSobject='.$LSobject,
-              'action' => 'import'
-            );
+            if (!empty($object -> listValidIOformats())) {
+              $LSview_actions['import'] = array (
+                'label' => 'Import',
+                'url' => 'import.php?LSobject='.$LSobject,
+                'action' => 'import'
+              );
+            }
           }
           $LSview_actions['refresh'] = array (
             'label' => 'Refresh',