Changeset 47 for trunk/Application


Ignore:
Timestamp:
Jul 27, 2014, 9:14:56 PM (10 years ago)
Author:
chronos
Message:
  • Odstraněno: Zbytečná PHP ukončovací značka "?>" z konce všech souborů.
Location:
trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 
        21config.php
         2.project
  • trunk/Application/Application.php

    r42 r47  
    99{
    1010  var $DefaultModule = 'Main';
    11  
     11
    1212  function __construct()
    1313  {
    1414    parent::__construct();
    1515    $this->Output = new CustomOutput($this);
    16    
     16
    1717/*    $this->Type->RegisterType('YesNo', 'Enumeration', array('Ano', 'Ne'));
    1818    $this->Type->RegisterType('NoYes', 'Enumeration', array('Ne', 'Ano'));
     
    2727    //$this->AddModule('Log');
    2828    //$this->AddModule('UserList');
    29    
     29
    3030    //if(isset($_SERVER['REMOTE_ADDR'])) $this->Modules['UserList']->Check();
    3131    //  else $this->Modules['UserList']->CurrentUser = new User(0);
     
    3434  }
    3535}
    36 
    37 ?>
  • trunk/Application/Config/ConfigSample.php

    r46 r47  
    2424  ),
    2525);
    26 
    27 ?>
  • trunk/Application/Controller/Add.php

    r45 r47  
    2222  }
    2323}
    24 
    25 ?>
  • trunk/Application/Controller/Client.php

    r45 r47  
    1010    $MeasureClient = new MeasureClient($this->System);
    1111    $MeasureClient->Process();
    12    
     12
    1313    //$View = new MeasureView($this->System);
    1414    //return($View->Add());
    1515  }
    1616}
    17 
    18 ?>
  • trunk/Application/Controller/Graph.php

    r45 r47  
    99  {
    1010    $this->System->Output->FullPage = false;
    11    
     11
    1212    $View = new GraphView($this->System);
    1313    return($View->Render());
    1414  }
    1515}
    16 
    17 ?>
  • trunk/Application/Controller/Main.php

    r42 r47  
    1212  }
    1313}
    14 
    15 ?>
  • trunk/Application/Controller/Measure.php

    r40 r47  
    99  }
    1010}
    11 
    12 ?>
  • trunk/Application/Controller/User.php

    r40 r47  
    88    $View = new UserView($this->System);
    99    return($Page->GetOutput($View->Login()));
    10   } 
    11  
     10  }
     11
    1212  function LoginFinish()
    1313  {
     
    1515    $View = new UserView($this->System);
    1616    return($Page->GetOutput($View->LoginFinish()));
    17   } 
     17  }
    1818
    1919  function Logout()
     
    2222    $View = new UserView($this->System);
    2323    return($Page->GetOutput($View->Logout()));
    24   } 
     24  }
    2525
    2626  function Options()
     
    2929    $View = new UserView($this->System);
    3030    return($Page->GetOutput($View->Options()));
    31   } 
    32  
     31  }
     32
    3333  function OptionsSave()
    3434  {
     
    3636    $View = new UserView($this->System);
    3737    return($Page->GetOutput($View->OptionsSave()));
    38   } 
     38  }
    3939
    4040  function Register()
     
    4343    $View = new UserView($this->System);
    4444    return($Page->GetOutput($View->Register()));
    45   } 
     45  }
    4646
    4747  function RegisterConfirm()
     
    5050    $View = new UserView($this->System);
    5151    return($Page->GetOutput($View->Confirm()));
    52   } 
     52  }
    5353
    5454  function PasswordRecovery()
     
    5757    $View = new UserView($this->System);
    5858    return($Page->GetOutput($View->PasswordRecovery()));
    59   } 
     59  }
    6060
    6161  function PasswordRecoveryFinish()
     
    6464    $View = new UserView($this->System);
    6565    return($Page->GetOutput($View->PasswordRecovery()));
    66   } 
     66  }
    6767
    6868  function PasswordRecoveryConfirm()
     
    7171    $View = new UserView($this->System);
    7272    return($Page->GetOutput($View->PasswordRecoveryConfirm()));
    73   } 
     73  }
    7474
    7575  function RegisterSave()
     
    7878    $View = new UserView($this->System);
    7979    return($Page->GetOutput($View->RegisterSave()));
    80   }   
     80  }
    8181}
    82 
    83 ?>
  • trunk/Application/CustomOutput.php

    r46 r47  
    7474  }
    7575}
    76 
    77 ?>
  • trunk/Application/Locale/cs_CZ.php

    r42 r47  
    2626  'UserPasswordRecoveryConfirmed' => 'Nové heslo bylo aktivováno.',
    2727  'UserBadRole' => 'Nemáte dostatečná oprávnění',
    28  
     28
    2929  'AccessDenied' => 'K provedení požadované akce nemáte dostatečné oprávnění',
    3030);
    31 
    32 ?>
  • trunk/Application/Model/Measure.php

    r46 r47  
    467467  }
    468468}
    469 
    470 ?>
  • trunk/Application/Model/Measurement/MeasureClient.php

    r44 r47  
    2626      } else echo('Třída '.$MeasureMethod['MeasureClass'].' neexistuje.');
    2727    }
    28   } 
     28  }
    2929}
    30 
    31 ?>
  • trunk/Application/Model/Measurement/Measurement.php

    r43 r47  
    66{
    77}
    8 
    9 ?>
  • trunk/Application/Model/Measurement/System.php

    r44 r47  
    2424
    2525  function Ping($Host = 'nix.cz')
    26   { 
     26  {
     27    $Row = array();
    2728    exec('ping '.$Host.' -c 1 -W 1|grep time=', $Row);
    2829    // W - timeout in seconds
     
    5556    $LastCpuUsage = unserialize(file_get_contents($CpuStateFileName));
    5657    //$cpuIDLEprev, $cpuSYSTprev, $cpuUSERprev;
    57  
     58
    5859    // get processor usage seconds for pct stats ###
    5960    $File = fopen('/proc/stat', 'r');
     
    6970    $CpuUsageDiffTotal = (($CpuUsageDiff['User'] + $CpuUsageDiff['System']) + $CpuUsageDiff['Idle']);
    7071    if ($CpuUsageDiffTotal > 0)
    71     { 
     72    {
    7273      $CpuUsagePercent['User'] = ($CpuUsageDiff['User'] / $CpuUsageDiffTotal) * 100;
    7374      $CpuUsagePercent['System'] = ($CpuUsageDiff['System'] / $CpuUsageDiffTotal) * 100;
     
    9394    array_shift($Output); // Skip header
    9495    foreach($Output as $Item)
    95     { 
     96    {
    9697      while(strpos($Item, '  ') !== false) $Item = str_replace('  ', ' ', $Item);  // Rrmove multiple spaces
    9798      $Item = explode(':', $Item);
     
    108109        $NetworkState[$Interface]['DownAverage'] = 0;
    109110        $NetworkState[$Interface]['UpAverage'] = 0;
    110       } 
     111      }
    111112      if($NetworkState[$Interface]['DownAverage'] < 0) $NetworkState[$Interface]['DownAverage'] = 0;
    112113      if($NetworkState[$Interface]['UpAverage'] < 0) $NetworkState[$Interface]['UpAverage'] = 0;
     
    121122    return($NetworkState['Interface']['DownAverage']);
    122123  }
    123  
     124
    124125  function NetworkSpeedUpload($Interface)
    125126  {
     
    177178  }
    178179}
    179 
    180 ?>
  • trunk/Application/Model/Permission.php

    r40 r47  
    1111      if($DbRow['SubGroup'] > 0) $Result = array_merge($Result, $this->LoadForGroup($DbRow['SubGroup']));
    1212      if($DbRow['Operation'] > 0)
    13       { 
     13      {
    1414        $DbResult2 = $this->Database->query('SELECT `PermissionOperation`.*, `Module`.`Name` FROM `PermissionOperation` JOIN `Module` ON `Module`.`Id` = `PermissionOperation`.`Module` WHERE `PermissionOperation`.`Id`='.$DbRow['Operation']);
    1515        $DbRow2 = $DbResult2->fetch_assoc();
     
    1919    $this->Data = $Result;
    2020  }
    21    
     21
    2222  function LoadForGroup($Group)
    2323  {
     
    2828      if($DbRow['SubGroup'] > 0) $Result = array_merge($Result, $this->LoadForGroup($DbRow['SubGroup']));
    2929      if($DbRow['Operation'] > 0)
    30       { 
     30      {
    3131        $DbResult2 = $this->Database->query('SELECT `PermissionOperation`.*, `Module`.`Name` FROM `PermissionOperation` JOIN `Module` ON `Module`.`Id` = `PermissionOperation`.`Module` WHERE `PermissionOperation`.`Id`='.$DbRow['Operation']);
    3232        $DbRow2 = $DbResult2->fetch_assoc();
     
    3636    return($Result);
    3737  }
    38  
     38
    3939  function Check($Module, $Action, $Item = 0)
    4040  {
     
    4444  }
    4545}
    46 
    47 ?>
  • trunk/Application/Model/User.php

    r46 r47  
    267267  }
    268268}
    269 
    270 ?>
  • trunk/Application/Model/stat_functions.php

    r43 r47  
    4343  if($Unit == '') return(TruncateDigits($Value, $Digits));
    4444  $I = 8;
    45   if($Value > 0) $II = 1; 
     45  if($Value > 0) $II = 1;
    4646  else if($Value < 0) $II = -1;
    4747  else $II = 0;
     
    9999  $Result = $Database->select($Measure['DataTable'], '*', 'measure='.$Measure['Id'].' AND level='.$Level.' ORDER BY time DESC LIMIT 2');
    100100  //echo($Database->LastQuery."\n");
    101   if($Result->num_rows == 0) 
    102   {
    103      $Database->insert($Measure['DataTable'], array('min' => $Value['min'], 'avg' => $Value['avg'], 'max' => $Value['max'], 'level' => $Level, 'measure' => $Measure['Id'], 'time' => TimeToMysqlDateTime($Time), 'continuity' => 0)); 
     101  if($Result->num_rows == 0)
     102  {
     103     $Database->insert($Measure['DataTable'], array('min' => $Value['min'], 'avg' => $Value['avg'], 'max' => $Value['max'], 'level' => $Level, 'measure' => $Measure['Id'], 'time' => TimeToMysqlDateTime($Time), 'continuity' => 0));
    104104     //echo($Database->LastQuery."\n");
    105105  } else if($Result->num_rows == 1)
     
    237237        }
    238238      }
    239       else if($ValueType == 'min') 
    240       {
    241         //echo($Values[$I+1]['continuity'].'=='.$Measure['ContinuityEnabled'].'<br>'); 
     239      else if($ValueType == 'min')
     240      {
     241        //echo($Values[$I+1]['continuity'].'=='.$Measure['ContinuityEnabled'].'<br>');
    242242        if($Values[$I + 1]['continuity'] == $Measure['ContinuityEnabled'])
    243243        {
     
    258258    $NewValue[$ValueType] = $NewValue[$ValueType];
    259259  }
    260   //if(($RightTime - $LeftTime) > 0) 
    261   if($Measure['Cumulative'] == 0) 
     260  //if(($RightTime - $LeftTime) > 0)
     261  if($Measure['Cumulative'] == 0)
    262262  {
    263263    $NewValue['avg'] = $NewValue['avg'] / ($RightTime - $LeftTime);
     
    273273
    274274  // Get first and last time
    275   //echo($Measure['Id'].','.$Level.','.StatTableName($Level)."\n"); 
     275  //echo($Measure['Id'].','.$Level.','.StatTableName($Level)."\n");
    276276  $Result = $Database->select($Measure['DataTable'], '*', 'measure='.$Measure['Id'].' AND level='.$Level.' ORDER BY time LIMIT 1');
    277277  if($Result->num_rows > 0)
     
    288288  } else $AbsoluteRightTime = 0;
    289289
    290   if($Debug) 
     290  if($Debug)
    291291  {
    292292    echo('AbsoluteLeftTime: '.$AbsoluteLeftTime.'('.TimeToMysqlDateTime($AbsoluteLeftTime).')<br>');
     
    297297
    298298function LoadRightSideValue($Level, $Measure, $Time)
    299 { 
     299{
    300300  global $Debug, $Database;
    301301  $Result = array();
     
    362362  //$AbsoluteTime = GetTimeRange($MeasureId);
    363363
    364 //  if(($TimeFrom > $AbsoluteLeftTime) and ($TimeStart < $AbsoluteRightTime) and 
     364//  if(($TimeFrom > $AbsoluteLeftTime) and ($TimeStart < $AbsoluteRightTime) and
    365365//    ($TimeTo > $AbsoluteLeftTime) and ($TimeTo < $AbsoluteRightTime))
    366366//  {
     
    480480      // Load values in time range
    481481      //array_pop($NextValues);
    482     } 
     482    }
    483483    echo("Uroven dokoncena<br>\n");
    484484    $DbResult = $Database->select($Measure['DataTable'], 'COUNT(*)', 'level='.$Level.' AND measure='.$Measure['Id']);
     
    525525) ENGINE = MYISAM ;');
    526526}
    527 
    528 ?>
  • trunk/Application/Version.php

    r46 r47  
    11<?php
    22
    3 $Revision = 46; // Subversion revision
     3$Revision = 47; // Subversion revision
    44$DatabaseRevision = 46; // SQL structure revision
    55$ReleaseTime = strtotime('2014-07-27');
  • trunk/Application/View/Graph.php

    r46 r47  
    222222  }
    223223}
    224 
    225 ?>
  • trunk/Application/View/Main.php

    r46 r47  
    223223  }
    224224}
    225 
    226 ?>
  • trunk/Application/View/Page.php

    r46 r47  
    6565  }
    6666}
    67 
    68 ?>
  • trunk/Application/View/User.php

    r42 r47  
    3838      'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
    3939    ),
    40   ); 
     40  );
    4141  var $LoginFormClass = array(
    4242    'Title' => 'Přihlášení uživatele',
     
    4848    ),
    4949  );
    50  
     50
    5151  function Login()
    5252  {
    5353    global $Config;
    54    
     54
    5555    $Form = new Form($this->System, $this->LoginFormClass);
    5656    $Form->OnSubmit = '?Module=User&amp;Action=LoginFinish';
    5757    $Output = $Form->ShowEditForm();
    5858    $Output .= '<div class="Centred">';
    59     if($Config['System']['UserRegistrationEnabled']) 
     59    if($Config['System']['UserRegistrationEnabled'])
    6060      $Output .= '<a href="?Module=User&amp;Action=Register">Registrovat se</a> ';
    6161    $Output .= '<a href="?Module=User&amp;Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>';
    6262    return($Output);
    6363  }
    64  
     64
    6565  function LoginFinish()
    6666  {
     
    8080    return($Output);
    8181  }
    82  
     82
    8383  function RegisterSave()
    8484  {
    8585    global $Config;
    86    
    87     if($Config['System']['UserRegistrationEnabled']) 
     86
     87    if($Config['System']['UserRegistrationEnabled'])
    8888    {
    8989      $Form = new Form($this->System, $this->RegisterFormClass, array());
     
    100100    return($Output);
    101101  }
    102  
     102
    103103  function PasswordRecoveryConfirm()
    104104  {
     
    108108    return($Output);
    109109  }
    110  
     110
    111111  function PasswordRecoveryFinish()
    112112  {
     
    119119    {
    120120      $Output .= $Form->ShowEditForm();
    121     }       
     121    }
    122122    return($Output);
    123123  }
    124  
     124
    125125  function PasswordRecovery()
    126126  {
     
    130130    return($Output);
    131131  }
    132  
     132
    133133  function Logout()
    134134  {
     
    138138    return($Output);
    139139  }
    140  
     140
    141141  function Options()
    142142  {
     
    147147    return($Output);
    148148  }
    149  
     149
    150150  function OptionsSave()
    151151  {
     
    161161    return($Output);
    162162  }
    163  
     163
    164164  function Register()
    165165  {
    166166    global $Config;
    167    
    168     if($Config['System']['UserRegistrationEnabled']) 
     167
     168    if($Config['System']['UserRegistrationEnabled'])
    169169    {
    170170      $Form = new Form($this->System, $this->RegisterFormClass);
     
    176176    return($Output);
    177177  }
    178  
     178
    179179  function RegisterConfirm()
    180180  {
    181181    global $Config;
    182    
    183     if($Config['System']['UserRegistrationEnabled']) 
     182
     183    if($Config['System']['UserRegistrationEnabled'])
    184184    {
    185185      $Page = new PageView($this->System);
     
    190190  }
    191191}
    192 
    193 ?>
Note: See TracChangeset for help on using the changeset viewer.