meta/app/views/section_detail.php

41 lines
1.5 KiB
PHP
Raw Normal View History

2012-08-31 16:18:23 -04:00
<p class="breadcrumbs">
<a href="<?= miniMVC\site_url('') ?>">Genres</a> >
2012-09-05 11:46:51 -04:00
<a href="<?= miniMVC\site_url('genres/detail/'.$p['genre_id']) ?>"><?= $p['genre'] ?></a> >
2012-08-31 16:18:23 -04:00
<a href="<?= miniMVC\site_url('category/detail/'.$p['category_id']) ?>"><?= $p['category'] ?></a> >
<?= $section ?>
</p>
2015-06-04 14:30:42 -04:00
<form class="add" action="<?= miniMVC\site_url("section/add_data") ?>" method="post" onsubmit="window.edit_wysiwyg.toggle()">
2012-08-31 16:18:23 -04:00
<fieldset>
<legend>Add Data</legend>
<dl>
<!-- Weird tag wrapping is intentional for display: inline-block -->
<dt><label for="name">Name:</label></dt><dd>
<input type="text" name="name[]" id="section" /></dd>
<dt><label for="val">Value:</label></dt><dd>
<textarea id="input" name="val[]" rows="5" cols="40"></textarea></dd>
2012-08-31 16:18:23 -04:00
<dt><input type="hidden" name="section_id" value="<?= $section_id ?>" /></dt><dd>
<button type="submit" class="save">Save Data</button></dd>
2012-08-31 16:18:23 -04:00
</dl>
</fieldset>
</form>
2015-06-04 14:30:42 -04:00
2012-09-13 19:16:51 -04:00
<h3>Data</h3>
2012-08-31 16:18:23 -04:00
<?php if ( ! empty($sdata)): ?>
2012-09-12 10:36:43 -04:00
<?php foreach($sdata as $d_id => $d): ?>
2012-08-31 16:18:23 -04:00
<?php foreach($d as $k => $v): ?>
2015-06-04 14:30:42 -04:00
<?php $class = (strpos($v, "<ul>") !== FALSE || strpos($v, "<br />") !== FALSE) ? 'multiline' : 'pair' ?>
2012-08-31 16:18:23 -04:00
<dl class="<?= $class ?>">
2012-09-12 10:36:43 -04:00
<dt>
<?= $k ?>
2015-06-04 14:30:42 -04:00
<span class="modify" data-type="data" data-id="<?=$d_id ?>" data-parent="<?= $section_id ?>">
2012-09-12 10:36:43 -04:00
<button class="edit">Edit</button>
<button class="delete">Delete</button>
</span>
</dt>
2012-08-31 16:18:23 -04:00
<dd><?= $v ?></dd>
</dl>
<?php endforeach ?>
<?php endforeach ?>
<?php endif ?>