/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright ©2006 by sTEFANs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Implementation of SWC control bar.
* @copyright Copyright ©2006 by sTEFANs
* @license http://opensource.org/licenses/lgpl-license.php GNU General Public License
/** Project configuration interface */
require_once('inc/config.inc.php');
/** SVN execution library */
require_once('inc/svn_lib.inc.php');
/** HTML generation library */
require_once('inc/page.inc.php');
/** Common utility functions */
require_once('inc/utils.inc.php');
* Prints control frame for selected config
if (count($config_list) >
0){
if ($settings->IsMinimizeControlBar() &&
$checked_out){
if (count($config_list) >
1){
if (count($config_list) >
1){
if ($config->IsSvnCommandBarEnabled() &&
$settings->IsSvnCommandBarVisible()){
if ($settings->IsSvnSwitchBarVisible()){
* Prints two default table rows for an unconfigured project.
* @param string $project_name Name of the project or NULL if no project name is provided.
if ($project_name !=
NULL){
* Prints two table cells vertically with project name.
* @param <b>SwcConfig</b> $config Active project configuration.
* @param boolean $compact If true, only project name is
* displayed within a single row.
$content =
$config->GetProjectName();
* Prints four table cells for Repository info for a configured project.
* This function prints the same number of cells as function
* <b>SvnCpPrintWebspaceInfoRow()</b>.
* @param <b>SwcConfig</b> $config Active project configuration.
* @param string $sel_frame Selected main frame.
* @param string $sel_action Selected action.
* @see SvnCpPrintWebspaceInfoRow
* Prints four table row cells for Webspace info for a configured project.
* This function prints the same number of cells as function
* <b>SvnCpPrintRepositoryInfoRow()</b>.
* @param <b>SwcConfig</b> $config Active project configuration.
* @see SvnCpPrintRepositoryInfoRow
* Prints five table row cells for minimal webspace and repository
* info for a configured project.
* @param <b>SwcConfig</b> $config Active project configuration.
$ws_deprecated =
($rev_webspace <
$rev_head);
$style =
($ws_deprecated ?
'text_low_bold_red' :
'text_low_bold');
$style =
($ws_deprecated ?
'text_low_bold_red' :
'text_low');
* Prints two table cells for updating the Webspace.
* @param <b>SwcConfig</b> $config Active project configuration.
* @param string $sel_frame Selected main frame.
* @param string $sel_action Selected action.
$ws_deprecated =
($rev_webspace <
$rev_head);
if ($ws_deprecated &&
!$compact){
if (!$ws_deprecated &&
!$compact){
* Prints one table cell for checking out the project into the Webspace.
* @param <b>SwcConfig</b> $config Active project configuration.
* @param string $sel_frame Selected main frame.
* @param string $sel_action Selected action.
* Prints two table cells for changing the project.
* @param array $configs Array of <b>SwcConfig</b>s which appears in selection list.
* @param <b>SwcConfig</b> $active_config Active config.
if ($active_config !=
NULL) {
$sel =
$active_config->GetProjectName();
foreach ($configs as $config){
$list[] =
array(IDX_VALUE =>
$config->GetProjectName(), IDX_NAME =>
$config->GetProjectName());
* Prints a single cell containing containing a button to switch to the configured project.
* @param <b>SwcConfig</b> $config Active project configuration.
* @param string $sel_frame Selected main frame.
$main_frame =
$config->GetMainFrame();
$sel =
strcmp($sel_frame, $main_frame) ==
0;
* Prints a single cell containing a table with some actions for a configured project.
* This function prints the cells within an separate table.
* @param <b>SwcConfig</b> $config Active project configuration.
* @param string $sel_frame Selected main frame.
* @param string $sel_action Selected action.
* @param int $colspan Number of columns the inner table should use in outer table.
$main_frame =
$config->GetRepositoryRoot();
if (strpos($main_frame, 'http') ===
0){
$main_frame =
$config->GetWebSvnUrl();
if ($main_frame !=
NULL){
$sel =
strcmp($sel_frame, $main_frame) ==
0;
* Prints a single cell containing a table allows to initiate an SVN command.
* This function prints the cells within an separate table.
* @param <b>SwcConfig</b> $config Active project configuration.
* @param string $sel_frame Selected main frame.
* @param string $sel_action Selected action.
* @param int $colspan Number of columns the inner table should use in outer table.
* Prints a single cell containing a table with actions to switch to a dedicated
* repository path for a configured project.
* This function prints the cells within an separate table.
* @param <b>SwcConfig</b> $config Active project configuration.
* @param string $sel_frame Selected main frame.
* @param string $sel_action Selected action.
* @param int $colspan Number of columns the inner table should use in outer table.
if (count($configs) >
1){
$select[] =
array($tag, $tag);
foreach($branches as $branch){
$select[] =
array($branch, $branch);
* Prints a single cell containing a table for user settings.
* This function prints the cells within an separate table.
* @param int $colspan Number of columns the inner table should use in outer table.
'text_low', $settings->IsPinProjectPage());
'text_low', $settings->IsSeparateResultWindow());
'text_low', $settings->IsSvnSwitchBarVisible());
if ($config !=
NULL &&
$config->IsSvnCommandBarEnabled()){
'text_low', $settings->IsSvnCommandBarVisible());
$settings->GetProjectFrameWidth(), 4, 'right');
$settings->GetProjectFrameHeight(), 4, 'right');
* Prints a single cell with a checkbox which allows to minimize the control bar.
* @param int $colspan Number of columns the cell should span.
'text_low', $settings->IsMinimizeControlBar());
* Prints a single cell with a button
* to display the help page.
* @param int $colspan Number of columns the cell should span.
$sel =
strcmp($sel_frame, $main_frame) ==
0;
* Main function for printing SVN Web Control page.