Ignore:
Timestamp:
Jan 19, 2012, 1:58:03 PM (13 years ago)
Author:
chronos
Message:
  • Upraveno: Jednotka Forms přetvořena na View. Namísto globální definice formulářů se nyní použije objektová definice odvozená z třídy View.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/FrontPage/FrontPage.php

    r366 r372  
    139139      if($_GET['Action'] == 'LoginForm')
    140140      {
    141         $Form = new Form('UserLogin');
     141        $Form = new UserLoginView($this->Database);
    142142        $Form->OnSubmit = '?Action=Login';
    143143        $Output .= $Form->ShowEditForm();
     
    147147      if($_GET['Action'] == 'Login')
    148148      {
    149         $Form = new Form('UserLogin');
     149        $Form = new UserLoginView($this->Database);
    150150        $Form->OnSubmit = '?Action=Login';
    151151        $Result = $this->System->Models['User']->Login($_POST['Username'], $_POST['Password']);
     
    166166      if($_GET['Action'] == 'UserOptions')
    167167      {
    168         $UserOptions = new Form('UserOptions');
     168        $UserOptions = new UserOptionsView($this->Database);
    169169        $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']);
    170170        $UserOptions->OnSubmit = '?Action=UserOptionsSave';
     
    173173      if($_GET['Action'] == 'UserOptionsSave')
    174174      {
    175         $UserOptions = new Form('UserOptions', array());
     175        $UserOptions = new UserOptionsView($this->Dstabase, array());
    176176        $UserOptions->LoadValuesFromForm();
    177177        $UserOptions->SaveValuesToDatabase($this->System->Models['User']->User['Id']);
     
    184184      if($_GET['Action'] == 'UserRegister')
    185185      {
    186         $Form = new Form('UserRegister');
     186        $Form = new UserRegisterView($this->Database);
    187187        $Form->LoadValuesFromForm();
    188188        $Form->OnSubmit = '?Action=UserRegisterSave';
     
    195195      if($_GET['Action'] == 'PasswordRecovery')
    196196      {
    197         $Form = new Form('PasswordRecovery');
     197        $Form = new PasswordRecoveryView($this->Database);
    198198        $Form->OnSubmit = '?Action=PasswordRecovery2';
    199199        $Output .= $Form->ShowEditForm();
     
    201201      if($_GET['Action'] == 'PasswordRecovery2')
    202202      {
    203         $Form = new Form('PasswordRecovery');
     203        $Form = new PasswordRecoveryView($this->Database);
    204204        $Form->LoadValuesFromForm();
    205205        $Result = $this->System->Models['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
     
    216216      if($_GET['Action'] == 'UserRegisterSave')
    217217      {
    218         $Form = new Form('UserRegister', array());
     218        $Form = new UserRegisterView($this->Database, array());
    219219        $Form->LoadValuesFromForm();
    220220        $Result = $this->System->Models['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']);
     
    228228      if($_GET['Action'] == 'MemberOptions')
    229229      {
    230         $UserOptions = new Form('MemberOptions');
     230        $UserOptions = new MemberOptionsView($this->Database);
    231231        $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']);
    232232        $DbRow = $DbResult->fetch_array();
    233         foreach($UserOptions->Definition['Items'] as $Index => $Item)
     233        foreach($UserOptions->Items as $Index => $Item)
    234234        {
    235235          $UserOptions->Values[$Index] = $DbRow[$Index];
     
    240240      if($_GET['Action'] == 'MemberOptionsSave')
    241241      {
    242         $UserOptions = new Form('MemberOptions');
     242        $UserOptions = new MemberOptionsView($this->Database);
    243243        $UserOptions->LoadValuesFromForm();
    244244        if($UserOptions->Values['FamilyMemberCount'] < 0)
     
    255255        $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']);
    256256        $DbRow = $DbResult->fetch_array();
    257         foreach($UserOptions->Definition['Items'] as $Index => $Item)
     257        foreach($UserOptions->Items as $Index => $Item)
    258258        {
    259259          $UserOptions->Values[$Index] = $DbRow[$Index];
Note: See TracChangeset for help on using the changeset viewer.