Ignore:
Timestamp:
Jun 18, 2013, 6:58:22 PM (11 years ago)
Author:
chronos
Message:
  • Upraveno: Uživatelská podpora přepracována na aplikační modul.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/global.php

    r546 r547  
    55include_once(dirname(__FILE__).'/Update.php');
    66include_once(dirname(__FILE__).'/rss.php');
    7 include_once(dirname(__FILE__).'/user.php');
    87include_once(dirname(__FILE__).'/Page.php');
    98include_once(dirname(__FILE__).'/error.php');
     
    1918include_once(dirname(__FILE__).'/../Modules/FrontPage/FrontPage.php');
    2019include_once(dirname(__FILE__).'/../Modules/Team/Team.php');
     20include_once(dirname(__FILE__).'/../Modules/User/User.php');
    2121
    2222GlobalInit();
     23$User = &$System->User; // Back compatibility
    2324
    2425function GlobalInit()
     
    5354  foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]);
    5455 
    55   $User = new User($System);
    56  
    5756  set_error_handler('ErrorHandler');
    5857  set_exception_handler('ExceptionHandler');
     
    6261 
    6362  // Initialize application modules
    64   $System->ModuleManager->RegisterModule(new AoWoW($System));
    65   $System->ModuleManager->RegisterModule(new Referrer($System));
     63  $System->ModuleManager->RegisterModule(new ModuleUser($System));
     64  $System->ModuleManager->RegisterModule(new ModuleAoWoW($System));
     65  $System->ModuleManager->RegisterModule(new ModuleReferrer($System));
    6666  $System->ModuleManager->Modules['Referrer']->Excluded[] = $System->Config['Web']['Host'];
    67   $System->ModuleManager->RegisterModule(new FrontPage($System));
    68   $System->ModuleManager->RegisterModule(new Team($System));
     67  $System->ModuleManager->RegisterModule(new ModuleFrontPage($System));
     68  $System->ModuleManager->RegisterModule(new ModuleTeam($System));
    6969  $System->ModuleManager->StartAll();
    7070}
     
    265265    'Direction' => $_SESSION['OrderDir'],
    266266  ));
    267 }
    268 
    269 function FormatOutput($s)
    270 {
    271   $out = '';
    272   $nn = 0;
    273   $n = 0;
    274   while($s != '')
    275   {
    276     $start = strpos($s, '<');
    277     $end = strpos($s, '>');
    278     if($start != 0)
    279     {
    280       $end = $start - 1;
    281       $start = 0;
    282     }
    283     $line = trim(substr($s, $start, $end + 1));
    284     if(strlen($line) > 0)
    285     if($line[0] == '<')
    286     {
    287       if($s[$start + 1] == '/')
    288       {
    289         $n = $n - 2;
    290         $nn = $n;
    291       } else
    292       {
    293         if(strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1);
    294         else $cmd = substr($line, 1, strlen($line) - 2);
    295         //echo('['.$cmd.']');
    296         if(strpos($s, '</'.$cmd.'>')) $n = $n + 2;
    297       }   
    298     }// else $line = '['.$line.']';
    299     //if($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n"));
    300     if($line != '') $out .= (str_repeat(' ', $nn).$line."\n");
    301     $s = substr($s, $end + 1, strlen($s));
    302     $nn = $n;
    303   }
    304   return($out);
    305 }
    306 
    307 function WriteLanguages($Selected)
    308 {
    309   global $System;
    310  
    311   $Output = '<select name="Language">';
    312   $DbResult = $System->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1');
    313   while($Language = $DbResult->fetch_assoc())
    314   {
    315     $Output .= '<option value="'.$Language['Id'].'"';
    316     if($Selected == $Language['Id'])
    317       $Output .= ' selected="selected"';
    318     $Output .= '>'.$Language['Name'].'</option>';
    319   }   
    320   $Output .= '</select>';
    321   return($Output);   
    322267}
    323268
     
    751696}
    752697
     698function WriteLanguages($Selected)
     699{
     700        global $System;
     701
     702        $Output = '<select name="Language">';
     703        $DbResult = $System->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1');
     704        while($Language = $DbResult->fetch_assoc())
     705        {
     706                $Output .= '<option value="'.$Language['Id'].'"';
     707                if($Selected == $Language['Id'])
     708                        $Output .= ' selected="selected"';
     709                $Output .= '>'.$Language['Name'].'</option>';
     710        }
     711        $Output .= '</select>';
     712        return($Output);
     713}
     714
     715
    753716?>
Note: See TracChangeset for help on using the changeset viewer.