meta/app/views/category_detail.php

48 lines
1.6 KiB
PHP
Raw Normal View History

2012-08-31 16:18:23 -04:00
<p class="breadcrumbs">
2015-06-04 14:30:42 -04:00
<a href="<?= miniMVC\site_url('') ?>">Genres</a> > <a href="<?= miniMVC\site_url('genre/detail/'.$genre['id']) ?>"><?= $genre['genre'] ?></a> > <?= $category ?>
2012-08-31 16:18:23 -04:00
</p>
2012-09-13 19:16:51 -04:00
<form class="add" action="<?= miniMVC\site_url("category/add_section") ?>" method="post">
<fieldset>
2012-08-31 16:18:23 -04:00
<legend>Add Section</legend>
<dl>
<!-- Weird tag wrapping is intentional for display: inline-block -->
<dt><label for="section">Section name:</label></dt><dd>
<input type="text" name="section" id="section" /></dd>
<dt><input type="hidden" name="category_id" value="<?= $category_id ?>" /></dt><dd>
<button type="submit" class="save">Add Section</button></dd>
</dl>
</fieldset>
2012-08-31 16:18:23 -04:00
</form>
2012-09-13 19:16:51 -04:00
<script src="<?= SCRIPT_PATH.'wysiwyg'; ?>"></script>
<h3>Sections</h3>
2012-08-31 16:18:23 -04:00
<ul class="list">
<?php foreach($sections as $id => $section): ?>
<?php if (is_array($section)) list($section, $d) = $section ?>
<li>
<h4><a href="<?= miniMVC\site_url("section/detail/{$id}") ?>"><?= $section ?></a></h4>
2015-06-04 14:30:42 -04:00
<span class="modify" data-id="<?= $id ?>" data-type="section" data-parent="<?= $category_id ?>">
<button class="edit">Edit</button>
<button class="delete">Delete</button>
</span>
2012-08-31 16:18:23 -04:00
<?php if ( ! empty($d)): ?>
2012-09-13 19:16:51 -04:00
<?php foreach($d as $did => $dd): ?>
2015-06-04 14:30:42 -04:00
<?php foreach($dd as $k => $v): ?>
<?php $class = (strpos($v, "<ul>") !== FALSE || strpos($v, "<br />") !== FALSE) ? 'multiline' : 'pair' ?>
<dl class="<?= $class ?>">
<dt><?= $k ?></dt>
<dd>
<?= $v ?>
</dd>
</dl>
<?php endforeach ?>
2012-09-13 19:16:51 -04:00
<?php endforeach ?>
2012-08-31 16:18:23 -04:00
<?php endif ?>
<?php $d = array(); // Don't let data linger ?>
</li>
<?php endforeach ?>
</ul>