Exemplo n.º 1
0
 public function display()
 {
     $html = '';
     $html .= '<div id="plugin_git_reference" class="plugin_git_repo_type_' . $this->repository->getBackendType() . '">';
     $html .= $this->getHeader();
     if ($this->repository->isMigratedToGerrit()) {
         $html .= $this->getRemoteRepositoryInfo();
     }
     $html .= $this->getCloneUrl();
     $html .= '</div>';
     $html .= $this->getOnlineEditDiv();
     if ($this->repository->isCreated()) {
         $html .= $this->gitphp_viewer->getContent();
     } else {
         $html .= $this->getWaitingForRepositoryCreationInfo();
     }
     $html .= '</div>';
     echo $html;
 }
Exemplo n.º 2
0
 private function displayContent()
 {
     $html = '';
     if ($this->repository->isCreated()) {
         $html .= $this->gitphp_viewer->getContent();
     } else {
         $html .= $this->getWaitingForRepositoryCreationInfo();
     }
     if ($this->isATreePage()) {
         $html .= $this->getMarkdownFilesDiv();
     }
     echo $html;
 }
Exemplo n.º 3
0
 public function display()
 {
     echo $this->gitphp_viewer->getContent();
     exit;
 }
Exemplo n.º 4
0
 public function testGetViewInverseURLArgumentIfActionIsBlobdiffAndJenkinsIsFalse()
 {
     $_REQUEST['jenkins'] = 'false';
     $_REQUEST['a'] = 'blobdiff';
     $src_initial = 'src';
     $dest_initial = 'dest';
     $_GET['h'] = $src_initial;
     $_GET['hp'] = $dest_initial;
     $repository = mock('GitRepository');
     stub($repository)->getId()->returns(148);
     stub($repository)->getFullName()->returns('abcd');
     stub($repository)->getProject()->returns(stub('Project')->getUnixName()->returns('project'));
     stub($repository)->getGitRootPath()->returns('/home/abcd');
     $gitphp_viewer = new GitViews_GitPhpViewer($repository, dirname(__FILE__) . '/_fixtures/fakeGitPHP');
     $gitphp_viewer->getContent();
     $this->assertEqual($_GET['h'], $src_initial);
     $this->assertEqual($_GET['hp'], $dest_initial);
 }