/** * Common layout for project views * * @access protected * @param string $template Template name * @param array $params Template parameters * @return string */ protected function projectLayout($template, array $params) { $content = $this->template->load($template, $params); $params['project_content_for_layout'] = $content; $params['title'] = $params['project']['name'] === $params['title'] ? $params['title'] : $params['project']['name'] . ' > ' . $params['title']; $params['board_selector'] = $this->projectPermission->getAllowedProjects($this->acl->getUserId()); return $this->template->layout('project/layout', $params); }
/** * Display the template show task (common between different actions) * * @access protected * @param array $task Task data * @param array $comment_form Comment form data * @param array $description_form Description form data * @param array $comment_edit_form Comment edit form data */ protected function showTask(array $task, array $comment_form = array(), array $description_form = array(), array $comment_edit_form = array()) { if (empty($comment_form)) { $comment_form = array('values' => array('task_id' => $task['id'], 'user_id' => $this->acl->getUserId()), 'errors' => array()); } if (empty($description_form)) { $description_form = array('values' => array('id' => $task['id']), 'errors' => array()); } if (empty($comment_edit_form)) { $comment_edit_form = array('values' => array('id' => 0), 'errors' => array()); } else { $hide_comment_form = true; } $this->response->html($this->template->layout('task_show', array('hide_comment_form' => isset($hide_comment_form), 'comment_edit_form' => $comment_edit_form, 'comment_form' => $comment_form, 'description_form' => $description_form, 'comments' => $this->comment->getAll($task['id']), 'task' => $task, 'columns_list' => $this->board->getColumnsList($task['project_id']), 'colors_list' => $this->task->getColors(), 'menu' => 'tasks', 'title' => $task['title']))); }
/** * Common layout for project views * * @access protected * @param string $template Template name * @param array $params Template parameters * @return string */ protected function projectLayout($template, array $params) { $content = $this->template->load($template, $params); $params['project_content_for_layout'] = $content; return $this->template->layout('project_layout', $params); }