Renamed browse subdir to rips, and fixed links

This commit is contained in:
2010-03-22 19:59:28 +00:00
parent a5330c67bc
commit 71537ef20b
5 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
<?php
$main = HandBrakeCluster_Main::instance();
$req = $main->request();
$config = $main->config();
// Grab the name of this source
$source_id = $req->get('id');
$source_path = base64_decode(str_replace('-', '/', $source_id));
$real_source_path = realpath($source_path);
// Ensure the source is a valid directory, and lies below the configured source_dir
if (!is_dir($source_path)) {
return;
}
$real_source_dir = realpath($config->get('rips.source_dir'));
if (substr($real_source_path, 0, strlen($real_source_dir)) != $real_source_dir) {
return;
}
$source = HandBrakeCluster_Rips_Source::load($source_path);
$this->smarty->assign('source_path', $source_path);
$this->smarty->assign('source', $source);
$this->smarty->assign('titles', $source->titles());
?>

17
pages/rips/sources.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
$main = HandBrakeCluster_Main::instance();
$config = $main->config();
$lister = new HandBrakeCluster_Rips_SourceLister($config->get('rips.source_dir'));
$sources = $lister->sources();
$sources_cached = array();
foreach ($sources as $source) {
$sources_cached[$source] = HandBrakeCluster_Rips_Source::isCached($source);
}
$this->smarty->assign('sources', $sources);
$this->smarty->assign('sources_cached', $sources_cached);
?>