Changeset 475 for trunk


Ignore:
Timestamp:
Jan 1, 2013, 12:34:19 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Chat přepracována na aplikační modul.
Location:
trunk
Files:
1 deleted
1 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r474 r475  
    3434include_once(dirname(__FILE__).'/../Modules/OpeningHours/OpeningHours.php');
    3535include_once(dirname(__FILE__).'/../Modules/Map/Map.php');
     36include_once(dirname(__FILE__).'/../Modules/Chat/Chat.php');
    3637
    3738$PrefixMultipliers = array
     
    301302  $System->ModuleManager->RegisterModule(new ModuleOpeningHours($System));
    302303  $System->ModuleManager->RegisterModule(new ModuleMap($System));
     304  $System->ModuleManager->RegisterModule(new ModuleChat($System));
    303305  $System->ModuleManager->StartAll();
    304306}
  • trunk/Modules/Chat/Chat.php

    r471 r475  
    11<?php
    22
    3 include_once('../Common/Global.php');
     3include_once('Common/Global.php');
    44
    5 class ChatHistory extends Page
     5class PageChatHistory extends Page
    66{
    7   var $FullTitle = 'Výpis z historie chatu';
    8   var $ShortTitle = 'Historie chatu';
    9 
     7  function __construct()
     8  {
     9    parent::__construct();
     10    $this->FullTitle = 'Výpis z historie chatu';
     11    $this->ShortTitle = 'Historie chatu';
     12    $this->NavigationPath[] = array('Name' => $this->ShortTitle, 'URL' => 'chat');     
     13  }
     14 
    1015  function dechexr($Num)
    1116  {
     
    1722  {
    1823    global $MonthNames;
    19 
     24   
    2025    if(!$this->System->Modules['User']->CheckPermission('Chat', 'Display')) return('Nemáte oprávnění');
    2126
    22     if(array_key_exists('date',$_GET)) $Date = $_GET['date']; else $Date = date('Y-m-d');
    23     $DateParts = explode('-',$Date);
     27    if(array_key_exists('date', $_GET)) $Date = $_GET['date'];
     28      else $Date = date('Y-m-d');
     29    $DateParts = explode('-', $Date);
    2430
    2531    $DbResult = $this->Database->select('ChatHistory', 'MAX(Time), MIN(Time)');
    2632    $RowTotal = $DbResult->fetch_array();
    2733
    28     $StartDateTimeParts = explode(' ',$RowTotal['MIN(Time)']);
    29     $StartDateParts = explode('-',$StartDateTimeParts[0]);
    30     $EndDateTimeParts = explode(' ',$RowTotal['MAX(Time)']);
    31     $EndDateParts = explode('-',$EndDateTimeParts[0]);
     34    $StartDateTimeParts = explode(' ', $RowTotal['MIN(Time)']);
     35    $StartDateParts = explode('-', $StartDateTimeParts[0]);
     36    $EndDateTimeParts = explode(' ', $RowTotal['MAX(Time)']);
     37    $EndDateParts = explode('-', $EndDateTimeParts[0]);
    3238
    3339    if(!array_key_exists('year', $_SESSION)) $_SESSION['year'] = date('Y', time());
     
    8187}
    8288
    83 $System->AddModule(new ChatHistory());
    84 $System->Modules['ChatHistory']->GetOutput();
     89class ModuleChat extends AppModule
     90{
     91  function __construct($System)
     92  {
     93    parent::__construct($System);
     94    $this->Name = 'Chat';
     95    $this->Version = '1.0';
     96    $this->Creator = 'Chronos';
     97    $this->License = 'GNU/GPL';
     98    $this->Description = 'Show history of IRC chat and previous SunriseChat';
     99    $this->Dependencies = array();
     100  }
     101 
     102  function Start()
     103  {
     104    parent::Start();
     105    $this->System->Pages['chat'] = 'PageChatHistory';
     106  } 
     107}
    85108
    86109?>
Note: See TracChangeset for help on using the changeset viewer.