From bd131cc36cf9a415a56354a1ff50c4e692bf5b4c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 4 Sep 2010 12:39:32 +0000 Subject: [PATCH] moved download link to top --- lam/templates/masscreate.php | 75 ++++++++++-------------------------- 1 file changed, 21 insertions(+), 54 deletions(-) diff --git a/lam/templates/masscreate.php b/lam/templates/masscreate.php index e7097911..5396862c 100644 --- a/lam/templates/masscreate.php +++ b/lam/templates/masscreate.php @@ -223,6 +223,7 @@ function showMainPage($scope, $selectedModules) { echo "\n"; echo "\n"; echo "\n"; + echo "    " . _("Download sample CSV file") . "\n"; echo "

\n"; echo "\n"; @@ -306,67 +307,33 @@ function showMainPage($scope, $selectedModules) { echo "
"; } - echo "

 

\n"; - - // print table example and build sample CSV + // build sample CSV $sampleCSV_head = array(); $sampleCSV_row = array(); - echo "" . _("This is an example how it would look in your spreadsheet program before you convert to CSV:") . "

\n"; - - echo "\n"; - echo "\n"; - // DN attributes - $sampleCSV_head[] = "\"dn_suffix\""; - $sampleCSV_head[] = "\"dn_rdn\""; - echo "\n"; - echo "\n"; - // module attributes - for ($m = 0; $m < sizeof($modules); $m++) { - if (sizeof($columns[$modules[$m]]) < 1) continue; - for ($i = 0; $i < sizeof($columns[$modules[$m]]); $i++) { - $sampleCSV_head[] = "\"" . $columns[$modules[$m]][$i]['name'] . "\""; - echo "\n"; - } + // DN attributes + $sampleCSV_head[] = "\"dn_suffix\""; + $sampleCSV_head[] = "\"dn_rdn\""; + // module attributes + for ($m = 0; $m < sizeof($modules); $m++) { + if (sizeof($columns[$modules[$m]]) < 1) continue; + for ($i = 0; $i < sizeof($columns[$modules[$m]]); $i++) { + $sampleCSV_head[] = "\"" . $columns[$modules[$m]][$i]['name'] . "\""; } - echo "\n"; - echo "\n"; - $RDNs = getRDNAttributes($scope, $selectedModules); - // DN attributes - $sampleCSV_row[] = "\"" . $_SESSION['config']->get_Suffix($scope) . "\""; - $sampleCSV_row[] = "\"" . $RDNs[0] . "\""; - echo "\n"; - echo "\n"; - // module attributes - for ($m = 0; $m < sizeof($modules); $m++) { - if (sizeof($columns[$modules[$m]]) < 1) continue; - for ($i = 0; $i < sizeof($columns[$modules[$m]]); $i++) { - $sampleCSV_row[] = "\"" . $columns[$modules[$m]][$i]['example'] . "\""; - echo "\n"; - } + } + $RDNs = getRDNAttributes($scope, $selectedModules); + // DN attributes + $sampleCSV_row[] = "\"" . $_SESSION['config']->get_Suffix($scope) . "\""; + $sampleCSV_row[] = "\"" . $RDNs[0] . "\""; + // module attributes + for ($m = 0; $m < sizeof($modules); $m++) { + if (sizeof($columns[$modules[$m]]) < 1) continue; + for ($i = 0; $i < sizeof($columns[$modules[$m]]); $i++) { + $sampleCSV_row[] = "\"" . $columns[$modules[$m]][$i]['example'] . "\""; } - echo "\n"; - echo "
\n"; - echo "dn_suffix"; - echo "\n"; - echo "dn_rdn"; - echo "\n"; - echo $columns[$modules[$m]][$i]['name']; - echo "
\n"; - echo $_SESSION['config']->get_Suffix($scope); - echo "\n"; - echo $RDNs[0]; - echo "\n"; - echo $columns[$modules[$m]][$i]['example']; - echo "
\n"; + } $sampleCSV = implode(",", $sampleCSV_head) . "\n" . implode(",", $sampleCSV_row) . "\n"; $_SESSION['mass_csv'] = $sampleCSV; - // link to CSV sample - echo "

\n"; - echo "

\n"; - echo "" . _("Download sample CSV file") . "\n"; - echo "

\n"; - include 'main_footer.php'; die; }