Example #1
0
 /**
  * Create a panel containing tabs with info for all the repos of this group
  * For instance, a panel with tabs for each gaia repo.
  *
  * @param  array  $data Array containing all the data for each repo
  * @return string HTML element to add in the repo tab
  */
 public static function getStatsPane($data)
 {
     if (!isset($data['stats'])) {
         $first_tab = true;
         $links = $tabs = '';
         foreach ($data as $stats) {
             $repo_pretty_name = Project::getRepositoriesNames()[$stats['stats']['repo']];
             $links .= self::addLink($repo_pretty_name, 'sub-' . $stats['stats']['repo'], $first_tab);
             $tabs .= self::getStatsTab($stats['stats'], 'sub-' . $stats['stats']['repo'], $first_tab);
             $first_tab = false;
         }
         return '
         <div class="stats-panel">
             <div class="tabs">
                 <ul class="tab-links">
                     ' . $links . '
                 </ul>
                 <div class="tab-content">
                     ' . $tabs . '
                 </div>
             </div>
         </div>';
     } else {
         return '<div class="stats-panel">' . self::getStatsTab($data['stats'], 'sub-' . $data['stats']['repo'], true) . '</div>';
     }
 }
Example #2
0
<?php

namespace Transvision;

/* Global variables used across the project */
// Repositories
$repos = Project::getRepositories();
$repos_nice_names = Project::getRepositoriesNames();
$gaia_repos = Project::getGaiaRepositories();
$desktop_repos = Project::getDesktopRepositories();
// Search forms
$form_search_options = ['case_sensitive', 'whole_word', 'perfect_match', 't2t', 'repo', 'search_type'];
$form_checkboxes = array_diff($form_search_options, ['repo', 'search_type']);