diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2011-06-02 17:20:54 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net ; true> | 2011-06-02 17:20:54 -0700 |
commit | 0720091ca73b9714aab2b38c3682c15a0cbd4533 (patch) | |
tree | 0d77e48eb52d3f39123659550976c5999effddff /htdocs/moderate/pages/index.php | |
parent | 1800a1e9022a9f4316e0d57a650faed9da0e8df4 (diff) |
Added pages
Diffstat (limited to 'htdocs/moderate/pages/index.php')
-rw-r--r-- | htdocs/moderate/pages/index.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/htdocs/moderate/pages/index.php b/htdocs/moderate/pages/index.php new file mode 100644 index 0000000..d6ffd87 --- /dev/null +++ b/htdocs/moderate/pages/index.php @@ -0,0 +1,52 @@ +<?php + +/* Foursquare Community Site + * + * Copyright (C) 2011 Foursquare Church. + * + * Developers: Jesse Morgan <jmorgan@foursquarestaff.com> + * + */ + +require_once('../../src/base.inc.php'); + +// Verify User is admin +if (!$_SESSION['currentUser']->isAdmin()) { + header('Location: ' . buildUrl('moderate/')); + exit; +} + +$error = ''; + +require_once('../src/header.inc.php'); + +echo "<h3>Pages</h3>"; + +echo "<p><a class=\"bigbutton\" href=\"editor.php\">Create Page</a></p>"; + +$pi = new PageIterator(); +$pi->query(); + +if ($pi->valid()) { + echo "<div class=\"userrow header\">" + . "<span class=\"name\">Title</span>" + . " <span class=\"actions\">Actions</span></div>"; + + foreach ($pi as $page) { + printf("<div class=\"userrow\">" + . "<span class=\"name\"><a href=\"%s.html\">%s</a></span>" + . " <span class=\"actions\">" + . " <a class=\"smallbutton\" href=\"editor.php?id=%s\">edit</a>" + . " <a class=\"smallbutton\" href=\"delete.php?id=%s\">delete</a></span></div>", + buildUrl('page/' . $page->getURL()), $page->getTitle(), + $page->getId(), $page->getId() + ); + } + +} else { + echo "<p>There are no pages to edit. Click the button above to create one.</p>"; +} + +require_once('../src/footer.inc.php'); + +?> |