warn about remote fork config in setup and help
[phorkie.git] / www / new.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 $reqWritePermissions = true;
14 require_once 'www-header.php';
15
16 $repopo = new Repository_Post();
17 if ($repopo->process($_POST, $_SESSION)) {
18     redirect($repopo->repo->getLink('display', null, true));
19 }
20
21 $phork = array(
22     '1' => new File(null, null)
23 );
24 $db = new Database();
25 render(
26     'new',
27     array(
28         'files'       => $phork,
29         'description' => '',
30         'htmlhelper'  => new HtmlHelper(),
31         'recents'     => $db->getSearch()->listAll(0, 5, 'modate', 'desc'),
32         'dh'          => new \Date_HumanDiff(),
33     )
34 );
35 ?>