student numbers
[ssproject1617.git] / testcms-final-anon / system / admin / theme / pages / edit.php
1 <h1>Editing &ldquo;<?php echo truncate($page->name, 4); ?>&rdquo;</h1>
2
3 <?php echo Notifications::read(); ?>
4
5 <section class="content">
6
7 <form method="post" action="<?php echo Url::current(); ?>" novalidate>
8 <fieldset>
9 <p>
10 <label for="name">Name:</label>
11 <input id="name" name="name" value="<?php echo Input::post('name', $page->name); ?>">
12
13 <em>The name of your page. This gets shown in the navigation.</em>
14 </p>
15
16 <p>
17 <label>Title:</label>
18 <input id="title" name="title" value="<?php echo Input::post('title', $page->title); ?>">
19
20 <em>The title of your page, which gets shown in the <code>&lt;title&gt;</code>.</em>
21 </p>
22
23 <p>
24 <label for="slug">Slug:</label>
25 <input id="slug" autocomplete="off" name="slug" value="<?php echo Input::post('slug', $page->slug); ?>">
26
27 <em>The slug for your page (<code id="output">slug</code>).</em>
28 </p>
29
30 <p>
31 <label for="content">Content:</label>
32 <textarea id="content" name="content"><?php echo Input::post('content', $page->content); ?></textarea>
33
34 <em>Your page's content. Accepts valid HTML.</em>
35 </p>
36
37 <p>
38 <label>Status:</label>
39 <select id="status" name="status">
40 <?php foreach(array('draft', 'archived', 'published') as $status): ?>
41 <?php $selected = (Input::post('status', $page->status) == $status) ? 'selected' : ''; ?>
42 <option value="<?php echo $status; ?>"<?php echo $selected; ?>>
43 <?php echo ucwords($status); ?>
44 </option>
45 <?php endforeach; ?>
46 </select>
47
48 <em>Do you want your page to be live (published), pending (draft), or hidden (archived)?</em>
49 </p>
50 </fieldset>
51
52 <p class="buttons">
53
54 <button name="save" type="submit">Save</button>
55 <?php
56 // Dont delete our posts page or home page
57 if(in_array($page->id, array(Config::get('metadata.home_page'), Config::get('metadata.posts_page'))) === false): ?>
58 <button name="delete" type="submit">Delete</button>
59 <?php endif; ?>
60
61 <a href="<?php echo admin_url('pages'); ?>">Return to pages</a>
62 </p>
63 </form>
64
65 </section>
66
67 <aside id="sidebar">
68 <h2>Editing</h2>
69 <em>Some useful links.</em>
70 <ul>
71 <li><a href="<?php echo Url::make($page->slug); ?>">View this page on your site</a></li>
72 </ul>
73 </aside>
74
75 <script src="//ajax.googleapis.com/ajax/libs/mootools/1.4.1/mootools-yui-compressed.js"></script>
76 <script>window.MooTools || document.write('<script src="<?php echo theme_url('assets/js/mootools.js'); ?>"><\/script>');</script>
77 <script src="<?php echo theme_url('assets/js/helpers.js'); ?>"></script>
78 <script>
79 (function() {
80 var slug = $('slug'), output = $('output');
81
82 // call the function to init the input text
83 formatSlug(slug, output);
84
85 // bind to input
86 slug.addEvent('keyup', function() {formatSlug(slug, output)});
87 }());
88 </script>
89