Initial commit
Working directory listing. Hardcoded sidebar template.
This commit is contained in:
37
public/index.php
Normal file
37
public/index.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
require_once('../private/config.php');
|
||||
require_once(SihnonFramework_Lib . 'SihnonFramework/Main.class.php');
|
||||
|
||||
require 'smarty/Smarty.class.php';
|
||||
|
||||
try {
|
||||
Sihnon_Main::registerAutoloadClasses('SihnonFramework', SihnonFramework_Lib, 'MediaListing', Sihnon_Main::makeAbsolutePath('../source/lib/'));
|
||||
$main = MediaListing_Main::instance();
|
||||
|
||||
$smarty = new Smarty();
|
||||
$smarty->template_dir = '../source/templates';
|
||||
$smarty->compile_dir = '../private/tmp/templates';
|
||||
$smarty->cache_dir = '../private/tmp/cache';
|
||||
$smarty->config_dir = '../private/config';
|
||||
$smarty->register_modifier('formatDuration', array('MediaListing_Main', 'formatDuration'));
|
||||
$smarty->register_modifier('formatFilesize', array('MediaListing_Main', 'formatFilesize'));
|
||||
$smarty->assign('version', '0.1');
|
||||
$smarty->assign('base_uri', $main->baseUri());
|
||||
|
||||
$request = new MediaListing_RequestParser(isset($_GET['l']) ? $_GET['l'] : '');
|
||||
$page = new MediaListing_Page($smarty, $request);
|
||||
if ($page->evaluate(
|
||||
array(
|
||||
'smarty' => $smarty,
|
||||
'request' => $request,
|
||||
)
|
||||
)) {
|
||||
$smarty->display('index.tpl');
|
||||
}
|
||||
|
||||
} catch (Sihnon_Exception $e) {
|
||||
die("Uncaught " . get_class($e) . ": " . $e->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user