Reorganised code layout
Separated class library and web interface code Added a common config/database config to be referenced by all subprojects Fixed previous commit
This commit is contained in:
35
webui/pages/rips/setup-rip.php
Normal file
35
webui/pages/rips/setup-rip.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
$config = $main->config();
|
||||
|
||||
// Grab the name of this source
|
||||
$encoded_filename = null;
|
||||
if ($req->get('submit')) {
|
||||
$encoded_filename = HandBrakeCluster_Main::issetelse($_POST['id'], HandBrakeCluster_Exception_InvalidParameters);
|
||||
|
||||
// Create the jobs from the request
|
||||
$jobs = HandBrakeCluster_Job::fromPostRequest($_POST['id'], $_POST['rip-options'], $_POST['rips']);
|
||||
|
||||
// Spawn the background client process to run all the jobs
|
||||
HandBrakeCluster_Job::runAllJobs();
|
||||
|
||||
HandBrakeCluster_Page::redirect('rips/setup-rip/queued');
|
||||
|
||||
} elseif ($req->get('queued')) {
|
||||
$this->smarty->assign('rips_submitted', true);
|
||||
|
||||
} else {
|
||||
$this->smarty->assign('rips_submitted', false);
|
||||
$encoded_filename = $req->get('id', HandBrakeCluster_Exception_InvalidParameters);
|
||||
|
||||
$source = HandBrakeCluster_Rips_Source::loadEncoded($encoded_filename);
|
||||
|
||||
$this->smarty->assign('source', $source);
|
||||
$this->smarty->assign('titles', $source->titles());
|
||||
$this->smarty->assign('longest_title', $source->longestTitle());
|
||||
$this->smarty->assign('default_output_directory', $config->get('rips.default.output_directory'));
|
||||
}
|
||||
|
||||
?>
|
||||
12
webui/pages/rips/source-details.php
Normal file
12
webui/pages/rips/source-details.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
$config = $main->config();
|
||||
|
||||
$source = HandBrakeCluster_Rips_Source::loadEncoded($req->get('id', HandBrakeCluster_Exception_InvalidParameters));
|
||||
|
||||
$this->smarty->assign('source', $source);
|
||||
$this->smarty->assign('titles', $source->titles());
|
||||
|
||||
?>
|
||||
17
webui/pages/rips/sources.php
Normal file
17
webui/pages/rips/sources.php
Normal 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->filename()] = HandBrakeCluster_Rips_Source::isCached($source->filename());
|
||||
}
|
||||
|
||||
$this->smarty->assign('sources', $sources);
|
||||
$this->smarty->assign('sources_cached', $sources_cached);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user