Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsModNewsLetter.cpp
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2006-Today Guy Deleeuw
3 *
4 * See the LICENSE file for terms of use.
5 */
6 
7 #include <dlfcn.h>
8 #include <stdio.h>
9 
10 #include <iostream>
11 
12 #include <boost/filesystem.hpp>
13 
14 #include <Wt/WLogger>
15 #include <Wt/WText>
16 #include <Wt/WAnchor>
17 #include <Wt/WRegExpValidator>
18 
19 #include <gdcore/gdCore.h>
20 
21 #include <Logger/WsLogger.h>
22 
23 #include <Main/WsApplication.h>
24 
25 #include "WsModNewsLetter.h"
26 #include "WsNewsLetter.h"
27 
28 extern "C" {
30  {
31  void* hndl = dlopen("libwt.so", RTLD_NOW | RTLD_GLOBAL);
32  if ( hndl == NULL ) {
33  fprintf(stderr, "cannot load libwt.so shared library! %s\n", dlerror());
34  return;
35  }
36  }
37 }
38 
39 // Class WsModNewsLetter
40 // =====================
42  : WsModule()
43 {
44 }
45 
47 {
48 }
49 
50 WWidget* WsModNewsLetter::createContentsMenuBar(WContainerWidget* parent) const
51 {
52  return 0;
53 }
54 
55 WWidget* WsModNewsLetter::createContents(WContainerWidget* parent) const
56 {
57  WsNewsLetter* pWsNewsLetter = new WsNewsLetter(parent);
58  pWsNewsLetter->setOptions(options());
59  return pWsNewsLetter;
60 }
61 
62 WsEditorWidget* WsModNewsLetter::createEditor(WContainerWidget* parent) const
63 {
64  return 0;
65 }
66 
67 WWidget* WsModNewsLetter::createAdmin(WContainerWidget* parent) const
68 {
69  return 0;
70 }
71 
73 {
74  return true;
75 }
76 
77 std::string WsModNewsLetter::description() const
78 {
79  return "WsModNewsLetter wittyShare module";
80 }
81 
82 std::string WsModNewsLetter::checkPath(const std::string& currentPath)
83 {
84  std::string newPath = WsModule::checkPath(currentPath);
85  WsNewsLetter* pWsNewsLetter = new WsNewsLetter();
86  pWsNewsLetter->setOptions(options());
87  newPath = pWsNewsLetter->checkPath(currentPath);
88  delete pWsNewsLetter;
89  return newPath;
90 }
91 
void WsModNewsLetterInit(void)
Wt::WWidget * createContents(Wt::WContainerWidget *parent=0) const
Create the contents.
bool saveEditor() const
a wittyShare module
virtual std::string checkPath(const std::string &currentPath)
Return the currentPath, or another path when some action is required for the currentPath example /New...
Wt::WWidget * createAdmin(Wt::WContainerWidget *parent=0) const
Create the contents for an administrator.
const std::vector< WsOption > & options() const
Get all options.
Definition: WsOption.cpp:70
virtual std::string checkPath(const std::string &currentPath)
Return the currentPath, or another path when some action is required for the currentPath example /New...
Definition: WsOption.cpp:90
Wt::WWidget * createContentsMenuBar(Wt::WContainerWidget *parent=0) const
Create the functionalities.
std::string checkPath(const std::string &currentPath)
WsEditorWidget * createEditor(Wt::WContainerWidget *parent=0) const
Create the contents for an editor (create a view of options).
void setOptions(const std::vector< WsOption > &vOptions)
Set all options.
Definition: WsOption.cpp:57
std::string description() const
Return the description of the module.
a wittyShare module