function getLatestHDHRStatus() { $hdhr = DVRUI_Vars::DVR_qpkgPath . '/' . DVRUI_Vars::DVR_bin; $DVRBin = new DVRUI_HDHRbintools($hdhr); $statusmsg = $DVRBin->get_DVR_status(); $lastline = ''; $configFile = new DVRUI_Engine_Config(); $logList = new DVRUI_Engine_LogList($configFile->getRecordPath()); $logfile = $logList->getNewestLogFile(); if (file_exists($logfile)) { $lines = file($logfile); $linecount = count($lines); $lastline = $lines[$linecount - 1]; } $htmlstr = preg_replace('/\\s+/', ' ', trim($statusmsg . ' | ' . $lastline)); return $htmlstr; }
$ajax->exportFunction("openServerPage", ""); $ajax->exportFunction("deleteRecordingByID", "id, rerecord"); /* GO */ // error_log( "Enable Ajax" ); $ajax->process(); // Process our callback // Apply default Theme */ // error_log( "Generate CSS if needed" ); applyDefaultTheme(); // Prep data for the page // error_log( "Get latest Status" ); $statusmsg = getLatestHDHRStatus(); // Get HDHR Version // error_log( "Get HDHR DVR version" ); $hdhr = DVRUI_Vars::DVR_qpkgPath . '/' . DVRUI_Vars::DVR_bin; $DVRBin = new DVRUI_HDHRbintools($hdhr); $DVRBinVersion = $DVRBin->get_DVR_version(); //Build navigation menu for pages // error_log( "Build Navigation Pages" ); // TODO: finish new Recordings page // $pageTitles = array('Server', 'HDHRs', 'Logs', 'Recordings', 'Recordings2'); // $pageNames = array('server_page', 'hdhr_page', 'log_page', 'recordings_page', 'newrec_page'); $pageTitles = array('Server', 'HDHRs', 'Logs', 'Recordings'); $pageNames = array('server_page', 'hdhr_page', 'log_page', 'recordings_page'); $menu_data = file_get_contents('style/pagemenu.html'); $menuEntries = ''; for ($i = 0; $i < count($pageNames); $i++) { $menuEntry = str_replace('<!-- dvrui_menu_pagename-->', $pageNames[$i], file_get_contents('style/pagemenu_entry.html')); $menuEntry = str_replace('<!-- dvrui_menu_pagetitle-->', $pageTitles[$i], $menuEntry); $menuEntries .= $menuEntry; }