diff options
Diffstat (limited to 'app/Template/link')
-rw-r--r-- | app/Template/link/create.php | 18 | ||||
-rw-r--r-- | app/Template/link/edit.php | 21 | ||||
-rw-r--r-- | app/Template/link/index.php | 33 | ||||
-rw-r--r-- | app/Template/link/remove.php | 15 |
4 files changed, 87 insertions, 0 deletions
diff --git a/app/Template/link/create.php b/app/Template/link/create.php new file mode 100644 index 00000000..12589574 --- /dev/null +++ b/app/Template/link/create.php @@ -0,0 +1,18 @@ +<div class="page-header"> + <h2><?= t('Add a new link') ?></h2> +</div> + +<form action="<?= $this->u('link', 'save') ?>" method="post" autocomplete="off"> + + <?= $this->formCsrf() ?> + + <?= $this->formLabel(t('Label'), 'label') ?> + <?= $this->formText('label', $values, $errors, array('required')) ?> + + <?= $this->formLabel(t('Opposite label'), 'opposite_label') ?> + <?= $this->formText('opposite_label', $values, $errors) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/link/edit.php b/app/Template/link/edit.php new file mode 100644 index 00000000..d9ce280c --- /dev/null +++ b/app/Template/link/edit.php @@ -0,0 +1,21 @@ +<div class="page-header"> + <h2><?= t('Link modification') ?></h2> +</div> + +<form action="<?= $this->u('link', 'update', array('link_id' => $link['id'])) ?>" method="post" autocomplete="off"> + + <?= $this->formCsrf() ?> + <?= $this->formHidden('id', $values) ?> + + <?= $this->formLabel(t('Label'), 'label') ?> + <?= $this->formText('label', $values, $errors, array('required')) ?> + + <?= $this->formLabel(t('Opposite label'), 'opposite_id') ?> + <?= $this->formSelect('opposite_id', $labels, $values, $errors) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= $this->a(t('cancel'), 'link', 'index') ?> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/link/index.php b/app/Template/link/index.php new file mode 100644 index 00000000..90d1c357 --- /dev/null +++ b/app/Template/link/index.php @@ -0,0 +1,33 @@ +<div class="page-header"> + <h2><?= t('Link labels') ?></h2> +</div> +<?php if (! empty($links)): ?> +<table> + <tr> + <th class="column-70"><?= t('Link labels') ?></th> + <th><?= t('Actions') ?></th> + </tr> + <?php foreach ($links as $link): ?> + <tr> + <td> + <strong><?= t($link['label']) ?></strong> + + <?php if (! empty($link['opposite_label'])): ?> + | <?= t($link['opposite_label']) ?> + <?php endif ?> + </td> + <td> + <ul> + <?= $this->a(t('Edit'), 'link', 'edit', array('link_id' => $link['id'])) ?> + <?= t('or') ?> + <?= $this->a(t('Remove'), 'link', 'confirm', array('link_id' => $link['id'])) ?> + </ul> + </td> + </tr> + <?php endforeach ?> +</table> +<?php else: ?> + <?= t('There is no link.') ?> +<?php endif ?> + +<?= $this->render('link/create', array('values' => $values, 'errors' => $errors)) ?>
\ No newline at end of file diff --git a/app/Template/link/remove.php b/app/Template/link/remove.php new file mode 100644 index 00000000..a802feb0 --- /dev/null +++ b/app/Template/link/remove.php @@ -0,0 +1,15 @@ +<div class="page-header"> + <h2><?= t('Remove a link') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this link: "%s"?', $link['label']) ?> + </p> + + <div class="form-actions"> + <?= $this->a(t('Yes'), 'link', 'remove', array('link_id' => $link['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->a(t('cancel'), 'link', 'index') ?> + </div> +</div>
\ No newline at end of file |