<?php cx_template_base('base'); ?>

<h2>Posts</h2>
<table>
<?php foreach (cx_posts_get(include_drafts: true) as $post): ?>
<tr>
 <td class="fill"><a href="<?= cx_url_admin('/posts/edit?id=' . $post->id); ?>"><?= $post->title ?></a></td>
 <td class="hug"><a href="<?= cx_url_admin('/posts/edit?id=' . $post->id); ?>">Edit</a></td>
 <td class="hug"><a href="<?= cx_url_admin('/posts/delete?id=' . $post->id); ?>">Delete</a></td>
</tr>
<?php endforeach; ?>
</table>

<h2>Pages</h2>
<table>
<?php foreach (cx_pages_get(navigation_only: false, include_drafts: true) as $post): ?>
<tr>
 <td class="fill"><a href="<?= cx_url_admin('/posts/edit?id=' . $post->id); ?>"><?= $post->title ?></a></td>
 <td class="hug"><a href="<?= cx_url_admin('/posts/edit?id=' . $post->id); ?>">Edit</a></td>
 <td class="hug"><a href="<?= cx_url_admin('/posts/delete?id=' . $post->id); ?>">Delete</a></td>
</tr>
<?php endforeach; ?>
</table>

<h2>Images</h2>
<table>
<?php foreach (cx_images_get() as $image): ?>
<tr>
 <td class="fill"><a href="<?= $image->url ?>"><?= $image->url ?></a></td>
 <td class="hug"><a href="<?= cx_url_admin('/images/edit?id=' . $image->id); ?>">Edit</a></td>
 <td class="hug"><a href="<?= cx_url_admin('/images/delete?id=' . $image->id); ?>">Delete</a></td>
</tr>
<?php endforeach; ?>
</table>
