$themeUrlReady = strtolower($theme); $themeUrlReady = str_replace(" ", "-", $themeUrlReady); $themeUrlReady = str_replace("-for-", "-", $themeUrlReady); return "/dataset/" . $themeUrlReady . "/resource/" . $uuid; } function makeTimeHumanTime($value) { return date("Y/m/d", $value); } // build recent content $recentContent = "<table id=\"viewTable\" class=\"dataTable\" style=\"border:none;\"><thead style=\"border-top-color:#fff;\"><tr class=\"headerRowStyle\"><th style=\"border:none; background-color:transparent; \">DATASET NAME</th><th style=\"border:none; background-color:transparent;\">DATE ADDED</th></tr></thead><tbody style=\"border-top-color:#DEAB14\">"; $datasets = getAllRecentDatasets(); $pos = 1; foreach ($datasets as $row) { $displayTime = makeTimeHumanTime($row->created); $displayLink = createResourceLink($row->theme, $row->uuid); $rowClass = $pos % 2 != 0 ? "odd" : "even"; $recentContent .= "<tr class=\"{$rowClass}\"><td style=\"border:none;\"><a href=\"" . $displayLink . "\">" . $row->datasetName . "</a></td><td style=\"border:none;\">" . $displayTime . "</td></tr>"; // $recentContent .= "<tr><td style=\"border:none;\"><a href=\"".$displayLink."\">".$row->datasetName."</a></td><td style=\"border:none;\">".$displayTime."</td></tr>"; $pos++; } $recentContent .= "</tbody></table>"; //$recentContent .= "<script>$(function(){ $('#viewTable').dataTable(bFilter: false, bInfo: false});</script>"; ?> <div class="panel-full-width panel-row" style="background-color:#EA761E; min-height:450px; padding-top:30px; padding-bottom:30px;"> <div class="panel-middle panel-row"> <div class="container"> <div class="orangeLeftBlock"> <i class="fa fa-clock-o" style="color:#fff; font-size:24px;"></i> <span class="orangeBlockHeader"> Recently added datasets</span> <br/>
function generateThemeData($theme) { $result = ""; $themeResources = getThemeResources($theme); $content = "<table id=\"viewTable\" style=\"border:none;\"><thead style=\"border-top-color:#fff;\"><tr class=\"headerRowStyle\"><th style=\"border:none; min-width:20px;\">#</th><th style=\"border:none;\">DATASET NAME</th><th style=\"border:none;\">SUB THEME</th><th style=\"border:none; min-width:70px;\">FILETYPE</th><th style=\"border:none; min-width:95px;\">DATE ADDED</th></tr></thead><tbody style=\"border-top-color:#DEAB14\">"; $pos = 1; foreach ($themeResources as $row) { $displayType = extractFileType($row->fileType, $row->fileName); $displayTime = makeTimeHumanTime($row->created); $displayLink = createResourceLink($theme, $row->uuid); $subTheme = fetchSubTheme($row->nid); $content .= "<tr><td style=\"border:none; font-weight:bold;\">" . $pos . "</td><td style=\"border:none;\"><a href=\"" . $displayLink . "\">" . $row->datasetName . "</a></td><td style=\"border:none;\">" . $subTheme . "</td><td style=\"border:none;\">" . $displayType . "</td><td style=\"border:none;\">" . $displayTime . "</td></tr>"; $pos++; } $content .= "</tbody></table>"; // force a bootstrap of table functionality $content .= "<script>\$(function(){ \$('#viewTable').dataTable({ \"bPaginate\": true,\"bLengthChange\": false,\"bSort\": true,\"bInfo\": true, \"bAutoWidth\": true, \"iDisplayLength\": 15}); });</script>"; return $content; }