Changeset 862


Ignore:
Timestamp:
Jan 22, 2016, 4:49:21 PM (9 years ago)
Author:
chronos
Message:
  • Fixed: Setup need to work without any app module installed.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Core.php

    r861 r862  
    1212  var $LocaleManager;
    1313  var $Bars;
     14  var $PageHeaders;
     15  var $BaseURL;
    1416
    1517  function __construct()
     
    2325    $this->Pages = array();
    2426    $this->Bars = array();
     27    $this->PageHeaders = array();
     28    $this->BaseURL = '';
    2529  }
    2630
     
    5660    );
    5761
     62    if(GetRemoteAddress() != '')
     63      $this->BaseURL = substr($_SERVER["CONTEXT_PREFIX"], 0, -1);
    5864    $this->PathItems = ProcessURL();
    5965
    6066    // Detect interface locale
    61     $this->LocaleManager->DefaultLangCode = $this->Config['Web']['Locale'];
     67    if(isset($this->Config['Web']['Locale']))
     68      $this->LocaleManager->DefaultLangCode = $this->Config['Web']['Locale'];
    6269    $this->LocaleManager->LangCode = $this->LocaleManager->DefaultLangCode;
    6370    if(count($this->PathItems) > 0)
     
    99106
    100107    $ScriptStartTime = GetMicrotime();
    101     if(GetRemoteAddress() != '') session_start();
     108    //if(GetRemoteAddress() != '')
     109      session_start();
    102110
    103111    // SQL injection hack protection
     
    139147  function Link($Target)
    140148  {
    141     $Remaining = substr($Target, count($this->Config['Web']['BaseURL']));
     149    $Remaining = substr($Target, count($this->BaseURL));
    142150    $TargetParts = explode('/', $Remaining);
    143151    if(count($TargetParts) > 0)
     
    145153      if(in_array($TargetParts[0], $this->LinkLocaleExceptions))
    146154      {
    147         return($this->Config['Web']['BaseURL'].$Target);
     155        return($this->BaseURL.$Target);
    148156      }
    149157    }
     
    218226
    219227    if($Locale == $this->LocaleManager->DefaultLangCode)
    220       return($this->Config['Web']['BaseURL'].$Target);
    221     return($this->Config['Web']['BaseURL'].'/'.$Locale.$Target);
     228      return($this->BaseURL.$Target);
     229    return($this->BaseURL.'/'.$Locale.$Target);
    222230  }
    223231
     
    319327    $this->Bars[$BarName][$ItemName] = $Callback;
    320328  }
     329
     330  function RegisterPageHeader($Name, $Callback)
     331  {
     332    $this->PageHeaders[$Name] = $Callback;
     333  }
    321334}
  • trunk/Application/UpdateTrace.php

    r857 r862  
    29382938}
    29392939
    2940 $Updates = array(
     2940class Updates
     2941{
     2942  function Get()
     2943  {
     2944    return(array(
    29412945  498 => array('Revision' => 506, 'Function' => 'UpdateTo506'),
    29422946  506 => array('Revision' => 510, 'Function' => 'UpdateTo510'),
     
    29702974  848 => array('Revision' => 849, 'Function' => 'UpdateTo849'),
    29712975  849 => array('Revision' => 857, 'Function' => 'UpdateTo857'),
    2972 );
     2976    ));
     2977  }
     2978}
  • trunk/Application/Version.php

    r861 r862  
    77
    88$Version = '1.0-alfa';
    9 $Revision = 861; // Subversion revision
     9$Revision = 862; // Subversion revision
    1010$DatabaseRevision = 857; // Database structure revision
    11 $ReleaseTime = '2016-01-21';
     11$ReleaseTime = '2016-01-22';
  • trunk/Modules/Export/Page.php

    r859 r862  
    705705      $DbRow = $DbResult->fetch_row();
    706706      $PageList = GetPageList($DbRow[0]);
    707       $Output = '<h3>'.T('Statistic of coplection selected groups').'</h3>'.
     707      $Output = '<h3>'.T('Statistic of completion selected groups').'</h3>'.
    708708        $PageList['Output'];
    709709
  • trunk/Modules/News/News.php

    r854 r862  
    2525    $this->RegisterRSS(array('Title' => T('News'), 'Channel' => 'news',
    2626      'Callback' => array('PageNews', 'ShowRSS'), 'Permission' => LICENCE_ANONYMOUS));
     27    $this->System->RegisterPageHeader('New', array($this, 'ShowRSSHeader'));
    2728  }
    2829
  • trunk/Packages/Common/Setup.php

    r860 r862  
    325325  {
    326326    $Output = "<?php\n\n".
    327         "\$IsDeveloper = in_array(\$_SERVER['REMOTE_ADDR'], array('127.0.0.1'));\n\n";
     327      "\$IsDeveloper = array_key_exists('REMOTE_ADDR', \$_SERVER) and in_array(\$_SERVER['REMOTE_ADDR'], array('127.0.0.1'));\n\n";
    328328
    329329    foreach($this->ConfigDefinition as $Def)
  • trunk/includes/Global.php

    r861 r862  
    88include_once(dirname(__FILE__).'/../Application/Version.php');
    99include_once(dirname(__FILE__).'/../Application/DefaultConfig.php');
     10include_once(dirname(__FILE__).'/../Application/UpdateTrace.php');
    1011include_once(dirname(__FILE__).'/PageEdit.php');
    1112require_once(dirname(__FILE__).'/../HTML/BBCodeParser2.php');
  • trunk/locale/cs.php

    r861 r862  
    265265      'Export don\'t have selected version of client' => 'Export nemá vybránu verzi klienta',
    266266      'Format output isn\'t select' => 'Nebyl vybrán formát výstupu',
    267       'Statistic of coplection selected groups' => 'Statistika dokončení vybraných skupin',
     267      'Statistic of completion selected groups' => 'Statistika dokončení vybraných skupin',
    268268      'English' => 'Anglických',
    269269      'Percent' => 'Procenta',
Note: See TracChangeset for help on using the changeset viewer.