$this->repository->name, '%path' => $item->path, '%revision' => $item->revision, ); if ($item->isFile()) { return strtr($this->getTemplateUrl('file_log_view'), $placeholders); } else { // directory return strtr($this->getTemplateUrl('directory_log_view'), $placeholders); } } public function getItemViewUrl(&$item) { $placeholders = array( '%repo_name' => $this->repository->name, '%path' => $item->path, '%revision' => $item->revision, ); if ($item->isDeleted()) { // Do not link to deleted items. return ''; } $view_url = $item->isFile() ? $this->getTemplateUrl('file_view') : $this->getTemplateUrl('directory_view'); return strtr($view_url, $placeholders); } public function getDiffUrl(&$file_item_new, $file_item_old) { $placeholders = array( '%repo_name' => $this->repository->name, '%path' => $file_item_new->path, '%old_revision' => $file_item_new->revision, '%new_revision' => $file_item_old->revision, ); return strtr($this->getTemplateUrl('diff'), $placeholders); } }