Changeset 405 for branches/Modular


Ignore:
Timestamp:
Jun 12, 2012, 7:25:25 PM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Podpora překládání.
  • Přidáno: Do seznamu modulů přidány akce Instalovat a Odinstalovat.
Location:
branches/Modular
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/Modular/Common/Global.php

    r401 r405  
    2525include_once('ViewForm.php');
    2626include_once('Types/Type.php');
     27include_once('Localization.php');
     28include_once('Navigation.php');
    2729 
    2830
     
    7375  $System->RootFolder = $Config['Web']['RootFolder'];
    7476  $System->Config = &$Config;
     77  $System->Localization = new Localization();
     78  $System->Localization->Locale = $Config['Web']['Locale'];
     79  $System->Localization->Load();
     80  $System->Navigation = new Navigation();
    7581}
    7682
  • branches/Modular/Common/Module.php

    r404 r405  
    270270    }
    271271  }
     272 
     273  function SearchModuleById($Id)
     274  {
     275    foreach($this->Modules as $Module)
     276    {
     277      DebugLog($Module->Name.' '.$Module->Id);
     278      if($Module->Id == $Id) return($Module->Name);
     279    }       
     280    return('');
     281  }
    272282}
    273283
  • branches/Modular/Common/ViewList.php

    r404 r405  
    5555        foreach($this->Actions as $Action)
    5656        {
    57           if(array_key_exists('Confirm', $Action)) $Confirm = ' onclick="return confirmAction(\''.$this->System->Localization->Translate($Action['Confirm']).'\');"';
     57          if(array_key_exists('Confirm', $Action) and ($Action['Confirm'] != ''))
     58            $Confirm = ' onclick="return confirmAction(\''.$this->System->Localization->Translate($Action['Confirm']).'\');"';
    5859            else $Confirm = '';
    5960          if(strpos($Action['Name'], '<') !== false) $ActionName = $Action['Name'];
     
    148149      'Type' => ViewItemTypeOneToMany, 'SQL' => $Name, 'TargetTable' => $TargetTable);
    149150  }   
     151 
     152  function AddItemAction($Name, $Module, $Action, $Confirm)
     153  {
     154    $this->Actions[$Name] = array('Name' => $Name, 'Module' => $Module,
     155      'Action' => $Action, 'Confirm' => $Confirm);
     156  }
    150157}
    151158
  • branches/Modular/Modules/Finance/Finance.php

    r379 r405  
    286286    $this->License = 'GNU/GPL';
    287287    $this->Description = 'Accounting processing';
    288     $this->Dependencies = array('User', 'Subject');
     288    $this->Dependencies = array('User', 'Subject', 'Member', 'Network');
    289289    $this->SupportedModels = array('FinanceYear', 'DocumentLine', 'DocumentLineSequence',
    290290      'FinanceTariff', 'FinanceOperation', 'FinanceClaimsLiabilities',
  • branches/Modular/Modules/System/System.php

    r404 r405  
    1212  function Show()
    1313  {
     14    $Output = '';
     15    if(array_key_exists('A', $_GET))
     16    {
     17      if($_GET['A'] == 'Install')
     18      {
     19        $this->System->LoadModules(false);
     20        $ModuleName = $this->System->SearchModuleById($_GET['Id']);
     21        if($ModuleName != '')
     22        {
     23          $this->System->Modules[$ModuleName]->Install();
     24          $this->System->Init();
     25        } else $Output .= 'Modul id '.$_GET['Id'].' nenalezen';
     26       
     27      }
     28      if($_GET['A'] == 'Uninstall')
     29      {
     30        $ModuleName = $this->System->SearchModuleById($_GET['Id']);
     31        if($ModuleName != '')
     32        {
     33          $this->System->Modules[$ModuleName]->UnInstall();
     34          $this->System->Init();
     35        } else $Output .= 'Modul id '.$_GET['Id'].' nenalezen';
     36      }
     37    }
    1438    $View = new ViewModules($this->System);
    1539    $View->LoadFromDatabase();
    16     return($View->Show());
     40    $Output .= $View->Show();
     41    return($Output);
    1742  }
    1843}
     
    3055    $this->AddItemBoolean('Installed', 'Instalováno');
    3156    $this->AddItemText('Description', 'Popis');
     57    $this->AddItemAction('Install', 'System', 'Install', '');
     58    $this->AddItemAction('Uninstall', 'System', 'Uninstall', '');
    3259  }
    3360}
  • branches/Modular/Modules/User/User.php

    r398 r405  
    383383    $thus->System->Modules['User']->Models['User']->AnonymousUserId = ANONYMOUS_ID;
    384384    $this->System->Pages['uzivatele'] = 'UserListPage';
    385     if(isset($_SERVER['REMOTE_ADDR'])) $this->System->Modules['User']->Models['User']->Check();
     385    if(isset($_SERVER['REMOTE_ADDR'])) $this->System->Modules['User']->Models['User']->Check();   
    386386  }
    387387 
  • branches/Modular/config.sample.php

    r398 r405  
    1616  'Web' => array
    1717  (
     18    'Locale' => 'csCZ',
    1819    'Style' => 'simple',
    1920    'FormatHTML' => false,
  • branches/Modular/index.php

    r403 r405  
    1111$Page = $System->PathItems[0];
    1212//if(substr($Page, -1) == '/') $Page = substr($Page, 0, -1);
    13 //print_r($System->Pages);
     13print_r($System->Pages);
    1414if(array_key_exists($Page, $System->Pages))
    1515{
Note: See TracChangeset for help on using the changeset viewer.