hide additional fields and add button to show them
[phorkie.git] / www / index.php
1 <?php
2 namespace phorkie;
3 /**
4  * Show paste creation form
5  *
6  * Elements:
7  * - description
8  * - file name (default: default.php)
9  * - content
10  *
11  * Creates and redirects to display page
12  */
13 require_once 'www-header.php';
14
15 $repopo = new Repository_Post();
16 if ($repopo->process($_POST)) {
17     redirect($repopo->repo->getLink('display'));
18 }
19
20 $phork = array(
21     '1' => new File(null, null)
22 );
23 $db = new Database();
24 render(
25     'index',
26     array(
27         'files'       => $phork,
28         'description' => '',
29         'htmlhelper'  => new HtmlHelper(),
30         'recents'     => $db->getSearch()->listAll(0, 5, 'crdate', 'desc'),
31         'dh'          => new \Date_HumanDiff(),
32     )
33 );
34 ?>