diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
commit | eeac2329baab1fdae7cbf6c707ed2ffd8beb4c1b (patch) | |
tree | 511c2fe47f8fbb1ea90e59e7a7a7f5e3530aa9ed /app/Template/action | |
parent | 65e9e5d1bed9f88ecfd43eb2c1e780a7c22c151f (diff) |
Helpers refactoring
Diffstat (limited to 'app/Template/action')
-rw-r--r-- | app/Template/action/event.php | 14 | ||||
-rw-r--r-- | app/Template/action/index.php | 40 | ||||
-rw-r--r-- | app/Template/action/params.php | 48 | ||||
-rw-r--r-- | app/Template/action/remove.php | 6 |
4 files changed, 54 insertions, 54 deletions
diff --git a/app/Template/action/event.php b/app/Template/action/event.php index 67a65c19..7f968a97 100644 --- a/app/Template/action/event.php +++ b/app/Template/action/event.php @@ -3,15 +3,15 @@ </div> <h3><?= t('Choose an event') ?></h3> -<form method="post" action="<?= $this->u('action', 'params', array('project_id' => $project['id'])) ?>"> +<form method="post" action="<?= $this->url->href('action', 'params', array('project_id' => $project['id'])) ?>"> - <?= $this->formCsrf() ?> + <?= $this->form->csrf() ?> - <?= $this->formHidden('project_id', $values) ?> - <?= $this->formHidden('action_name', $values) ?> + <?= $this->form->hidden('project_id', $values) ?> + <?= $this->form->hidden('action_name', $values) ?> - <?= $this->formLabel(t('Event'), 'event_name') ?> - <?= $this->formSelect('event_name', $events, $values) ?><br/> + <?= $this->form->label(t('Event'), 'event_name') ?> + <?= $this->form->select('event_name', $events, $values) ?><br/> <div class="form-help"> <?= t('When the selected event occurs execute the corresponding action.') ?> @@ -20,6 +20,6 @@ <div class="form-actions"> <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= $this->a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/action/index.php b/app/Template/action/index.php index e388fbc9..9e98554c 100644 --- a/app/Template/action/index.php +++ b/app/Template/action/index.php @@ -15,25 +15,25 @@ <?php foreach ($actions as $action): ?> <tr> - <td><?= $this->inList($action['event_name'], $available_events) ?></td> - <td><?= $this->inList($action['action_name'], $available_actions) ?></td> + <td><?= $this->text->in($action['event_name'], $available_events) ?></td> + <td><?= $this->text->in($action['action_name'], $available_actions) ?></td> <td> <ul> <?php foreach ($action['params'] as $param): ?> <li> - <?= $this->inList($param['name'], $available_params) ?> = + <?= $this->text->in($param['name'], $available_params) ?> = <strong> - <?php if ($this->contains($param['name'], 'column_id')): ?> - <?= $this->inList($param['value'], $columns_list) ?> - <?php elseif ($this->contains($param['name'], 'user_id')): ?> - <?= $this->inList($param['value'], $users_list) ?> - <?php elseif ($this->contains($param['name'], 'project_id')): ?> - <?= $this->inList($param['value'], $projects_list) ?> - <?php elseif ($this->contains($param['name'], 'color_id')): ?> - <?= $this->inList($param['value'], $colors_list) ?> - <?php elseif ($this->contains($param['name'], 'category_id')): ?> - <?= $this->inList($param['value'], $categories_list) ?> - <?php elseif ($this->contains($param['name'], 'label')): ?> + <?php if ($this->text->contains($param['name'], 'column_id')): ?> + <?= $this->text->in($param['value'], $columns_list) ?> + <?php elseif ($this->text->contains($param['name'], 'user_id')): ?> + <?= $this->text->in($param['value'], $users_list) ?> + <?php elseif ($this->text->contains($param['name'], 'project_id')): ?> + <?= $this->text->in($param['value'], $projects_list) ?> + <?php elseif ($this->text->contains($param['name'], 'color_id')): ?> + <?= $this->text->in($param['value'], $colors_list) ?> + <?php elseif ($this->text->contains($param['name'], 'category_id')): ?> + <?= $this->text->in($param['value'], $categories_list) ?> + <?php elseif ($this->text->contains($param['name'], 'label')): ?> <?= $this->e($param['value']) ?> <?php endif ?> </strong> @@ -42,7 +42,7 @@ </ul> </td> <td> - <?= $this->a(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?> + <?= $this->url->link(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?> </td> </tr> <?php endforeach ?> @@ -51,12 +51,12 @@ <?php endif ?> <h3><?= t('Add an action') ?></h3> -<form method="post" action="<?= $this->u('action', 'event', array('project_id' => $project['id'])) ?>" class="listing"> - <?= $this->formCsrf() ?> - <?= $this->formHidden('project_id', $values) ?> +<form method="post" action="<?= $this->url->href('action', 'event', array('project_id' => $project['id'])) ?>" class="listing"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('project_id', $values) ?> - <?= $this->formLabel(t('Action'), 'action_name') ?> - <?= $this->formSelect('action_name', $available_actions, $values) ?><br/> + <?= $this->form->label(t('Action'), 'action_name') ?> + <?= $this->form->select('action_name', $available_actions, $values) ?><br/> <div class="form-actions"> <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/> diff --git a/app/Template/action/params.php b/app/Template/action/params.php index 3a5ecb86..685cbcc5 100644 --- a/app/Template/action/params.php +++ b/app/Template/action/params.php @@ -3,34 +3,34 @@ </div> <h3><?= t('Define action parameters') ?></h3> -<form method="post" action="<?= $this->u('action', 'create', array('project_id' => $project['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('action', 'create', array('project_id' => $project['id'])) ?>" autocomplete="off"> - <?= $this->formCsrf() ?> + <?= $this->form->csrf() ?> - <?= $this->formHidden('project_id', $values) ?> - <?= $this->formHidden('event_name', $values) ?> - <?= $this->formHidden('action_name', $values) ?> + <?= $this->form->hidden('project_id', $values) ?> + <?= $this->form->hidden('event_name', $values) ?> + <?= $this->form->hidden('action_name', $values) ?> <?php foreach ($action_params as $param_name => $param_desc): ?> - <?php if ($this->contains($param_name, 'column_id')): ?> - <?= $this->formLabel($param_desc, $param_name) ?> - <?= $this->formSelect('params['.$param_name.']', $columns_list, $values) ?><br/> - <?php elseif ($this->contains($param_name, 'user_id')): ?> - <?= $this->formLabel($param_desc, $param_name) ?> - <?= $this->formSelect('params['.$param_name.']', $users_list, $values) ?><br/> - <?php elseif ($this->contains($param_name, 'project_id')): ?> - <?= $this->formLabel($param_desc, $param_name) ?> - <?= $this->formSelect('params['.$param_name.']', $projects_list, $values) ?><br/> - <?php elseif ($this->contains($param_name, 'color_id')): ?> - <?= $this->formLabel($param_desc, $param_name) ?> - <?= $this->formSelect('params['.$param_name.']', $colors_list, $values) ?><br/> - <?php elseif ($this->contains($param_name, 'category_id')): ?> - <?= $this->formLabel($param_desc, $param_name) ?> - <?= $this->formSelect('params['.$param_name.']', $categories_list, $values) ?><br/> - <?php elseif ($this->contains($param_name, 'label')): ?> - <?= $this->formLabel($param_desc, $param_name) ?> - <?= $this->formText('params['.$param_name.']', $values) ?> + <?php if ($this->text->contains($param_name, 'column_id')): ?> + <?= $this->form->label($param_desc, $param_name) ?> + <?= $this->form->select('params['.$param_name.']', $columns_list, $values) ?><br/> + <?php elseif ($this->text->contains($param_name, 'user_id')): ?> + <?= $this->form->label($param_desc, $param_name) ?> + <?= $this->form->select('params['.$param_name.']', $users_list, $values) ?><br/> + <?php elseif ($this->text->contains($param_name, 'project_id')): ?> + <?= $this->form->label($param_desc, $param_name) ?> + <?= $this->form->select('params['.$param_name.']', $projects_list, $values) ?><br/> + <?php elseif ($this->text->contains($param_name, 'color_id')): ?> + <?= $this->form->label($param_desc, $param_name) ?> + <?= $this->form->select('params['.$param_name.']', $colors_list, $values) ?><br/> + <?php elseif ($this->text->contains($param_name, 'category_id')): ?> + <?= $this->form->label($param_desc, $param_name) ?> + <?= $this->form->select('params['.$param_name.']', $categories_list, $values) ?><br/> + <?php elseif ($this->text->contains($param_name, 'label')): ?> + <?= $this->form->label($param_desc, $param_name) ?> + <?= $this->form->text('params['.$param_name.']', $values) ?> <?php endif ?> <?php endforeach ?> @@ -38,6 +38,6 @@ <div class="form-actions"> <input type="submit" value="<?= t('Save this action') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= $this->a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/action/remove.php b/app/Template/action/remove.php index 672c08a7..c8d4dfe4 100644 --- a/app/Template/action/remove.php +++ b/app/Template/action/remove.php @@ -4,12 +4,12 @@ <div class="confirm"> <p class="alert alert-info"> - <?= t('Do you really want to remove this action: "%s"?', $this->inList($action['event_name'], $available_events).'/'.$this->inList($action['action_name'], $available_actions)) ?> + <?= t('Do you really want to remove this action: "%s"?', $this->text->in($action['event_name'], $available_events).'/'.$this->text->in($action['action_name'], $available_actions)) ?> </p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'action', 'remove', array('project_id' => $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?> + <?= $this->url->link(t('Yes'), 'action', 'remove', array('project_id' => $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> </div> </div>
\ No newline at end of file |