Home | Info | Research | Blog | Repos | Messages | Contact Me

http://www.pyrasis.com/images/repository.gif

[websvn] / trunk / index.php Repository:

View of /trunk/index.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (download) (annotate)
Sat Dec 22 11:16:06 2007 KST (2 years, 8 months ago) by pyrasis
File size: 3632 byte(s)
2.0으로 머지.
    1 <?php
    2 // WebSVN - Subversion repository viewing via the web using PHP
    3 // Copyright (C) 2004-2006 Tim Armes
    4 //
    5 // This program is free software; you can redistribute it and/or modify
    6 // it under the terms of the GNU General Public License as published by
    7 // the Free Software Foundation; either version 2 of the License, or
    8 // (at your option) any later version.
    9 //
   10 // This program is distributed in the hope that it will be useful,
   11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
   12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13 // GNU General Public License for more details.
   14 //
   15 // You should have received a copy of the GNU General Public License
   16 // along with this program; if not, write to the Free Software
   17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   18 //
   19 // --
   20 //
   21 // index.php
   22 //
   23 // Main page.  Lists all the projects
   24 
   25 require_once("include/setup.php");
   26 require_once("include/svnlook.php");
   27 require_once("include/template.php");
   28 
   29 $vars["action"] = $lang["PROJECTS"];
   30 $vars["repname"] = "";
   31 $vars["rev"] = 0;
   32 $vars["path"] = "";
   33 
   34 // Sort the repositories by group
   35 $config->sortByGroup();
   36 
   37 if ($config->flatIndex)
   38 {
   39    // Create the flat view
   40 
   41    $projects = $config->getRepositories();
   42    $i = 0;
   43    $listing = array ();
   44    foreach ($projects as $project)
   45    {
   46       if ($project->hasReadAccess("/", true))
   47       {
   48          $url = $config->getURL($project, "/", "dir");
   49 
   50          $listing[$i]["rowparity"] = $i % 2;
   51          $listing[$i++]["projlink"] = "<a href=\"${url}sc=$showchanged\">".$project->getDisplayName()."</a>";
   52       }
   53    }
   54    $vars["flatview"] = true;
   55    $vars["treeview"] = false;
   56 }
   57 else
   58 {
   59    // Create the tree view
   60 
   61    $projects = $config->getRepositories();
   62    reset($projects);
   63    $i = 0;
   64    $listing = array ();
   65    $curgroup = NULL;
   66    $parity = 0;
   67    foreach ($projects as $project)
   68    {
   69       if ($project->hasReadAccess("/", true))
   70       {
   71          $listing[$i]["rowparity"] = $parity % 2;
   72          $url = $config->getURL($project, "/", "dir");
   73          if ($curgroup != $project->group)
   74          {
   75             # TODO: this should be de-soupified
   76             if (!empty($curgroup))
   77                $listing[$i]["listitem"] = "</div>\n";  // Close the switchcontent div
   78             else
   79                $listing[$i]["listitem"] = "";
   80 
   81             $listing[$i]["isprojlink"] = false;
   82             $listing[$i]["isgrouphead"] = true;
   83 
   84             $curgroup = $project->group;
   85             $listing[$i++]["listitem"] .= "<div class=\"groupname\" onclick=\"expandcontent(this, 'grp$curgroup');\" style=\"cursor:hand; cursor:pointer\"><div class=\"a\"><span class=\"showstate\"></span>$curgroup</div></div>\n<div id=\"grp$curgroup\" class=\"switchcontent\">";
   86          }
   87 
   88          $parity++;
   89          $listing[$i]["isgrouphead"] = false;
   90          $listing[$i]["isprojlink"] = true;
   91          $listing[$i++]["listitem"] = "<a href=\"${url}sc=$showchanged\">".$project->name."</a>\n";
   92       }
   93    }
   94 
   95    if (!empty($curgroup))
   96    $listing[$i]["isprojlink"] = false;
   97    $listing[$i]["isgrouphead"] = false;
   98    $listing[$i]["listitem"] = "</div>";  // Close the switchcontent div
   99 
  100    $vars["flatview"] = false;
  101    $vars["treeview"] = true;
  102    $vars["opentree"] = $config->openTree;
  103 }
  104 
  105 $vars['indexurl'] = $config->getURL($rep, '', 'index').'sc='.$showchanged;
  106 
  107 $vars["version"] = $version;
  108 parseTemplate($config->getTemplatePath()."header.tmpl", $vars, $listing);
  109 parseTemplate($config->getTemplatePath()."index.tmpl", $vars, $listing);
  110 parseTemplate($config->getTemplatePath()."footer.tmpl", $vars, $listing);
  111 
  112 ?>


Copyright © 2003-2007 PYRASIS.COM,. All rights reserved.