Initial commit

Working directory listing. Hardcoded sidebar template.
This commit is contained in:
2011-01-16 22:59:18 +00:00
parent ee1707d86e
commit 65c560cdf0
20 changed files with 558 additions and 0 deletions

40
source/pages/list.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
$config = MediaListing_Main::instance()->config();
$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());
?>