Ignore:
Timestamp:
Apr 7, 2020, 10:15:48 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/View.php

    r864 r880  
    99    //$Output .= ' <form action="?setlocale" method="get">';
    1010    $Output = ' <select onchange="window.location=this.value">';
    11     foreach($this->System->LocaleManager->Available as $Locale)
     11    foreach ($this->System->LocaleManager->Available as $Locale)
    1212    {
    1313      $Remaining = substr($_SERVER["REQUEST_URI"], strlen($this->System->BaseURL));
    14       if(substr($Remaining, 1, strlen($Locale['Code'].'/')) == $this->System->LocaleManager->LangCode.'/')
     14      if (substr($Remaining, 1, strlen($Locale['Code'].'/')) == $this->System->LocaleManager->LangCode.'/')
    1515        $Remaining = substr($Remaining, strlen('/'.$Locale['Code']));
    16       if($Locale['Code'] == $this->System->LocaleManager->CurrentLocale->Texts->Code) $Selected = ' selected="selected"';
     16      if ($Locale['Code'] == $this->System->LocaleManager->CurrentLocale->Texts->Code) $Selected = ' selected="selected"';
    1717        else $Selected = '';
    1818      $Remaining = $this->System->TranslateReverseURL($Remaining, $this->System->LocaleManager->LangCode);
     
    2323    $Output .= '</select><noscript><span><input type="submit" value="Submit"/></span></noscript>';
    2424
    25     return($Output);
     25    return $Output;
    2626  }
    2727
     
    2929  {
    3030    $Output = '<div class="Menu">';
    31     if(isset($this->System->User))
     31    if (isset($this->System->User))
    3232    {
    33       if(!$this->System->User->Licence(LICENCE_USER))
     33      if (!$this->System->User->Licence(LICENCE_USER))
    3434        $Output .= '<div class="advert">'.$this->System->Config['Web']['Advertisement'].'</div>';
    3535    }
     
    3838    // Show bars items
    3939    $Bar = '';
    40     foreach($this->System->Bars['Top'] as $BarItem)
     40    foreach ($this->System->Bars['Top'] as $BarItem)
    4141      $Bar .= call_user_func($BarItem);
    42       if(trim($Bar) != '') $Output .= $Bar;
     42      if (trim($Bar) != '') $Output .= $Bar;
    4343      else $Output .= '&nbsp;';
    4444
     
    4646    //$Output .= '</form>';
    4747    $Output .= '</span></div>';
    48     return($Output);
     48    return $Output;
    4949  }
    5050
     
    5353    $Output = '<strong>'.T('Menu').':</strong>'.
    5454      '<div class="verticalmenu"><ul>';
    55     foreach($this->System->Menu as $MenuItem)
    56       if(!isset($this->System->User) or $this->System->User->Licence($MenuItem['Permission']))
     55    foreach ($this->System->Menu as $MenuItem)
     56      if (!isset($this->System->User) or $this->System->User->Licence($MenuItem['Permission']))
    5757      {
    58         if(isset($MenuItem['Click'])) $OnClick = ' onclick="'.$MenuItem['Click'].'"';
     58        if (isset($MenuItem['Click'])) $OnClick = ' onclick="'.$MenuItem['Click'].'"';
    5959        else $OnClick = '';
    60         if($MenuItem['Icon'] != '') $Icon = '<img src="'.$this->System->Link('/images/menu/'.$MenuItem['Icon']).'"/>';
     60        if ($MenuItem['Icon'] != '') $Icon = '<img src="'.$this->System->Link('/images/menu/'.$MenuItem['Icon']).'"/>';
    6161        else $Icon = '';
    6262        $Output .= '<li>'.$Icon.'<a class="verticalmenua" title="'.$MenuItem['Hint'].'" href="'.
     
    6464      }
    6565      $Output .= '</ul></div>';
    66       return($Output);
     66      return $Output;
    6767  }
    6868
     
    8383    // Show page headers
    8484    $Bar = '';
    85     foreach($this->System->PageHeaders as $Item)
     85    foreach ($this->System->PageHeaders as $Item)
    8686      $Output .= call_user_func($Item);
    8787
    8888    $Title = $this->System->Config['Web']['Title'];
    89     if($this->Title != '') $Title = $this->Title.' - '.$Title;
     89    if ($this->Title != '') $Title = $this->Title.' - '.$Title;
    9090    $Output .= '<title>'.$Title.'</title>'.
    9191    '<script src="'.$this->System->Link('/style/respond.js').'"></script>'.
     
    9898    // Show bars items
    9999    $Bar = '';
    100     foreach($this->System->Bars['Left'] as $BarItem)
     100    foreach ($this->System->Bars['Left'] as $BarItem)
    101101      $Bar .= call_user_func($BarItem);
    102       if(trim($Bar) != '') $Output .= $Bar;
     102      if (trim($Bar) != '') $Output .= $Bar;
    103103      else $Output .= '&nbsp;';
    104104
    105105    $Output .= '</td><td id="border-left"></td><td class="content">';
    106     return($Output);
     106    return $Output;
    107107  }
    108108
     
    117117    // Show bars items
    118118    $Bar = '';
    119     foreach($this->System->Bars['Right'] as $BarItem)
     119    foreach ($this->System->Bars['Right'] as $BarItem)
    120120      $Bar .= call_user_func($BarItem);
    121       if(trim($Bar) != '') $Output .= $Bar;
     121      if (trim($Bar) != '') $Output .= $Bar;
    122122      else $Output .= '&nbsp;';
    123123    $Output .= '</td>';
     
    129129
    130130    $Output .= '</td></tr>';
    131     if($this->System->Config['Web']['ShowRuntimeInfo'] == true)
     131    if ($this->System->Config['Web']['ShowRuntimeInfo'] == true)
    132132      $Output .= '<tr><td colspan="3" style="text-align: center;">'.T('Generating duration').': '.
    133133    $ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s &nbsp;&nbsp; '.T('Used memory').': '.
     
    137137      '</body>'.
    138138      '</html>';
    139     return($Output);
     139    return $Output;
    140140  }
    141141
     
    143143  {
    144144    $Output = $this->ShowHeader().$Content.$this->ShowFooter();
    145     if($this->System->Config['Web']['FormatOutput'])
     145    if ($this->System->Config['Web']['FormatOutput'])
    146146      $Output = $this->FormatOutput($Output);
    147     return($Output);
     147    return $Output;
    148148  }
    149149
     
    153153    $nn = 0;
    154154    $n = 0;
    155     while($s != '')
     155    while ($s != '')
    156156    {
    157157      $start = strpos($s, '<');
    158158      $end = strpos($s, '>');
    159       if($start != 0)
     159      if ($start != 0)
    160160      {
    161161        $end = $start - 1;
     
    163163      }
    164164      $line = trim(substr($s, $start, $end + 1));
    165       if(strlen($line) > 0)
    166         if($line[0] == '<')
     165      if (strlen($line) > 0)
     166        if ($line[0] == '<')
    167167        {
    168           if($s[$start + 1] == '/')
     168          if ($s[$start + 1] == '/')
    169169          {
    170170            $n = $n - 2;
     
    172172          } else
    173173          {
    174             if(strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1);
     174            if (strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1);
    175175            else $cmd = substr($line, 1, strlen($line) - 2);
    176176            //echo('['.$cmd.']');
    177             if(strpos($s, '</'.$cmd.'>')) $n = $n + 2;
     177            if (strpos($s, '</'.$cmd.'>')) $n = $n + 2;
    178178          }
    179179        }// else $line = '['.$line.']';
    180         //if($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n"));
    181         if($nn < 0) $nn = 0;
    182         if($line != '') $out .= (str_repeat(' ', $nn).$line."\n");
     180        //if ($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n"));
     181        if ($nn < 0) $nn = 0;
     182        if ($line != '') $out .= (str_repeat(' ', $nn).$line."\n");
    183183        $s = substr($s, $end + 1, strlen($s));
    184184        $nn = $n;
    185185    }
    186     return($out);
     186    return $out;
    187187  }
    188188}
Note: See TracChangeset for help on using the changeset viewer.