From 56ca67879e8af707b5d9361e3b0c5871ff95a203 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 31 Oct 2010 13:48:15 +0000 Subject: [PATCH] added button for file upload on account lists --- lam/lib/lists.inc | 51 +++++++++++++++++++++++++----------- lam/lib/types/dhcp.inc | 19 +++++++++++++- lam/templates/masscreate.php | 6 ++--- 3 files changed, 57 insertions(+), 19 deletions(-) diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index 658cf75e..da3dfd42 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -465,8 +465,8 @@ class lamList { * Manages all POST actions (e.g. button pressed) for the account lists. */ protected function listDoPost() { - // check if button was pressed and if we have to add/delete an account - if (isset($_POST['new']) || isset($_POST['del'])){ + // check if button was pressed and if we have to add/delete an account or call file upload + if (isset($_POST['new']) || isset($_POST['del']) || isset($_POST['fileUpload'])){ if (!checkIfWriteAccessIsAllowed()) { die(); } @@ -489,6 +489,11 @@ class lamList { exit; } } + // file upload + elseif (isset($_POST['fileUpload'])){ + metaRefresh("../masscreate.php?type=" . $this->type); + exit; + } } // PDF button foreach ($_POST as $key => $value) { @@ -677,11 +682,37 @@ class lamList { echo "\n"; if (checkIfWriteAccessIsAllowed()) { // add/delete buttons - echo ("\n"); + echo "\n"; if (!$createOnly) { - echo ("\n"); + echo "\n"; } - echo "   "; + $type = new $this->type(); + if ($type->supportsFileUpload()) { + echo '      '; + echo "\n"; + } + ?> +     + + \n"; echo "\n"; @@ -715,16 +746,6 @@ class lamList { window.onload = listResizeITabContentDiv; window.onresize = listResizeITabContentDiv; jQuery('#filterButton').button(); - jQuery('#newButton').button({ - icons: { - primary: 'createButton' - } - }); - jQuery('#delButton').button({ - icons: { - primary: 'deleteButton' - } - }); }); " . $this->labels['deleteEntry'] . "\n"); } - echo "  "; + echo '      '; + echo "\n"; + echo '      '; echo ("\n"); echo "   "; ?>