Changeset 107


Ignore:
Timestamp:
Oct 10, 2012, 2:50:48 PM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Zobrazení aktualit na stránce portálu.
Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UWebSession.pas

    r106 r107  
    149149
    150150procedure TWebSession.RegisterModules;
     151var
     152  ModuleBase: TModuleBase;
    151153begin
    152154  with ModuleManager do begin
     
    161163    RegisterModule(TModuleIS.Create(nil), True);
    162164    RegisterModule(TModuleNews.Create(nil), True);
     165
     166    ModuleBase := TModuleBase(ModuleManager.FindModuleByName('Base'));
     167    if Assigned(ModuleBase) then ModuleBase.Session := Self;
    163168  end;
    164169end;
  • trunk/Modules/Base/UModuleBase.pas

    r105 r107  
    1919    FGeneratePage: TGeneratePageEvent;
    2020  public
     21    Session: TWebSession;
    2122    Pages: TPageList;
    2223    HandlerData: THTTPHandlerData;
  • trunk/Modules/News/UModuleNews.pas

    r105 r107  
    66
    77uses
    8   Classes, SysUtils, UModularSystem, SpecializedDictionary, UModuleBase;
     8  Classes, SysUtils, UModularSystem, SpecializedDictionary, UModuleBase, UNews,
     9  UHTTPServer, UModuleUser;
    910
    1011type
     
    1415  public
    1516    ModuleBase: TModuleBase;
    16     procedure Show;
     17    News: TNews;
     18    function Show(HandlerData: THTTPHandlerData): string;
    1719    constructor Create(Owner: TComponent); override;
    1820    destructor Destroy; override;
     
    3234{ TModuleNews }
    3335
    34 procedure TModuleNews.Show;
     36function TModuleNews.Show(HandlerData: THTTPHandlerData): string;
    3537begin
    36 
     38  Result := News.Show(HandlerData);
    3739end;
    3840
     
    5759  BeforeStart;
    5860  ModuleBase := TModuleBase(Manager.FindModuleByName('Base'));
    59   UserControlPage := TUserControlPage.Create(nil);
    60   ModuleBase.Pages.RegisterPage(UserControlPage, 'uzivatel');
     61  //UserControlPage := TUserControlPage.Create(nil);
     62  //ModuleBase.Pages.RegisterPage(UserControlPage, 'uzivatel');
    6163  //RegisterPage(TUserControlPage, UserControlPage, '');
     64  News := TNews.Create;
     65  News.ModuleUser := TModuleUser(Manager.FindModuleByName('User'));
     66  News.Database := ModuleBase.Session.Database;
     67  News.ModuleBase := ModuleBase;
    6268  AfterStart;
    6369end;
     
    6672begin
    6773  BeforeStop;
    68   ModuleBase.Pages.UnregisterPage(UserControlPage);
    69   FreeAndNil(UserControlPage);
     74  FreeAndNil(News);
     75  //ModuleBase.Pages.UnregisterPage(UserControlPage);
     76  //FreeAndNil(UserControlPage);
    7077  ModuleBase := nil;
    7178  AfterStop;
  • trunk/Modules/Portal/UModulePortal.pas

    r105 r107  
    88  Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase,
    99  UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses,
    10   UModuleBase, UModuleUser;
     10  UModuleBase, UModuleUser, UModuleNews;
    1111
    1212type
     
    6666  WebPagePortal := TWebPagePortal.Create(nil);
    6767  ModuleBase.Pages.RegisterPage(WebPagePortal, '');
    68   TWebPagePortal(WebPagePortal).ModuleUser := TModuleUser(Manager.FindModuleByName('User'));
     68  ModuleUser := TModuleUser(Manager.FindModuleByName('User'));
     69  TWebPagePortal(WebPagePortal).ModuleUser := ModuleUser;
     70  TWebPagePortal(WebPagePortal).ModuleNews := TModuleNews(Manager.FindModuleByName('News'));
    6971  AfterStart;
    7072end;
     
    7678  FreeAndNil(WebPagePortal);
    7779  ModuleBase := nil;
     80  ModuleUser := nil;
    7881  AfterStop;
    7982end;
  • trunk/Modules/Portal/UPagePortal.pas

    r105 r107  
    256256          Output := Output + ShowPanel('Kamery', WebcamPanel)
    257257        else if Panel.Values['Module'] = 'NewsGroupList' then
    258           //Output := Output + ShowPanel('Aktuality',
    259           //ModuleNews.Show,
     258          Output := Output + ShowPanel('Aktuality',
     259          ModuleNews.Show(HandlerData)); //,
    260260          //['<a href="?Action=CustomizeNews">Upravit</a>']);
    261261      end;
  • trunk/Modules/User/UModuleUser.pas

    r105 r107  
    6161  //RegisterPage(TUserControlPage, UserControlPage, '');
    6262  User := TWebUser.Create;
    63   //User.Database := Database;
     63  User.Database := ModuleBase.Session.Database;
    6464  UserOnline := TWebOnlineUser.Create;
    65   //UserOnline.Database := Database;
     65  UserOnline.Database := ModuleBase.Session.Database;
    6666  AfterStart;
    6767end;
  • trunk/ZdechovNET.lpi

    r105 r107  
    117117      </Item7>
    118118    </RequiredPackages>
    119     <Units Count="37">
     119    <Units Count="38">
    120120      <Unit0>
    121121        <Filename Value="ZdechovNET.lpr"/>
     
    338338        <UnitName Value="UModuleBase"/>
    339339      </Unit36>
     340      <Unit37>
     341        <Filename Value="Modules/News/UNews.pas"/>
     342        <IsPartOfProject Value="True"/>
     343        <UnitName Value="UNews"/>
     344      </Unit37>
    340345    </Units>
    341346  </ProjectOptions>
Note: See TracChangeset for help on using the changeset viewer.