sTEFANs Subversion Web Contol (SWC)
Inc
[ class tree: Swc ] [ index: Swc ] [ all elements ]

Source for file swc_details_content.inc.php

Documentation is available at swc_details_content.inc.php

  1. <?php
  2. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. SVN Web Control
  4. Copyright ©2006 by sTEFANs
  5. Created on 23.02.2006
  6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330,
  20. Boston, MA 02111-1307, USA.
  21. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  22. */
  23.  
  24. /**
  25.  * The detailed output page for command execution.
  26.  * Results as provided by $_SESSION[IDX_EXEC_RES]
  27.  * are printed.
  28.  * 
  29.  * @package Swc
  30.  * @subpackage Inc
  31.  * @author Stefan Schraml
  32.  * @copyright Copyright ©2006 by sTEFANs
  33.  * @license http://opensource.org/licenses/lgpl-license.php GNU General Public License
  34.  * @version v1.1.0
  35.  * @since v1.0.0
  36.  */
  37.  
  38. /** SVN execution library */
  39. require_once('svn_lib.inc.php');
  40. /** Common definitions */
  41. require_once('var.inc.php');
  42. /** HTML generation library */
  43. require_once('page.inc.php');
  44.     
  45.     /** 
  46.      * Prints all execution results provided within
  47.      * $_SESSION[IDX_EXEC_RES] array or via given
  48.      * $exec_res argument.
  49.      * @param array $exec_res Array of result arrays as
  50.      *  provided by <i>ExecSvnCmd</i> and related functions.
  51.      *  If this argument is NULL (default), $_SESSION[IDX_EXEC_RES]
  52.      *  is used instead. This is needed to enable the
  53.      *  details be shown within a sparate browser window.
  54.      * @see ExecSvnCmd
  55.      * 
  56.      * @since v1.0.0
  57.      */
  58.     function SwcDetailsPrintExecutionResults(&$exec_res NULL){
  59. //PrintDebugArray($_SESSION, 'SESSION');
  60.         if ($exec_res == NULL && 
  61.             isset($_SESSION[IDX_EXEC_RES]&& 
  62.             is_array($_SESSION[IDX_EXEC_RES]&& 
  63.             count($_SESSION[IDX_EXEC_RES]0{
  64.             
  65.             $exec_res $_SESSION[IDX_EXEC_RES];
  66.         }
  67.         
  68.         echo '<br/>';
  69.         if ($exec_res != NULL){
  70.         foreach($exec_res as $result){
  71.                 SwcDetailsPrintCmdResult($result);
  72.                 echo '<br/>';
  73.             }
  74.         else {
  75.             SwcDetailsPrintDefault();
  76.         }
  77.         
  78.         if ($exec_res == NULL){
  79.             unset($_SESSION[IDX_EXEC_RES]);
  80.         }        
  81.     }
  82.     
  83.     /** 
  84.      * Prints the default statement for unknown actions.
  85.      * 
  86.      * @since v1.0.0
  87.      */
  88.     function SwcDetailsPrintDefault(){
  89.         echo '<span class="text_low_bold_red">'.T(TK_DETAILS_DEFAULT_TEXT).'</span><br/>';
  90.     }    
  91.     
  92.     /** 
  93.      * Prints the HTML friendly entire result of a command.
  94.      * @param array $cmd_result a single result array as provided by ExecSvnCmd.
  95.      * @see ExecSvnCmd
  96.      * 
  97.      * @since v1.0.0
  98.      */
  99.     function SwcDetailsPrintCmdResult($cmd_result){
  100.         OpenTable(120'result');
  101.             if (isset($cmd_result[IDX_TITLE])){
  102.                 PrintTableCell($cmd_result[IDX_TITLE]'title'4);
  103.             else {
  104.                 PrintEmptyTableCell(4);
  105.             }
  106.         NewTableRow();
  107.             PrintTableCell(T(TK_DETAILS_LABEL_CMDLINE)'text_low_bold');
  108.             if (isset($cmd_result[IDX_CMDLINE])){
  109.                 PrintTableCell($cmd_result[IDX_CMDLINE]'text_low');
  110.             else {
  111.                 PrintEmptyTableCell();
  112.             }
  113.             PrintTableCell(T(TK_DETAILS_LABEL_RESULT_CODE)'text_low_bold');
  114.             if (isset($cmd_result[IDX_CMD_RC])){
  115.                 PrintTableCell($cmd_result[IDX_CMD_RC]'text_low');
  116.             else {
  117.                 PrintEmptyTableCell();
  118.             }
  119.         NewTableRow();
  120.             PrintTableCell(T(TK_DETAILS_LABEL_ERROR)'text_low_bold'00'top');
  121.             if (isset($cmd_result[IDX_ERROUT])){
  122.                 OpenTableCell('text_low_bold_red'3);
  123.                     if (count($cmd_result[IDX_ERROUT]== 0){
  124.                         echo T(TK_DETAILS_NO_ERROR);
  125.                     else {
  126.                         PrintArray($cmd_result[IDX_ERROUT]''false);
  127.                     }
  128.                 CloseTableCell();
  129.             else {
  130.                 PrintEmptyTableCell(3);
  131.             }
  132.         NewTableRow();
  133.             PrintTableCell(T(TK_DETAILS_LABEL_OUTPUT)'text_low_bold'00'top');
  134.             if (isset($cmd_result[IDX_STDOUT])){
  135.                 OpenTableCell('text_low'3);
  136.                     PrintArray($cmd_result[IDX_STDOUT]);
  137.                 CloseTableCell();
  138.             else {
  139.                 PrintEmptyTableCell(3);
  140.             }
  141.         CloseTable();            
  142.     }
  143.         
  144. ?>

Documentation generated on Fri, 03 Nov 2006 18:45:04 +0100 by phpDocumentor 1.3.0RC6
for sTEFANs POWERED BY eBC.bz