Skip to content

Can Task Navigation be Added? #26

Answered by creecros
aljawaid asked this question in Q&A
Discussion options

You must be logged in to vote

so as an example, I'll let you make it pretty, just add a hook:
$this->template->hook->attach('template:task:show:top', 'glancer:layout/glancer_nav');

and add the template file to hook:

<?php 
$alltasks = $this->model->taskFinderModel->getAllIds($project['id']); 
$key = array_search($task['id'], $alltasks); 
$last_key = count($alltasks)-1;
$next_key = ($key + 1 <= $last_key) ? $key + 1 : 0;
$prev_key = ($key - 1 >= 0) ? $key - 1 : $last_key;

$next = $alltasks[$next_key];
$prev = $alltasks[$prev_key];

?>
<?= $this->url->icon('arrow-right', t('Next Task'), 'TaskViewController', 'show', array('task_id' => $next)) ?>
<?= $this->url->icon('arrow-left', t('Prev Task'), 'TaskViewController', '…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@aljawaid
Comment options

aljawaid Jan 13, 2023
Maintainer Author

Answer selected by creecros
Comment options

aljawaid
Jan 14, 2023
Maintainer Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested Feature Request
2 participants