add cms, add todo
[ssproject1617.git] / testcms-final-anon / system / admin / controllers / metadata.php
1 <?php defined('IN_CMS') or die('No direct access allowed.');
2
3 class Metadata_controller {
4
5 public function __construct() {
6 $this->admin_url = Config::get('application.admin_folder');
7 }
8
9 public function index() {
10 if(Input::method() == 'POST') {
11 if(Metadata::update()) {
12 return Response::redirect($this->admin_url . '/metadata');
13 }
14 }
15
16 // provide a list to set for our home page and posts page
17 $pages = Pages::list_all(array('status' => 'published'));
18
19 // list valid themes
20 $themes = Themes::list_all();
21
22 Template::render('metadata/index', array(
23 'pages' => $pages,
24 'themes' => $themes,
25 'metadata' => (object) Config::get('metadata')
26 ));
27 }
28
29 }