Changeset 561 for trunk/includes


Ignore:
Timestamp:
Aug 13, 2013, 11:31:34 PM (12 years ago)
Author:
chronos
Message:
  • Modified: New RSS channels are now registered by modules itself.
  • Modified: ShoutBox transformed to application module.
Location:
trunk/includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/Page.php

    r560 r561  
    156156'<script type="text/javascript" src="'.$System->Link('/style/global.js').'"></script>'.
    157157'<link rel="shortcut icon" href="'.$System->Link('/images/favicon.ico').'" />';
    158   if(isset($RSSChannels))
    159   foreach($RSSChannels as $Channel)
     158  foreach($System->RSSChannels as $Channel)
    160159  {
    161160    $Output .= ' <link rel="alternate" title="'.$Channel['Title'].'" href="'.
     
    180179  global $System, $ScriptStartTime, $User, $Revision, $ReleaseTime;
    181180
    182     $ScriptGenerateDuration = round(GetMicrotime() - $ScriptStartTime, 2);
    183 
    184     $Output = '</td>'.
    185       '<td class="menu2">';
    186     $Output .= ShowTranslatedMenu();
    187     $Output .= '</td>'.
    188     '</tr><tr>'.
    189     '<td colspan="4" class="page-bottom">Verze: '.$Revision.' ('.HumanDate($ReleaseTime).')'.
    190     ' &nbsp; <a href="http://svn.zdechov.net/trac/wowpreklad/browser/trunk">Zdrojové soubory</a> &nbsp; '.
    191     '<a href="http://svn.zdechov.net/trac/wowpreklad/log/trunk?verbose=on">Novinky</a> &nbsp; '.
    192     $System->Config['Web']['WebCounter'];
    193  
    194     $Output .= '</td></tr>';
    195     if($System->Config['Web']['ShowRuntimeInfo'] == true)
    196       $Output .= '<tr><td colspan="3" style="text-align: center;">Doba generování: '.$ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s &nbsp;&nbsp; Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B &nbsp;&nbsp; <a href="http://validator.w3.org/check?uri='.htmlentities('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?'.$_SERVER['QUERY_STRING']).'">HTML validator</a></td></tr>';
    197     $Output .= '</table>'.
    198       '</body>'.
    199       '</html>';
    200     $User->Store();
    201     return($Output);
     181  $ScriptGenerateDuration = round(GetMicrotime() - $ScriptStartTime, 2);
     182 
     183  $Output = '</td>'.
     184                '<td class="menu2">';
     185  $Output .= ShowTranslatedMenu();
     186  $Output .= '</td>'.
     187                '</tr><tr>'.
     188                '<td colspan="4" class="page-bottom">Verze: '.$Revision.' ('.HumanDate($ReleaseTime).')'.
     189                ' &nbsp; <a href="http://svn.zdechov.net/trac/wowpreklad/browser/trunk">Zdrojové soubory</a> &nbsp; '.
     190                '<a href="http://svn.zdechov.net/trac/wowpreklad/log/trunk?verbose=on">Novinky</a> &nbsp; '.
     191                $System->Config['Web']['WebCounter'];
     192 
     193  $Output .= '</td></tr>';
     194  if($System->Config['Web']['ShowRuntimeInfo'] == true)
     195        $Output .= '<tr><td colspan="3" style="text-align: center;">Doba generování: '.$ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s &nbsp;&nbsp; Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B &nbsp;&nbsp; <a href="http://validator.w3.org/check?uri='.htmlentities('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?'.$_SERVER['QUERY_STRING']).'">HTML validator</a></td></tr>';
     196  $Output .= '</table>'.
     197                '</body>'.
     198                '</html>';
     199  $User->Store();
     200  return($Output);
    202201}
    203202
  • trunk/includes/Version.php

    r560 r561  
    11<?php
    22
    3 $Revision = 560; // Subversion revision
     3$Revision = 561; // Subversion revision
    44$DatabaseRevision = 543; // Database structure revision
    55$ReleaseTime = '2013-08-13';
  • trunk/includes/global.php

    r558 r561  
    2424include_once(dirname(__FILE__).'/../Modules/Server/Server.php');
    2525include_once(dirname(__FILE__).'/../Modules/ClientVersion/ClientVersion.php');
     26include_once(dirname(__FILE__).'/../Modules/ShoutBox/ShoutBox.php');
    2627include_once(dirname(__FILE__).'/../Modules/FrontPage/FrontPage.php');
    2728
     
    7172  $System->ModuleManager->RegisterModule(new ModuleReferrer($System));
    7273  $System->ModuleManager->Modules['Referrer']->Excluded[] = $System->Config['Web']['Host'];
    73   $System->ModuleManager->RegisterModule(new ModuleFrontPage($System));
    7474  $System->ModuleManager->RegisterModule(new ModuleTeam($System));
    7575  $System->ModuleManager->RegisterModule(new ModuleDictionary($System));
     
    7979  $System->ModuleManager->RegisterModule(new ModuleServer($System));
    8080  $System->ModuleManager->RegisterModule(new ModuleClientVersion($System));
     81  $System->ModuleManager->RegisterModule(new ModuleShoutBox($System));
     82  $System->ModuleManager->RegisterModule(new ModuleFrontPage($System));
    8183  $System->ModuleManager->StartAll();
    8284}
    8385
    84 $RSSChannels = array(
    85   array('Title' => 'Změny systému', 'Channel' => 'news'),
    86   array('Title' => 'Poslední překlady', 'Channel' => 'translation'),
    87   array('Title' => 'Kecátko', 'Channel' => 'shoutbox'),
    88 );
     86$System->RegisterRSS(array('Title' => 'Změny systému', 'Channel' => 'news'));
    8987
    9088function GetMicrotime()
  • trunk/includes/system.php

    r558 r561  
    2323  var $ModuleManager;
    2424  var $PathItems;
     25  var $Menu;
     26  var $RSSChannels;
    2527 
    2628  function __construct()
    2729  {
    2830    $this->Config = array();
     31    $this->Menu = array();
     32    $this->RSSChannels = array();
    2933  }
    3034 
     
    133137  }
    134138 
     139  function RegisterRSS($Channel, $Pos = NULL)
     140  {
     141        if(is_null($Pos)) $this->RSSChannels[] = $Channel;
     142          else {
     143                array_splice($this->RSSChannels, $Pos, 0, array($Channel));
     144          }
     145  }
     146 
    135147  function SearchPage($PathItems, $Pages)
    136148  {
Note: See TracChangeset for help on using the changeset viewer.