Move webui code under subdir
This commit is contained in:
3
source/webui/pages/errors/404.php
Normal file
3
source/webui/pages/errors/404.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
?>
|
||||
10
source/webui/pages/errors/unhandled-exception.php
Normal file
10
source/webui/pages/errors/unhandled-exception.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
$main = MediaListing_Main::instance();
|
||||
$config = $main->config();
|
||||
|
||||
$this->smarty->assign('display_exceptions', $config->get('debug.display_exceptions'));
|
||||
$this->smarty->assign('exception', $exception);
|
||||
$this->smarty->assign('exception_type', get_class($exception));
|
||||
|
||||
?>
|
||||
18
source/webui/pages/home.php
Normal file
18
source/webui/pages/home.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
$main = MediaListing_Main::instance();
|
||||
$config = $main->config();
|
||||
$smarty = $main->smarty();
|
||||
|
||||
$source_paths = $config->get('sources');
|
||||
$sources = array();
|
||||
|
||||
foreach ($source_paths as $source_path) {
|
||||
list($name, $path) = explode(':', $source_path);
|
||||
|
||||
$sources[] = new MediaListing_Source($name, $path, false);
|
||||
}
|
||||
|
||||
$smarty->assign('sources', $sources);
|
||||
|
||||
?>
|
||||
44
source/webui/pages/list.php
Normal file
44
source/webui/pages/list.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
$main = MediaListing_Main::instance();
|
||||
$config = $main->config();
|
||||
$request = $main->request();
|
||||
$smarty = $main->smarty();
|
||||
|
||||
$source_paths = $config->get('sources');
|
||||
$sources = array();
|
||||
|
||||
foreach ($source_paths as $source_path) {
|
||||
list($name, $path) = explode(':', $source_path);
|
||||
|
||||
$sources[$name] = new MediaListing_Source($name, $path);
|
||||
}
|
||||
|
||||
$source_name = $request->get('source');
|
||||
$source = $sources[$source_name];
|
||||
$source_path = $request->getRemainder('source', true);
|
||||
$directory = $sources[$source_name]->root();
|
||||
foreach ($source_path as $subdir) {
|
||||
$directory = $directory->file($subdir);
|
||||
}
|
||||
|
||||
$path = implode('/', $source_path);
|
||||
if ($path) {
|
||||
$path .= '/';
|
||||
}
|
||||
|
||||
$parent_source_path = $source_path;
|
||||
array_pop($parent_source_path);
|
||||
$parent_path = implode('/', $parent_source_path);
|
||||
if ($parent_path) {
|
||||
$parent_path .= '/';
|
||||
}
|
||||
|
||||
$smarty->assign('parent', $directory->parent());
|
||||
$smarty->assign('parent_path', $parent_path);
|
||||
$smarty->assign('source', $source);
|
||||
$smarty->assign('path', $path);
|
||||
$smarty->assign('root', $directory);
|
||||
$smarty->assign('files', $directory->files());
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user