Ignore:
Timestamp:
Jul 15, 2013, 11:23:55 PM (11 years ago)
Author:
chronos
Message:
  • Upraveno: Existující moduly se nyní načítají automaticky z disku z adresáře Modules.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r553 r556  
    2020include_once(dirname(__FILE__).'/Form/Form.php');
    2121include_once(dirname(__FILE__).'/../FormClasses.php');
    22  
    23 // Application modules
    24 // TODO: Should be configurable
    25 include_once(dirname(__FILE__).'/../Modules/System/System.php');
    26 include_once(dirname(__FILE__).'/../Modules/Error/Error.php');
    27 include_once(dirname(__FILE__).'/../Modules/Log/Log.php');
    28 include_once(dirname(__FILE__).'/../Modules/File/File.php');
    29 include_once(dirname(__FILE__).'/../Modules/Meteostation/Meteostation.php');
    30 include_once(dirname(__FILE__).'/../Modules/Portal/Portal.php');
    31 include_once(dirname(__FILE__).'/../Modules/IS/IS.php');
    32 include_once(dirname(__FILE__).'/../Modules/Network/Network.php');
    33 include_once(dirname(__FILE__).'/../Modules/TV/TV.php');
    34 include_once(dirname(__FILE__).'/../Modules/OpeningHours/OpeningHours.php');
    35 include_once(dirname(__FILE__).'/../Modules/Map/Map.php');
    36 include_once(dirname(__FILE__).'/../Modules/Chat/Chat.php');
    37 include_once(dirname(__FILE__).'/../Modules/WebCam/WebCam.php');
    38 include_once(dirname(__FILE__).'/../Modules/User/User.php');
    39 include_once(dirname(__FILE__).'/../Modules/Finance/Finance.php');
    40 include_once(dirname(__FILE__).'/../Modules/FinanceBankAPI/FinanceBankAPI.php');
    41 include_once(dirname(__FILE__).'/../Modules/Customer/Customer.php');
    42 include_once(dirname(__FILE__).'/../Modules/NetworkShare/NetworkShare.php');
    43 include_once(dirname(__FILE__).'/../Modules/News/News.php');
    44 include_once(dirname(__FILE__).'/../Modules/Meals/Meals.php');
    45 include_once(dirname(__FILE__).'/../Modules/NetworkTopology/NetworkTopology.php');
    46 include_once(dirname(__FILE__).'/../Modules/NetworkConfig/NetworkConfig.php');
    47 include_once(dirname(__FILE__).'/../Modules/NetworkConfigLinux/NetworkConfigLinux.php');
    48 include_once(dirname(__FILE__).'/../Modules/NetworkConfigRouterOS/NetworkConfigRouterOS.php');
    49 include_once(dirname(__FILE__).'/../Modules/TimeMeasure/TimeMeasure.php');
    50 include_once(dirname(__FILE__).'/../Modules/Task/Task.php');
    51 include_once(dirname(__FILE__).'/../Modules/Stock/Stock.php');
    52 include_once(dirname(__FILE__).'/../Modules/Search/Search.php');
    53 include_once(dirname(__FILE__).'/../Modules/EmailQueue/EmailQueue.php');
    5422
    5523function GlobalInit()
     
    7341  // TODO: unset general global variable $Config after setting is loaded to objects
    7442  $System->Config = &$Config;
    75   $System->Database->Connect($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
     43  $System->Database->Connect($Config['Database']['Host'], $Config['Database']['User'],
     44    $Config['Database']['Password'], $Config['Database']['Database']);
    7645  $System->Database->Prefix = $Config['Database']['Prefix'];
    7746  $System->Database->charset($Config['Database']['Charset']);
     
    9160  RegisterFormClasses($System->FormManager); 
    9261 
    93   // Register new modules
    94   // TODO: Should be configurable
    95   $System->ModuleManager->RegisterModule(new ModuleError($System));
    96   $System->ModuleManager->RegisterModule(new ModuleSystem($System));
    97   $System->ModuleManager->RegisterModule(new ModuleLog($System));
    98   $System->ModuleManager->RegisterModule(new ModuleFile($System));
    99   $System->ModuleManager->RegisterModule(new ModuleUser($System));
    100   $System->ModuleManager->RegisterModule(new ModuleEmailQueue($System));
    101   $System->ModuleManager->RegisterModule(new ModuleMeteostation($System));
    102   $System->ModuleManager->RegisterModule(new ModulePortal($System));
    103   $System->ModuleManager->RegisterModule(new ModuleIS($System));
    104   $System->ModuleManager->RegisterModule(new ModuleNetwork($System));
    105   $System->ModuleManager->RegisterModule(new ModuleTV($System));
    106   $System->ModuleManager->RegisterModule(new ModuleOpeningHours($System));
    107   $System->ModuleManager->RegisterModule(new ModuleMap($System));
    108   $System->ModuleManager->RegisterModule(new ModuleChat($System));
    109   $System->ModuleManager->RegisterModule(new ModuleWebCam($System));
    110   $System->ModuleManager->RegisterModule(new ModuleFinance($System));
    111   $System->ModuleManager->RegisterModule(new ModuleFinanceBankAPI($System));
    112   $System->ModuleManager->RegisterModule(new ModuleCustomer($System));
    113   $System->ModuleManager->RegisterModule(new ModuleNetworkShare($System));
    114   $System->ModuleManager->RegisterModule(new ModuleNews($System));
    115   $System->ModuleManager->RegisterModule(new ModuleMeals($System));
    116   $System->ModuleManager->RegisterModule(new ModuleNetworkTopology($System));
    117   $System->ModuleManager->RegisterModule(new ModuleNetworkConfig($System));
    118   $System->ModuleManager->RegisterModule(new ModuleNetworkConfigRouterOS($System));
    119   $System->ModuleManager->RegisterModule(new ModuleNetworkConfigLinux($System));
    120   $System->ModuleManager->RegisterModule(new ModuleTimeMeasure($System));
    121   $System->ModuleManager->RegisterModule(new ModuleTask($System));
    122   $System->ModuleManager->RegisterModule(new ModuleStock($System));
    123   $System->ModuleManager->RegisterModule(new ModuleSearch($System));
     62  // Register and start existing modules
     63  $System->ModuleManager->LoadModulesFromDir(dirname(__FILE__).'/../Modules');
    12464  $System->ModuleManager->StartAll();
    12565}
    12666
    127 $MonthNames = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec');
     67$MonthNames = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen',
     68        'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec');
    12869
    12970$UnitNames = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB');
     
    390331{
    391332  return(str_replace(
    392     array('á', 'č', 'ď', 'é', 'ě', 'í', 'ľ', 'ň', 'ó', 'ř', 'š', 'ť', 'ú', 'ů', 'ý', 'ž', 'Á', 'Č', 'Ď', 'É', 'Ě', 'Í', 'Ľ', 'Ň', 'Ó', 'Ř', 'Š', 'Ť', 'Ú', 'Ů', 'Ý', 'Ž'),
    393     array('a', 'c', 'd', 'e', 'e', 'i', 'l', 'n', 'o', 'r', 's', 't', 'u', 'u', 'y', 'z', 'A', 'C', 'D', 'E', 'E', 'I', 'L', 'N', 'O', 'R', 'S', 'T', 'U', 'U', 'Y', 'Z'),
     333    array('á', 'č', 'ď', 'é', 'ě', 'í', 'ľ', 'ň', 'ó', 'ř', 'š', 'ť', 'ú', 'ů',
     334      'ý', 'ž', 'Á', 'Č', 'Ď', 'É', 'Ě', 'Í', 'Ľ', 'Ň', 'Ó', 'Ř', 'Š', 'Ť', 'Ú', 'Ů', 'Ý', 'Ž'),
     335    array('a', 'c', 'd', 'e', 'e', 'i', 'l', 'n', 'o', 'r', 's', 't', 'u', 'u',
     336      'y', 'z', 'A', 'C', 'D', 'E', 'E', 'I', 'L', 'N', 'O', 'R', 'S', 'T', 'U', 'U', 'Y', 'Z'),
    394337    $Text));
    395338}
     
    398341{
    399342  return(strtr(strtolower(trim($Name)), array(' ' => '-', '.' => '', '(' => '-', ')' => '-',
    400   'č' => 'c', 'š' => 's', 'ě' => 'e', 'ř' => 'r', 'ž' => 'z', 'ý' => 'y', 'á' => 'a', 'í' => 'i', 'é' => 'e', 'ů' => 'u', 'ú' => 'u', 'ď' => 'd', 'ť' => 't', 'ň' => 'n', 'ó' => 'o',
    401   'Č' => 'c', 'Š' => 's', 'Ě' => 'e', 'Ř' => 'r', 'Ž' => 'z', 'Ý' => 'y', 'Á' => 'a', 'Í' => 'i', 'É' => 'e', 'Ů' => 'u', 'Ú' => 'u', 'Ď' => 'd', 'Ť' => 't', 'Ň' => 'n', 'Ó' => 'o',
     343  'č' => 'c', 'š' => 's', 'ě' => 'e', 'ř' => 'r', 'ž' => 'z', 'ý' => 'y',
     344  'á' => 'a', 'í' => 'i', 'é' => 'e', 'ů' => 'u', 'ú' => 'u', 'ď' => 'd',
     345  'ť' => 't', 'ň' => 'n', 'ó' => 'o',
     346  'Č' => 'c', 'Š' => 's', 'Ě' => 'e', 'Ř' => 'r', 'Ž' => 'z', 'Ý' => 'y',
     347  'Á' => 'a', 'Í' => 'i', 'É' => 'e', 'Ů' => 'u', 'Ú' => 'u', 'Ď' => 'd',
     348  'Ť' => 't', 'Ň' => 'n', 'Ó' => 'o',
    402349)));
    403350}
Note: See TracChangeset for help on using the changeset viewer.