Ignore:
Timestamp:
Apr 15, 2010, 8:20:31 AM (14 years ago)
Author:
george
Message:
  • Opraveno: Zobrazopvání HTTP odkazů v kecátku.
  • Přidáno: Systémová hlášení se nyní zobrazují v barevných rámečcích s ikonou. Typy zpráv jsou informace, varování a kritická chyba.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/global_function.php

    r465 r466  
    342342  if(isset($LanguageList[$LanguageId]) == false)
    343343  {
    344     echo('Jazyk dle zadaného Id neexistuje.');
     344    ShowMessage('Jazyk dle zadaného Id neexistuje.', MESSAGE_CRITICAL);
    345345    ShowFooter();
    346346    die();
     
    559559function MakeActiveLinks($Content)
    560560{
     561  $Content = htmlspecialchars($Content);
     562  $Content = str_replace("\n", ' <br/>', $Content);
     563  $Content = str_replace("\r", '', $Content);
     564 
    561565  $Result = ''; 
    562566  $I = 0;
     
    566570    $Result .= substr($Content, 0, $I);
    567571    $Content = substr($Content, $I);
    568     if(strpos($Content, ' ') !== false)
    569       $URL = substr($Content, 0, strpos($Content, ' '));
     572    $SpacePos = strpos($Content, ' ');
     573    if($SpacePos !== false) $URL = substr($Content, 0, strpos($Content, ' '));
    570574      else $URL = substr($Content, 0);
     575   
    571576    $Result .= '<a href="'.$URL.'">'.$URL.'</a>';
    572577    $Content = substr($Content, strlen($URL));
     
    576581}
    577582
     583define('MESSAGE_WARNING', 0);
     584define('MESSAGE_CRITICAL', 1);
     585define('MESSAGE_INFORMATION', 2);
     586
     587function ShowMessage($Text, $Type = MESSAGE_INFORMATION)
     588{
     589  global $System;
     590 
     591  $IconName = array(MESSAGE_INFORMATION => 'information', MESSAGE_WARNING => 'warning', MESSAGE_CRITICAL => 'critical');
     592  $BackgroundColor = array(MESSAGE_INFORMATION => '#e0e0ff', MESSAGE_WARNING => '#ffffe0', MESSAGE_CRITICAL => '#ffe0e0');
     593 
     594  echo('<div class="message" style="background-color: '.$BackgroundColor[$Type].';"><table><tr><td class="icon"><img src="'.$System->Link('/images/message/'.$IconName[$Type].'.png').'" alt="'.$IconName[$Type].'"><td>'.$Text.'</td></tr></table></div>');
     595}
     596
    578597?>
Note: See TracChangeset for help on using the changeset viewer.