This repository has been archived by the owner on Aug 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added dashboard, new icons, and fixed some CSS
- Loading branch information
Showing
34 changed files
with
294 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
<?php | ||
require_once("TinyAjaxBehavior.php"); | ||
require_once("vars.php"); | ||
require_once("includes/dvrui_hdhrjson.php"); | ||
require_once("includes/dvrui_rules.php"); | ||
require_once("includes/dvrui_recordings.php"); | ||
require_once("includes/dvrui_upcoming.php"); | ||
|
||
|
||
function openDashboardPage() { | ||
// prep | ||
ob_start(); | ||
$tab = new TinyAjaxBehavior(); | ||
|
||
//create output | ||
$htmlStr = buildDashboard(); | ||
|
||
//get data | ||
$result = ob_get_contents(); | ||
ob_end_clean(); | ||
|
||
//display | ||
$tab->add(TabInnerHtml::getBehavior("dashboard_box", $htmlStr)); | ||
|
||
return $tab->getString(); | ||
} | ||
|
||
function buildDashboard() { | ||
$dashboard = ''; | ||
|
||
$hdhr = new DVRUI_HDHRjson(); | ||
$hdhrRules = new DVRUI_Rules($hdhr); | ||
$hdhrRules->processAllRules(); | ||
$hdhrRecordings = new DVRUI_Recordings($hdhr); | ||
$hdhrRecordings->processAllRecordings($hdhr); | ||
$hdhrRecordings->sortRecordings('DD'); | ||
|
||
|
||
$hardware = file_get_contents('style/dashboard_hardware.html'); | ||
$hardware = str_replace('<!-- dvrui_hdhrlist_data -->',getDashboardHardware($hdhr),$hardware); | ||
$recent = file_get_contents('style/dashboard_recent.html'); | ||
$recent = str_replace('<!-- dvr_recent_recordings_list -->',getRecentRecordings($hdhr,$hdhrRecordings),$recent); | ||
$soon = file_get_contents('style/dashboard_upcoming.html'); | ||
$soon = str_replace('<!-- dvr_soon_list -->',getSoon($hdhr,$hdhrRecordings,$hdhrRules),$soon); | ||
|
||
$dashboard .= $hardware; | ||
$dashboard .= $recent; | ||
$dashboard .= $soon; | ||
|
||
return $dashboard; | ||
} | ||
|
||
function getDashboardHardware($hdhr) { | ||
// Discover HDHR Devices | ||
$devices = $hdhr->device_count(); | ||
$hdhr_data = ''; | ||
for ($i=0; $i < $devices; $i++) { | ||
$hdhrEntry = file_get_contents('style/hdhrlist_entry.html'); | ||
$hdhr_device_data = "<a href=" . $hdhr->get_device_baseurl($i) . ">" . $hdhr->get_device_id($i) . "</a>"; | ||
$hdhr_lineup_data = "<a href=" . $hdhr->get_device_lineup($i) . ">" . $hdhr->get_device_channels($i) . " Channels</a>"; | ||
$hdhrEntry = str_replace('<!--hdhr_device-->',$hdhr_device_data,$hdhrEntry); | ||
$hdhrEntry = str_replace('<!--hdhr_channels-->',$hdhr_lineup_data,$hdhrEntry); | ||
$hdhrEntry = str_replace('<!--hdhr_model-->',$hdhr->get_device_model($i),$hdhrEntry); | ||
$hdhrEntry = str_replace('<!--hdhr_tuners-->',$hdhr->get_device_tuners($i) . ' tuners',$hdhrEntry); | ||
$hdhrEntry = str_replace('<!--hdhr_firmware-->',$hdhr->get_device_firmware($i),$hdhrEntry); | ||
$hdhrEntry = str_replace('<!--hdhr_legacy-->',$hdhr->get_device_legacy($i),$hdhrEntry); | ||
$hdhrEntry = str_replace('<!--hdhr_image-->',$hdhr->get_device_image($i),$hdhrEntry); | ||
$hdhr_data .= $hdhrEntry ; | ||
} | ||
$engines = $hdhr->engine_count(); | ||
for ($i=0; $i < $engines; $i++) { | ||
$engineEntry = file_get_contents('style/recordenginelist_entry.html'); | ||
$engineEntry = str_replace('<!--rec_image-->',$hdhr->get_engine_image($i),$engineEntry); | ||
$engineEntry = str_replace('<!--rec_name-->',$hdhr->get_engine_name($i),$engineEntry); | ||
$engineEntry = str_replace('<!--rec_version-->',$hdhr->get_engine_version($i),$engineEntry); | ||
$engineEntry = str_replace('<!--rec_freespace-->',$hdhr->get_engine_space($i),$engineEntry); | ||
$engine_discover_data = "<a href=" . $hdhr->get_engine_discoverURL($i) . ">" . $hdhr->get_engine_local_ip($i) . "</a>"; | ||
$engineEntry = str_replace('<!--rec_localip-->',$engine_discover_data,$engineEntry); | ||
$engine_storage_data = "<a href=" . $hdhr->get_engine_storage_url($i) . ">" . $hdhr->get_engine_storage_id($i) . "</a>"; | ||
$engineEntry = str_replace('<!--rec_storageid-->',$engine_storage_data,$engineEntry); | ||
$hdhr_data .= $engineEntry; | ||
} | ||
return $hdhr_data; | ||
} | ||
|
||
function getRecentRecordings($hdhr, $hdhrRecordings) { | ||
|
||
$numRecordings = $hdhrRecordings->getRecordingCount(); | ||
if ($numRecordings > 10) { | ||
$numRecordings = 10; | ||
} | ||
|
||
$recordingsData = ''; | ||
for ($i=0; $i < $numRecordings; $i++) { | ||
$recordingsEntry = file_get_contents('style/recordings_entry.html'); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_id -->',$hdhrRecordings->getRecordingID($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_series_id -->',$hdhrRecordings->getSeriesID($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_image -->',$hdhrRecordings->getRecordingImage($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_episode -->',$hdhrRecordings->getEpisodeNumber($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_show -->',$hdhrRecordings->getEpisodeTitle($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_title -->',$hdhrRecordings->getTitle($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_play -->',$hdhrRecordings->get_PlayURL($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_recstart -->',$hdhrRecordings->getRecordStartTime($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_start -->',$hdhrRecordings->getStartTime($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_originaldate -->',$hdhrRecordings->getOriginalAirDate($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_repeat -->',$hdhrRecordings->isRepeat($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_chname -->',$hdhrRecordings->getChannelName($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_chnumber -->',$hdhrRecordings->getChannelNumber($i),$recordingsEntry); | ||
$recordingsEntry = str_replace('<!-- dvr_recordings_chaffiliate -->',$hdhrRecordings->getChannelAffiliate($i),$recordingsEntry); | ||
$recordingsData .= $recordingsEntry; | ||
} | ||
|
||
return $recordingsData; | ||
} | ||
|
||
function getSoon($hdhr, $hdhrRecordings, $hdhrRules) { | ||
$soonStr = ''; | ||
|
||
$upcoming = new DVRUI_Upcoming($hdhr,$hdhrRecordings); | ||
$upcoming->initByRules($hdhrRules); | ||
$numRules = $upcoming->getSeriesCount(); | ||
for ($i=0; $i < $numRules; $i++) { | ||
$upcoming->processNext($i); | ||
} | ||
|
||
$upcoming->sortUpcomingByDate(); | ||
$numShows = $upcoming->getUpcomingCount(); | ||
if ($numShows > 10) { | ||
$numShows = 10; | ||
} | ||
|
||
for ($i=0;$i < $numShows;$i++) { | ||
$entry = file_get_contents('style/upcoming_entry.html'); | ||
$entry = str_replace('<!-- dvr_upcoming_title -->',$upcoming->getTitle($i),$entry); | ||
$entry = str_replace('<!-- dvr_upcoming_episode -->',$upcoming->getEpNum($i) . ' : ' . $upcoming->getEpTitle($i),$entry); | ||
$entry = str_replace('<!-- dvr_upcoming_original_airdate -->',$upcoming->getEpOriginalAirDate($i),$entry); | ||
$entry = str_replace('<!-- dvr_upcoming_image -->',$upcoming->getEpImg($i),$entry); | ||
$entry = str_replace('<!-- dvr_upcoming_start -->',$upcoming->getEpStart($i),$entry); | ||
$entry = str_replace('<!-- dvr_upcoming_stop -->',$upcoming->getEpEnd($i),$entry); | ||
$entry = str_replace('<!-- dvr_upcoming_channels -->',$upcoming->getEpChannelNum($i),$entry); | ||
$entry = str_replace('<!-- dvr_upcoming_channel_name -->',$upcoming->getEpChannelName($i),$entry); | ||
$soonStr .= $entry; | ||
} | ||
|
||
|
||
return $soonStr; | ||
} | ||
|
||
?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div id="dashboard_content" class="dashboard_content"> | ||
<div id='dashboard_box'><!-- dvrui_dashboard_data --></div> | ||
<BR/> | ||
</div> |
Oops, something went wrong.